2 # - Make freshclam package (script and daemon)
3 # - restart amavis in triggers if group membership was modified?
6 %bcond_without milter # build without milter subpackage
7 %if "%{pld_release}" == "ac"
8 %bcond_with llvm # build without llvm support
10 %bcond_without llvm # build without llvm support
13 Summary: An anti-virus utility for Unix
14 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
20 Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21 # Source0-md5: c6e6e333d8c9bd3785cbc6ec296c146f
23 Source2: %{name}.sysconfig
24 Source3: %{name}-milter.init
25 Source4: %{name}-cron-updatedb
26 Source5: %{name}.logrotate
27 Source8: %{name}-post-updatedb
28 Source9: %{name}-milter.sysconfig
29 Source10: %{name}.tmpfiles
30 Source11: clamd.service
31 Patch0: %{name}-pld_config.patch
32 Patch1: %{name}-nolibs.patch
33 Patch2: am-nosilentrules.patch
35 URL: http://www.clamav.net/
36 BuildRequires: autoconf
37 BuildRequires: automake
38 BuildRequires: bzip2-devel
39 BuildRequires: gmp-devel
40 BuildRequires: libltdl-devel
41 %{?with_milter:BuildRequires: libmilter-devel}
42 BuildRequires: libstdc++-devel
43 BuildRequires: libtool
44 %{?with_milter:BuildRequires: libwrap-devel}
45 %{?with_llvm:BuildRequires: llvm-devel}
46 BuildRequires: ncurses-devel
47 BuildRequires: rpm >= 4.4.9-56
48 BuildRequires: rpmbuild(macros) >= 1.647
49 BuildRequires: zlib-devel
50 Requires(post,preun): /sbin/chkconfig
51 Requires(postun): /usr/sbin/groupdel
52 Requires(postun): /usr/sbin/userdel
53 Requires(postun,pre): /usr/sbin/usermod
54 Requires(pre): /bin/id
55 Requires(pre): /usr/bin/getgid
56 Requires(pre): /usr/sbin/groupadd
57 Requires(pre): /usr/sbin/useradd
58 Requires(post,preun,postun): systemd-units >= 38
59 Requires: systemd-units >= 38
60 Requires(triggerpostun): sed >= 4.0
61 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
62 Requires: /usr/sbin/usermod
63 Requires: rc-scripts >= 0.4.1.23
64 Suggests: clamav-database
65 Provides: group(clamav)
66 Provides: user(clamav)
67 Conflicts: logrotate < 3.7-4
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
72 especially for e-mail scanning on mail gateways. It provides a number
73 of utilities including a flexible and scalable multi-threaded daemon,
74 a command line scanner and advanced tool for automatic database
75 updates. The core of the package is an anti-virus engine available in
76 a form of shared library.
78 Here is a list of the main features:
79 - command-line scanner
80 - fast, multi-threaded daemon with support for on-access scanning
81 - milter interface for sendmail
82 - advanced database updater with support for scripted updates and
84 - virus scanner C library
85 - on-access scanning (Linux® and FreeBSD®)
86 - virus database updated multiple times per day (see home page for
87 total number of signatures)
88 - built-in support for various archive formats, including Zip, RAR,
89 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
90 - built-in support for almost all mail file formats
91 - built-in support for ELF executables and Portable Executable files
92 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
93 obfuscated with SUE, Y0da Cryptor and others
94 - built-in support for popular document formats including MS Office
95 and MacOffice files, HTML, RTF and PDF
97 %description -l pl.UTF-8
98 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
99 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
100 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
101 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
102 napisany w C i zgodny z POSIXem.
105 Summary: Shared libraries for clamav
106 Summary(pl.UTF-8): Biblioteki dzielone clamav
110 Shared libraries for clamav.
112 %description libs -l pl.UTF-8
113 Biblioteki dzielone clamav.
116 Summary: ClamAV filter using milter interface
117 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
119 Requires: %{name} = %{epoch}:%{version}-%{release}
121 #Requires: sendmail >= 8.11
122 Requires: tcp_wrappers
125 ClamAV sendmail filter using MILTER interface.
127 %description milter -l pl.UTF-8
128 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
131 Summary: clamav - Development header files and libraries
132 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
133 Group: Development/Libraries
134 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
135 Requires: bzip2-devel
140 This package contains the development header files and libraries
141 necessary to develop clamav client applications.
143 %description devel -l pl.UTF-8
144 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
148 Summary: clamav static libraries
149 Summary(pl.UTF-8): Biblioteki statyczne clamav
150 Group: Development/Libraries
151 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
154 clamav static libraries.
156 %description static -l pl.UTF-8
157 Biblioteki statyczne clamav.
167 # automake 1.12+ needs configure.ac not .in
176 %{?with_milter:--enable-milter} \
177 --with-dbdir=/var/lib/%{name} \
179 --with-ltdl-include=%{_includedir} \
180 --with-ltdl-lib=%{_libdir}
183 LIBTOOL=%{_bindir}/libtool
186 rm -rf $RPM_BUILD_ROOT
187 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
188 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
189 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
190 $RPM_BUILD_ROOT%{systemdunitdir}
193 LIBTOOL=%{_bindir}/libtool \
194 DESTDIR=$RPM_BUILD_ROOT
195 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
197 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
198 5 * * * * root %{_sbindir}/clamav-cron-updatedb
201 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
203 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
204 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
206 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
207 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
208 cp -p etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
209 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
211 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
213 install %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
215 install %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
217 # NOTE: clamd uses sane rights to it's clamd.pid file
218 # So better keep it dir
219 # If it is fixed use of dir will be unecesary
220 install -d $RPM_BUILD_ROOT/var/run/%{name}
222 :> $RPM_BUILD_ROOT/var/log/freshclam.log
225 rm -rf $RPM_BUILD_ROOT
227 %triggerin -- amavis-ng
228 %addusertogroup -q clamav amavis
230 %triggerin -- amavisd-new
231 %addusertogroup -q clamav amavis
233 %triggerin -- amavisd
234 %addusertogroup -q clamav amavis
237 %groupadd -g 43 clamav
238 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
241 /sbin/chkconfig --add clamd
242 %service clamd restart "Clam Antivirus daemon"
243 touch /var/log/freshclam.log
244 chown clamav:root /var/log/freshclam.log
245 chmod 640 /var/log/freshclam.log
246 %systemd_post clamd.service
249 if [ "$1" = "0" ]; then
251 /sbin/chkconfig --del clamd
253 %systemd_preun clamd.service
256 if [ "$1" = "0" ]; then
262 %triggerpostun -- %{name} < 0.80
263 if [ -f /etc/clamav.conf.rpmsave ]; then
264 echo "Renaming config to new name /etc/clamd.conf"
265 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
266 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
267 echo "Changing config location in freshclam config"
268 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
271 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
272 %{__cp} -f /etc/clamd.conf{,.rpmsave}
275 s,^FixStaleSocket$,& yes,
276 s,^AllowSupplementaryGroups$,& yes,
277 s,^ClamukoScanOnOpen$,& yes,
278 s,^ClamukoScanOnClose$,& yes,
279 s,^ClamukoScanOnExec$,& yes,
283 %banner -e %{name}-0.90 <<EOF
284 ClamAV config was automatically upgraded to 0.90 format. You should review it
285 that it's still valid.
288 # unfortunately clamd has no configcheck option so we just have to start it
289 # once again after config was broken after upgrade
290 touch /var/lock/subsys/clamd
291 %service -q clamd restart
293 %triggerpostun -- %{name} < 0.97.7-4
294 %systemd_trigger clamd.service
297 /sbin/chkconfig --add clamav-milter
298 %service clamav-milter restart "Clam Antivirus daemon"
301 if [ "$1" = "0" ]; then
302 %service clamav-milter stop
303 /sbin/chkconfig --del clamav-milter
306 %post libs -p /sbin/ldconfig
307 %postun libs -p /sbin/ldconfig
310 %defattr(644,root,root,755)
311 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
312 %attr(755,root,root) %{_bindir}/clambc
313 %attr(755,root,root) %{_bindir}/clamdscan
314 %attr(755,root,root) %{_bindir}/clamdtop
315 %attr(755,root,root) %{_bindir}/clamscan
316 %attr(755,root,root) %{_bindir}/freshclam
317 %attr(755,root,root) %{_bindir}/sigtool
318 %attr(755,root,root) %{_bindir}/clamconf
319 %attr(755,root,root) %{_sbindir}/clamd
320 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
321 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
322 %{systemdtmpfilesdir}/%{name}.conf
323 %{systemdunitdir}/clamd.service
324 %attr(755,clamav,root) %dir /var/lib/%{name}
325 %attr(640,clamav,root) %ghost /var/log/freshclam.log
326 %attr(750,clamav,clamav) %dir /var/run/%{name}
328 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
329 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
330 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
332 %attr(754,root,root) /etc/rc.d/init.d/clamd
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
336 %{_mandir}/man8/clamd*
340 %defattr(644,root,root,755)
341 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
342 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
343 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
344 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
345 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
346 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
347 %attr(755,root,root) %{_sbindir}/clamav-milter
348 %{_mandir}/man8/clamav-milter.8*
349 %attr(700,clamav,clamav) /var/spool/clamav
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_libdir}/lib*.so.*.*
355 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
356 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
357 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_bindir}/clamav-config
362 %attr(755,root,root) %{_libdir}/lib*.so
365 %{_pkgconfigdir}/*.pc
368 %defattr(644,root,root,755)