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