3 changed files with 210 additions and 0 deletions
@ -0,0 +1,15 @@
|
||||
Index: GNUmakefile.in
|
||||
--- GNUmakefile.in.orig 2004-01-31 02:15:33 +0100
|
||||
+++ GNUmakefile.in 2005-07-25 09:17:57 +0200
|
||||
@@ -62,9 +62,9 @@
|
||||
MAN_DIR = @mandir@
|
||||
MAN_DEST = $(MAN_DIR)/man1
|
||||
SHARE_DEST = @datadir@
|
||||
-DOC_DEST = $(SHARE_DEST)/doc/privoxy
|
||||
+DOC_DEST = $(SHARE_DEST)/doc
|
||||
VAR_DEST = @localstatedir@
|
||||
-LOGS_DEST = $(VAR_DEST)/log/privoxy
|
||||
+LOGS_DEST = $(VAR_DEST)/log
|
||||
PIDS_DEST = $(VAR_DEST)/run
|
||||
|
||||
# if $prefix = /usr/local then the default CONFDEST change from
|
@ -0,0 +1,135 @@
|
||||
## |
||||
## privoxy.spec -- OpenPKG RPM Package Specification |
||||
## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/> |
||||
## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/> |
||||
## |
||||
## Permission to use, copy, modify, and distribute this software for |
||||
## any purpose with or without fee is hereby granted, provided that |
||||
## the above copyright notice and this permission notice appear in all |
||||
## copies. |
||||
## |
||||
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
||||
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||||
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
||||
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
||||
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||||
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
||||
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
## SUCH DAMAGE. |
||||
## |
||||
|
||||
# package information |
||||
Name: privoxy |
||||
Summary: Privacy Web Proxy |
||||
URL: http://www.privoxy.org/ |
||||
Vendor: Privoxy Development Team |
||||
Packager: OpenPKG |
||||
Distribution: OpenPKG |
||||
Class: EVAL |
||||
Group: Web |
||||
License: GPL |
||||
Version: 3.0.3 |
||||
Release: 20050725 |
||||
|
||||
# list of sources |
||||
Source0: http://osdn.dl.sourceforge.net/ijbswa/privoxy-%{version}-stable-src.tar.gz |
||||
Source1: rc.privoxy |
||||
Patch0: privoxy.patch |
||||
|
||||
# build information |
||||
Prefix: %{l_prefix} |
||||
BuildRoot: %{l_buildroot} |
||||
BuildPreReq: OpenPKG, openpkg >= 20040130, autoconf, make |
||||
PreReq: OpenPKG, openpkg >= 20040130 |
||||
BuildPreReq: pcre |
||||
PreReq: pcre |
||||
AutoReq: no |
||||
AutoReqProv: no |
||||
|
||||
%description |
||||
Privoxy is a web proxy with advanced filtering capabilities for |
||||
protecting privacy, modifying web page content, managing cookies, |
||||
controlling access, and removing ads, banners, pop-ups and other |
||||
obnoxious Internet junk. Privoxy has a very flexible configuration and |
||||
can be customized to suit individual needs and tastes. Privoxy has |
||||
application for both stand-alone systems and multi-user networks. |
||||
|
||||
%track |
||||
prog privoxy = { |
||||
version = %{version} |
||||
url = http://prdownloads.sourceforge.net/ijbswa/ |
||||
regex = privoxy-(\d+\.\d+(\.\d+)*)-stable-src\.tar\.gz |
||||
} |
||||
|
||||
%prep |
||||
%setup -q -n privoxy-%{version}-stable |
||||
%patch -p0 |
||||
|
||||
%build |
||||
%{l_prefix}/bin/autoheader >/dev/null 2>&1 |
||||
%{l_prefix}/bin/autoconf >/dev/null 2>&1 |
||||
CC="%{l_cc}" \ |
||||
CFLAGS="%{l_cflags -O}" \ |
||||
CPPFLAGS="%{l_cppflags}" \ |
||||
LDFLAGS="%{l_ldflags}" \ |
||||
./configure \ |
||||
--prefix=%{l_prefix} \ |
||||
--sysconfdir=%{l_prefix}/etc/privoxy \ |
||||
--datadir=%{l_prefix}/share/privoxy \ |
||||
--localstatedir=%{l_prefix}/var/privoxy \ |
||||
--with-user=%{l_rusr} \ |
||||
--with-group=%{l_rgrp} |
||||
%{l_make} %{l_mflags -O} |
||||
|
||||
%install |
||||
rm -rf $RPM_BUILD_ROOT |
||||
%{l_make} %{l_mflags} install \ |
||||
prefix=$RPM_BUILD_ROOT%{l_prefix} \ |
||||
exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \ |
||||
CONF_BASE=$RPM_BUILD_ROOT%{l_prefix}/etc/privoxy \ |
||||
SHARE_DEST=$RPM_BUILD_ROOT%{l_prefix}/share/privoxy \ |
||||
VAR_DEST=$RPM_BUILD_ROOT%{l_prefix}/var/privoxy |
||||
chmod a+r $RPM_BUILD_ROOT%{l_prefix}/etc/privoxy/* |
||||
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
||||
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/privoxy/doc |
||||
rm -f $RPM_BUILD_ROOT%{l_prefix}/var/privoxy/log/* |
||||
%{l_shtool} subst \ |
||||
-e 's;^\(confdir\).*;\1 %{l_prefix}/etc/privoxy;' \ |
||||
-e 's;^\(logdir\).*;\1 %{l_prefix}/var/privoxy/log;' \ |
||||
-e 's;logfile logfile;logfile privoxy.log;' \ |
||||
-e 's;jarfile jarfile;#jarfile privoxy.jar;' \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/privoxy/config |
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
||||
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
||||
%{SOURCE rc.privoxy} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} \ |
||||
'%config %{l_prefix}/etc/privoxy/*' \ |
||||
'%config %{l_prefix}/etc/privoxy/templates/*' \ |
||||
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/privoxy/*' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
rm -rf $RPM_BUILD_ROOT |
||||
|
||||
%post |
||||
# after upgrade, restart service |
||||
[ $1 -eq 2 ] || exit 0 |
||||
eval `%{l_rc} privoxy status 2>/dev/null` |
||||
[ ".$privoxy_active" = .yes ] && %{l_rc} privoxy restart |
||||
exit 0 |
||||
|
||||
%preun |
||||
# before erase, stop service and remove log files |
||||
[ $1 -eq 0 ] || exit 0 |
||||
%{l_rc} privoxy stop 2>/dev/null |
||||
rm -f $RPM_INSTALL_PREFIX/var/privoxy/run/* >/dev/null 2>&1 || true |
||||
rm -f $RPM_INSTALL_PREFIX/var/privoxy/log/* >/dev/null 2>&1 || true |
||||
exit 0 |
||||
|
@ -0,0 +1,60 @@
|
||||
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
||||
## |
||||
## rc.privoxy -- Run-Commands |
||||
## |
||||
|
||||
%config |
||||
privoxy_enable="$openpkg_rc_def" |
||||
privoxy_bind="127.0.0.1:110" |
||||
privoxy_log_prolog="true" |
||||
privoxy_log_epilog="true" |
||||
privoxy_log_numfiles="10" |
||||
privoxy_log_minsize="1M" |
||||
privoxy_log_complevel="9" |
||||
|
||||
%common |
||||
privoxy_cfgfile="@l_prefix@/etc/privoxy/config" |
||||
privoxy_pidfile="@l_prefix@/var/privoxy/run/privoxy.pid" |
||||
privoxy_logfile="@l_prefix@/var/privoxy/log/privoxy.log" |
||||
privoxy_signal () { |
||||
[ -f $privoxy_pidfile ] && kill -$1 `cat $privoxy_pidfile` |
||||
} |
||||
|
||||
%status -u @l_susr@ -o |
||||
privoxy_usable="unknown" |
||||
privoxy_active="no" |
||||
rcService privoxy enable yes && \ |
||||
privoxy_signal 0 && privoxy_active="yes" |
||||
echo "privoxy_enable=\"$privoxy_enable\"" |
||||
echo "privoxy_usable=\"$privoxy_usable\"" |
||||
echo "privoxy_active=\"$privoxy_active\"" |
||||
|
||||
%start -u @l_susr@ |
||||
rcService privoxy enable yes || exit 0 |
||||
rcService privoxy active yes && exit 0 |
||||
@l_prefix@/sbin/privoxy \ |
||||
--user @l_rusr@.@l_rgrp@ \ |
||||
--pidfile $privoxy_pidfile \ |
||||
$privoxy_cfgfile |
||||
|
||||
%stop -u @l_susr@ |
||||
rcService privoxy enable yes || exit 0 |
||||
rcService privoxy active no && exit 0 |
||||
privoxy_signal TERM |
||||
sleep 2 |
||||
rm -f $privoxy_pidfile >/dev/null 2>&1 || true |
||||
|
||||
%restart -u @l_susr@ |
||||
rcService privoxy enable yes || exit 0 |
||||
rcService privoxy active no && exit 0 |
||||
rc privoxy stop start |
||||
|
||||
%daily -u @l_susr@ |
||||
rcService privoxy enable yes || exit 0 |
||||
shtool rotate -f \ |
||||
-n $privoxy_log_numfiles -s $privoxy_log_minsize -d \ |
||||
-z $privoxy_log_complevel -m 664 -o @l_rusr@ -g @l_rgrp@ \ |
||||
-P "$privoxy_log_prolog" \ |
||||
-E "$privoxy_log_epilog; rc privoxy restart" \ |
||||
$privoxy_logfile |
||||
|
Loading…
Reference in new issue