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
8 Summary: An anti-virus utility for Unix
9 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
16 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
17 # Source0-md5: 98590386ba9a69039580b1bf48ca038b
19 Source2: %{name}.sysconfig
20 Source3: %{name}-milter.init
21 Source4: %{name}-cron-updatedb
22 Source5: %{name}.logrotate
23 Source8: %{name}-post-updatedb
24 Source9: %{name}-milter.sysconfig
25 Patch0: %{name}-pld_config.patch
26 Patch1: %{name}-nolibs.patch
27 URL: http://www.clamav.net/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: bzip2-devel
31 BuildRequires: gmp-devel
32 %{?with_milter:BuildRequires: libmilter-devel}
33 BuildRequires: libtool
34 %{?with_milter:BuildRequires: libwrap-devel}
35 BuildRequires: rpmbuild(macros) >= 1.514
36 BuildRequires: zlib-devel
37 Requires(post,preun): /sbin/chkconfig
38 Requires(postun): /usr/sbin/groupdel
39 Requires(postun): /usr/sbin/userdel
40 Requires(postun,pre): /usr/sbin/usermod
41 Requires(pre): /bin/id
42 Requires(pre): /usr/bin/getgid
43 Requires(pre): /usr/sbin/groupadd
44 Requires(pre): /usr/sbin/useradd
45 Requires(triggerpostun): sed >= 4.0
46 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
47 Requires: /usr/sbin/usermod
50 Provides: group(clamav)
51 Provides: user(clamav)
52 Conflicts: logrotate < 3.7-4
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
57 especially for e-mail scanning on mail gateways. It provides a number
58 of utilities including a flexible and scalable multi-threaded daemon,
59 a command line scanner and advanced tool for automatic database
60 updates. The core of the package is an anti-virus engine available in
61 a form of shared library.
63 Here is a list of the main features:
64 - command-line scanner
65 - fast, multi-threaded daemon with support for on-access scanning
66 - milter interface for sendmail
67 - advanced database updater with support for scripted updates and
69 - virus scanner C library
70 - on-access scanning (Linux® and FreeBSD®)
71 - virus database updated multiple times per day (see home page for
72 total number of signatures)
73 - built-in support for various archive formats, including Zip, RAR,
74 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
75 - built-in support for almost all mail file formats
76 - built-in support for ELF executables and Portable Executable files
77 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
78 obfuscated with SUE, Y0da Cryptor and others
79 - built-in support for popular document formats including MS Office
80 and MacOffice files, HTML, RTF and PDF
82 %description -l pl.UTF-8
83 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
84 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
85 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
86 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
87 napisany w C i zgodny z POSIXem.
90 Summary: Shared libraries for clamav
91 Summary(pl.UTF-8): Biblioteki dzielone clamav
95 Shared libraries for clamav.
97 %description libs -l pl.UTF-8
98 Biblioteki dzielone clamav.
101 Summary: ClamAV filter using milter interface
102 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
104 Requires: %{name} = %{epoch}:%{version}-%{release}
105 Requires: sendmail >= 8.11
106 Requires: tcp_wrappers
109 ClamAV sendmail filter using MILTER interface.
111 %description milter -l pl.UTF-8
112 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
115 Summary: clamav - Development header files and libraries
116 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
117 Group: Development/Libraries
118 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
119 Requires: bzip2-devel
124 This package contains the development header files and libraries
125 necessary to develop clamav client applications.
127 %description devel -l pl.UTF-8
128 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
132 Summary: clamav static libraries
133 Summary(pl.UTF-8): Biblioteki statyczne clamav
134 Group: Development/Libraries
135 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
138 clamav static libraries.
140 %description static -l pl.UTF-8
141 Biblioteki statyczne clamav.
156 %{?with_milter:--enable-milter} \
157 --with-dbdir=/var/lib/%{name} \
159 --with-ltdl-include=/usr/include \
160 --with-ltdl-lib=%{_libdir}
163 LIBTOOL=/usr/bin/libtool
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
168 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
171 LIBTOOL=/usr/bin/libtool \
172 DESTDIR=$RPM_BUILD_ROOT
173 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
175 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
176 5 * * * * root %{_sbindir}/clamav-cron-updatedb
179 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
181 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
182 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
184 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
185 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
186 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
187 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
189 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
191 # NOTE: clamd uses sane rights to it's clamd.pid file
192 # So better keep it dir
193 # If it is fixed use of dir will be unecesary
194 install -d $RPM_BUILD_ROOT/var/run/%{name}
196 :> $RPM_BUILD_ROOT/var/log/freshclam.log
199 rm -rf $RPM_BUILD_ROOT
201 %triggerin -- amavis-ng
202 %addusertogroup -q clamav amavis
204 %triggerin -- amavisd-new
205 %addusertogroup -q clamav amavis
207 %triggerin -- amavisd
208 %addusertogroup -q clamav amavis
211 %groupadd -g 43 clamav
212 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
215 /sbin/chkconfig --add clamd
216 %service clamd restart "Clam Antivirus daemon"
217 touch /var/log/freshclam.log
218 chown clamav:root /var/log/freshclam.log
219 chmod 640 /var/log/freshclam.log
222 if [ "$1" = "0" ]; then
224 /sbin/chkconfig --del clamd
228 if [ "$1" = "0" ]; then
233 %triggerpostun -- %{name} < 0.80
234 if [ -f /etc/clamav.conf.rpmsave ]; then
235 echo "Renaming config to new name /etc/clamd.conf"
236 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
237 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
238 echo "Changing config location in freshclam config"
239 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
242 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
243 %{__cp} -f /etc/clamd.conf{,.rpmsave}
246 s,^FixStaleSocket$,& yes,
247 s,^AllowSupplementaryGroups$,& yes,
248 s,^ClamukoScanOnOpen$,& yes,
249 s,^ClamukoScanOnClose$,& yes,
250 s,^ClamukoScanOnExec$,& yes,
254 %banner -e %{name}-0.90 <<EOF
255 ClamAV config was automatically upgraded to 0.90 format. You should review it
256 that it's still valid.
259 # unfortunately clamd has no configcheck option so we just have to start it
260 # once again after config was broken after upgrade
261 touch /var/lock/subsys/clamd
262 %service -q clamd restart
265 /sbin/chkconfig --add clamav-milter
266 %service clamav-milter restart "Clam Antivirus daemon"
269 if [ "$1" = "0" ]; then
270 %service clamav-milter stop
271 /sbin/chkconfig --del clamav-milter
274 %post libs -p /sbin/ldconfig
275 %postun libs -p /sbin/ldconfig
278 %defattr(644,root,root,755)
279 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
280 %attr(755,root,root) %{_bindir}/clamdscan
281 %attr(755,root,root) %{_bindir}/clamdtop
282 %attr(755,root,root) %{_bindir}/clamscan
283 %attr(755,root,root) %{_bindir}/freshclam
284 %attr(755,root,root) %{_bindir}/sigtool
285 %attr(755,root,root) %{_bindir}/clamconf
286 %attr(755,root,root) %{_sbindir}/clamd
287 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
288 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
289 %attr(755,clamav,root) %dir /var/lib/%{name}
290 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
291 %attr(640,clamav,root) %ghost /var/log/freshclam.log
292 %attr(750,clamav,clamav) %dir /var/run/%{name}
294 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
295 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
296 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
298 %attr(754,root,root) /etc/rc.d/init.d/clamd
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
300 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
302 %{_mandir}/man8/clamd*
306 %defattr(644,root,root,755)
307 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
308 %config(noreplace) %verify(not md5 mtime size) /etc/clamav-milter.conf
309 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
310 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
311 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
312 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
313 %attr(755,root,root) %{_sbindir}/clamav-milter
314 %{_mandir}/man8/clamav-milter.8*
315 %attr(700,clamav,clamav) /var/spool/clamav
319 %defattr(644,root,root,755)
320 %attr(755,root,root) %{_libdir}/lib*.so.*.*
321 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
322 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
323 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
326 %defattr(644,root,root,755)
327 %attr(755,root,root) %{_bindir}/clamav-config
328 %attr(755,root,root) %{_libdir}/lib*.so
331 %{_pkgconfigdir}/*.pc
334 %defattr(644,root,root,755)