2 # - Make freshclam package (script and daemon)
5 %bcond_without milter # build without milter subpackage
7 Summary: An anti-virus utility for Unix
8 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
15 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
16 # Source0-md5: dbe6820ff98f5a6f67a03e3ad63fa90b
18 Source2: %{name}.sysconfig
19 Source3: %{name}-milter.init
20 Source4: %{name}-cron-updatedb
21 Source5: %{name}.logrotate
22 Source8: %{name}-post-updatedb
23 Source9: %{name}-milter.sysconfig
24 Patch0: %{name}-pld_config.patch
25 Patch1: %{name}-no_auto_libwrap.patch
26 Patch2: %{name}-nolibs.patch
27 Patch3: %{name}-valid_pp_exp.patch
28 URL: http://www.clamav.net/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: bzip2-devel
32 BuildRequires: gmp-devel
33 %{?with_milter:BuildRequires: libmilter-devel}
34 BuildRequires: libtool
35 %{?with_milter:BuildRequires: libwrap-devel}
36 BuildRequires: rpmbuild(macros) >= 1.268
37 BuildRequires: zlib-devel
38 Requires(post,preun): /sbin/chkconfig
39 Requires(postun): /usr/sbin/groupdel
40 Requires(postun): /usr/sbin/userdel
41 Requires(postun,pre): /usr/sbin/usermod
42 Requires(pre): /bin/id
43 Requires(pre): /usr/bin/getgid
44 Requires(pre): /usr/sbin/groupadd
45 Requires(pre): /usr/sbin/useradd
46 Requires(triggerpostun): sed >= 4.0
47 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
48 Requires: /usr/sbin/usermod
51 Provides: group(clamav)
52 Provides: user(clamav)
53 Conflicts: logrotate < 3.7-4
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
58 especially for e-mail scanning on mail gateways. It provides a number
59 of utilities including a flexible and scalable multi-threaded daemon,
60 a command line scanner and advanced tool for automatic database
61 updates. The core of the package is an anti-virus engine available in
62 a form of shared library.
64 Here is a list of the main features:
65 - command-line scanner
66 - fast, multi-threaded daemon with support for on-access scanning
67 - milter interface for sendmail
68 - advanced database updater with support for scripted updates and
70 - virus scanner C library
71 - on-access scanning (Linux® and FreeBSD®)
72 - virus database updated multiple times per day (see home page for
73 total number of signatures)
74 - built-in support for various archive formats, including Zip, RAR,
75 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
76 - built-in support for almost all mail file formats
77 - built-in support for ELF executables and Portable Executable files
78 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
79 obfuscated with SUE, Y0da Cryptor and others
80 - built-in support for popular document formats including MS Office
81 and MacOffice files, HTML, RTF and PDF
83 %description -l pl.UTF-8
84 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
85 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
86 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
87 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
88 napisany w C i zgodny z POSIXem.
91 Summary: Shared libraries for clamav
92 Summary(pl.UTF-8): Biblioteki dzielone clamav
96 Shared libraries for clamav.
98 %description libs -l pl.UTF-8
99 Biblioteki dzielone clamav.
102 Summary: ClamAV filter using milter interface
103 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
105 Requires: %{name} = %{epoch}:%{version}-%{release}
106 Requires: sendmail >= 8.11
107 Requires: tcp_wrappers
110 ClamAV sendmail filter using MILTER interface.
112 %description milter -l pl.UTF-8
113 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
116 Summary: clamav - Development header files and libraries
117 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
118 Group: Development/Libraries
119 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
120 Requires: bzip2-devel
125 This package contains the development header files and libraries
126 necessary to develop clamav client applications.
128 %description devel -l pl.UTF-8
129 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
133 Summary: clamav static libraries
134 Summary(pl.UTF-8): Biblioteki statyczne clamav
135 Group: Development/Libraries
136 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
139 clamav static libraries.
141 %description static -l pl.UTF-8
142 Biblioteki statyczne clamav.
160 %{?with_milter:--enable-milter} \
161 --with-dbdir=/var/lib/%{name} \
163 %{__make} LIBTOOL=/usr/bin/libtool
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
168 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
171 LIBTOOL=/usr/bin/libtool \
172 DESTDIR=$RPM_BUILD_ROOT
173 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
175 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
176 5 * * * * root %{_sbindir}/clamav-cron-updatedb
179 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
181 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
182 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
184 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
185 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
186 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
187 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
189 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
191 # NOTE: clamd uses sane rights to it's clamd.pid file
192 # So better keep it dir
193 # If it is fixed use of dir will be unecesary
194 install -d $RPM_BUILD_ROOT/var/run/%{name}
196 :> $RPM_BUILD_ROOT/var/log/freshclam.log
199 rm -rf $RPM_BUILD_ROOT
201 %triggerin -- amavis-ng
202 AMAVIS=$(/usr/bin/getgid amavis)
204 if [ $RESULT -eq 0 ]; then
205 echo "Adding clamav to amavis group GID=$AMAVIS"
206 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
209 %triggerin -- amavisd-new
210 AMAVIS=$(/usr/bin/getgid amavis)
212 if [ $RESULT -eq 0 ]; then
213 echo "Adding clamav to amavis group GID=$AMAVIS"
214 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
217 %triggerin -- amavisd
218 AMAVIS=$(/usr/bin/getgid amavis)
220 if [ $RESULT -eq 0 ]; then
221 echo "Adding clamav to amavis group GID=$AMAVIS"
222 /usr/sbin/usermod -G amavis clamav 1>&2
226 %groupadd -g 43 clamav
227 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
229 # FIXME: check this. is it proper after useradd macro?
230 # TODO: use addusertogroup macro?
231 if [ -n "`/usr/bin/getgid amavis`" ]; then
232 echo "Adding clamav to amavis group"
233 /usr/sbin/usermod -G amavis clamav 1>&2
237 /sbin/chkconfig --add clamd
238 %service clamd restart "Clam Antivirus daemon"
239 touch /var/log/freshclam.log
240 chown clamav:root /var/log/freshclam.log
241 chmod 640 /var/log/freshclam.log
244 if [ "$1" = "0" ]; then
246 /sbin/chkconfig --del clamd
250 if [ "$1" = "0" ]; then
255 %triggerpostun -- %{name} < 0.80
256 if [ -f /etc/clamav.conf.rpmsave ]; then
257 echo "Renaming config to new name /etc/clamd.conf"
258 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
259 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
260 echo "Changing config location in freshclam config"
261 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
264 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
265 %{__cp} -f /etc/clamd.conf{,.rpmsave}
268 s,^FixStaleSocket$,& yes,
269 s,^AllowSupplementaryGroups$,& yes,
270 s,^ClamukoScanOnOpen$,& yes,
271 s,^ClamukoScanOnClose$,& yes,
272 s,^ClamukoScanOnExec$,& yes,
276 %banner -e %{name}-0.90 <<EOF
277 ClamAV config was automatically upgraded to 0.90 format. You should review it
278 that it's still valid.
281 # unfortunately clamd has no configcheck option so we just have to start it
282 # once again after config was broken after upgrade
283 touch /var/lock/subsys/clamd
284 %service -q clamd restart
287 /sbin/chkconfig --add clamav-milter
288 %service clamav-milter restart "Clam Antivirus daemon"
291 if [ "$1" = "0" ]; then
292 %service clamav-milter stop
293 /sbin/chkconfig --del clamav-milter
296 %post libs -p /sbin/ldconfig
297 %postun libs -p /sbin/ldconfig
300 %defattr(644,root,root,755)
301 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
302 %attr(755,root,root) %{_bindir}/clamdscan
303 %attr(755,root,root) %{_bindir}/clamscan
304 %attr(755,root,root) %{_bindir}/freshclam
305 %attr(755,root,root) %{_bindir}/sigtool
306 %attr(755,root,root) %{_bindir}/clamconf
307 %attr(755,root,root) %{_sbindir}/clamd
308 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
309 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
310 %attr(755,clamav,root) %dir /var/lib/%{name}
311 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
312 %attr(640,clamav,root) %ghost /var/log/freshclam.log
313 %attr(750,clamav,clamav) %dir /var/run/%{name}
315 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
316 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
317 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
319 %attr(754,root,root) /etc/rc.d/init.d/clamd
320 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
321 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
323 %{_mandir}/man8/clamd*
327 %defattr(644,root,root,755)
328 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
329 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
330 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
331 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
332 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
333 %attr(755,root,root) %{_sbindir}/clamav-milter
334 %{_mandir}/man8/clamav-milter.8*
335 %attr(700,clamav,clamav) /var/spool/clamav
339 %defattr(644,root,root,755)
340 %attr(755,root,root) %{_libdir}/lib*.so.*.*
341 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.5
342 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.5
343 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.5
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_bindir}/clamav-config
348 %attr(755,root,root) %{_libdir}/lib*.so
351 %{_pkgconfigdir}/*.pc
354 %defattr(644,root,root,755)