1 %include /usr/lib/rpm/macros.perl
2 Summary: A Mail Virus Scanner - Daemon.
3 Summary(pl): Antywirusowy skaner poczty elektronicznej - Demon
8 Group: Applications/Mail
9 Source0: http://www.amavis.org/dist/perl/%{name}-snapshot-%{version}.tar.gz
11 Patch0: %{name}-notest-mta.patch
12 Patch1: %{name}-nomilter.patch
13 Patch2: %{name}-qmail.patch
14 URL: http://www.amavis.org/
16 BuildRequires: autoconf
17 BuildRequires: automake
21 BuildRequires: ncompress
22 BuildRequires: perl-Archive-Tar
23 BuildRequires: perl-Archive-Zip
24 BuildRequires: perl-Compress-Zlib
25 BuildRequires: perl-MIME-tools
26 BuildRequires: perl-Unix-Syslog
27 BuildRequires: perl-Convert-UUlib
28 BuildRequires: perl-Convert-TNEF
29 BuildRequires: perl-libnet
30 BuildRequires: sh-utils
36 Requires: %{_libdir}/sendmail
46 Requires: amavisd-daemon
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 AMaViS is a script that interfaces a mail transport agent (MTA) with
51 one or more virus scanners. This is daemonized version of amavis.
54 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
55 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
58 Summary: A Mail Virus Scanner - postfix back-end.
59 Summary(pl): Antywirusowy skaner poczty elektronicznej - back-end dla postfiksa
60 Group: Applications/Mail
61 Provides: amavisd-daemon
62 Obsoletes: amavisd-daemon
66 AMaViS is a script that interfaces a mail transport agent (MTA) with
67 one or more virus scanners. This is daemonized version of amavis.
69 This package contains backend for postfix.
71 %description postfix -l pl
72 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
73 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
75 Pakiet ten zawiera back-end dla postfiks.
78 Summary: A Mail Virus Scanner - exim backend.
79 Summary(pl): Antywirusowy skaner poczty elektronicznej - backend dla exima
80 Group: Applications/Mail
81 Provides: amavisd-daemon
82 Obsoletes: amavisd-daemon
86 AMaViS is a script that interfaces a mail transport agent (MTA) with
87 one or more virus scanners. This is daemonized version of amavis.
89 This package contains backend for exim.
91 %description exim -l pl
92 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
93 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
95 Pakiet ten zawiera back-end dla exima.
98 Summary: A Mail Virus Scanner - qmail backend.
99 Summary(pl): Antywirusowy skaner poczty elektronicznej - backend dla qmaila
100 Group: Applications/Mail
101 Provides: amavisd-daemon
102 Obsoletes: amavisd-daemon
106 AMaViS is a script that interfaces a mail transport agent (MTA) with
107 one or more virus scanners. This is daemonized version of amavis.
109 This package contains backend for qmail.
111 %description qmail -l pl
112 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
113 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
115 Pakiet ten zawiera back-end dla qmaila.
118 Summary: A Mail Virus Scanner - sendmail backend.
119 Summary(pl): Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
120 Group: Applications/Mail
121 Provides: amavisd-daemon
122 Obsoletes: amavisd-daemon
125 %description sendmail
126 AMaViS is a script that interfaces a mail transport agent (MTA) with
127 one or more virus scanners. This is daemonized version of amavis.
129 This package contains backend for sendmail.
131 %description sendmail -l pl
132 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
133 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
135 Pakiet ten zawiera back-end dla sendmaila.
138 %setup -q -n %{name}-snapshot-%{version}
152 --with-runtime-dir=%{_var}/spool/amavis/runtime \
153 --with-virusdir=%{_var}/spool/amavis/virusmails \
154 --with-logdir=%{_var}/log \
155 --with-amavisuser=amavis \
156 --with-sockname=%{_var}/run/amavisd/amavisd.sock
159 mv amavis/amavisd amavis/amavisd.postfix
166 --with-runtime-dir=%{_var}/spool/amavis/runtime \
167 --with-virusdir=%{_var}/spool/amavis/virusmails \
168 --with-logdir=%{_var}/log \
169 --with-amavisuser=amavis \
170 --with-sockname=%{_var}/run/amavisd/amavisd.sock
173 mv amavis/amavisd amavis/amavisd.exim
180 --with-runtime-dir=%{_var}/spool/amavis/runtime \
181 --with-virusdir=%{_var}/spool/amavis/virusmails \
182 --with-logdir=%{_var}/log \
183 --with-amavisuser=amavis \
184 --with-sockname=%{_var}/run/amavisd/amavisd.sock
187 mv amavis/amavisd amavis/amavisd.qmail
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
201 mv amavis/amavisd amavis/amavisd.sendmail
203 gzip -9nf README* NEWS AUTHORS BUGS ChangeLog FAQ HINTS TODO doc/amavis.html
206 rm -rf $RPM_BUILD_ROOT
207 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis,%{_var}/run/amavisd}
210 amavisuser=$(id -u) \
211 DESTDIR=$RPM_BUILD_ROOT
212 install -D %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
214 install amavis/amavisd.{exim,postfix,qmail,sendmail} $RPM_BUILD_ROOT%{_sbindir}
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_sbindir}/amavis
219 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/*
220 %config(noreplace) %{_sysconfdir}/amavisd.conf
221 %doc *.gz doc/*.gz doc/amavis.png
222 %attr(750,amavis,root) %{_var}/spool/amavis
223 %attr(755,amavis,root) %{_var}/run/amavisd
226 %attr(755,root,root) %{_sbindir}/amavisd.exim
227 %ghost %{_sbindir}/amavisd
230 %attr(755,root,root) %{_sbindir}/amavisd.postfix
231 %ghost %{_sbindir}/amavisd
234 %attr(755,root,root) %{_sbindir}/amavisd.qmail
235 %ghost %{_sbindir}/amavisd
238 %attr(755,root,root) %{_sbindir}/amavisd.sendmail
239 %ghost %{_sbindir}/amavisd
242 if [ -n "`id -u amavis 2>/dev/null`" ]; then
243 if [ "`id -u amavis`" != "97" ]; then
244 echo "Warning: user amavis haven't uid=97. Correct this before installing amavis" 1>&2
248 %{_sbindir}/useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody amavis 1>&2
252 if [ "$1" = "0" ]; then
253 %{_sbindir}/userdel amavis
257 /sbin/chkconfig --add amavisd
259 if [ -f %{_var}/lock/subsys/amavisd ]; then
260 /etc/rc.d/init.d/amavisd restart >&2
262 echo "Run \"/etc/rc.d/init.d/amavisd start\" to start Amavisd daemon."
266 if [ "$1" = "0" ];then
267 if [ -f %{_var}/lock/subsys/amavisd ]; then
268 /etc/rc.d/init.d/amavisd stop >&2
270 /sbin/chkconfig --del amavisd
274 ln -sf amavisd.exim %{_sbindir}/amavisd
277 ln -sf amavisd.postfix %{_sbindir}/amavisd
280 ln -sf amavisd.qmail %{_sbindir}/amavisd
283 ln -sf amavisd.sendmail %{_sbindir}/amavisd
286 rm -rf $RPM_BUILD_ROOT