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 %bcond_without llvm # LLVM support
9 %if "%{pld_release}" == "ac"
17 Summary: An anti-virus utility for Unix
18 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
24 Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
25 # Source0-md5: 157c601161da1c2d5a0e48ea1b49e067
27 Source2: %{name}.sysconfig
28 Source3: %{name}-milter.init
29 Source4: %{name}-cron-updatedb
30 Source5: %{name}.logrotate
31 Source8: %{name}-post-updatedb
32 Source9: %{name}-milter.sysconfig
33 Source10: %{name}.tmpfiles
34 Source11: clamd.service
35 Patch0: %{name}-pld_config.patch
36 Patch1: %{name}-nolibs.patch
37 %if "%{pld_release}" == "ac"
38 Patch2: am-nosilentrules.patch
41 Patch4: %{name}-openssl.patch
42 Patch5: %{name}-major.patch
43 URL: http://www.clamav.net/
44 BuildRequires: autoconf
45 BuildRequires: automake
46 BuildRequires: bzip2-devel
47 BuildRequires: curl-devel
48 BuildRequires: gmp-devel
49 BuildRequires: libltdl-devel
50 %{?with_milter:BuildRequires: libmilter-devel}
51 BuildRequires: libstdc++-devel
52 BuildRequires: libtool
53 %{?with_milter:BuildRequires: libwrap-devel}
54 %{?with_llvm:BuildRequires: llvm-devel}
55 BuildRequires: ncurses-devel
56 BuildRequires: openssl-devel
57 BuildRequires: rpm >= 4.4.9-56
58 BuildRequires: rpmbuild(macros) >= 1.647
59 BuildRequires: zlib-devel
60 Requires(post,preun): /sbin/chkconfig
61 Requires(postun): /usr/sbin/groupdel
62 Requires(postun): /usr/sbin/userdel
63 Requires(postun,pre): /usr/sbin/usermod
64 Requires(pre): /bin/id
65 Requires(pre): /usr/bin/getgid
66 Requires(pre): /usr/sbin/groupadd
67 Requires(pre): /usr/sbin/useradd
68 Requires(post,preun,postun): systemd-units >= 38
69 Requires: systemd-units >= 38
70 Requires(triggerpostun): sed >= 4.0
71 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
72 Requires: /usr/sbin/usermod
73 Requires: rc-scripts >= 0.4.1.23
74 Suggests: clamav-database
76 Provides: group(clamav)
77 Provides: user(clamav)
78 Conflicts: logrotate < 3.7-4
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
83 especially for e-mail scanning on mail gateways. It provides a number
84 of utilities including a flexible and scalable multi-threaded daemon,
85 a command line scanner and advanced tool for automatic database
86 updates. The core of the package is an anti-virus engine available in
87 a form of shared library.
89 Here is a list of the main features:
90 - command-line scanner
91 - fast, multi-threaded daemon with support for on-access scanning
92 - milter interface for sendmail
93 - advanced database updater with support for scripted updates and
95 - virus scanner C library
96 - on-access scanning (Linux® and FreeBSD®)
97 - virus database updated multiple times per day (see home page for
98 total number of signatures)
99 - built-in support for various archive formats, including Zip, RAR,
100 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
101 - built-in support for almost all mail file formats
102 - built-in support for ELF executables and Portable Executable files
103 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
104 obfuscated with SUE, Y0da Cryptor and others
105 - built-in support for popular document formats including MS Office
106 and MacOffice files, HTML, RTF and PDF
108 %description -l pl.UTF-8
109 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
110 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
111 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
112 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
113 napisany w C i zgodny z POSIXem.
116 Summary: Shared libraries for clamav
117 Summary(pl.UTF-8): Biblioteki dzielone clamav
121 Shared libraries for clamav.
123 %description libs -l pl.UTF-8
124 Biblioteki dzielone clamav.
127 Summary: ClamAV filter using milter interface
128 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
130 Requires: %{name} = %{epoch}:%{version}-%{release}
132 #Requires: sendmail >= 8.11
133 Requires: tcp_wrappers
136 ClamAV sendmail filter using MILTER interface.
138 %description milter -l pl.UTF-8
139 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
142 Summary: clamav - Development header files and libraries
143 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
144 Group: Development/Libraries
145 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
146 Requires: bzip2-devel
149 Requires: openssl-devel
153 This package contains the development header files and libraries
154 necessary to develop clamav client applications.
156 %description devel -l pl.UTF-8
157 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
161 Summary: clamav static libraries
162 Summary(pl.UTF-8): Biblioteki statyczne clamav
163 Group: Development/Libraries
164 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
167 clamav static libraries.
169 %description static -l pl.UTF-8
170 Biblioteki statyczne clamav.
176 %if "%{pld_release}" == "ac"
179 %if "%{pld_release}" != "ac"
192 --disable-silent-rules \
195 %{?with_llvm:--enable-llvm --with-system-llvm} \
196 %{?with_milter:--enable-milter} \
197 --with-dbdir=/var/lib/%{name} \
199 --with-ltdl-include=%{_includedir} \
200 --with-ltdl-lib=%{_libdir}
203 LIBTOOL=%{_bindir}/libtool
206 rm -rf $RPM_BUILD_ROOT
207 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
208 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
209 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
210 $RPM_BUILD_ROOT%{systemdunitdir}
213 LIBTOOL=%{_bindir}/libtool \
214 DESTDIR=$RPM_BUILD_ROOT
215 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
217 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
218 5 * * * * root %{_sbindir}/clamav-cron-updatedb
221 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
223 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
224 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
226 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
227 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
228 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
231 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
233 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
235 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
237 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
239 # NOTE: clamd uses sane rights to it's clamd.pid file
240 # So better keep it dir
241 # If it is fixed use of dir will be unecesary
242 install -d $RPM_BUILD_ROOT/var/run/%{name}
244 :> $RPM_BUILD_ROOT/var/log/freshclam.log
247 rm -rf $RPM_BUILD_ROOT
249 %triggerin -- amavis-ng
250 %addusertogroup -q clamav amavis
252 %triggerin -- amavisd-new
253 %addusertogroup -q clamav amavis
255 %triggerin -- amavisd
256 %addusertogroup -q clamav amavis
259 %groupadd -g 43 clamav
260 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
263 /sbin/chkconfig --add clamd
264 %service clamd restart "Clam Antivirus daemon"
265 touch /var/log/freshclam.log
266 chown clamav:root /var/log/freshclam.log
267 chmod 640 /var/log/freshclam.log
268 %systemd_post clamd.service
271 if [ "$1" = "0" ]; then
273 /sbin/chkconfig --del clamd
275 %systemd_preun clamd.service
278 if [ "$1" = "0" ]; then
284 %triggerpostun -- %{name} < 0.80
285 if [ -f /etc/clamav.conf.rpmsave ]; then
286 echo "Renaming config to new name /etc/clamd.conf"
287 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
288 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
289 echo "Changing config location in freshclam config"
290 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
293 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
294 %{__cp} -f /etc/clamd.conf{,.rpmsave}
297 s,^FixStaleSocket$,& yes,
298 s,^AllowSupplementaryGroups$,& yes,
299 s,^ClamukoScanOnOpen$,& yes,
300 s,^ClamukoScanOnClose$,& yes,
301 s,^ClamukoScanOnExec$,& yes,
305 %banner -e %{name}-0.90 <<EOF
306 ClamAV config was automatically upgraded to 0.90 format. You should review it
307 that it's still valid.
310 # unfortunately clamd has no configcheck option so we just have to start it
311 # once again after config was broken after upgrade
312 touch /var/lock/subsys/clamd
313 %service -q clamd restart
315 %triggerpostun -- %{name} < 0.97.7-4
316 %systemd_trigger clamd.service
319 /sbin/chkconfig --add clamav-milter
320 %service clamav-milter restart "Clam Antivirus daemon"
323 if [ "$1" = "0" ]; then
324 %service clamav-milter stop
325 /sbin/chkconfig --del clamav-milter
328 %post libs -p /sbin/ldconfig
329 %postun libs -p /sbin/ldconfig
332 %defattr(644,root,root,755)
333 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
334 %attr(755,root,root) %{_bindir}/clambc
335 %attr(755,root,root) %{_bindir}/clamdscan
336 %attr(755,root,root) %{_bindir}/clamdtop
337 %attr(755,root,root) %{_bindir}/clamscan
338 %attr(755,root,root) %{_bindir}/clamsubmit
339 %attr(755,root,root) %{_bindir}/freshclam
340 %attr(755,root,root) %{_bindir}/sigtool
341 %attr(755,root,root) %{_bindir}/clamconf
342 %attr(755,root,root) %{_sbindir}/clamd
343 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
344 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
345 %{systemdtmpfilesdir}/%{name}.conf
346 %{systemdunitdir}/clamd.service
347 %attr(755,clamav,root) %dir /var/lib/%{name}
348 %attr(640,clamav,root) %ghost /var/log/freshclam.log
349 %attr(750,clamav,clamav) %dir /var/run/%{name}
351 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
352 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
353 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
355 %attr(754,root,root) /etc/rc.d/init.d/clamd
356 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
357 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
359 %{_mandir}/man8/clamd*
363 %defattr(644,root,root,755)
364 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
365 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
366 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
367 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
368 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
369 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
370 %attr(755,root,root) %{_sbindir}/clamav-milter
371 %{_mandir}/man8/clamav-milter.8*
372 %attr(700,clamav,clamav) /var/spool/clamav
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
378 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
379 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
380 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
381 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
385 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_bindir}/clamav-config
387 %attr(755,root,root) %{_libdir}/libclamav.so
388 %attr(755,root,root) %{_libdir}/libclamunrar.so
389 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
390 %{_libdir}/libclamav.la
391 %{_libdir}/libclamunrar.la
392 %{_libdir}/libclamunrar_iface.la
393 %{_includedir}/clamav.h
394 %{_pkgconfigdir}/libclamav.pc
397 %defattr(644,root,root,755)
398 %{_libdir}/libclamav.a
399 %{_libdir}/libclamunrar.a
400 %{_libdir}/libclamunrar_iface.a