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: 4d4b93243a5add0216acc4f24f43a895
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 Patch0: %{name}-pld_config.patch
31 Patch1: %{name}-nolibs.patch
32 Patch2: am-nosilentrules.patch
34 URL: http://www.clamav.net/
35 BuildRequires: autoconf
36 BuildRequires: automake
37 BuildRequires: bzip2-devel
38 BuildRequires: gmp-devel
39 BuildRequires: libltdl-devel
40 %{?with_milter:BuildRequires: libmilter-devel}
41 BuildRequires: libstdc++-devel
42 BuildRequires: libtool
43 %{?with_milter:BuildRequires: libwrap-devel}
44 %{?with_llvm:BuildRequires: llvm-devel}
45 BuildRequires: ncurses-devel
46 BuildRequires: rpm >= 4.4.9-56
47 BuildRequires: rpmbuild(macros) >= 1.514
48 BuildRequires: zlib-devel
49 Requires(post,preun): /sbin/chkconfig
50 Requires(postun): /usr/sbin/groupdel
51 Requires(postun): /usr/sbin/userdel
52 Requires(postun,pre): /usr/sbin/usermod
53 Requires(pre): /bin/id
54 Requires(pre): /usr/bin/getgid
55 Requires(pre): /usr/sbin/groupadd
56 Requires(pre): /usr/sbin/useradd
57 Requires(triggerpostun): sed >= 4.0
58 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
59 Requires: /usr/sbin/usermod
60 Requires: rc-scripts >= 0.4.1.23
61 Suggests: clamav-database
62 Provides: group(clamav)
63 Provides: user(clamav)
64 Conflicts: logrotate < 3.7-4
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
69 especially for e-mail scanning on mail gateways. It provides a number
70 of utilities including a flexible and scalable multi-threaded daemon,
71 a command line scanner and advanced tool for automatic database
72 updates. The core of the package is an anti-virus engine available in
73 a form of shared library.
75 Here is a list of the main features:
76 - command-line scanner
77 - fast, multi-threaded daemon with support for on-access scanning
78 - milter interface for sendmail
79 - advanced database updater with support for scripted updates and
81 - virus scanner C library
82 - on-access scanning (Linux® and FreeBSD®)
83 - virus database updated multiple times per day (see home page for
84 total number of signatures)
85 - built-in support for various archive formats, including Zip, RAR,
86 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
87 - built-in support for almost all mail file formats
88 - built-in support for ELF executables and Portable Executable files
89 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
90 obfuscated with SUE, Y0da Cryptor and others
91 - built-in support for popular document formats including MS Office
92 and MacOffice files, HTML, RTF and PDF
94 %description -l pl.UTF-8
95 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
96 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
97 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
98 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
99 napisany w C i zgodny z POSIXem.
102 Summary: Shared libraries for clamav
103 Summary(pl.UTF-8): Biblioteki dzielone clamav
107 Shared libraries for clamav.
109 %description libs -l pl.UTF-8
110 Biblioteki dzielone clamav.
113 Summary: ClamAV filter using milter interface
114 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
116 Requires: %{name} = %{epoch}:%{version}-%{release}
118 #Requires: sendmail >= 8.11
119 Requires: tcp_wrappers
122 ClamAV sendmail filter using MILTER interface.
124 %description milter -l pl.UTF-8
125 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
128 Summary: clamav - Development header files and libraries
129 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
130 Group: Development/Libraries
131 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
132 Requires: bzip2-devel
137 This package contains the development header files and libraries
138 necessary to develop clamav client applications.
140 %description devel -l pl.UTF-8
141 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
145 Summary: clamav static libraries
146 Summary(pl.UTF-8): Biblioteki statyczne clamav
147 Group: Development/Libraries
148 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
151 clamav static libraries.
153 %description static -l pl.UTF-8
154 Biblioteki statyczne clamav.
171 %{?with_milter:--enable-milter} \
172 --with-dbdir=/var/lib/%{name} \
174 --with-ltdl-include=/usr/include \
175 --with-ltdl-lib=%{_libdir}
178 LIBTOOL=/usr/bin/libtool
181 rm -rf $RPM_BUILD_ROOT
182 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
183 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
184 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
187 LIBTOOL=/usr/bin/libtool \
188 DESTDIR=$RPM_BUILD_ROOT
189 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
191 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
192 5 * * * * root %{_sbindir}/clamav-cron-updatedb
195 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
197 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
198 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
200 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
201 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
202 cp -p etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
203 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
205 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
207 install %{SOURCE10} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
209 # Not packaged/installed anymore, but we want it ghosted
210 touch $RPM_BUILD_ROOT/var/lib/clamav/{daily,main}.cvd
212 # NOTE: clamd uses sane rights to it's clamd.pid file
213 # So better keep it dir
214 # If it is fixed use of dir will be unecesary
215 install -d $RPM_BUILD_ROOT/var/run/%{name}
217 :> $RPM_BUILD_ROOT/var/log/freshclam.log
220 rm -rf $RPM_BUILD_ROOT
222 %triggerin -- amavis-ng
223 %addusertogroup -q clamav amavis
225 %triggerin -- amavisd-new
226 %addusertogroup -q clamav amavis
228 %triggerin -- amavisd
229 %addusertogroup -q clamav amavis
232 %groupadd -g 43 clamav
233 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
236 /sbin/chkconfig --add clamd
237 %service clamd restart "Clam Antivirus daemon"
238 touch /var/log/freshclam.log
239 chown clamav:root /var/log/freshclam.log
240 chmod 640 /var/log/freshclam.log
243 if [ "$1" = "0" ]; then
245 /sbin/chkconfig --del clamd
249 if [ "$1" = "0" ]; then
254 %triggerpostun -- %{name} < 0.80
255 if [ -f /etc/clamav.conf.rpmsave ]; then
256 echo "Renaming config to new name /etc/clamd.conf"
257 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
258 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
259 echo "Changing config location in freshclam config"
260 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
263 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
264 %{__cp} -f /etc/clamd.conf{,.rpmsave}
267 s,^FixStaleSocket$,& yes,
268 s,^AllowSupplementaryGroups$,& yes,
269 s,^ClamukoScanOnOpen$,& yes,
270 s,^ClamukoScanOnClose$,& yes,
271 s,^ClamukoScanOnExec$,& yes,
275 %banner -e %{name}-0.90 <<EOF
276 ClamAV config was automatically upgraded to 0.90 format. You should review it
277 that it's still valid.
280 # unfortunately clamd has no configcheck option so we just have to start it
281 # once again after config was broken after upgrade
282 touch /var/lock/subsys/clamd
283 %service -q clamd restart
286 /sbin/chkconfig --add clamav-milter
287 %service clamav-milter restart "Clam Antivirus daemon"
290 if [ "$1" = "0" ]; then
291 %service clamav-milter stop
292 /sbin/chkconfig --del clamav-milter
295 %post libs -p /sbin/ldconfig
296 %postun libs -p /sbin/ldconfig
299 %defattr(644,root,root,755)
300 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
301 %attr(755,root,root) %{_bindir}/clambc
302 %attr(755,root,root) %{_bindir}/clamdscan
303 %attr(755,root,root) %{_bindir}/clamdtop
304 %attr(755,root,root) %{_bindir}/clamscan
305 %attr(755,root,root) %{_bindir}/freshclam
306 %attr(755,root,root) %{_bindir}/sigtool
307 %attr(755,root,root) %{_bindir}/clamconf
308 %attr(755,root,root) %{_sbindir}/clamd
309 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
310 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
311 /usr/lib/tmpfiles.d/%{name}.conf
312 %attr(755,clamav,root) %dir /var/lib/%{name}
313 %attr(644,clamav,root) %ghost %verify(not md5 mtime size) /var/lib/clamav/*.cvd
314 %attr(640,clamav,root) %ghost /var/log/freshclam.log
315 %attr(750,clamav,clamav) %dir /var/run/%{name}
317 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
318 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
319 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
321 %attr(754,root,root) /etc/rc.d/init.d/clamd
322 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
323 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
325 %{_mandir}/man8/clamd*
329 %defattr(644,root,root,755)
330 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
331 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
332 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
333 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
334 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
335 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
336 %attr(755,root,root) %{_sbindir}/clamav-milter
337 %{_mandir}/man8/clamav-milter.8*
338 %attr(700,clamav,clamav) /var/spool/clamav
342 %defattr(644,root,root,755)
343 %attr(755,root,root) %{_libdir}/lib*.so.*.*
344 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
345 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
346 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_bindir}/clamav-config
351 %attr(755,root,root) %{_libdir}/lib*.so
354 %{_pkgconfigdir}/*.pc
357 %defattr(644,root,root,755)