wok rev 2275

Add: privoxy
author Paul Issott <paul@slitaz.org>
date Wed Feb 18 17:14:11 2009 +0000 (2009-02-18)
parents 49e766e49c35
children 9356d6530243
files privoxy/receipt privoxy/stuff/daemon-privoxy
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/privoxy/receipt	Wed Feb 18 17:14:11 2009 +0000
     1.3 @@ -0,0 +1,62 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="privoxy"
     1.7 +VERSION="3.0.10-stable"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Non-caching web privacy proxy."
    1.10 +MAINTAINER="paul@slitaz.org"
    1.11 +DEPENDS="zlib"
    1.12 +BUILD_DEPENDS="zlib-dev autoconf perl m4 coreutils"
    1.13 +TARBALL="$PACKAGE-$VERSION-src.tar.gz"
    1.14 +WEB_SITE="http://www.privoxy.org/"
    1.15 +WGET_URL="http://downloads.sourceforge.net/ijbswa/$TARBALL"
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	# Have to create privoxy user/group to be able to compile
    1.21 +	adduser privoxy -s /bin/false -H -D -S
    1.22 +
    1.23 +	cd $src
    1.24 +
    1.25 +	# Needs autoconf
    1.26 +	autoheader
    1.27 +	autoconf
    1.28 +
    1.29 +	./configure \
    1.30 +		--prefix=/usr \
    1.31 +		--sysconfdir=/etc/privoxy \
    1.32 +		--infodir=/usr/share/info \
    1.33 +		--mandir=/usr/share/man \
    1.34 +		$CONFIGURE_ARGS
    1.35 +	make
    1.36 +	make DESTDIR=$PWD/_pkg install
    1.37 +}
    1.38 +
    1.39 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.40 +genpkg_rules()
    1.41 +{
    1.42 +	mkdir -p $fs/usr/var $fs/etc/init.d
    1.43 +	cp -a $_pkg/usr/sbin $fs/usr
    1.44 +	cp -a $_pkg/usr/var/* $fs/usr/var
    1.45 +	cp -a $_pkg/etc $fs
    1.46 +
    1.47 +	# Copy daemon from /stuff
    1.48 +	cp stuff/daemon-privoxy $fs/etc/init.d/privoxy
    1.49 +}
    1.50 +
    1.51 +post_install()
    1.52 +{
    1.53 +	# adduser privoxy if needed
    1.54 +	if ! grep -q privoxy $1/etc/passwd; then
    1.55 +		echo -n "Adding user privoxy..."
    1.56 +		chroot $1/ adduser privoxy -s /bin/false -H -D -S
    1.57 +		status
    1.58 +	fi
    1.59 +}
    1.60 +
    1.61 +# Del user privoxy when pkg is removed.
    1.62 +post_remove()
    1.63 +{
    1.64 +	deluser privoxy
    1.65 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/privoxy/stuff/daemon-privoxy	Wed Feb 18 17:14:11 2009 +0000
     2.3 @@ -0,0 +1,59 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/daemon-name: Start, stop and restart daemon 
     2.6 +# on SliTaz, at boot time or with the command line.
     2.7 +#
     2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=Privoxy
    2.15 +DESC="Web proxy daemon"
    2.16 +DAEMON=/usr/sbin/privoxy
    2.17 +OPTIONS="--pidfile /var/run/privoxy.pid"
    2.18 +USER="--user privoxy"
    2.19 +CONFIG=/etc/privoxy/config
    2.20 +PIDFILE=/var/run/privoxy.pid
    2.21 +
    2.22 +case "$1" in
    2.23 +  start)
    2.24 +    if [ -f $PIDFILE ] ; then
    2.25 +      echo "$NAME already running."
    2.26 +      exit 1
    2.27 +    fi
    2.28 +    echo -n "Starting $DESC: $NAME... "
    2.29 +    $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null
    2.30 +    status
    2.31 +    ;;
    2.32 +  stop)
    2.33 +    if [ ! -f $PIDFILE ] ; then
    2.34 +      echo "$NAME is not running."
    2.35 +      exit 1
    2.36 +    fi
    2.37 +    echo -n "Stopping $DESC: $NAME... "
    2.38 +    kill `cat $PIDFILE`
    2.39 +    rm $PIDFILE
    2.40 +    status
    2.41 +    ;;
    2.42 +  restart)
    2.43 +    if [ ! -f $PIDFILE ] ; then
    2.44 +      echo "$NAME is not running."
    2.45 +      exit 1
    2.46 +    fi
    2.47 +    kill `cat $PIDFILE`
    2.48 +    rm $PIDFILE
    2.49 +    sleep 2
    2.50 +    echo -n "Restarting $DESC: $NAME... "
    2.51 +    $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null
    2.52 +    status
    2.53 +    ;;
    2.54 +  *)
    2.55 +    echo ""
    2.56 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.57 +    echo ""
    2.58 +    exit 1
    2.59 +    ;;
    2.60 +esac
    2.61 +
    2.62 +exit 0