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