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://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
27 # Source0-md5: cf1f3cbe62a08c9165801f79239166ff
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 Patch0: %{name}-pld_config.patch
38 Patch1: %{name}-nolibs.patch
39 %if "%{pld_release}" == "ac"
40 Patch2: am-nosilentrules.patch
43 Patch4: %{name}-openssl.patch
44 Patch5: %{name}-major.patch
46 URL: http://www.clamav.net/
47 BuildRequires: autoconf
48 BuildRequires: automake
49 BuildRequires: bzip2-devel
50 BuildRequires: curl-devel
51 BuildRequires: gmp-devel
52 BuildRequires: libltdl-devel
53 %{?with_milter:BuildRequires: libmilter-devel}
54 BuildRequires: libstdc++-devel
55 BuildRequires: libtool
56 %{?with_milter:BuildRequires: libwrap-devel}
57 %{?with_llvm:%{?with_system_llvm:BuildRequires: llvm-devel < 3.7}}
58 BuildRequires: ncurses-devel
59 BuildRequires: openssl-devel
60 BuildRequires: rpm >= 4.4.9-56
61 BuildRequires: rpmbuild(macros) >= 1.647
62 BuildRequires: zlib-devel
63 Requires(post,preun): /sbin/chkconfig
64 Requires(postun): /usr/sbin/groupdel
65 Requires(postun): /usr/sbin/userdel
66 Requires(postun,pre): /usr/sbin/usermod
67 Requires(pre): /bin/id
68 Requires(pre): /usr/bin/getgid
69 Requires(pre): /usr/sbin/groupadd
70 Requires(pre): /usr/sbin/useradd
71 Requires(post,preun,postun): systemd-units >= 38
72 Requires: systemd-units >= 38
73 Requires(triggerpostun): sed >= 4.0
74 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
75 Requires: /usr/sbin/usermod
76 Requires: rc-scripts >= 0.4.1.23
77 Suggests: clamav-database
79 Provides: group(clamav)
80 Provides: user(clamav)
81 Conflicts: logrotate < 3.7-4
82 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
86 especially for e-mail scanning on mail gateways. It provides a number
87 of utilities including a flexible and scalable multi-threaded daemon,
88 a command line scanner and advanced tool for automatic database
89 updates. The core of the package is an anti-virus engine available in
90 a form of shared library.
92 Here is a list of the main features:
93 - command-line scanner
94 - fast, multi-threaded daemon with support for on-access scanning
95 - milter interface for sendmail
96 - advanced database updater with support for scripted updates and
98 - virus scanner C library
99 - on-access scanning (Linux® and FreeBSD®)
100 - virus database updated multiple times per day (see home page for
101 total number of signatures)
102 - built-in support for various archive formats, including Zip, RAR,
103 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
104 - built-in support for almost all mail file formats
105 - built-in support for ELF executables and Portable Executable files
106 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
107 obfuscated with SUE, Y0da Cryptor and others
108 - built-in support for popular document formats including MS Office
109 and MacOffice files, HTML, RTF and PDF
111 %description -l pl.UTF-8
112 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
113 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
114 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
115 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
116 napisany w C i zgodny z POSIXem.
119 Summary: Shared libraries for clamav
120 Summary(pl.UTF-8): Biblioteki dzielone clamav
124 Shared libraries for clamav.
126 %description libs -l pl.UTF-8
127 Biblioteki dzielone clamav.
130 Summary: ClamAV filter using milter interface
131 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
133 Requires: %{name} = %{epoch}:%{version}-%{release}
135 #Requires: sendmail >= 8.11
136 Requires: tcp_wrappers
139 ClamAV sendmail filter using MILTER interface.
141 %description milter -l pl.UTF-8
142 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
145 Summary: clamav - Development header files and libraries
146 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
147 Group: Development/Libraries
148 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
149 Requires: bzip2-devel
152 Requires: openssl-devel
156 This package contains the development header files and libraries
157 necessary to develop clamav client applications.
159 %description devel -l pl.UTF-8
160 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
164 Summary: clamav static libraries
165 Summary(pl.UTF-8): Biblioteki statyczne clamav
166 Group: Development/Libraries
167 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
170 clamav static libraries.
172 %description static -l pl.UTF-8
173 Biblioteki statyczne clamav.
179 %if "%{pld_release}" == "ac"
182 %if "%{pld_release}" != "ac"
196 --disable-silent-rules \
199 %{?with_llvm:--enable-llvm %{?with_system_llvm:--with-system-llvm}} \
200 %{?with_milter:--enable-milter} \
201 --with-dbdir=/var/lib/%{name} \
203 --with-ltdl-include=%{_includedir} \
204 --with-ltdl-lib=%{_libdir}
207 LIBTOOL=%{_bindir}/libtool
210 rm -rf $RPM_BUILD_ROOT
211 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
212 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
213 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
214 $RPM_BUILD_ROOT%{systemdunitdir}
217 LIBTOOL=%{_bindir}/libtool \
218 DESTDIR=$RPM_BUILD_ROOT
219 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
221 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
222 5 * * * * root %{_sbindir}/clamav-cron-updatedb
225 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
227 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
228 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
230 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
231 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
232 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
235 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
237 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
239 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
241 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
243 # NOTE: clamd uses sane rights to it's clamd.pid file
244 # So better keep it dir
245 # If it is fixed use of dir will be unecesary
246 install -d $RPM_BUILD_ROOT/var/run/%{name}
248 :> $RPM_BUILD_ROOT/var/log/freshclam.log
251 rm -rf $RPM_BUILD_ROOT
253 %triggerin -- amavis-ng
254 %addusertogroup -q clamav amavis
256 %triggerin -- amavisd-new
257 %addusertogroup -q clamav amavis
259 %triggerin -- amavisd
260 %addusertogroup -q clamav amavis
263 %groupadd -g 43 clamav
264 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
267 /sbin/chkconfig --add clamd
268 %service clamd restart "Clam Antivirus daemon"
269 touch /var/log/freshclam.log
270 chown clamav:root /var/log/freshclam.log
271 chmod 640 /var/log/freshclam.log
272 %systemd_post clamd.service
275 if [ "$1" = "0" ]; then
277 /sbin/chkconfig --del clamd
279 %systemd_preun clamd.service
282 if [ "$1" = "0" ]; then
288 %triggerpostun -- %{name} < 0.80
289 if [ -f /etc/clamav.conf.rpmsave ]; then
290 echo "Renaming config to new name /etc/clamd.conf"
291 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
292 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
293 echo "Changing config location in freshclam config"
294 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
297 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
298 %{__cp} -f /etc/clamd.conf{,.rpmsave}
301 s,^FixStaleSocket$,& yes,
302 s,^AllowSupplementaryGroups$,& yes,
303 s,^ClamukoScanOnOpen$,& yes,
304 s,^ClamukoScanOnClose$,& yes,
305 s,^ClamukoScanOnExec$,& yes,
309 %banner -e %{name}-0.90 <<EOF
310 ClamAV config was automatically upgraded to 0.90 format. You should review it
311 that it's still valid.
314 # unfortunately clamd has no configcheck option so we just have to start it
315 # once again after config was broken after upgrade
316 touch /var/lock/subsys/clamd
317 %service -q clamd restart
319 %triggerpostun -- %{name} < 0.97.7-4
320 %systemd_trigger clamd.service
323 /sbin/chkconfig --add clamav-milter
324 %service clamav-milter restart "Clam Antivirus daemon"
327 if [ "$1" = "0" ]; then
328 %service clamav-milter stop
329 /sbin/chkconfig --del clamav-milter
332 %post libs -p /sbin/ldconfig
333 %postun libs -p /sbin/ldconfig
336 %defattr(644,root,root,755)
337 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
338 %attr(755,root,root) %{_bindir}/clambc
339 %attr(755,root,root) %{_bindir}/clamdscan
340 %attr(755,root,root) %{_bindir}/clamdtop
341 %attr(755,root,root) %{_bindir}/clamscan
342 %attr(755,root,root) %{_bindir}/clamsubmit
343 %attr(755,root,root) %{_bindir}/freshclam
344 %attr(755,root,root) %{_bindir}/sigtool
345 %attr(755,root,root) %{_bindir}/clamconf
346 %attr(755,root,root) %{_sbindir}/clamd
347 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
348 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
349 %{systemdtmpfilesdir}/%{name}.conf
350 %{systemdunitdir}/clamd.service
351 %attr(755,clamav,root) %dir /var/lib/%{name}
352 %attr(640,clamav,root) %ghost /var/log/freshclam.log
353 %attr(750,clamav,clamav) %dir /var/run/%{name}
355 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
356 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
357 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
359 %attr(754,root,root) /etc/rc.d/init.d/clamd
360 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
361 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
363 %{_mandir}/man8/clamd*
367 %defattr(644,root,root,755)
368 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
369 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
370 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
371 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
372 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
373 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
374 %attr(755,root,root) %{_sbindir}/clamav-milter
375 %{_mandir}/man8/clamav-milter.8*
376 %attr(700,clamav,clamav) /var/spool/clamav
380 %defattr(644,root,root,755)
381 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.7
383 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
384 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.7
385 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
386 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.7
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{_bindir}/clamav-config
391 %attr(755,root,root) %{_libdir}/libclamav.so
392 %attr(755,root,root) %{_libdir}/libclamunrar.so
393 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
394 %{_libdir}/libclamav.la
395 %{_libdir}/libclamunrar.la
396 %{_libdir}/libclamunrar_iface.la
397 %{_includedir}/clamav.h
398 %{_pkgconfigdir}/libclamav.pc
401 %defattr(644,root,root,755)
402 %{_libdir}/libclamav.a
403 %{_libdir}/libclamunrar.a
404 %{_libdir}/libclamunrar_iface.a