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: 98590386ba9a69039580b1bf48ca038b
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}-nolibs.patch
26 URL: http://www.clamav.net/
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: bzip2-devel
30 BuildRequires: gmp-devel
31 %{?with_milter:BuildRequires: libmilter-devel}
32 BuildRequires: libtool
33 %{?with_milter:BuildRequires: libwrap-devel}
34 BuildRequires: rpmbuild(macros) >= 1.268
35 BuildRequires: zlib-devel
36 Requires(post,preun): /sbin/chkconfig
37 Requires(postun): /usr/sbin/groupdel
38 Requires(postun): /usr/sbin/userdel
39 Requires(postun,pre): /usr/sbin/usermod
40 Requires(pre): /bin/id
41 Requires(pre): /usr/bin/getgid
42 Requires(pre): /usr/sbin/groupadd
43 Requires(pre): /usr/sbin/useradd
44 Requires(triggerpostun): sed >= 4.0
45 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
46 Requires: /usr/sbin/usermod
49 Provides: group(clamav)
50 Provides: user(clamav)
51 Conflicts: logrotate < 3.7-4
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
56 especially for e-mail scanning on mail gateways. It provides a number
57 of utilities including a flexible and scalable multi-threaded daemon,
58 a command line scanner and advanced tool for automatic database
59 updates. The core of the package is an anti-virus engine available in
60 a form of shared library.
62 Here is a list of the main features:
63 - command-line scanner
64 - fast, multi-threaded daemon with support for on-access scanning
65 - milter interface for sendmail
66 - advanced database updater with support for scripted updates and
68 - virus scanner C library
69 - on-access scanning (Linux® and FreeBSD®)
70 - virus database updated multiple times per day (see home page for
71 total number of signatures)
72 - built-in support for various archive formats, including Zip, RAR,
73 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
74 - built-in support for almost all mail file formats
75 - built-in support for ELF executables and Portable Executable files
76 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
77 obfuscated with SUE, Y0da Cryptor and others
78 - built-in support for popular document formats including MS Office
79 and MacOffice files, HTML, RTF and PDF
81 %description -l pl.UTF-8
82 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
83 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
84 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
85 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
86 napisany w C i zgodny z POSIXem.
89 Summary: Shared libraries for clamav
90 Summary(pl.UTF-8): Biblioteki dzielone clamav
94 Shared libraries for clamav.
96 %description libs -l pl.UTF-8
97 Biblioteki dzielone clamav.
100 Summary: ClamAV filter using milter interface
101 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
103 Requires: %{name} = %{epoch}:%{version}-%{release}
104 Requires: sendmail >= 8.11
105 Requires: tcp_wrappers
108 ClamAV sendmail filter using MILTER interface.
110 %description milter -l pl.UTF-8
111 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
114 Summary: clamav - Development header files and libraries
115 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
116 Group: Development/Libraries
117 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
118 Requires: bzip2-devel
123 This package contains the development header files and libraries
124 necessary to develop clamav client applications.
126 %description devel -l pl.UTF-8
127 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
131 Summary: clamav static libraries
132 Summary(pl.UTF-8): Biblioteki statyczne clamav
133 Group: Development/Libraries
134 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
137 clamav static libraries.
139 %description static -l pl.UTF-8
140 Biblioteki statyczne clamav.
155 %{?with_milter:--enable-milter} \
156 --with-dbdir=/var/lib/%{name} \
158 %{__make} LIBTOOL=/usr/bin/libtool
161 rm -rf $RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
163 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
166 LIBTOOL=/usr/bin/libtool \
167 DESTDIR=$RPM_BUILD_ROOT
168 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
170 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
171 5 * * * * root %{_sbindir}/clamav-cron-updatedb
174 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
176 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
177 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
179 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
180 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
181 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
182 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
184 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
186 # NOTE: clamd uses sane rights to it's clamd.pid file
187 # So better keep it dir
188 # If it is fixed use of dir will be unecesary
189 install -d $RPM_BUILD_ROOT/var/run/%{name}
191 :> $RPM_BUILD_ROOT/var/log/freshclam.log
194 rm -rf $RPM_BUILD_ROOT
196 %triggerin -- amavis-ng
197 AMAVIS=$(/usr/bin/getgid amavis)
199 if [ $RESULT -eq 0 ]; then
200 echo "Adding clamav to amavis group GID=$AMAVIS"
201 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
204 %triggerin -- amavisd-new
205 AMAVIS=$(/usr/bin/getgid amavis)
207 if [ $RESULT -eq 0 ]; then
208 echo "Adding clamav to amavis group GID=$AMAVIS"
209 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
212 %triggerin -- amavisd
213 AMAVIS=$(/usr/bin/getgid amavis)
215 if [ $RESULT -eq 0 ]; then
216 echo "Adding clamav to amavis group GID=$AMAVIS"
217 /usr/sbin/usermod -G amavis clamav 1>&2
221 %groupadd -g 43 clamav
222 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
224 # FIXME: check this. is it proper after useradd macro?
225 # TODO: use addusertogroup macro?
226 if [ -n "`/usr/bin/getgid amavis`" ]; then
227 echo "Adding clamav to amavis group"
228 /usr/sbin/usermod -G amavis clamav 1>&2
232 /sbin/chkconfig --add clamd
233 %service clamd restart "Clam Antivirus daemon"
234 touch /var/log/freshclam.log
235 chown clamav:root /var/log/freshclam.log
236 chmod 640 /var/log/freshclam.log
239 if [ "$1" = "0" ]; then
241 /sbin/chkconfig --del clamd
245 if [ "$1" = "0" ]; then
250 %triggerpostun -- %{name} < 0.80
251 if [ -f /etc/clamav.conf.rpmsave ]; then
252 echo "Renaming config to new name /etc/clamd.conf"
253 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
254 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
255 echo "Changing config location in freshclam config"
256 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
259 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
260 %{__cp} -f /etc/clamd.conf{,.rpmsave}
263 s,^FixStaleSocket$,& yes,
264 s,^AllowSupplementaryGroups$,& yes,
265 s,^ClamukoScanOnOpen$,& yes,
266 s,^ClamukoScanOnClose$,& yes,
267 s,^ClamukoScanOnExec$,& yes,
271 %banner -e %{name}-0.90 <<EOF
272 ClamAV config was automatically upgraded to 0.90 format. You should review it
273 that it's still valid.
276 # unfortunately clamd has no configcheck option so we just have to start it
277 # once again after config was broken after upgrade
278 touch /var/lock/subsys/clamd
279 %service -q clamd restart
282 /sbin/chkconfig --add clamav-milter
283 %service clamav-milter restart "Clam Antivirus daemon"
286 if [ "$1" = "0" ]; then
287 %service clamav-milter stop
288 /sbin/chkconfig --del clamav-milter
291 %post libs -p /sbin/ldconfig
292 %postun libs -p /sbin/ldconfig
295 %defattr(644,root,root,755)
296 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
297 %attr(755,root,root) %{_bindir}/clamdscan
298 %attr(755,root,root) %{_bindir}/clamdtop
299 %attr(755,root,root) %{_bindir}/clamscan
300 %attr(755,root,root) %{_bindir}/freshclam
301 %attr(755,root,root) %{_bindir}/sigtool
302 %attr(755,root,root) %{_bindir}/clamconf
303 %attr(755,root,root) %{_sbindir}/clamd
304 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
305 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
306 %attr(755,clamav,root) %dir /var/lib/%{name}
307 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
308 %attr(640,clamav,root) %ghost /var/log/freshclam.log
309 %attr(750,clamav,clamav) %dir /var/run/%{name}
311 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
312 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
313 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
315 %attr(754,root,root) /etc/rc.d/init.d/clamd
316 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
317 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
319 %{_mandir}/man8/clamd*
323 %defattr(644,root,root,755)
324 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
325 %config(noreplace) %verify(not md5 mtime size) /etc/clamav-milter.conf
326 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
327 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
328 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
329 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
330 %attr(755,root,root) %{_sbindir}/clamav-milter
331 %{_mandir}/man8/clamav-milter.8*
332 %attr(700,clamav,clamav) /var/spool/clamav
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_libdir}/lib*.so.*.*
338 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
339 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
340 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
343 %defattr(644,root,root,755)
344 %attr(755,root,root) %{_bindir}/clamav-config
345 %attr(755,root,root) %{_libdir}/lib*.so
348 %{_pkgconfigdir}/*.pc
351 %defattr(644,root,root,755)