# HG changeset patch # User Paul Issott # Date 1234977251 0 # Node ID 10ef56b7f468182fe8b8284f6c70377aa59ed7b0 # Parent 49e766e49c354edf509817aec467a3d18d4c517b Add: privoxy diff -r 49e766e49c35 -r 10ef56b7f468 privoxy/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/privoxy/receipt Wed Feb 18 17:14:11 2009 +0000 @@ -0,0 +1,62 @@ +# SliTaz package receipt. + +PACKAGE="privoxy" +VERSION="3.0.10-stable" +CATEGORY="network" +SHORT_DESC="Non-caching web privacy proxy." +MAINTAINER="paul@slitaz.org" +DEPENDS="zlib" +BUILD_DEPENDS="zlib-dev autoconf perl m4 coreutils" +TARBALL="$PACKAGE-$VERSION-src.tar.gz" +WEB_SITE="http://www.privoxy.org/" +WGET_URL="http://downloads.sourceforge.net/ijbswa/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + # Have to create privoxy user/group to be able to compile + adduser privoxy -s /bin/false -H -D -S + + cd $src + + # Needs autoconf + autoheader + autoconf + + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/privoxy \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + $CONFIGURE_ARGS + make + make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/var $fs/etc/init.d + cp -a $_pkg/usr/sbin $fs/usr + cp -a $_pkg/usr/var/* $fs/usr/var + cp -a $_pkg/etc $fs + + # Copy daemon from /stuff + cp stuff/daemon-privoxy $fs/etc/init.d/privoxy +} + +post_install() +{ + # adduser privoxy if needed + if ! grep -q privoxy $1/etc/passwd; then + echo -n "Adding user privoxy..." + chroot $1/ adduser privoxy -s /bin/false -H -D -S + status + fi +} + +# Del user privoxy when pkg is removed. +post_remove() +{ + deluser privoxy +} diff -r 49e766e49c35 -r 10ef56b7f468 privoxy/stuff/daemon-privoxy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/privoxy/stuff/daemon-privoxy Wed Feb 18 17:14:11 2009 +0000 @@ -0,0 +1,59 @@ +#!/bin/sh +# /etc/init.d/daemon-name: Start, stop and restart daemon +# on SliTaz, at boot time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Privoxy +DESC="Web proxy daemon" +DAEMON=/usr/sbin/privoxy +OPTIONS="--pidfile /var/run/privoxy.pid" +USER="--user privoxy" +CONFIG=/etc/privoxy/config +PIDFILE=/var/run/privoxy.pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + echo -n "Restarting $DESC: $NAME... " + $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0