2 # - Make freshclam package (script and daemon)
3 # - restart amavis in triggers if group membership was modified?
6 %bcond_without milter # milter interface subpackage
7 %if "%{pld_release}" == "ac"
8 %bcond_with llvm # LLVM support
10 %bcond_without llvm # LLVM support
13 Summary: An anti-virus utility for Unix
14 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
20 Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21 # Source0-md5: b649d35ee85d4d6075a98173dd255c17
23 Source2: %{name}.sysconfig
24 Source3: %{name}-milter.init
25 Source4: %{name}-cron-updatedb
26 Source5: %{name}.logrotate
27 Source8: %{name}-post-updatedb
28 Source9: %{name}-milter.sysconfig
29 Source10: %{name}.tmpfiles
30 Source11: clamd.service
31 Patch0: %{name}-pld_config.patch
32 Patch1: %{name}-nolibs.patch
33 %if "%{pld_release}" == "ac"
34 Patch2: am-nosilentrules.patch
37 Patch4: %{name}-openssl.patch
38 Patch5: %{name}-major.patch
39 URL: http://www.clamav.net/
40 BuildRequires: autoconf
41 BuildRequires: automake
42 BuildRequires: bzip2-devel
43 BuildRequires: curl-devel
44 BuildRequires: gmp-devel
45 BuildRequires: libltdl-devel
46 %{?with_milter:BuildRequires: libmilter-devel}
47 BuildRequires: libstdc++-devel
48 BuildRequires: libtool
49 %{?with_milter:BuildRequires: libwrap-devel}
50 BuildRequires: llvm-devel
51 %{?with_llvm:BuildRequires: llvm-devel}
52 BuildRequires: ncurses-devel
53 BuildRequires: openssl-devel
54 BuildRequires: rpm >= 4.4.9-56
55 BuildRequires: rpmbuild(macros) >= 1.647
56 BuildRequires: zlib-devel
57 Requires(post,preun): /sbin/chkconfig
58 Requires(postun): /usr/sbin/groupdel
59 Requires(postun): /usr/sbin/userdel
60 Requires(postun,pre): /usr/sbin/usermod
61 Requires(pre): /bin/id
62 Requires(pre): /usr/bin/getgid
63 Requires(pre): /usr/sbin/groupadd
64 Requires(pre): /usr/sbin/useradd
65 Requires(post,preun,postun): systemd-units >= 38
66 Requires: systemd-units >= 38
67 Requires(triggerpostun): sed >= 4.0
68 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
69 Requires: /usr/sbin/usermod
70 Requires: rc-scripts >= 0.4.1.23
71 Suggests: clamav-database
73 Provides: group(clamav)
74 Provides: user(clamav)
75 Conflicts: logrotate < 3.7-4
76 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
80 especially for e-mail scanning on mail gateways. It provides a number
81 of utilities including a flexible and scalable multi-threaded daemon,
82 a command line scanner and advanced tool for automatic database
83 updates. The core of the package is an anti-virus engine available in
84 a form of shared library.
86 Here is a list of the main features:
87 - command-line scanner
88 - fast, multi-threaded daemon with support for on-access scanning
89 - milter interface for sendmail
90 - advanced database updater with support for scripted updates and
92 - virus scanner C library
93 - on-access scanning (Linux® and FreeBSD®)
94 - virus database updated multiple times per day (see home page for
95 total number of signatures)
96 - built-in support for various archive formats, including Zip, RAR,
97 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
98 - built-in support for almost all mail file formats
99 - built-in support for ELF executables and Portable Executable files
100 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
101 obfuscated with SUE, Y0da Cryptor and others
102 - built-in support for popular document formats including MS Office
103 and MacOffice files, HTML, RTF and PDF
105 %description -l pl.UTF-8
106 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
107 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
108 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
109 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
110 napisany w C i zgodny z POSIXem.
113 Summary: Shared libraries for clamav
114 Summary(pl.UTF-8): Biblioteki dzielone clamav
118 Shared libraries for clamav.
120 %description libs -l pl.UTF-8
121 Biblioteki dzielone clamav.
124 Summary: ClamAV filter using milter interface
125 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
127 Requires: %{name} = %{epoch}:%{version}-%{release}
129 #Requires: sendmail >= 8.11
130 Requires: tcp_wrappers
133 ClamAV sendmail filter using MILTER interface.
135 %description milter -l pl.UTF-8
136 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
139 Summary: clamav - Development header files and libraries
140 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
141 Group: Development/Libraries
142 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
143 Requires: bzip2-devel
146 Requires: openssl-devel
150 This package contains the development header files and libraries
151 necessary to develop clamav client applications.
153 %description devel -l pl.UTF-8
154 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
158 Summary: clamav static libraries
159 Summary(pl.UTF-8): Biblioteki statyczne clamav
160 Group: Development/Libraries
161 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
164 clamav static libraries.
166 %description static -l pl.UTF-8
167 Biblioteki statyczne clamav.
173 %if "%{pld_release}" == "ac"
187 --disable-silent-rules \
190 %{?with_milter:--enable-milter} \
191 --with-dbdir=/var/lib/%{name} \
193 --with-ltdl-include=%{_includedir} \
194 --with-ltdl-lib=%{_libdir}
197 LIBTOOL=%{_bindir}/libtool
200 rm -rf $RPM_BUILD_ROOT
201 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
202 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
203 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
204 $RPM_BUILD_ROOT%{systemdunitdir}
207 LIBTOOL=%{_bindir}/libtool \
208 DESTDIR=$RPM_BUILD_ROOT
209 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
211 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
212 5 * * * * root %{_sbindir}/clamav-cron-updatedb
215 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
217 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
218 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
220 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
221 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
222 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
225 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
227 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
229 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
231 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
233 # NOTE: clamd uses sane rights to it's clamd.pid file
234 # So better keep it dir
235 # If it is fixed use of dir will be unecesary
236 install -d $RPM_BUILD_ROOT/var/run/%{name}
238 :> $RPM_BUILD_ROOT/var/log/freshclam.log
241 rm -rf $RPM_BUILD_ROOT
243 %triggerin -- amavis-ng
244 %addusertogroup -q clamav amavis
246 %triggerin -- amavisd-new
247 %addusertogroup -q clamav amavis
249 %triggerin -- amavisd
250 %addusertogroup -q clamav amavis
253 %groupadd -g 43 clamav
254 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
257 /sbin/chkconfig --add clamd
258 %service clamd restart "Clam Antivirus daemon"
259 touch /var/log/freshclam.log
260 chown clamav:root /var/log/freshclam.log
261 chmod 640 /var/log/freshclam.log
262 %systemd_post clamd.service
265 if [ "$1" = "0" ]; then
267 /sbin/chkconfig --del clamd
269 %systemd_preun clamd.service
272 if [ "$1" = "0" ]; then
278 %triggerpostun -- %{name} < 0.80
279 if [ -f /etc/clamav.conf.rpmsave ]; then
280 echo "Renaming config to new name /etc/clamd.conf"
281 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
282 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
283 echo "Changing config location in freshclam config"
284 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
287 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
288 %{__cp} -f /etc/clamd.conf{,.rpmsave}
291 s,^FixStaleSocket$,& yes,
292 s,^AllowSupplementaryGroups$,& yes,
293 s,^ClamukoScanOnOpen$,& yes,
294 s,^ClamukoScanOnClose$,& yes,
295 s,^ClamukoScanOnExec$,& yes,
299 %banner -e %{name}-0.90 <<EOF
300 ClamAV config was automatically upgraded to 0.90 format. You should review it
301 that it's still valid.
304 # unfortunately clamd has no configcheck option so we just have to start it
305 # once again after config was broken after upgrade
306 touch /var/lock/subsys/clamd
307 %service -q clamd restart
309 %triggerpostun -- %{name} < 0.97.7-4
310 %systemd_trigger clamd.service
313 /sbin/chkconfig --add clamav-milter
314 %service clamav-milter restart "Clam Antivirus daemon"
317 if [ "$1" = "0" ]; then
318 %service clamav-milter stop
319 /sbin/chkconfig --del clamav-milter
322 %post libs -p /sbin/ldconfig
323 %postun libs -p /sbin/ldconfig
326 %defattr(644,root,root,755)
327 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
328 %attr(755,root,root) %{_bindir}/clambc
329 %attr(755,root,root) %{_bindir}/clamdscan
330 %attr(755,root,root) %{_bindir}/clamdtop
331 %attr(755,root,root) %{_bindir}/clamscan
332 %attr(755,root,root) %{_bindir}/clamsubmit
333 %attr(755,root,root) %{_bindir}/freshclam
334 %attr(755,root,root) %{_bindir}/sigtool
335 %attr(755,root,root) %{_bindir}/clamconf
336 %attr(755,root,root) %{_sbindir}/clamd
337 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
338 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
339 %{systemdtmpfilesdir}/%{name}.conf
340 %{systemdunitdir}/clamd.service
341 %attr(755,clamav,root) %dir /var/lib/%{name}
342 %attr(640,clamav,root) %ghost /var/log/freshclam.log
343 %attr(750,clamav,clamav) %dir /var/run/%{name}
345 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
346 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
347 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
349 %attr(754,root,root) /etc/rc.d/init.d/clamd
350 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
351 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
353 %{_mandir}/man8/clamd*
357 %defattr(644,root,root,755)
358 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
359 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
360 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
361 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
362 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
363 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
364 %attr(755,root,root) %{_sbindir}/clamav-milter
365 %{_mandir}/man8/clamav-milter.8*
366 %attr(700,clamav,clamav) /var/spool/clamav
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
372 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
373 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
374 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
375 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
376 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_bindir}/clamav-config
381 %attr(755,root,root) %{_libdir}/libclamav.so
382 %attr(755,root,root) %{_libdir}/libclamunrar.so
383 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
384 %{_libdir}/libclamav.la
385 %{_libdir}/libclamunrar.la
386 %{_libdir}/libclamunrar_iface.la
387 %{_includedir}/clamav.h
388 %{_pkgconfigdir}/libclamav.pc
391 %defattr(644,root,root,755)
392 %{_libdir}/libclamav.a
393 %{_libdir}/libclamunrar.a
394 %{_libdir}/libclamunrar_iface.a