aboutsummaryrefslogtreecommitdiffstats
path: root/main/clamsmtp
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-09-22 06:17:47 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-09-22 06:18:47 +0000
commitdf8d0f17845c931cfe1318e55c9b12b620f1def1 (patch)
tree33d13b516657a6148d8280f197453fde2cead88f /main/clamsmtp
parent6afa7fca2df3a2c5508e2a33b1095ac5e82abe78 (diff)
downloadaports-df8d0f17845c931cfe1318e55c9b12b620f1def1.tar.bz2
aports-df8d0f17845c931cfe1318e55c9b12b620f1def1.tar.xz
main/clamsmtp: fix default config. create user
Diffstat (limited to 'main/clamsmtp')
-rw-r--r--main/clamsmtp/0001-extra-clamsmtp-renamed-init.d-script-to-clamsmtpd.patch181
-rw-r--r--main/clamsmtp/APKBUILD9
-rw-r--r--main/clamsmtp/clamsmtp.pre-install4
-rw-r--r--main/clamsmtp/clamsmtp.pre-upgrade2
4 files changed, 13 insertions, 183 deletions
diff --git a/main/clamsmtp/0001-extra-clamsmtp-renamed-init.d-script-to-clamsmtpd.patch b/main/clamsmtp/0001-extra-clamsmtp-renamed-init.d-script-to-clamsmtpd.patch
deleted file mode 100644
index c0032bae07..0000000000
--- a/main/clamsmtp/0001-extra-clamsmtp-renamed-init.d-script-to-clamsmtpd.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From 539dfdd4b0358fa78f26c38853c36fabc65c54cd Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Fri, 17 Jul 2009 08:48:42 +0000
-Subject: [PATCH] extra/clamsmtp: renamed init.d script to clamsmtpd
-
-partly fixes #64
----
- extra/clamsmtp/APKBUILD | 18 +++++++++++-------
- extra/clamsmtp/clamsmtp.confd | 5 -----
- extra/clamsmtp/clamsmtp.initd | 22 ----------------------
- extra/clamsmtp/clamsmtp.post-upgrade | 16 ++++++++++++++++
- extra/clamsmtp/clamsmtp.pre-upgrade | 12 ++++++++++++
- extra/clamsmtp/clamsmtpd.confd | 5 +++++
- extra/clamsmtp/clamsmtpd.initd | 22 ++++++++++++++++++++++
- 7 files changed, 66 insertions(+), 34 deletions(-)
- delete mode 100644 extra/clamsmtp/clamsmtp.confd
- delete mode 100644 extra/clamsmtp/clamsmtp.initd
- create mode 100644 extra/clamsmtp/clamsmtp.post-upgrade
- create mode 100644 extra/clamsmtp/clamsmtp.pre-upgrade
- create mode 100644 extra/clamsmtp/clamsmtpd.confd
- create mode 100644 extra/clamsmtp/clamsmtpd.initd
-
-diff --git a/extra/clamsmtp/APKBUILD b/extra/clamsmtp/APKBUILD
-index 5402d09..0ad433a 100644
---- a/extra/clamsmtp/APKBUILD
-+++ b/extra/clamsmtp/APKBUILD
-@@ -2,16 +2,18 @@
- # Maintainer: Carlo Landmeter <clandmeter at gmail>
- pkgname=clamsmtp
- pkgver=1.10
--pkgrel=1
-+pkgrel=2
- pkgdesc="An SMTP Virus Filter"
- url="http://memberwebs.com/stef/software/clamsmtp/"
- license="as-is"
--depends="uclibc"
--makedepends=""
-+depends=
-+makedepends=
-+install="$pkgname.pre-upgrade $pkgname.post-upgrade"
- subpackages="$pkgname-doc"
- source="http://memberwebs.com/stef/software/clamsmtp/${pkgname}-${pkgver}.tar.gz
--clamsmtp.confd
--clamsmtp.initd"
-+ clamsmtpd.confd
-+ clamsmtpd.initd
-+ $install"
-
- build() {
- cd "$srcdir/$pkgname-$pkgver"
-@@ -30,5 +32,7 @@ build() {
- }
-
- md5sums="b068ba6e444859782bbdd88f290c1abf clamsmtp-1.10.tar.gz
--e84205681f64c07af9ec5b6a3dd8bc38 clamsmtp.confd
--161baf2fb444b67d8a08fbfe4375a12c clamsmtp.initd"
-+e84205681f64c07af9ec5b6a3dd8bc38 clamsmtpd.confd
-+161baf2fb444b67d8a08fbfe4375a12c clamsmtpd.initd
-+32e7b12f3a1f4669d080d8cfdb537e78 clamsmtp.pre-upgrade
-+d9fbdc217d12cf1e85b0323f822b7e47 clamsmtp.post-upgrade"
-diff --git a/extra/clamsmtp/clamsmtp.confd b/extra/clamsmtp/clamsmtp.confd
-deleted file mode 100644
-index 8d08b68..0000000
---- a/extra/clamsmtp/clamsmtp.confd
-+++ /dev/null
-@@ -1,5 +0,0 @@
--#
--# Specify daemon $OPTS here.
--#
--
--OPTS=""
-diff --git a/extra/clamsmtp/clamsmtp.initd b/extra/clamsmtp/clamsmtp.initd
-deleted file mode 100644
-index dbd817f..0000000
---- a/extra/clamsmtp/clamsmtp.initd
-+++ /dev/null
-@@ -1,22 +0,0 @@
--#!/sbin/runscript
--
--NAME=clamsmtpd
--DAEMON=/usr/sbin/$NAME
--
--depend() {
-- need net
--}
--
--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 $?
--}
-diff --git a/extra/clamsmtp/clamsmtp.post-upgrade b/extra/clamsmtp/clamsmtp.post-upgrade
-new file mode 100644
-index 0000000..c418ff8
---- /dev/null
-+++ b/extra/clamsmtp/clamsmtp.post-upgrade
-@@ -0,0 +1,16 @@
-+#!/bin/sh
-+
-+moved=
-+for i in /etc/runlevels/*/clamsmtp; do
-+ if [ -L $i ]; then
-+ mv ${i} ${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/extra/clamsmtp/clamsmtp.pre-upgrade b/extra/clamsmtp/clamsmtp.pre-upgrade
-new file mode 100644
-index 0000000..12de39f
---- /dev/null
-+++ b/extra/clamsmtp/clamsmtp.pre-upgrade
-@@ -0,0 +1,12 @@
-+#!/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
-+
-diff --git a/extra/clamsmtp/clamsmtpd.confd b/extra/clamsmtp/clamsmtpd.confd
-new file mode 100644
-index 0000000..8d08b68
---- /dev/null
-+++ b/extra/clamsmtp/clamsmtpd.confd
-@@ -0,0 +1,5 @@
-+#
-+# Specify daemon $OPTS here.
-+#
-+
-+OPTS=""
-diff --git a/extra/clamsmtp/clamsmtpd.initd b/extra/clamsmtp/clamsmtpd.initd
-new file mode 100644
-index 0000000..dbd817f
---- /dev/null
-+++ b/extra/clamsmtp/clamsmtpd.initd
-@@ -0,0 +1,22 @@
-+#!/sbin/runscript
-+
-+NAME=clamsmtpd
-+DAEMON=/usr/sbin/$NAME
-+
-+depend() {
-+ need net
-+}
-+
-+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 $?
-+}
---
-1.6.3.3
-
diff --git a/main/clamsmtp/APKBUILD b/main/clamsmtp/APKBUILD
index 5fefb2f81f..1bad20a087 100644
--- a/main/clamsmtp/APKBUILD
+++ b/main/clamsmtp/APKBUILD
@@ -2,13 +2,13 @@
# Maintainer: Carlo Landmeter <clandmeter at gmail>
pkgname=clamsmtp
pkgver=1.10
-pkgrel=5
+pkgrel=6
pkgdesc="An SMTP Virus Filter"
url="http://memberwebs.com/stef/software/clamsmtp/"
license="as-is"
depends=
makedepends=
-install="$pkgname.pre-upgrade $pkgname.post-upgrade"
+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
@@ -25,6 +25,11 @@ build() {
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
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
index 12de39f7b1..97d90817be 100644
--- a/main/clamsmtp/clamsmtp.pre-upgrade
+++ b/main/clamsmtp/clamsmtp.pre-upgrade
@@ -10,3 +10,5 @@ if [ -f "$old" ] && [ ! -f "$new" ]; then
echo " *"
fi
+adduser -H -s /bin/false -D clamav 2>/dev/null
+exit 0