]> git.pld-linux.org Git - packages/amavisd.git/blob - amavisd.spec
-taken & changed, orginally from:
[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(postun):      /usr/sbin/userdel
39 Requires(post,preun):   /sbin/chkconfig
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:       amavisd
73 Requires:       postfix
74
75 %description postfix
76 AMaViS is a script that interfaces a mail transport agent (MTA) with
77 one or more virus scanners. This is daemonized version of amavis.
78
79 This package contains backend for postfix.
80
81 %description postfix -l pl
82 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
83 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
84
85 Pakiet ten zawiera back-end dla postfiks.
86
87 %package exim
88 Summary:        A Mail Virus Scanner - exim backend
89 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla exima
90 Group:          Applications/Mail
91 Provides:       amavisd-daemon
92 Obsoletes:      amavisd-daemon
93 Obsoletes:      amavisd-postfix
94 Obsoletes:      amavisd-qmail
95 Obsoletes:      amavisd-sendmail
96 Requires:       amavisd
97 Requires:       exim
98
99 %description exim
100 AMaViS is a script that interfaces a mail transport agent (MTA) with
101 one or more virus scanners. This is daemonized version of amavis.
102
103 This package contains backend for exim.
104
105 %description exim -l pl
106 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
107 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
108
109 Pakiet ten zawiera back-end dla exima.
110
111 # NFY
112 #%package qmail
113 #Summary:       A Mail Virus Scanner - qmail backend.
114 #Summary(pl):   Antywirusowy skaner poczty elektronicznej - backend dla qmaila
115 #Group:         Applications/Mail
116 #Provides:      amavisd-daemon
117 #Obsoletes:     amavisd-daemon
118 #Obsoletes:     amavisd-postfix
119 #Obsoletes:     amavisd-exim
120 #Obsoletes:     amavisd-sendmail
121 #Requires:      amavisd
122 #Requires:      qmailmta
123 #
124 #%description qmail
125 #AMaViS is a script that interfaces a mail transport agent (MTA) with
126 #one or more virus scanners. This is daemonized version of amavis.
127 #
128 #This package contains backend for qmail.
129 #
130 #%description qmail -l pl
131 #AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
132 #a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
133 #
134 #Pakiet ten zawiera back-end dla qmaila.
135
136 %package sendmail
137 Summary:        A Mail Virus Scanner - sendmail backend
138 Summary(pl):    Antywirusowy skaner poczty elektronicznej - backend dla sendmaila
139 Group:          Applications/Mail
140 Provides:       amavisd-daemon
141 Obsoletes:      amavisd-daemon
142 Obsoletes:      amavisd-postfix
143 Obsoletes:      amavisd-exim
144 Obsoletes:      amavisd-qmail
145 Requires:       amavisd
146 Requires:       sendmail
147
148 %description sendmail
149 AMaViS is a script that interfaces a mail transport agent (MTA) with
150 one or more virus scanners. This is daemonized version of amavis.
151
152 This package contains backend for sendmail.
153
154 %description sendmail -l pl
155 AMaViS to skrypt po¶rednicz±cy pomiêdzy agentem transferu poczty (MTA)
156 a jednym lub wiêcej programów antywirusowych. Wersja zdemonizowana.
157
158 Pakiet ten zawiera back-end dla sendmaila.
159
160 %define no_install_post_chrpath 1
161 %prep
162 %setup -q -n %{name}-snapshot-%{version}
163 %patch0 -p1
164 %patch1 -p1
165 %patch2 -p1
166 %patch3 -p1
167 %patch4 -p1
168
169 %build
170 rm -f missing
171 %{__aclocal}
172 %{__autoconf}
173 %{__automake}
174 %configure \
175         --enable-smtp \
176         --enable-postfix \
177         --enable-all \
178         --enable-syslog \
179         --with-runtime-dir=%{_var}/spool/amavis/runtime \
180         --with-virusdir=%{_var}/spool/amavis/virusmails \
181         --with-logdir=%{_var}/log \
182         --with-amavisuser=amavis \
183         --with-sockname=%{_var}/run/amavisd/amavisd.sock
184
185 %{__make}
186 mv amavis/amavisd amavis/amavisd.postfix
187
188 %configure \
189         --disable-smtp \
190         --enable-exim \
191         --enable-all \
192         --enable-syslog \
193         --with-runtime-dir=%{_var}/spool/amavis/runtime \
194         --with-virusdir=%{_var}/spool/amavis/virusmails \
195         --with-logdir=%{_var}/log \
196         --with-amavisuser=amavis \
197         --with-sockname=%{_var}/run/amavisd/amavisd.sock
198
199 %{__make}
200 mv amavis/amavisd amavis/amavisd.exim
201
202 # NFY
203 #%%configure \
204 #       --disable-smtp \
205 #       --enable-qmail \
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.qmail
216
217 %configure \
218         --disable-smtp \
219         --enable-sendmail \
220         --enable-all \
221         --enable-syslog \
222         --with-runtime-dir=%{_var}/spool/amavis/runtime \
223         --with-virusdir=%{_var}/spool/amavis/virusmails \
224         --with-logdir=%{_var}/log \
225         --with-amavisuser=amavis \
226         --with-sockname=%{_var}/run/amavisd/amavisd.sock
227
228 %{__make}
229 mv amavis/amavisd amavis/amavisd.sendmail
230
231 %install
232 rm -rf $RPM_BUILD_ROOT
233 install -d $RPM_BUILD_ROOT{%{_var}/spool/amavis/{runtime,virusmails},%{_var}/run/amavisd}
234
235 %{__make} install \
236         amavisuser=$(id -u) \
237         DESTDIR=$RPM_BUILD_ROOT
238 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
239
240 install amavis/amavisd.{exim,postfix,sendmail} $RPM_BUILD_ROOT%{_sbindir}
241
242 %clean
243 rm -rf $RPM_BUILD_ROOT
244
245 %pre
246 if [ -n "`id -u amavis 2>/dev/null`" ]; then
247        if [ "`id -u amavis`" != "97" ]; then
248                echo "Error: user amavis doesn't have uid=97. Correct this before installing amavis." 1>&2
249                exit 1
250        fi
251 else
252        /usr/sbin/useradd -u 97 -r -d %{_var}/spool/amavis -s /bin/false -c "Anti Virus Checker" -g nobody  amavis 1>&2
253 fi
254
255 %postun
256 if [ "$1" = "0" ]; then
257        /usr/sbin/userdel amavis
258 fi
259
260 %post
261 /sbin/chkconfig --add amavisd
262 if [ -f /var/lock/subsys/amavisd ]; then
263         /etc/rc.d/init.d/amavisd restart >&2
264 else
265         echo "Run \"/etc/rc.d/init.d/amavisd start\" to start Amavisd daemon."
266 fi
267
268 %preun
269 if [ "$1" = "0" ];then
270         if [ -f /var/lock/subsys/amavisd ]; then
271                 /etc/rc.d/init.d/amavisd stop >&2
272         fi
273         /sbin/chkconfig --del amavisd
274 fi
275
276 %post exim
277 ln -sf amavisd.exim %{_sbindir}/amavisd
278
279 %post postfix
280 ln -sf amavisd.postfix %{_sbindir}/amavisd
281
282 #%post qmail
283 #ln -sf amavisd.qmail %{_sbindir}/amavisd
284
285 %post sendmail
286 ln -sf amavisd.sendmail %{_sbindir}/amavisd
287
288 %files
289 %defattr(644,root,root,755)
290 %doc README* NEWS AUTHORS BUGS ChangeLog FAQ HINTS TODO doc/amavis.html doc/amavis.png
291 %attr(755,root,root) %{_sbindir}/amavis
292 %attr(754,root,root) /etc/rc.d/init.d/*
293 %config(noreplace) %{_sysconfdir}/amavisd.conf
294 %attr(750,amavis,root) %{_var}/spool/amavis
295 %attr(755,amavis,root) %{_var}/run/amavisd
296
297 %files exim
298 %attr(755,root,root) %{_sbindir}/amavisd.exim
299 %ghost %attr(777,root,root) %{_sbindir}/amavisd
300
301 %files postfix
302 %attr(755,root,root) %{_sbindir}/amavisd.postfix
303 %ghost %attr(777,root,root) %{_sbindir}/amavisd
304
305 #%files qmail
306 #%attr(755,root,root) %{_sbindir}/amavisd.qmail
307 #%ghost %attr(777,root,root) %{_sbindir}/amavisd
308
309 %files sendmail
310 %attr(755,root,root) %{_sbindir}/amavisd.sendmail
311 %ghost %attr(777,root,root) %{_sbindir}/amavisd
This page took 0.040978 seconds and 3 git commands to generate.