2 # Make freshclam (script and daemon)
5 %bcond_with milter # build milter subpackage
6 %bcond_with curl # enable curl support
8 Summary: An anti-virus utility for Unix
9 Summary(pl): Antywirusowe narzêdzie dla Uniksów
15 Source0: http://heanet.dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
16 # Source0-md5: 59bf21e169a35d7e9c27a34435f9b870
17 # Source0-size: 2668125
19 Source2: %{name}.sysconfig
20 Source3: %{name}-milter.init
21 Source4: %{name}-cron-updatedb
22 Source5: %{name}.logrotate
23 # Remember to update date after databases upgrade
24 %define database_version 20041019
25 Source6: http://db.local.clamav.net/daily.cvd
26 # Source6-md5: cee37166f11f509143d61b0e9d3cfeff
27 # Source6-size: 100250
28 Source7: http://db.local.clamav.net/main.cvd
29 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
30 # Source7-size: 1284637
31 Source8: %{name}-post-updatedb
32 Source9: %{name}-milter.sysconfig
33 Patch0: %{name}-pld_config.patch
34 Patch1: %{name}-no_auto_libwrap.patch
35 Patch2: %{name}-nolibs.patch
36 URL: http://www.clamav.net/
37 BuildRequires: autoconf
38 BuildRequires: automake
39 %{?with_curl:BuildRequires: curl-devel}
40 BuildRequires: gmp-devel
41 %{?with_milter:BuildRequires: libwrap-devel}
42 BuildRequires: libtool
43 BuildRequires: rpmbuild(macros) >= 1.159
44 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
45 BuildRequires: zlib-devel
46 Requires(pre): /bin/id
47 Requires(pre): /usr/bin/getgid
48 Requires(pre): /usr/sbin/groupadd
49 Requires(pre): /usr/sbin/useradd
50 Requires(postun): /usr/sbin/groupdel
51 Requires(postun): /usr/sbin/userdel
52 Requires(postun,pre): /usr/sbin/usermod
53 Requires(post,preun): /sbin/chkconfig
54 Requires: /usr/sbin/usermod
55 Requires: %{name}-libs = %{version}-%{release}
57 Provides: group(clamav)
58 Provides: user(clamav)
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
63 AMaViS, compressed files, on-access scanning and includes a program
64 for auto-updating with support for digital signatures. The virus
65 database has over 25000 viruses, worms and trojans signatures. The
66 scanner is multithreaded, written in C, and POSIX compliant.
69 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
70 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
71 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
72 Baza wirusów zawiera ponad 25000 sygnatur. Skaner jest wielow±tkowy,
73 napisany w C i zgodny z POSIXem.
76 Summary: Shared libraries for clamav
77 Summary(pl): Biblioteki dzielone clamav
81 Shared libraries for clamav.
83 %description libs -l pl
84 Biblioteki dzielone clamav.
87 Summary: ClamAV filter using milter interface
88 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
90 Requires: %{name} = %{epoch}:%{version}-%{release}
91 Requires: sendmail >= 8.11
92 Requires: tcp_wrappers
95 ClamAV sendmail filter using MILTER interface.
97 %description -l pl milter
98 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
101 Summary: clamav - Development header files and libraries
102 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
103 Group: Development/Libraries
104 Requires: %{name}-libs = %{version}-%{release}
105 Requires: bzip2-devel
110 This package contains the development header files and libraries
111 necessary to develop clamav client applications.
113 %description devel -l pl
114 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
118 Summary: clamav static libraris
119 Summary(pl): Biblioteki statyczne clamav
120 Group: Development/Libraries
121 Requires: %{name}-devel = %{version}-%{release}
124 clamav static libraries.
126 %description static -l pl
127 Biblioteki statyczne clamav.
130 Summary: Virus database for clamav
131 Summary(pl): Bazy wirusów dla clamav
133 Version: %{version}.%{database_version}
136 %description database
137 Virus database for clamav (updated %{database_version}).
139 %description database -l pl
140 Bazy wirusów dla clamav (aktualizowana %{database_version}).
148 # kill old libtool.m4 copy
149 head -n 489 acinclude.m4 > acinclude.m4.tmp
150 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
151 mv -f acinclude.m4.tmp acinclude.m4
161 %{!?with_curl:--without-libcurl} \
162 %{?with_milter:--enable-milter} \
163 --with-dbdir=/var/lib/%{name}
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
169 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
172 DESTDIR=$RPM_BUILD_ROOT
173 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
175 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/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}
188 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
189 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
190 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
192 # NOTE: clamd uses sane rights to it's clamd.pid file
193 # So better keep it dir
194 # If it is fixed use of dir will be unecesary
195 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
197 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
200 rm -rf $RPM_BUILD_ROOT
202 %triggerin -- amavis-ng
203 AMAVIS=$(/usr/bin/getgid amavis)
205 if [ $RESULT -eq 0 ]; then
206 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
207 echo "adding clamav to amavis group GID=$AMAVIS"
210 %triggerin -- amavisd-new
211 AMAVIS=$(/usr/bin/getgid amavis)
213 if [ $RESULT -eq 0 ]; then
214 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
215 echo "adding clamav to amavis group GID=$AMAVIS"
218 %triggerin -- amavisd
219 AMAVIS=$(/usr/bin/getgid amavis)
221 if [ $RESULT -eq 0 ]; then
222 echo "adding clamav to amavis group GID=$AMAVIS"
223 /usr/sbin/usermod -G amavis clamav 1>&2
227 if [ -n "`/usr/bin/getgid clamav`" ]; then
228 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
229 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
233 echo "Adding group clamav GID=43"
234 /usr/sbin/groupadd -g 43 clamav
236 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
237 if [ "`/bin/id -u clamav`" != 43 ]; then
238 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
242 echo "Adding user clamav UID=43"
243 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
244 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
245 if [ -n "`/usr/bin/getgid amavis`" ]; then
246 echo "adding clamav to amavis group"
247 /usr/sbin/usermod -G amavis clamav 1>&2
252 /sbin/chkconfig --add clamd
253 if [ -f /var/lock/subsys/clamd ]; then
254 /etc/rc.d/init.d/clamd restart >&2
256 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
258 touch %{_var}/log/freshclam.log
259 chown clamav:root %{_var}/log/freshclam.log
260 chmod 640 %{_var}/log/freshclam.log
263 if [ "$1" = "0" ]; then
264 if [ -f /var/lock/subsys/clamd ]; then
265 /etc/rc.d/init.d/clamd stop
267 /sbin/chkconfig --del clamd
271 if [ "$1" = "0" ]; then
276 %triggerpostun -- %{name} <= 0.75.1
277 if [ -f /etc/clamav.conf.rpmsave ]; then
278 echo "Renaming config to new name /etc/clamd.conf"
279 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
280 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
285 /sbin/chkconfig --add clamav-milter
286 if [ -f /var/lock/subsys/clamav-milter ]; then
287 /etc/rc.d/init.d/clamd restart >&2
289 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
293 if [ "$1" = "0" ]; then
294 if [ -f /var/lock/subsys/clamav-milter ]; then
295 /etc/rc.d/init.d/clamav-milter stop
297 /sbin/chkconfig --del clamav-milter
300 %post libs -p /sbin/ldconfig
301 %postun libs -p /sbin/ldconfig
303 %post database -p %{_sbindir}/%{name}-post-updatedb
306 %defattr(644,root,root,755)
307 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
308 %attr(755,root,root) %{_bindir}/clamdscan
309 %attr(755,root,root) %{_bindir}/clamscan
310 %attr(755,root,root) %{_bindir}/freshclam
311 %attr(755,root,root) %{_bindir}/sigtool
312 %attr(755,root,root) %{_sbindir}/clamd
313 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
314 %attr(755,clamav,root) %dir /var/lib/%{name}
315 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
316 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
318 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
319 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
320 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
322 %attr(754,root,root) /etc/rc.d/init.d/clamd
323 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
324 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
326 %{_mandir}/man8/clamd*
330 %defattr(644,root,root,755)
331 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
332 %attr(755,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.*.*
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_bindir}/clamav-config
348 %attr(755,root,root) %{_libdir}/lib*.so
351 %{_pkgconfigdir}/*.pc
354 %defattr(644,root,root,755)
358 %defattr(644,root,root,755)
359 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
360 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd