]> git.pld-linux.org Git - packages/amavisd.git/blob - amavisd.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/amavisd.git] / amavisd.spec
1 #
2 # Conditional build:
3 %bcond_with     qmail           # enable qmail
4
5 %include        /usr/lib/rpm/macros.perl
6 Summary:        A Mail Virus Scanner - Daemon
7 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej - Demon
8 Name:           amavisd
9 Version:        0.1
10 Release:        8
11 Epoch:          1
12 License:        GPL
13 Group:          Applications/Mail
14 Source0:        http://www.amavis.org/dist/perl/%{name}-%{version}.tar.gz
15 # Source0-md5:  432a32bfc6d473564f49028b540f53ad
16 Source1:        %{name}.init
17 Patch0:         %{name}-notest-mta.patch
18 Patch1:         %{name}-nomilter.patch
19 Patch2:         %{name}-qmail.patch
20 Patch3:         %{name}-mks_vir.patch
21 Patch4:         %{name}-clamav.patch
22 Patch5:         %{name}-mks_vir-mksd.patch
23 Patch6:         %{name}-qmail-new.patch
24 Patch7:         %{name}-acx_pthread.patch
25 URL:            http://www.amavis.org/
26 BuildRequires:  arc
27 BuildRequires:  autoconf
28 BuildRequires:  automake
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-Convert-TNEF
36 BuildRequires:  perl-Convert-UUlib
37 BuildRequires:  perl-MIME-tools
38 BuildRequires:  perl-Unix-Syslog
39 BuildRequires:  perl-libnet
40 BuildRequires:  rpmbuild(macros) >= 1.268
41 BuildRequires:  unarj
42 BuildRequires:  unrar
43 BuildRequires:  zoo
44 Requires(post,preun):   /sbin/chkconfig
45 Requires(postun):       /usr/sbin/userdel
46 Requires(pre):  /bin/id
47 Requires(pre):  /usr/sbin/useradd
48 Requires:       /usr/lib/sendmail
49 Requires:       amavisd-daemon
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 Provides:       user(amavis)
60 Obsoletes:      AMaViS
61 Obsoletes:      amavis
62 Obsoletes:      amavisd-new
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 # needs fix somewhere
66 %undefine       with_ccache
67
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
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.
75
76 %package postfix
77 Summary:        A Mail Virus Scanner - postfix back-end
78 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej - back-end dla postfiksa
79 Group:          Applications/Mail
80 Requires:       amavisd
81 Requires:       postfix
82 Provides:       amavisd-daemon
83 Obsoletes:      amavisd-daemon
84 Obsoletes:      amavisd-exim
85 Obsoletes:      amavisd-qmail
86 Obsoletes:      amavisd-sendmail
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
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.
97
98 Pakiet ten zawiera back-end dla postfiks.
99
100 %package exim
101 Summary:        A Mail Virus Scanner - exim backend
102 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej - backend dla exima
103 Group:          Applications/Mail
104 Requires:       amavisd
105 Requires:       exim
106 Provides:       amavisd-daemon
107 Obsoletes:      amavisd-daemon
108 Obsoletes:      amavisd-postfix
109 Obsoletes:      amavisd-qmail
110 Obsoletes:      amavisd-sendmail
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
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.
121
122 Pakiet ten zawiera back-end dla exima.
123
124 # NFY
125 %package qmail
126 Summary:        A Mail Virus Scanner - qmail backend
127 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej - backend dla qmaila
128 Group:          Applications/Mail
129 Requires:       amavisd
130 Requires:       qmail
131 Provides:       amavisd-daemon
132 Obsoletes:      amavisd-daemon
133 Obsoletes:      amavisd-exim
134 Obsoletes:      amavisd-postfix
135 Obsoletes:      amavisd-sendmail
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
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.
146
147 Pakiet ten zawiera back-end dla qmaila.
148
149 %package sendmail
150 Summary:        A Mail Virus Scanner - sendmail backend
151 Summary(pl.UTF-8):      Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
152 Group:          Applications/Mail
153 Requires:       amavisd
154 Requires:       sendmail
155 Provides:       amavisd-daemon
156 Obsoletes:      amavisd-daemon
157 Obsoletes:      amavisd-exim
158 Obsoletes:      amavisd-postfix
159 Obsoletes:      amavisd-qmail
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
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.
170
171 Pakiet ten zawiera back-end dla sendmaila.
172
173 %define no_install_post_chrpath 1
174 %prep
175 %setup -q
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
184 %patch7 -p1
185
186 %build
187 rm -f missing
188 %{__aclocal}
189 %{__automake}
190 %{__autoconf}
191 %configure \
192         --with-sendmail-wrapper=/usr/lib/sendmail \
193         --enable-smtp \
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 \
207         --with-sendmail-wrapper=/usr/lib/sendmail \
208         --disable-smtp \
209         --enable-exim \
210         --enable-all \
211         --enable-syslog \
212         --with-runtime-dir=%{_var}/spool/amavis/runtime \
213         --with-virusdir=%{_var}/spool/amavis/virusmails \
214         --with-logdir=%{_var}/log \
215         --with-amavisuser=amavis \
216         --with-sockname=%{_var}/run/amavisd/amavisd.sock
217
218 %{__make}
219 mv amavis/amavisd amavis/amavisd.exim
220
221 #NFY
222 %configure \
223         --with-sendmail-wrapper=/usr/lib/sendmail \
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
237
238 %configure \
239         --with-sendmail-wrapper=/usr/lib/sendmail \
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
252
253 %install
254 rm -rf $RPM_BUILD_ROOT
255 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails},%{_var}/run/amavisd}
256
257 %{__make} install \
258         amavisuser=$(id -u) \
259         DESTDIR=$RPM_BUILD_ROOT
260 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
261
262 install amavis/{amavisd.{exim,postfix,sendmail,qmail},amavis.qmail-queue} $RPM_BUILD_ROOT%{_sbindir}
263
264 %clean
265 rm -rf $RPM_BUILD_ROOT
266
267 %pre
268 %useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis
269
270 %postun
271 if [ "$1" = "0" ]; then
272         %userremove amavis
273 fi
274
275 %post
276 /sbin/chkconfig --add amavisd
277 %service amavisd restart "Amavisd daemon"
278
279 %preun
280 if [ "$1" = "0" ];then
281         %service amavisd stop
282         /sbin/chkconfig --del amavisd
283 fi
284
285 %post exim
286 ln -sf amavisd.exim %{_sbindir}/amavisd
287
288 %post postfix
289 ln -sf amavisd.postfix %{_sbindir}/amavisd
290
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
295
296 %post sendmail
297 ln -sf amavisd.sendmail %{_sbindir}/amavisd
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
303 %attr(754,root,root) /etc/rc.d/init.d/*
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavisd.conf
305 %attr(750,amavis,root) %{_var}/spool/amavis
306 %attr(755,amavis,root) %{_var}/run/amavisd
307
308 %files exim
309 %defattr(644,root,root,755)
310 %attr(755,root,root) %{_sbindir}/amavisd.exim
311 %attr(777,root,root) %ghost %{_sbindir}/amavisd
312
313 %files postfix
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_sbindir}/amavisd.postfix
316 %attr(777,root,root) %ghost %{_sbindir}/amavisd
317
318 %if %{with qmail}
319 %files qmail
320 %defattr(644,root,root,755)
321 %attr(755,root,root) %{_sbindir}/amavis.qmail-queue
322 %attr(755,root,root) %{_sbindir}/amavisd.qmail
323 %attr(777,root,root) %ghost %{_sbindir}/amavisd
324 %endif
325
326 %files sendmail
327 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_sbindir}/amavisd.sendmail
329 %attr(777,root,root) %ghost %{_sbindir}/amavisd
This page took 0.128588 seconds and 3 git commands to generate.