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