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