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