summaryrefslogtreecommitdiff
path: root/community/p3scan
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
committerroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
commit8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch)
tree03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/p3scan
parente445a313723389ba9ee1fded025c567dae5b21ea (diff)
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/p3scan')
-rw-r--r--community/p3scan/PKGBUILD59
-rw-r--r--community/p3scan/p3scan.install7
-rw-r--r--community/p3scan/p3scan.service10
-rw-r--r--community/p3scan/p3scan.tmpfiles1
4 files changed, 77 insertions, 0 deletions
diff --git a/community/p3scan/PKGBUILD b/community/p3scan/PKGBUILD
new file mode 100644
index 000000000..17039ff9b
--- /dev/null
+++ b/community/p3scan/PKGBUILD
@@ -0,0 +1,59 @@
+# $Id: PKGBUILD 91863 2013-05-28 17:37:47Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: v01d <phreakuencies@gmail.com>
+
+pkgname=p3scan
+pkgver=2.3.2
+pkgrel=9
+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')
+install=p3scan.install
+source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"
+ "p3scan.service"
+ "p3scan.tmpfiles")
+md5sums=('9f8decc7d4701228788e3c8717096ca0'
+ '74a3a5e52e6714ac5001985061248a34'
+ '265a730e20e3d8aaf0cd7816dc98ca71')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Fix CFLAGS and other options hardcoded in Makefiles
+ unset CFLAGS
+ 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/bin/|' Makefile
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Create base dirs, the Makefile assumes they're there
+ install -d $pkgdir/usr/bin $pkgdir/usr/man/man8 $pkgdir/etc/rc.d
+
+ # install with root set on $pkgdir
+ make DESTDIR=$pkgdir install
+
+ # delete init script provided and use an arch compatible one
+ rm -rf $pkgdir/etc/rc.d
+
+ # 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
+
+ install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+ install -Dm0644 $srcdir/$pkgname.tmpfiles $pkgdir/usr/lib/tmpfiles.d/$pkgname.conf
+}
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/p3scan.service b/community/p3scan/p3scan.service
new file mode 100644
index 000000000..bdd34b75c
--- /dev/null
+++ b/community/p3scan/p3scan.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=p3scan proxy
+
+[Service]
+Type=forking
+PIDFile=/run/p3scan/p3scan.pid
+ExecStart=/usr/bin/p3scan
+
+[Install]
+WantedBy=multi-user.target
diff --git a/community/p3scan/p3scan.tmpfiles b/community/p3scan/p3scan.tmpfiles
new file mode 100644
index 000000000..17f0a4c22
--- /dev/null
+++ b/community/p3scan/p3scan.tmpfiles
@@ -0,0 +1 @@
+d /run/p3scan 0755 root root -