aboutsummaryrefslogtreecommitdiffstats
path: root/main/clamsmtp
diff options
context:
space:
mode:
Diffstat (limited to 'main/clamsmtp')
-rw-r--r--main/clamsmtp/APKBUILD42
-rw-r--r--main/clamsmtp/clamsmtp.post-upgrade17
-rw-r--r--main/clamsmtp/clamsmtp.pre-install4
-rw-r--r--main/clamsmtp/clamsmtp.pre-upgrade14
-rw-r--r--main/clamsmtp/clamsmtpd.confd5
-rw-r--r--main/clamsmtp/clamsmtpd.initd23
6 files changed, 105 insertions, 0 deletions
diff --git a/main/clamsmtp/APKBUILD b/main/clamsmtp/APKBUILD
new file mode 100644
index 0000000000..372ed1a43f
--- /dev/null
+++ b/main/clamsmtp/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=clamsmtp
+pkgver=1.10
+pkgrel=9
+pkgdesc="An SMTP Virus Filter"
+url="http://memberwebs.com/stef/software/clamsmtp/"
+arch="all"
+license="as-is"
+depends=
+makedepends=
+install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade"
+subpackages="$pkgname-doc"
+source="http://memberwebs.com/stef/software/clamsmtp/${pkgname}-${pkgver}.tar.gz
+ clamsmtpd.confd
+ clamsmtpd.initd
+ "
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make || return 1
+ make DESTDIR="$pkgdir" install || return 1
+
+ # set default clam address and user
+ sed -e 's|^\#ClamAddress:.*|ClamAddress: /var/run/clamav/clamd.sock|'\
+ -e 's|^\#User:.*|User: clamav|' \
+ -i doc/clamsmtpd.conf
+
+ install -Dm644 doc/clamsmtpd.conf "$pkgdir"/etc/clamsmtpd.conf
+ install -Dm755 "$srcdir"/clamsmtpd.initd "$pkgdir"/etc/init.d/clamsmtpd
+ install -Dm644 "$srcdir"/clamsmtpd.confd "$pkgdir"/etc/conf.d/clamsmtpd
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+}
+
+md5sums="b068ba6e444859782bbdd88f290c1abf clamsmtp-1.10.tar.gz
+e84205681f64c07af9ec5b6a3dd8bc38 clamsmtpd.confd
+d34b382f2b4b3bc2497eb05f16cfc1ba clamsmtpd.initd"
diff --git a/main/clamsmtp/clamsmtp.post-upgrade b/main/clamsmtp/clamsmtp.post-upgrade
new file mode 100644
index 0000000000..2dbccbb22a
--- /dev/null
+++ b/main/clamsmtp/clamsmtp.post-upgrade
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+moved=
+for i in /etc/runlevels/*/clamsmtp; do
+ if [ -L $i ]; then
+ rm $i
+ ln -s /etc/init.d/clamsmtpd ${i}d
+ moved=1
+ fi
+done
+
+if [ -n "$moved" ]; then
+ echo " *"
+ echo " * NOTICE: /etc/init.d/clamsmtp is renamed to /etc/init.d/clamsmtpd"
+ echo " *"
+fi
+
diff --git a/main/clamsmtp/clamsmtp.pre-install b/main/clamsmtp/clamsmtp.pre-install
new file mode 100644
index 0000000000..59ac60a44d
--- /dev/null
+++ b/main/clamsmtp/clamsmtp.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+adduser -H -s /bin/false -D clamav 2>/dev/null
+exit 0
diff --git a/main/clamsmtp/clamsmtp.pre-upgrade b/main/clamsmtp/clamsmtp.pre-upgrade
new file mode 100644
index 0000000000..97d90817be
--- /dev/null
+++ b/main/clamsmtp/clamsmtp.pre-upgrade
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+old=/etc/conf.d/clamsmtp
+new=/etc/conf.d/clamsmtpd
+
+if [ -f "$old" ] && [ ! -f "$new" ]; then
+ mv "$old" "$new"
+ echo " *"
+ echo " * NOTICE: $old was renamed to $new"
+ echo " *"
+fi
+
+adduser -H -s /bin/false -D clamav 2>/dev/null
+exit 0
diff --git a/main/clamsmtp/clamsmtpd.confd b/main/clamsmtp/clamsmtpd.confd
new file mode 100644
index 0000000000..8d08b6868c
--- /dev/null
+++ b/main/clamsmtp/clamsmtpd.confd
@@ -0,0 +1,5 @@
+#
+# Specify daemon $OPTS here.
+#
+
+OPTS=""
diff --git a/main/clamsmtp/clamsmtpd.initd b/main/clamsmtp/clamsmtpd.initd
new file mode 100644
index 0000000000..9be17d0959
--- /dev/null
+++ b/main/clamsmtp/clamsmtpd.initd
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+
+NAME=clamsmtpd
+DAEMON=/usr/sbin/$NAME
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet \
+ --exec ${DAEMON} -- ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --quiet \
+ --exec ${DAEMON}
+ eend $?
+}