diff options
author | Nishant Limbachia <nishant@mnspace.net> | 2010-05-12 17:44:08 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-12 17:44:08 +0200 |
commit | 8497f2d5d4766f694473ce4ee57a5bb47a14f542 (patch) | |
tree | 311d939750611a2cc6df34f41c2cc325725e2b81 | |
parent | 40562dc9577c9028898cb54e0d65f36c7dd340a3 (diff) | |
download | slackbuilds-8497f2d5d4766f694473ce4ee57a5bb47a14f542.tar.gz |
network/policyd: Updated for version 1.82
-rw-r--r-- | network/policyd/policyd.SlackBuild | 23 | ||||
-rw-r--r-- | network/policyd/rc.policyd | 35 | ||||
-rw-r--r-- | network/policyd/slack-desc | 2 |
3 files changed, 39 insertions, 21 deletions
diff --git a/network/policyd/policyd.SlackBuild b/network/policyd/policyd.SlackBuild index 34ebec230a..ffae56e6e3 100644 --- a/network/policyd/policyd.SlackBuild +++ b/network/policyd/policyd.SlackBuild @@ -2,15 +2,15 @@ # Slackware Package Build Script for policyd -# Copyright (c) 2007, Nishant Limbachia (nishant@mnspace.net) +# Copyright (c) 2008-2009, Nishant Limbachia (nishant@mnspace.net) # All rights reserved. - +# # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: - +# # 1. Redistributions of script must retain the above copyright notice, # this list of conditions and the following disclaimer. - +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -24,11 +24,11 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Modified by Robby Workman <rworkman@slackbuilds.org> - + PRGNAM=policyd VERSION=1.82 ARCH=${ARCH:-i486} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} CWD=$(pwd) @@ -36,16 +36,20 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +set -e + 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 rm -fr $TMP/$PRGNAM-$VERSION $PKG mkdir -p $PKG $TMP $OUTPUT cd $TMP -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1 +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $TMP/$PRGNAM-$VERSION chown root.root . find . \ @@ -55,10 +59,7 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 644 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Note - for future policyd versions, check to see if the upstream Makefile -# has an different CFLAGS defined. We're just pulling what the author put -# in and appending standard Slackware ones to it. --rworkman -make CFLAGS="-g -W -Wall -DMAXFDS=4096 $SLKCFLAGS" build || exit 1 +make CFLAGS+="$SLKCFLAGS" build strip --strip-unneeded cleanup stats policyd 2> /dev/null mkdir -p $PKG/usr/bin diff --git a/network/policyd/rc.policyd b/network/policyd/rc.policyd index a6400e71c9..06f87a21e8 100644 --- a/network/policyd/rc.policyd +++ b/network/policyd/rc.policyd @@ -2,24 +2,40 @@ # # /etc/rc.d/rc.policyd # -# start/stop/restart policy daemon - +# start/stop/restart Policy daemon for Postfix +# # The PIDFILE is setup in the config file. Default is /var/run/policyd.pid -# if you change the location in the config file then it **needs** to be changed here too. +# If you change the location in the config file then it **needs** to be +# changed here too. + PIDFILE="/var/run/policyd.pid" CONFIG="/etc/policyd.conf" policyd_start() { if [ -x /etc/rc.d/rc.policyd ]; then - echo "Starting Policy daemon" - /usr/bin/policyd -c $CONFIG + if [ -f $PIDFILE ]; then + echo "Policy daemon seems to be running with PID: $(cat $PIDFILE)" + else + if [ -r "$CONFIG" ]; then + echo "Starting Policy daemon" + /usr/bin/policyd -c $CONFIG + else + echo "$CONFIG is missing or unreadable. Exiting..." + exit 1 + fi + fi fi } policyd_stop() { - echo "Stopping Policy daemon" - /bin/kill $(cat $PIDFILE) - rm -f $PIDFILE + if [ -f $PIDFILE ]; then + echo "Stopping Policy daemon" + /bin/kill $(cat $PIDFILE) + rm -f $PIDFILE + else + echo "Policy daemon is not running..." + exit 1 + fi } policyd_restart() { @@ -38,8 +54,9 @@ case "$1" in 'restart') policyd_restart ;; -'*') +*) echo "USAGE: $0 start|stop|restart" exit 1 ;; esac + diff --git a/network/policyd/slack-desc b/network/policyd/slack-desc index 44336ac4ab..bc4f9500ae 100644 --- a/network/policyd/slack-desc +++ b/network/policyd/slack-desc @@ -11,7 +11,7 @@ policyd: policyd: Policyd is an anti-spam plugin for Postfix (written in C) that policyd: does Greylisting, Sender-throttling, Spamtrap monitoring and policyd: blacklisting, helo auto blacklisting and helo randomization -policyd: prevention (HRP). +policyd: prevention (HRP). policyd: policyd: Homepage: http://policyd.org/ policyd: |