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"
194 export CFLAGS="%{rpmcflags} -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99"
195 export CXXFLAGS="%{rpmcxxflags} -std=gnu++98"
202 --disable-zlib-vcheck \
203 --disable-silent-rules \
206 %{?with_llvm:--enable-llvm %{?with_system_llvm:--with-system-llvm}} \
207 %{?with_milter:--enable-milter} \
208 --with-dbdir=/var/lib/%{name} \
210 --with-ltdl-include=%{_includedir} \
211 --with-ltdl-lib=%{_libdir}
214 LIBTOOL=%{_bindir}/libtool
217 rm -rf $RPM_BUILD_ROOT
218 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
219 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
220 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
221 $RPM_BUILD_ROOT%{systemdunitdir}
224 LIBTOOL=%{_bindir}/libtool \
225 DESTDIR=$RPM_BUILD_ROOT
226 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
228 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
229 5 * * * * root %{_sbindir}/clamav-cron-updatedb
232 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
234 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
235 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
237 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
238 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
239 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
242 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
244 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
246 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
248 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
249 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
250 sed -e's#@sbindir@#%{_sbindir}#' < %{SOURCE13} > $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
252 # NOTE: clamd uses sane rights to it's clamd.pid file
253 # So better keep it dir
254 # If it is fixed use of dir will be unecesary
255 install -d $RPM_BUILD_ROOT/var/run/%{name}
257 :> $RPM_BUILD_ROOT/var/log/freshclam.log
260 rm -rf $RPM_BUILD_ROOT
262 %triggerin -- amavis-ng
263 %addusertogroup -q clamav amavis
265 %triggerin -- amavisd-new
266 %addusertogroup -q clamav amavis
268 %triggerin -- amavisd
269 %addusertogroup -q clamav amavis
272 %groupadd -g 43 clamav
273 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
276 /sbin/chkconfig --add clamd
277 %service clamd restart "Clam Antivirus daemon"
278 touch /var/log/freshclam.log
279 chown clamav:root /var/log/freshclam.log
280 chmod 640 /var/log/freshclam.log
281 %systemd_post clamd.service cronjob-clamav.timer
284 if [ "$1" = "0" ]; then
286 /sbin/chkconfig --del clamd
288 %systemd_preun clamd.service cronjob-clamav.timer
291 if [ "$1" = "0" ]; then
297 %triggerpostun -- %{name} < 0.80
298 if [ -f /etc/clamav.conf.rpmsave ]; then
299 echo "Renaming config to new name /etc/clamd.conf"
300 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
301 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
302 echo "Changing config location in freshclam config"
303 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
306 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
307 %{__cp} -f /etc/clamd.conf{,.rpmsave}
310 s,^FixStaleSocket$,& yes,
311 s,^AllowSupplementaryGroups$,& yes,
312 s,^ClamukoScanOnOpen$,& yes,
313 s,^ClamukoScanOnClose$,& yes,
314 s,^ClamukoScanOnExec$,& yes,
318 %banner -e %{name}-0.90 <<EOF
319 ClamAV config was automatically upgraded to 0.90 format. You should review it
320 that it's still valid.
323 # unfortunately clamd has no configcheck option so we just have to start it
324 # once again after config was broken after upgrade
325 touch /var/lock/subsys/clamd
326 %service -q clamd restart
328 %triggerpostun -- %{name} < 0.97.7-4
329 %systemd_trigger clamd.service
331 %triggerpostun -- %{name} < 0.99.2-2
332 %systemd_service_enable cronjob-clamav.timer
335 /sbin/chkconfig --add clamav-milter
336 %service clamav-milter restart "Clam Antivirus daemon"
339 if [ "$1" = "0" ]; then
340 %service clamav-milter stop
341 /sbin/chkconfig --del clamav-milter
344 %post libs -p /sbin/ldconfig
345 %postun libs -p /sbin/ldconfig
348 %defattr(644,root,root,755)
349 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
350 %attr(755,root,root) %{_bindir}/clambc
351 %attr(755,root,root) %{_bindir}/clamdscan
352 %attr(755,root,root) %{_bindir}/clamdtop
353 %attr(755,root,root) %{_bindir}/clamscan
354 %attr(755,root,root) %{_bindir}/clamsubmit
355 %attr(755,root,root) %{_bindir}/freshclam
356 %attr(755,root,root) %{_bindir}/sigtool
357 %attr(755,root,root) %{_bindir}/clamconf
358 %attr(755,root,root) %{_sbindir}/clamd
359 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
360 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
361 %{systemdtmpfilesdir}/%{name}.conf
362 %{systemdunitdir}/clamd.service
363 %{systemdunitdir}/cronjob-clamav.service
364 %{systemdunitdir}/cronjob-clamav.timer
365 %attr(755,clamav,root) %dir /var/lib/%{name}
366 %attr(640,clamav,root) %ghost /var/log/freshclam.log
367 %attr(750,clamav,clamav) %dir /var/run/%{name}
369 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
370 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
371 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
373 %attr(754,root,root) /etc/rc.d/init.d/clamd
374 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
375 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
377 %{_mandir}/man5/clamd*
378 %{_mandir}/man5/freshclam*
379 %{_mandir}/man8/clamd*
383 %defattr(644,root,root,755)
384 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
385 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
386 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
387 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
388 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
389 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
390 %attr(755,root,root) %{_sbindir}/clamav-milter
391 %{_mandir}/man5/clamav-milter*
392 %{_mandir}/man8/clamav-milter.8*
393 %attr(700,clamav,clamav) /var/spool/clamav
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
399 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.7
400 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
401 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.7
402 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
403 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.7
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_bindir}/clamav-config
408 %attr(755,root,root) %{_libdir}/libclamav.so
409 %attr(755,root,root) %{_libdir}/libclamunrar.so
410 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
411 %{_libdir}/libclamav.la
412 %{_libdir}/libclamunrar.la
413 %{_libdir}/libclamunrar_iface.la
414 %{_includedir}/clamav.h
415 %{_pkgconfigdir}/libclamav.pc
418 %defattr(644,root,root,755)
419 %{_libdir}/libclamav.a
420 %{_libdir}/libclamunrar.a
421 %{_libdir}/libclamunrar_iface.a