]>
Commit | Line | Data |
---|---|---|
154629dc | 1 | # |
2 | # Conditional build: | |
af9a7095 | 3 | %bcond_with qmail # enable qmail |
4 | ||
bb38b6f5 | 5 | Summary: A Mail Virus Scanner - Daemon |
5f376c2c | 6 | Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej - Demon |
9fd1909c | 7 | Name: amavisd |
e8af650f | 8 | Version: 0.1 |
8a298572 | 9 | Release: 8 |
e8af650f | 10 | Epoch: 1 |
9fd1909c | 11 | License: GPL |
12 | Group: Applications/Mail | |
e8af650f | 13 | Source0: http://www.amavis.org/dist/perl/%{name}-%{version}.tar.gz |
ba5395dd | 14 | # Source0-md5: 432a32bfc6d473564f49028b540f53ad |
d252005d | 15 | Source1: %{name}.init |
421380b6 | 16 | Patch0: %{name}-notest-mta.patch |
17 | Patch1: %{name}-nomilter.patch | |
18 | Patch2: %{name}-qmail.patch | |
08265da5 | 19 | Patch3: %{name}-mks_vir.patch |
16b2c28b | 20 | Patch4: %{name}-clamav.patch |
e8af650f | 21 | Patch5: %{name}-mks_vir-mksd.patch |
22 | Patch6: %{name}-qmail-new.patch | |
e1bd335a | 23 | Patch7: %{name}-acx_pthread.patch |
d252005d | 24 | URL: http://www.amavis.org/ |
9a75c9dc AM |
25 | BuildRequires: arc |
26 | BuildRequires: autoconf | |
29267624 | 27 | BuildRequires: automake |
9a75c9dc AM |
28 | BuildRequires: file |
29 | BuildRequires: lha | |
30 | BuildRequires: ncompress | |
9fd1909c | 31 | BuildRequires: perl-Archive-Tar |
32 | BuildRequires: perl-Archive-Zip | |
33 | BuildRequires: perl-Compress-Zlib | |
f5a44ef9 ER |
34 | BuildRequires: perl-Convert-TNEF |
35 | BuildRequires: perl-Convert-UUlib | |
9fd1909c | 36 | BuildRequires: perl-MIME-tools |
9a75c9dc | 37 | BuildRequires: perl-Unix-Syslog |
fc68307a | 38 | BuildRequires: perl-libnet |
e51ace5b | 39 | BuildRequires: rpmbuild(macros) >= 1.268 |
9fd1909c | 40 | BuildRequires: unarj |
9fd1909c | 41 | BuildRequires: unrar |
42 | BuildRequires: zoo | |
f5a44ef9 ER |
43 | Requires(post,preun): /sbin/chkconfig |
44 | Requires(postun): /usr/sbin/userdel | |
30dfe46a ER |
45 | Requires(pre): /bin/id |
46 | Requires(pre): /usr/sbin/useradd | |
93279a89 | 47 | Requires: /usr/lib/sendmail |
f5a44ef9 | 48 | Requires: amavisd-daemon |
9fd1909c | 49 | Requires: arc |
50 | Requires: bzip2 | |
9a75c9dc | 51 | Requires: file |
9fd1909c | 52 | Requires: lha |
9fd1909c | 53 | Requires: ncompress |
9a75c9dc AM |
54 | Requires: sh-utils |
55 | Requires: unarj | |
9fd1909c | 56 | Requires: unrar |
57 | Requires: zoo | |
397ffa87 | 58 | Provides: user(amavis) |
2165ccc9 | 59 | Obsoletes: AMaViS |
60 | Obsoletes: amavis | |
d260790f | 61 | Obsoletes: amavisd-new |
e51ace5b | 62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
9fd1909c | 63 | |
5645dbcb ER |
64 | # needs fix somewhere |
65 | %undefine with_ccache | |
66 | ||
9fd1909c | 67 | %description |
68 | AMaViS is a script that interfaces a mail transport agent (MTA) with | |
69 | one or more virus scanners. This is daemonized version of amavis. | |
70 | ||
2dd5392c JR |
71 | %description -l pl.UTF-8 |
72 | AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA) | |
73 | a jednym lub więcej programów antywirusowych. Wersja zdemonizowana. | |
9fd1909c | 74 | |
7edaca6c | 75 | %package postfix |
bb38b6f5 | 76 | Summary: A Mail Virus Scanner - postfix back-end |
5f376c2c | 77 | Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej - back-end dla postfiksa |
7edaca6c | 78 | Group: Applications/Mail |
d260790f PG |
79 | Requires: amavisd |
80 | Requires: postfix | |
7edaca6c | 81 | Provides: amavisd-daemon |
d657b635 | 82 | Obsoletes: amavisd-daemon |
6989490b JB |
83 | Obsoletes: amavisd-exim |
84 | Obsoletes: amavisd-qmail | |
85 | Obsoletes: amavisd-sendmail | |
7edaca6c | 86 | |
87 | %description postfix | |
88 | AMaViS is a script that interfaces a mail transport agent (MTA) with | |
89 | one or more virus scanners. This is daemonized version of amavis. | |
90 | ||
91 | This package contains backend for postfix. | |
92 | ||
2dd5392c JR |
93 | %description postfix -l pl.UTF-8 |
94 | AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA) | |
95 | a jednym lub więcej programów antywirusowych. Wersja zdemonizowana. | |
7edaca6c | 96 | |
97 | Pakiet ten zawiera back-end dla postfiks. | |
98 | ||
99 | %package exim | |
bb38b6f5 | 100 | Summary: A Mail Virus Scanner - exim backend |
5f376c2c | 101 | Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej - backend dla exima |
7edaca6c | 102 | Group: Applications/Mail |
d260790f PG |
103 | Requires: amavisd |
104 | Requires: exim | |
7edaca6c | 105 | Provides: amavisd-daemon |
d657b635 | 106 | Obsoletes: amavisd-daemon |
6989490b JB |
107 | Obsoletes: amavisd-postfix |
108 | Obsoletes: amavisd-qmail | |
109 | Obsoletes: amavisd-sendmail | |
7edaca6c | 110 | |
111 | %description exim | |
112 | AMaViS is a script that interfaces a mail transport agent (MTA) with | |
113 | one or more virus scanners. This is daemonized version of amavis. | |
114 | ||
115 | This package contains backend for exim. | |
116 | ||
2dd5392c JR |
117 | %description exim -l pl.UTF-8 |
118 | AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA) | |
119 | a jednym lub więcej programów antywirusowych. Wersja zdemonizowana. | |
7edaca6c | 120 | |
121 | Pakiet ten zawiera back-end dla exima. | |
122 | ||
fd946805 | 123 | # NFY |
e8af650f | 124 | %package qmail |
f5a44ef9 | 125 | Summary: A Mail Virus Scanner - qmail backend |
5f376c2c | 126 | Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej - backend dla qmaila |
e8af650f | 127 | Group: Applications/Mail |
d260790f PG |
128 | Requires: amavisd |
129 | Requires: qmail | |
e8af650f | 130 | Provides: amavisd-daemon |
131 | Obsoletes: amavisd-daemon | |
e8af650f | 132 | Obsoletes: amavisd-exim |
e51ace5b | 133 | Obsoletes: amavisd-postfix |
e8af650f | 134 | Obsoletes: amavisd-sendmail |
e8af650f | 135 | |
136 | %description qmail | |
137 | AMaViS is a script that interfaces a mail transport agent (MTA) with | |
138 | one or more virus scanners. This is daemonized version of amavis. | |
139 | ||
140 | This package contains backend for qmail. | |
141 | ||
2dd5392c JR |
142 | %description qmail -l pl.UTF-8 |
143 | AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA) | |
144 | a jednym lub więcej programów antywirusowych. Wersja zdemonizowana. | |
e8af650f | 145 | |
146 | Pakiet ten zawiera back-end dla qmaila. | |
d657b635 | 147 | |
148 | %package sendmail | |
bb38b6f5 | 149 | Summary: A Mail Virus Scanner - sendmail backend |
5f376c2c | 150 | Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej - backend dla sendmaila |
d657b635 | 151 | Group: Applications/Mail |
d260790f PG |
152 | Requires: amavisd |
153 | Requires: sendmail | |
d657b635 | 154 | Provides: amavisd-daemon |
155 | Obsoletes: amavisd-daemon | |
6989490b | 156 | Obsoletes: amavisd-exim |
e51ace5b | 157 | Obsoletes: amavisd-postfix |
6989490b | 158 | Obsoletes: amavisd-qmail |
d657b635 | 159 | |
160 | %description sendmail | |
161 | AMaViS is a script that interfaces a mail transport agent (MTA) with | |
162 | one or more virus scanners. This is daemonized version of amavis. | |
163 | ||
164 | This package contains backend for sendmail. | |
165 | ||
2dd5392c JR |
166 | %description sendmail -l pl.UTF-8 |
167 | AMaViS to skrypt pośredniczący pomiędzy agentem transferu poczty (MTA) | |
168 | a jednym lub więcej programów antywirusowych. Wersja zdemonizowana. | |
d657b635 | 169 | |
170 | Pakiet ten zawiera back-end dla sendmaila. | |
171 | ||
5afb771e | 172 | %define no_install_post_chrpath 1 |
9fd1909c | 173 | %prep |
d3ee3c37 | 174 | %setup -q |
e8af650f | 175 | #-n %{name}-snapshot-%{version} |
176 | #%patch0 -p1 | |
177 | #%patch1 -p1 | |
178 | #%patch2 -p1 | |
179 | #%patch3 -p1 | |
180 | #%patch4 -p1 | |
181 | %patch5 -p1 | |
182 | %patch6 -p1 | |
e1bd335a | 183 | %patch7 -p1 |
9fd1909c | 184 | |
185 | %build | |
c684646b | 186 | rm -f missing |
187 | %{__aclocal} | |
98001dd0 | 188 | %{__automake} |
e1bd335a | 189 | %{__autoconf} |
9fd1909c | 190 | %configure \ |
5645dbcb | 191 | --with-sendmail-wrapper=/usr/lib/sendmail \ |
9fd1909c | 192 | --enable-smtp \ |
7edaca6c | 193 | --enable-postfix \ |
194 | --enable-all \ | |
195 | --enable-syslog \ | |
196 | --with-runtime-dir=%{_var}/spool/amavis/runtime \ | |
197 | --with-virusdir=%{_var}/spool/amavis/virusmails \ | |
198 | --with-logdir=%{_var}/log \ | |
199 | --with-amavisuser=amavis \ | |
200 | --with-sockname=%{_var}/run/amavisd/amavisd.sock | |
201 | ||
202 | %{__make} | |
203 | mv amavis/amavisd amavis/amavisd.postfix | |
204 | ||
205 | %configure \ | |
5645dbcb | 206 | --with-sendmail-wrapper=/usr/lib/sendmail \ |
7edaca6c | 207 | --disable-smtp \ |
208 | --enable-exim \ | |
9a75c9dc AM |
209 | --enable-all \ |
210 | --enable-syslog \ | |
69be0075 | 211 | --with-runtime-dir=%{_var}/spool/amavis/runtime \ |
14eb7e8e | 212 | --with-virusdir=%{_var}/spool/amavis/virusmails \ |
9a75c9dc AM |
213 | --with-logdir=%{_var}/log \ |
214 | --with-amavisuser=amavis \ | |
215 | --with-sockname=%{_var}/run/amavisd/amavisd.sock | |
9fd1909c | 216 | |
217 | %{__make} | |
d657b635 | 218 | mv amavis/amavisd amavis/amavisd.exim |
219 | ||
e8af650f | 220 | #NFY |
221 | %configure \ | |
5645dbcb | 222 | --with-sendmail-wrapper=/usr/lib/sendmail \ |
e8af650f | 223 | --disable-smtp \ |
224 | --enable-qmail \ | |
225 | --enable-all \ | |
226 | --enable-syslog \ | |
227 | --with-runtime-dir=%{_var}/spool/amavis/runtime \ | |
228 | --with-virusdir=%{_var}/spool/amavis/virusmails \ | |
229 | --with-logdir=%{_var}/log \ | |
230 | --with-amavisuser=amavis \ | |
231 | --with-sockname=%{_var}/run/amavisd/amavisd.sock | |
232 | ||
233 | %{__make} | |
234 | mv amavis/amavisd amavis/amavisd.qmail | |
235 | mv amavis/amavis amavis/amavis.qmail-queue | |
d657b635 | 236 | |
237 | %configure \ | |
5645dbcb | 238 | --with-sendmail-wrapper=/usr/lib/sendmail \ |
d657b635 | 239 | --disable-smtp \ |
240 | --enable-sendmail \ | |
241 | --enable-all \ | |
242 | --enable-syslog \ | |
243 | --with-runtime-dir=%{_var}/spool/amavis/runtime \ | |
244 | --with-virusdir=%{_var}/spool/amavis/virusmails \ | |
245 | --with-logdir=%{_var}/log \ | |
246 | --with-amavisuser=amavis \ | |
247 | --with-sockname=%{_var}/run/amavisd/amavisd.sock | |
248 | ||
249 | %{__make} | |
250 | mv amavis/amavisd amavis/amavisd.sendmail | |
9fd1909c | 251 | |
9fd1909c | 252 | %install |
253 | rm -rf $RPM_BUILD_ROOT | |
0cfe765e | 254 | install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails},%{_var}/run/amavisd} |
9fd1909c | 255 | |
256 | %{__make} install \ | |
257 | amavisuser=$(id -u) \ | |
258 | DESTDIR=$RPM_BUILD_ROOT | |
b0314d36 | 259 | install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
9fd1909c | 260 | |
e8af650f | 261 | install amavis/{amavisd.{exim,postfix,sendmail,qmail},amavis.qmail-queue} $RPM_BUILD_ROOT%{_sbindir} |
7edaca6c | 262 | |
6989490b JB |
263 | %clean |
264 | rm -rf $RPM_BUILD_ROOT | |
265 | ||
7b5a032d | 266 | %pre |
b778d05f | 267 | %useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis |
7b5a032d | 268 | |
269 | %postun | |
270 | if [ "$1" = "0" ]; then | |
397ffa87 | 271 | %userremove amavis |
7b5a032d | 272 | fi |
273 | ||
9fd1909c | 274 | %post |
275 | /sbin/chkconfig --add amavisd | |
e51ace5b | 276 | %service amavisd restart "Amavisd daemon" |
9fd1909c | 277 | |
278 | %preun | |
279 | if [ "$1" = "0" ];then | |
e51ace5b | 280 | %service amavisd stop |
93279a89 | 281 | /sbin/chkconfig --del amavisd |
9fd1909c | 282 | fi |
283 | ||
7edaca6c | 284 | %post exim |
d657b635 | 285 | ln -sf amavisd.exim %{_sbindir}/amavisd |
286 | ||
d657b635 | 287 | %post postfix |
288 | ln -sf amavisd.postfix %{_sbindir}/amavisd | |
289 | ||
e8af650f | 290 | %post qmail |
291 | ln -sf amavisd.qmail %{_sbindir}/amavisd | |
292 | # mv /var/bin/qmail-queue /var/bin/qmail-queue-real | |
293 | # ln -s amavis.qmail-queue /var/bin/qmail-queue | |
d657b635 | 294 | |
d657b635 | 295 | %post sendmail |
296 | ln -sf amavisd.sendmail %{_sbindir}/amavisd | |
93279a89 JB |
297 | |
298 | %files | |
299 | %defattr(644,root,root,755) | |
300 | %doc README* NEWS AUTHORS BUGS ChangeLog FAQ HINTS TODO doc/amavis.html doc/amavis.png | |
301 | %attr(755,root,root) %{_sbindir}/amavis | |
b0314d36 | 302 | %attr(754,root,root) /etc/rc.d/init.d/* |
961caaa1 | 303 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavisd.conf |
93279a89 JB |
304 | %attr(750,amavis,root) %{_var}/spool/amavis |
305 | %attr(755,amavis,root) %{_var}/run/amavisd | |
306 | ||
307 | %files exim | |
f43262d4 | 308 | %defattr(644,root,root,755) |
93279a89 | 309 | %attr(755,root,root) %{_sbindir}/amavisd.exim |
e6f2f187 | 310 | %attr(777,root,root) %ghost %{_sbindir}/amavisd |
93279a89 JB |
311 | |
312 | %files postfix | |
f43262d4 | 313 | %defattr(644,root,root,755) |
93279a89 | 314 | %attr(755,root,root) %{_sbindir}/amavisd.postfix |
e6f2f187 | 315 | %attr(777,root,root) %ghost %{_sbindir}/amavisd |
93279a89 | 316 | |
af9a7095 | 317 | %if %{with qmail} |
e8af650f | 318 | %files qmail |
f43262d4 | 319 | %defattr(644,root,root,755) |
e8af650f | 320 | %attr(755,root,root) %{_sbindir}/amavis.qmail-queue |
321 | %attr(755,root,root) %{_sbindir}/amavisd.qmail | |
e6f2f187 | 322 | %attr(777,root,root) %ghost %{_sbindir}/amavisd |
af9a7095 | 323 | %endif |
93279a89 JB |
324 | |
325 | %files sendmail | |
f43262d4 | 326 | %defattr(644,root,root,755) |
93279a89 | 327 | %attr(755,root,root) %{_sbindir}/amavisd.sendmail |
e6f2f187 | 328 | %attr(777,root,root) %ghost %{_sbindir}/amavisd |