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
44 URL: http://www.clamav.net/
45 BuildRequires: autoconf
46 BuildRequires: automake
47 BuildRequires: bzip2-devel
48 BuildRequires: curl-devel
49 BuildRequires: gmp-devel
50 BuildRequires: libltdl-devel
51 %{?with_milter:BuildRequires: libmilter-devel}
52 BuildRequires: libstdc++-devel
53 BuildRequires: libtool
54 %{?with_milter:BuildRequires: libwrap-devel}
55 %{?with_llvm:BuildRequires: llvm-devel}
56 BuildRequires: ncurses-devel
57 BuildRequires: openssl-devel
58 BuildRequires: rpm >= 4.4.9-56
59 BuildRequires: rpmbuild(macros) >= 1.647
60 BuildRequires: zlib-devel
61 Requires(post,preun): /sbin/chkconfig
62 Requires(postun): /usr/sbin/groupdel
63 Requires(postun): /usr/sbin/userdel
64 Requires(postun,pre): /usr/sbin/usermod
65 Requires(pre): /bin/id
66 Requires(pre): /usr/bin/getgid
67 Requires(pre): /usr/sbin/groupadd
68 Requires(pre): /usr/sbin/useradd
69 Requires(post,preun,postun): systemd-units >= 38
70 Requires: systemd-units >= 38
71 Requires(triggerpostun): sed >= 4.0
72 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
73 Requires: /usr/sbin/usermod
74 Requires: rc-scripts >= 0.4.1.23
75 Suggests: clamav-database
77 Provides: group(clamav)
78 Provides: user(clamav)
79 Conflicts: logrotate < 3.7-4
80 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
84 especially for e-mail scanning on mail gateways. It provides a number
85 of utilities including a flexible and scalable multi-threaded daemon,
86 a command line scanner and advanced tool for automatic database
87 updates. The core of the package is an anti-virus engine available in
88 a form of shared library.
90 Here is a list of the main features:
91 - command-line scanner
92 - fast, multi-threaded daemon with support for on-access scanning
93 - milter interface for sendmail
94 - advanced database updater with support for scripted updates and
96 - virus scanner C library
97 - on-access scanning (Linux® and FreeBSD®)
98 - virus database updated multiple times per day (see home page for
99 total number of signatures)
100 - built-in support for various archive formats, including Zip, RAR,
101 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
102 - built-in support for almost all mail file formats
103 - built-in support for ELF executables and Portable Executable files
104 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
105 obfuscated with SUE, Y0da Cryptor and others
106 - built-in support for popular document formats including MS Office
107 and MacOffice files, HTML, RTF and PDF
109 %description -l pl.UTF-8
110 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
111 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
112 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
113 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
114 napisany w C i zgodny z POSIXem.
117 Summary: Shared libraries for clamav
118 Summary(pl.UTF-8): Biblioteki dzielone clamav
122 Shared libraries for clamav.
124 %description libs -l pl.UTF-8
125 Biblioteki dzielone clamav.
128 Summary: ClamAV filter using milter interface
129 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
131 Requires: %{name} = %{epoch}:%{version}-%{release}
133 #Requires: sendmail >= 8.11
134 Requires: tcp_wrappers
137 ClamAV sendmail filter using MILTER interface.
139 %description milter -l pl.UTF-8
140 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
143 Summary: clamav - Development header files and libraries
144 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
145 Group: Development/Libraries
146 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
147 Requires: bzip2-devel
150 Requires: openssl-devel
154 This package contains the development header files and libraries
155 necessary to develop clamav client applications.
157 %description devel -l pl.UTF-8
158 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
162 Summary: clamav static libraries
163 Summary(pl.UTF-8): Biblioteki statyczne clamav
164 Group: Development/Libraries
165 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
168 clamav static libraries.
170 %description static -l pl.UTF-8
171 Biblioteki statyczne clamav.
177 %if "%{pld_release}" == "ac"
180 %if "%{pld_release}" != "ac"
194 --disable-silent-rules \
197 %{?with_llvm:--enable-llvm --with-system-llvm} \
198 %{?with_milter:--enable-milter} \
199 --with-dbdir=/var/lib/%{name} \
201 --with-ltdl-include=%{_includedir} \
202 --with-ltdl-lib=%{_libdir}
205 LIBTOOL=%{_bindir}/libtool
208 rm -rf $RPM_BUILD_ROOT
209 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
210 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
211 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
212 $RPM_BUILD_ROOT%{systemdunitdir}
215 LIBTOOL=%{_bindir}/libtool \
216 DESTDIR=$RPM_BUILD_ROOT
217 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
219 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
220 5 * * * * root %{_sbindir}/clamav-cron-updatedb
223 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
225 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
226 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
228 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
229 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
230 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
233 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
235 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
237 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
239 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
241 # NOTE: clamd uses sane rights to it's clamd.pid file
242 # So better keep it dir
243 # If it is fixed use of dir will be unecesary
244 install -d $RPM_BUILD_ROOT/var/run/%{name}
246 :> $RPM_BUILD_ROOT/var/log/freshclam.log
249 rm -rf $RPM_BUILD_ROOT
251 %triggerin -- amavis-ng
252 %addusertogroup -q clamav amavis
254 %triggerin -- amavisd-new
255 %addusertogroup -q clamav amavis
257 %triggerin -- amavisd
258 %addusertogroup -q clamav amavis
261 %groupadd -g 43 clamav
262 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
265 /sbin/chkconfig --add clamd
266 %service clamd restart "Clam Antivirus daemon"
267 touch /var/log/freshclam.log
268 chown clamav:root /var/log/freshclam.log
269 chmod 640 /var/log/freshclam.log
270 %systemd_post clamd.service
273 if [ "$1" = "0" ]; then
275 /sbin/chkconfig --del clamd
277 %systemd_preun clamd.service
280 if [ "$1" = "0" ]; then
286 %triggerpostun -- %{name} < 0.80
287 if [ -f /etc/clamav.conf.rpmsave ]; then
288 echo "Renaming config to new name /etc/clamd.conf"
289 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
290 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
291 echo "Changing config location in freshclam config"
292 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
295 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
296 %{__cp} -f /etc/clamd.conf{,.rpmsave}
299 s,^FixStaleSocket$,& yes,
300 s,^AllowSupplementaryGroups$,& yes,
301 s,^ClamukoScanOnOpen$,& yes,
302 s,^ClamukoScanOnClose$,& yes,
303 s,^ClamukoScanOnExec$,& yes,
307 %banner -e %{name}-0.90 <<EOF
308 ClamAV config was automatically upgraded to 0.90 format. You should review it
309 that it's still valid.
312 # unfortunately clamd has no configcheck option so we just have to start it
313 # once again after config was broken after upgrade
314 touch /var/lock/subsys/clamd
315 %service -q clamd restart
317 %triggerpostun -- %{name} < 0.97.7-4
318 %systemd_trigger clamd.service
321 /sbin/chkconfig --add clamav-milter
322 %service clamav-milter restart "Clam Antivirus daemon"
325 if [ "$1" = "0" ]; then
326 %service clamav-milter stop
327 /sbin/chkconfig --del clamav-milter
330 %post libs -p /sbin/ldconfig
331 %postun libs -p /sbin/ldconfig
334 %defattr(644,root,root,755)
335 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
336 %attr(755,root,root) %{_bindir}/clambc
337 %attr(755,root,root) %{_bindir}/clamdscan
338 %attr(755,root,root) %{_bindir}/clamdtop
339 %attr(755,root,root) %{_bindir}/clamscan
340 %attr(755,root,root) %{_bindir}/clamsubmit
341 %attr(755,root,root) %{_bindir}/freshclam
342 %attr(755,root,root) %{_bindir}/sigtool
343 %attr(755,root,root) %{_bindir}/clamconf
344 %attr(755,root,root) %{_sbindir}/clamd
345 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
346 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
347 %{systemdtmpfilesdir}/%{name}.conf
348 %{systemdunitdir}/clamd.service
349 %attr(755,clamav,root) %dir /var/lib/%{name}
350 %attr(640,clamav,root) %ghost /var/log/freshclam.log
351 %attr(750,clamav,clamav) %dir /var/run/%{name}
353 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
354 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
355 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
357 %attr(754,root,root) /etc/rc.d/init.d/clamd
358 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
359 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
361 %{_mandir}/man8/clamd*
365 %defattr(644,root,root,755)
366 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
367 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
368 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
369 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
370 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
371 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
372 %attr(755,root,root) %{_sbindir}/clamav-milter
373 %{_mandir}/man8/clamav-milter.8*
374 %attr(700,clamav,clamav) /var/spool/clamav
378 %defattr(644,root,root,755)
379 %attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
380 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
381 %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
383 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
384 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_bindir}/clamav-config
389 %attr(755,root,root) %{_libdir}/libclamav.so
390 %attr(755,root,root) %{_libdir}/libclamunrar.so
391 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so
392 %{_libdir}/libclamav.la
393 %{_libdir}/libclamunrar.la
394 %{_libdir}/libclamunrar_iface.la
395 %{_includedir}/clamav.h
396 %{_pkgconfigdir}/libclamav.pc
399 %defattr(644,root,root,755)
400 %{_libdir}/libclamav.a
401 %{_libdir}/libclamunrar.a
402 %{_libdir}/libclamunrar_iface.a