aboutsummaryrefslogtreecommitdiffstats
path: root/community/clamsmtp
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2018-12-24 14:13:15 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2018-12-24 14:14:10 +0000
commit16817be7d5138bfedb7868b204ee26353e67aede (patch)
tree0b114fe2e7531e2aeab6debdd19f228020bf863a /community/clamsmtp
parent66216b13996290741c818e928c7f9f04384a5291 (diff)
downloadaports-16817be7d5138bfedb7868b204ee26353e67aede.tar.bz2
aports-16817be7d5138bfedb7868b204ee26353e67aede.tar.xz
community/clamsmtp: move to community
Home page unreachable since some time, no updates from upstream in some years.
Diffstat (limited to 'community/clamsmtp')
-rw-r--r--community/clamsmtp/APKBUILD61
-rw-r--r--community/clamsmtp/clamsmtp.post-upgrade17
-rw-r--r--community/clamsmtp/clamsmtp.pre-install6
-rw-r--r--community/clamsmtp/clamsmtp.pre-upgrade16
-rw-r--r--community/clamsmtp/clamsmtpd.confd5
-rw-r--r--community/clamsmtp/clamsmtpd.initd23
6 files changed, 128 insertions, 0 deletions
diff --git a/community/clamsmtp/APKBUILD b/community/clamsmtp/APKBUILD
new file mode 100644
index 0000000000..6e6a62ed2b
--- /dev/null
+++ b/community/clamsmtp/APKBUILD
@@ -0,0 +1,61 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=clamsmtp
+pkgver=1.10
+pkgrel=15
+pkgdesc="An SMTP Virus Filter"
+url="http://thewalter.net/stef/software/clamsmtp/"
+arch="all"
+license="BSD"
+depends=""
+makedepends=""
+install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade"
+subpackages="$pkgname-doc"
+source="http://thewalter.net/stef/software/clamsmtp/clamsmtp-$pkgver.tar.gz
+ clamsmtpd.confd
+ clamsmtpd.initd
+ "
+
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ cd "$_builddir"
+ update_config_sub || return 1
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ 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
+01cbffdd905736452e3ac50c16c2cea9 clamsmtpd.initd"
+sha256sums="a52fdb4b26e11ece30c478a806c95b1eda16f4e73937bd560ece7017fb0df92a clamsmtp-1.10.tar.gz
+2383e93e39f5228d50a6e94ae3d3d4983443a6981db23ab0fc8faac11b2518cc clamsmtpd.confd
+965999e302b9b6726c443e941ba58609032e82254e67e64acd96d15ba24e7ba6 clamsmtpd.initd"
+sha512sums="f28e2c1d78c965245d8d7a8810fbeb11d41e40383eba2e8fca500f94c2e4b8d9a2c0b9e4e8e967965bf50266968e0b9549fb62369f37724350a20174c89a044b clamsmtp-1.10.tar.gz
+007b948a11ab4c8da737328d2088abd5b66dc7f83bf1b8bcb26a5deb639864e77553b7e7434139ddb8a916fe39beb4aabb35f766ce96274449b414268703a6ee clamsmtpd.confd
+2540bcafa866249cd63cb961c4d589eca900e9d1bedfc06c5ae890118fd9e49f1bd126e6dc23d1d953cc1038b390a2a736b67032e9fb33e70227887a6cbc4a5c clamsmtpd.initd"
diff --git a/community/clamsmtp/clamsmtp.post-upgrade b/community/clamsmtp/clamsmtp.post-upgrade
new file mode 100644
index 0000000000..2dbccbb22a
--- /dev/null
+++ b/community/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/community/clamsmtp/clamsmtp.pre-install b/community/clamsmtp/clamsmtp.pre-install
new file mode 100644
index 0000000000..fdb83a0904
--- /dev/null
+++ b/community/clamsmtp/clamsmtp.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S clamav 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G clamav -g clamav clamav 2>/dev/null
+
+exit 0
diff --git a/community/clamsmtp/clamsmtp.pre-upgrade b/community/clamsmtp/clamsmtp.pre-upgrade
new file mode 100644
index 0000000000..c397bfc382
--- /dev/null
+++ b/community/clamsmtp/clamsmtp.pre-upgrade
@@ -0,0 +1,16 @@
+#!/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
+
+addgroup -S clamav 2>/dev/null
+adduser -S -D -H -s /bin/false -G clamav -g clamav clamav 2>/dev/null
+
+exit 0
diff --git a/community/clamsmtp/clamsmtpd.confd b/community/clamsmtp/clamsmtpd.confd
new file mode 100644
index 0000000000..8d08b6868c
--- /dev/null
+++ b/community/clamsmtp/clamsmtpd.confd
@@ -0,0 +1,5 @@
+#
+# Specify daemon $OPTS here.
+#
+
+OPTS=""
diff --git a/community/clamsmtp/clamsmtpd.initd b/community/clamsmtp/clamsmtpd.initd
new file mode 100644
index 0000000000..c3942b3b07
--- /dev/null
+++ b/community/clamsmtp/clamsmtpd.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+
+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 $?
+}