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
17 %bcond_with system_llvm
19 Summary: An anti-virus utility for Unix
20 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
26 Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
27 # Source0-md5: 61b51a04619aeafd965892a53f86d192
29 Source2: %{name}.sysconfig
30 Source3: %{name}-milter.init
31 Source4: %{name}-cron-updatedb
32 Source5: %{name}.logrotate
33 Source8: %{name}-post-updatedb
34 Source9: %{name}-milter.sysconfig
35 Source10: %{name}.tmpfiles
36 Source11: clamd.service
37 Source12: cronjob-clamav.timer
38 Source13: cronjob-clamav.service.in
39 Patch0: %{name}-pld_config.patch
40 Patch1: %{name}-nolibs.patch
41 %if "%{pld_release}" == "ac"
42 Patch2: am-nosilentrules.patch
45 Patch4: %{name}-openssl.patch
46 Patch5: %{name}-major.patch
48 URL: http://www.clamav.net/
49 BuildRequires: autoconf
50 BuildRequires: automake
51 BuildRequires: bzip2-devel
52 BuildRequires: check-devel
53 BuildRequires: curl-devel
54 BuildRequires: gmp-devel
55 BuildRequires: libltdl-devel
56 %{?with_milter:BuildRequires: libmilter-devel}
57 BuildRequires: libstdc++-devel >= 5:3.4
58 BuildRequires: libtool
59 %{?with_milter:BuildRequires: libwrap-devel}
60 %{?with_llvm:%{?with_system_llvm:BuildRequires: llvm-devel < 3.7}}
61 BuildRequires: ncurses-devel
62 BuildRequires: openssl-devel
63 BuildRequires: pkgconfig
64 BuildRequires: rpm >= 4.4.9-56
65 BuildRequires: rpmbuild(macros) >= 1.647
66 BuildRequires: zlib-devel
67 Requires(post,preun): /sbin/chkconfig
68 Requires(postun): /usr/sbin/groupdel
69 Requires(postun): /usr/sbin/userdel
70 Requires(postun,pre): /usr/sbin/usermod
71 Requires(pre): /bin/id
72 Requires(pre): /usr/bin/getgid
73 Requires(pre): /usr/sbin/groupadd
74 Requires(pre): /usr/sbin/useradd
75 Requires(post,preun,postun): systemd-units >= 38
76 Requires: systemd-units >= 38
77 Requires(triggerpostun): sed >= 4.0
78 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
79 Requires: /usr/sbin/usermod
80 Requires: rc-scripts >= 0.4.1.23
81 Suggests: clamav-database
83 Provides: group(clamav)
84 Provides: user(clamav)
85 Conflicts: logrotate < 3.7-4
86 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
89 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
90 especially for e-mail scanning on mail gateways. It provides a number
91 of utilities including a flexible and scalable multi-threaded daemon,
92 a command line scanner and advanced tool for automatic database
93 updates. The core of the package is an anti-virus engine available in
94 a form of shared library.
96 Here is a list of the main features:
97 - command-line scanner
98 - fast, multi-threaded daemon with support for on-access scanning
99 - milter interface for sendmail
100 - advanced database updater with support for scripted updates and
102 - virus scanner C library
103 - on-access scanning (Linux® and FreeBSD®)
104 - virus database updated multiple times per day (see home page for
105 total number of signatures)
106 - built-in support for various archive formats, including Zip, RAR,
107 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
108 - built-in support for almost all mail file formats
109 - built-in support for ELF executables and Portable Executable files
110 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
111 obfuscated with SUE, Y0da Cryptor and others
112 - built-in support for popular document formats including MS Office
113 and MacOffice files, HTML, RTF and PDF
115 %description -l pl.UTF-8
116 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
117 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
118 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
119 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
120 napisany w C i zgodny z POSIXem.
123 Summary: Shared libraries for clamav
124 Summary(pl.UTF-8): Biblioteki dzielone clamav
128 Shared libraries for clamav.
130 %description libs -l pl.UTF-8
131 Biblioteki dzielone clamav.
134 Summary: ClamAV filter using milter interface
135 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
137 Requires: %{name} = %{epoch}:%{version}-%{release}
139 #Requires: sendmail >= 8.11
140 Requires: tcp_wrappers
143 ClamAV sendmail filter using MILTER interface.
145 %description milter -l pl.UTF-8
146 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
149 Summary: clamav - Development header files and libraries
150 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
151 Group: Development/Libraries
152 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
153 Requires: bzip2-devel
156 Requires: openssl-devel
160 This package contains the development header files and libraries
161 necessary to develop clamav client applications.
163 %description devel -l pl.UTF-8
164 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
168 Summary: clamav static libraries
169 Summary(pl.UTF-8): Biblioteki statyczne clamav
170 Group: Development/Libraries
171 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
174 clamav static libraries.
176 %description static -l pl.UTF-8
177 Biblioteki statyczne clamav.
183 %if "%{pld_release}" == "ac"
186 %if "%{pld_release}" != "ac"
200 --disable-zlib-vcheck \
201 --disable-silent-rules \
204 %{?with_llvm:--enable-llvm %{?with_system_llvm:--with-system-llvm}} \
205 %{?with_milter:--enable-milter} \
206 --with-dbdir=/var/lib/%{name} \
208 --with-ltdl-include=%{_includedir} \
209 --with-ltdl-lib=%{_libdir}
212 LIBTOOL=%{_bindir}/libtool
215 rm -rf $RPM_BUILD_ROOT
216 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
217 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
218 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
219 $RPM_BUILD_ROOT%{systemdunitdir}
222 LIBTOOL=%{_bindir}/libtool \
223 DESTDIR=$RPM_BUILD_ROOT
224 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
226 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
227 5 * * * * root %{_sbindir}/clamav-cron-updatedb
230 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
232 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
233 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
235 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
236 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
237 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
240 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
242 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
244 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
246 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
247 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
248 sed -e's#@sbindir@#%{_sbindir}#' < %{SOURCE13} > $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
250 # NOTE: clamd uses sane rights to it's clamd.pid file
251 # So better keep it dir
252 # If it is fixed use of dir will be unecesary
253 install -d $RPM_BUILD_ROOT/var/run/%{name}
255 :> $RPM_BUILD_ROOT/var/log/freshclam.log
258 rm -rf $RPM_BUILD_ROOT
260 %triggerin -- amavis-ng
261 %addusertogroup -q clamav amavis
263 %triggerin -- amavisd-new
264 %addusertogroup -q clamav amavis
266 %triggerin -- amavisd
267 %addusertogroup -q clamav amavis
270 %groupadd -g 43 clamav
271 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
274 /sbin/chkconfig --add clamd
275 %service clamd restart "Clam Antivirus daemon"
276 touch /var/log/freshclam.log
277 chown clamav:root /var/log/freshclam.log
278 chmod 640 /var/log/freshclam.log
279 %systemd_post clamd.service cronjob-clamav.timer
282 if [ "$1" = "0" ]; then
284 /sbin/chkconfig --del clamd
286 %systemd_preun clamd.service cronjob-clamav.timer
289 if [ "$1" = "0" ]; then
295 %triggerpostun -- %{name} < 0.80
296 if [ -f /etc/clamav.conf.rpmsave ]; then
297 echo "Renaming config to new name /etc/clamd.conf"
298 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
299 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
300 echo "Changing config location in freshclam config"
301 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
304 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
305 %{__cp} -f /etc/clamd.conf{,.rpmsave}
308 s,^FixStaleSocket$,& yes,
309 s,^AllowSupplementaryGroups$,& yes,
310 s,^ClamukoScanOnOpen$,& yes,
311 s,^ClamukoScanOnClose$,& yes,
312 s,^ClamukoScanOnExec$,& yes,
316 %banner -e %{name}-0.90 <<EOF
317 ClamAV config was automatically upgraded to 0.90 format. You should review it
318 that it's still valid.
321 # unfortunately clamd has no configcheck option so we just have to start it
322 # once again after config was broken after upgrade
323 touch /var/lock/subsys/clamd
324 %service -q clamd restart
326 %triggerpostun -- %{name} < 0.97.7-4
327 %systemd_trigger clamd.service
329 %triggerpostun -- %{name} < 0.99.2-2
330 %systemd_service_enable cronjob-clamav.timer
333 /sbin/chkconfig --add clamav-milter
334 %service clamav-milter restart "Clam Antivirus daemon"
337 if [ "$1" = "0" ]; then
338 %service clamav-milter stop
339 /sbin/chkconfig --del clamav-milter
342 %post libs -p /sbin/ldconfig
343 %postun libs -p /sbin/ldconfig
346 %defattr(644,root,root,755)
347 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
348 %attr(755,root,root) %{_bindir}/clambc
349 %attr(755,root,root) %{_bindir}/clamdscan
350 %attr(755,root,root) %{_bindir}/clamdtop
351 %attr(755,root,root) %{_bindir}/clamscan
352 %attr(755,root,root) %{_bindir}/clamsubmit
353 %attr(755,root,root) %{_bindir}/freshclam
354 %attr(755,root,root) %{_bindir}/sigtool
355 %attr(755,root,root) %{_bindir}/clamconf
356 %attr(755,root,root) %{_sbindir}/clamd
357 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
358 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
359 %{systemdtmpfilesdir}/%{name}.conf
360 %{systemdunitdir}/clamd.service
361 %{systemdunitdir}/cronjob-clamav.service
362 %{systemdunitdir}/cronjob-clamav.timer
363 %attr(755,clamav,root) %dir /var/lib/%{name}
364 %attr(640,clamav,root) %ghost /var/log/freshclam.log
365 %attr(750,clamav,clamav) %dir /var/run/%{name}
367 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
368 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
369 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
371 %attr(754,root,root) /etc/rc.d/init.d/clamd
372 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
373 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
375 %{_mandir}/man5/clamd*
376 %{_mandir}/man5/freshclam*
377 %{_mandir}/man8/clamd*
381 %defattr(644,root,root,755)
382 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
383 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
384 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
385 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
386 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
387 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
388 %attr(755,root,root) %{_sbindir}/clamav-milter
389 %{_mandir}/man5/clamav-milter*
390 %{_mandir}/man8/clamav-milter.8*
391 %attr(700,clamav,clamav) /var/spool/clamav
395 %defattr(644,root,root,755)
396 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
397 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.7
398 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
399 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.7
400 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
401 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.7
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_bindir}/clamav-config
406 %attr(755,root,root) %{_libdir}/libclamav.so
407 %attr(755,root,root) %{_libdir}/libclamunrar.so
408 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
409 %{_libdir}/libclamav.la
410 %{_libdir}/libclamunrar.la
411 %{_libdir}/libclamunrar_iface.la
412 %{_includedir}/clamav.h
413 %{_pkgconfigdir}/libclamav.pc
416 %defattr(644,root,root,755)
417 %{_libdir}/libclamav.a
418 %{_libdir}/libclamunrar.a
419 %{_libdir}/libclamunrar_iface.a