aboutsummaryrefslogtreecommitdiffstats
path: root/extra/clamsmtp/0001-extra-clamsmtp-renamed-init.d-script-to-clamsmtpd.patch
blob: c0032bae07f79bf8e0dbba4d3309581d8a4980fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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