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