summaryrefslogtreecommitdiffstats
path: root/network/privoxy/privoxy.SlackBuild
diff options
context:
space:
mode:
author alkos333 <me@alkos333.net>2010-05-12 17:44:10 +0200
committer David Somero <xgizzmo@slackbuilds.org>2010-05-12 17:44:10 +0200
commit83085a75138a02cabc09a50f99f9fb1394ac9324 (patch)
tree6b75a327c3195a70029830b64be277c4eabc350e /network/privoxy/privoxy.SlackBuild
parent8f1d80487b8d9de9c7ee52a62c76b60dc5bb20e5 (diff)
downloadslackbuilds-83085a75138a02cabc09a50f99f9fb1394ac9324.tar.gz
slackbuilds-83085a75138a02cabc09a50f99f9fb1394ac9324.tar.xz
network/privoxy: Updated for version 3.0.12
Diffstat (limited to 'network/privoxy/privoxy.SlackBuild')
-rw-r--r--network/privoxy/privoxy.SlackBuild47
1 files changed, 36 insertions, 11 deletions
diff --git a/network/privoxy/privoxy.SlackBuild b/network/privoxy/privoxy.SlackBuild
index 6ddc0cc0f3..c94a8cade8 100644
--- a/network/privoxy/privoxy.SlackBuild
+++ b/network/privoxy/privoxy.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
-
# Slackware build script for privoxy
+
# Copyright (c) 2007 alkos333 <me@alkos333.net>
# All rights reserved.
#
@@ -26,10 +26,8 @@
# Modified by the SlackBuilds.org project
-set -e
-
PRGNAM=privoxy
-VERSION=3.0.10
+VERSION=3.0.12
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -43,8 +41,29 @@ if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+fi
+
+## privoxy user & group *MUST* exist before package creation
+# See http://slackbuilds.org/uid_gid.txt for current recomendations.
+PRIVOXY_USER=${PRIVOXY_USER:-privoxy}
+PRIVOXY_GROUP=${PRIVOXY_GROUP:-privoxy}
+
+if ! grep -q ^$PRIVOXY_GROUP: /etc/group 2>/dev/null ; then
+ echo " Error: PRIVOXY group ($PRIVOXY_GROUP) doesn't exist."
+ echo " Try creating one with: groupadd -g 206 $PRIVOXY_GROUP"
+ exit 1
+fi
+
+if ! grep -q ^$PRIVOXY_USER: /etc/passwd 2>/dev/null ; then
+ echo " Error: PRIVOXY user ($PRIVOXY_USER) doesn't exist."
+ echo " Try creating one with: useradd -u 206 -g $PRIVOXY_GROUP -d /dev/null -s /bin/false $PRIVOXY_USER"
+ exit 1
fi
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -65,9 +84,11 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=$PKG/var \
--datadir=$PKG/usr \
--mandir=$PKG/usr/man \
+ --docdir=$PKG/usr/doc/$PRGNAM-$VERSION \
--with-docbook=no \
- --with-user=privoxy \
- --with-group=privoxy
+ --with-user=$PRIVOXY_USER \
+ --with-group=$PRIVOXY_GROUP \
+ --build=$ARCH-slackware-linux
make || exit 1
make install-strip || exit 1
@@ -81,7 +102,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc -type f -exec chmod 644 {} \;
mkdir $PKG/etc/rc.d
-cat $TMP/$PRGNAM-$VERSION-stable/slackware/rc.privoxy.orig > $PKG/etc/rc.d/rc.$PRGNAM.new
+cat slackware/rc.privoxy.orig > $PKG/etc/rc.d/rc.$PRGNAM.new
sed -i " s/%PROGRAM%/$PRGNAM/
s/%SBIN_DEST%/\/usr\/bin/
s/%CONF_DEST%/\/etc\/$PRGNAM/
@@ -92,13 +113,17 @@ sed -i " s/%PROGRAM%/$PRGNAM/
# Fix Path within the configuration files (thanks to h4kteur)
sed -i "s#$PKG##g" $PKG/etc/$PRGNAM/config
-# Fix Path with the config file to point to right usermanual (thanks toBP{k})
-sed -i "s#user-manual /usr/doc/$PRGNAM#user-manual /usr/doc/$PRGNAM-$VERSION#" $PKG/etc/privoxy/config
+# Fix Path with the config file to point to right usermanual (thanks to BP{k})
+sed -i \
+ "s#user-manual /usr/doc/$PRGNAM#user-manual /usr/doc/$PRGNAM-$VERSION#" \
+ $PKG/etc/privoxy/config
# Make .new files so we dont clobber existing configuration
find $PKG/etc/privoxy -type f -exec mv {} {}.new \;
-
-# Remove this directory since it empty and part of Slackware base
+# Don't clobber the logfile either
+mv $PKG/var/log/privoxy/logfile $PKG/var/log/privoxy/logfile.new
+
+# Remove this directory since it's empty and part of Slackware base
rmdir $PKG/var/run
mkdir -p $PKG/install