diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/p3scan |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/p3scan')
-rw-r--r-- | community/p3scan/PKGBUILD | 50 | ||||
-rw-r--r-- | community/p3scan/p3scan.install | 7 | ||||
-rw-r--r-- | community/p3scan/rc.p3scan | 39 |
3 files changed, 96 insertions, 0 deletions
diff --git a/community/p3scan/PKGBUILD b/community/p3scan/PKGBUILD new file mode 100644 index 000000000..67dd6ca21 --- /dev/null +++ b/community/p3scan/PKGBUILD @@ -0,0 +1,50 @@ +# $Id: PKGBUILD 44195 2011-04-04 13:08:48Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: v01d <phreakuencies@gmail.com> + +pkgname=p3scan +pkgver=2.3.2 +pkgrel=5 +pkgdesc="Fully transparent POP3/SMTP proxy with Anti-Virus and SPAM protection" +arch=('i686' 'x86_64') +url="http://p3scan.sourceforge.net/" +depends=('pcre' 'openssl') +license=('GPL') +source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz" "rc.p3scan") +md5sums=('9f8decc7d4701228788e3c8717096ca0' 'f6e3450c3a932477c49082559b7abef8') +install=p3scan.install +md5sums=('9f8decc7d4701228788e3c8717096ca0' + '482a783e699b6532cbc478977f429eb5') + +build() { + cd $srcdir/$pkgname-$pkgver + + # Fix CFLAGS and other options hardcoded in Makefiles + sed -ri "s|^CFLAGS=-Wall( -g)? -O2|CFLAGS=-Wall $CFLAGS|" Makefile ripmime/Makefile ripmime/tnef/Makefile ripmime/ripOLE/Makefile + sed -ri 's|^LOCATION=.+$|LOCATION=/usr|' ripmime/Makefile + sed -ri 's|\$\(SYSINS\) -v -m 550 --strip p3scan \$\(PREFIX\)/sbin/|$(SYSINS) -D -v -m 550 --strip p3scan $(DESTDIR)/usr/sbin/|' Makefile + make + + # Create base dirs, the Makefile assumes they're there + install -d $pkgdir/usr/sbin $startdir/pkg/etc/rc.d $startdir/pkg/usr/man/man8 + + # install with root set on $pkgdir + make DESTDIR=$pkgdir install + + # delete init script provided and use an arch compatible one + rm -f $pkgdir/etc/rc.d/rc.p3scan + install -D -m755 -g root -o root $srcdir/rc.p3scan $pkgdir/etc/rc.d/p3scan + + # BUG?: make absolute link a relative one + ( + cd $pkgdir/etc/p3scan + ln -sf p3scan-en.mail p3scan.mail + ) + + # BUG: fix .conf file (the license has C style comments, they should be conf-style comments) + sed -ri 's|^[/ ]\*/?|# |g' $pkgdir/etc/p3scan/p3scan.conf + + mv $pkgdir/usr/man $pkgdir/usr/share/ + mv $pkgdir/usr/doc $pkgdir/usr/share/ + rm -rf $pkgdir/var/run +} diff --git a/community/p3scan/p3scan.install b/community/p3scan/p3scan.install new file mode 100644 index 000000000..0f139dd28 --- /dev/null +++ b/community/p3scan/p3scan.install @@ -0,0 +1,7 @@ +post_install() { + echo "==> You may want an Anti-Virus program to use with p3scan. Installing clamav is recommended." +} + +post_upgrade() { + post_install $1 $2 +} diff --git a/community/p3scan/rc.p3scan b/community/p3scan/rc.p3scan new file mode 100644 index 000000000..fc8b79b22 --- /dev/null +++ b/community/p3scan/rc.p3scan @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting p3scan" + [ -d /var/run/p3scan ] || mkdir -p /var/run/p3scan + if [ -a /var/run/p3scan/p3scan.pid ]; then stat_die; fi + + # Start p3scan + /usr/sbin/p3scan + if ! [ -a /var/run/p3scan/p3scan.pid ]; then stat_die; fi + add_daemon p3scan + stat_done + ;; + stop) + stat_busy "Stopping p3scan" + + # Stop p3scan + if [ -a /var/run/p3scan/p3scan.pid ]; then + kill `cat /var/run/p3scan/p3scan.pid` &>/dev/null || stat_die + rm -f /var/run/p3scan/p3scan.pid + rm_daemon p3scan + stat_done + else + stat_fail + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 { start | stop | restart }" +esac +exit 0 |