2 # - Make freshclam (script and daemon)
3 # - trigger for 0.90 config
4 # - check how the "scripted updates" work (instead of old full cvd download)
7 %bcond_without milter # build without milter subpackage
8 %bcond_without database # build without databases subpackage
9 %bcond_with curl # enable curl support
14 Summary: An anti-virus utility for Unix
15 Summary(pl): Narzêdzie antywirusowe dla Uniksów
18 Release: 0.%{_rc}.%{_rel}
22 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}%{_rc}.tar.gz
23 # Source0-md5: 91da47456ed28a7cfbfe17b033e15121
25 Source2: %{name}.sysconfig
26 Source3: %{name}-milter.init
27 Source4: %{name}-cron-updatedb
28 Source5: %{name}.logrotate
30 # Remember to update date after databases upgrade
31 %define database_version 20061105
32 Source6: http://db.local.clamav.net/daily.cvd
33 # Source6-md5: a39e9288913b4bae43823bf9d1bfad76
34 Source7: http://db.local.clamav.net/main.cvd
35 # Source7-md5: 347c99544205184fbc1bd23fd7cfd782
36 Source8: %{name}-post-updatedb
38 Source9: %{name}-milter.sysconfig
39 Patch0: %{name}-pld_config.patch
40 Patch1: %{name}-no_auto_libwrap.patch
41 Patch2: %{name}-nolibs.patch
42 URL: http://www.clamav.net/
43 BuildRequires: autoconf
44 BuildRequires: automake
45 BuildRequires: bzip2-devel
46 %{?with_curl:BuildRequires: curl-devel}
47 BuildRequires: gmp-devel
48 BuildRequires: libtool
49 %{?with_milter:BuildRequires: libwrap-devel}
50 BuildRequires: rpmbuild(macros) >= 1.268
51 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
52 BuildRequires: zlib-devel
53 Requires(post,preun): /sbin/chkconfig
54 Requires(postun): /usr/sbin/groupdel
55 Requires(postun): /usr/sbin/userdel
56 Requires(postun,pre): /usr/sbin/usermod
57 Requires(pre): /bin/id
58 Requires(pre): /usr/bin/getgid
59 Requires(pre): /usr/sbin/groupadd
60 Requires(pre): /usr/sbin/useradd
61 Requires(triggerpostun): sed >= 4.0
62 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
63 Requires: /usr/sbin/usermod
66 Provides: group(clamav)
67 Provides: user(clamav)
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
72 AMaViS, compressed files, on-access scanning and includes a program
73 for auto-updating with support for digital signatures. The virus
74 database has over 34000 viruses, worms and trojans signatures. The
75 scanner is multithreaded, written in C, and POSIX compliant.
78 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
79 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
80 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
81 Baza wirusów zawiera ponad 34000 sygnatur. Skaner jest wielow±tkowy,
82 napisany w C i zgodny z POSIXem.
85 Summary: Shared libraries for clamav
86 Summary(pl): Biblioteki dzielone clamav
90 Shared libraries for clamav.
92 %description libs -l pl
93 Biblioteki dzielone clamav.
96 Summary: ClamAV filter using milter interface
97 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
99 Requires: %{name} = %{epoch}:%{version}-%{release}
100 Requires: sendmail >= 8.11
101 Requires: tcp_wrappers
104 ClamAV sendmail filter using MILTER interface.
106 %description milter -l pl
107 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
110 Summary: clamav - Development header files and libraries
111 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
112 Group: Development/Libraries
113 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
114 Requires: bzip2-devel
119 This package contains the development header files and libraries
120 necessary to develop clamav client applications.
122 %description devel -l pl
123 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
127 Summary: clamav static libraries
128 Summary(pl): Biblioteki statyczne clamav
129 Group: Development/Libraries
130 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
133 clamav static libraries.
135 %description static -l pl
136 Biblioteki statyczne clamav.
139 Summary: Virus database for clamav
140 Summary(pl): Bazy wirusów dla clamav
141 Version: %{_ver}.%{database_version}
142 Group: Applications/Databases
145 %description database
146 Virus database for clamav (updated %{database_version}).
148 %description database -l pl
149 Bazy wirusów dla clamav (aktualizowana %{database_version}).
152 %setup -q %{?_rc:-n %{name}-%{_ver}%{_rc}}
157 # kill old libtool.m4 copy
158 head -n 489 acinclude.m4 > acinclude.m4.tmp
159 tail -n +4089 acinclude.m4 >> acinclude.m4.tmp
160 mv -f acinclude.m4.tmp acinclude.m4
170 %{!?with_curl:--without-libcurl} \
171 %{?with_milter:--enable-milter} \
172 --with-dbdir=/var/lib/%{name}
176 rm -rf $RPM_BUILD_ROOT
177 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
178 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
181 DESTDIR=$RPM_BUILD_ROOT
182 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
184 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
185 5 * * * * root %{_sbindir}/clamav-cron-updatedb
188 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
190 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
191 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
193 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
194 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
195 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
196 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
199 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
200 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
201 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
203 rm -f $RPM_BUILD_ROOT/var/lib/%{name}/{main,daily}.cvd
206 # NOTE: clamd uses sane rights to it's clamd.pid file
207 # So better keep it dir
208 # If it is fixed use of dir will be unecesary
209 install -d $RPM_BUILD_ROOT/var/run/%{name}
211 :> $RPM_BUILD_ROOT/var/log/freshclam.log
214 rm -rf $RPM_BUILD_ROOT
216 %triggerin -- amavis-ng
217 AMAVIS=$(/usr/bin/getgid amavis)
219 if [ $RESULT -eq 0 ]; then
220 echo "Adding clamav to amavis group GID=$AMAVIS"
221 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
224 %triggerin -- amavisd-new
225 AMAVIS=$(/usr/bin/getgid amavis)
227 if [ $RESULT -eq 0 ]; then
228 echo "Adding clamav to amavis group GID=$AMAVIS"
229 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
232 %triggerin -- amavisd
233 AMAVIS=$(/usr/bin/getgid amavis)
235 if [ $RESULT -eq 0 ]; then
236 echo "Adding clamav to amavis group GID=$AMAVIS"
237 /usr/sbin/usermod -G amavis clamav 1>&2
241 %groupadd -g 43 clamav
242 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
244 # FIXME: check this. is it proper after useradd macro?
245 # TODO: use addusertogroup macro?
246 if [ -n "`/usr/bin/getgid amavis`" ]; then
247 echo "Adding clamav to amavis group"
248 /usr/sbin/usermod -G amavis clamav 1>&2
252 /sbin/chkconfig --add clamd
253 %service clamd restart "Clam Antivirus daemon"
254 touch /var/log/freshclam.log
255 chown clamav:root /var/log/freshclam.log
256 chmod 640 /var/log/freshclam.log
259 if [ "$1" = "0" ]; then
261 /sbin/chkconfig --del clamd
265 if [ "$1" = "0" ]; then
270 %triggerpostun -- %{name} <= 0.75.1
271 if [ -f /etc/clamav.conf.rpmsave ]; then
272 echo "Renaming config to new name /etc/clamd.conf"
273 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
274 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
275 echo "Changing config location in freshclam config"
276 sed -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
280 /sbin/chkconfig --add clamav-milter
281 %service clamav-milter restart "Clam Antivirus daemon"
284 if [ "$1" = "0" ]; then
285 %service clamav-milter stop
286 /sbin/chkconfig --del clamav-milter
289 %post libs -p /sbin/ldconfig
290 %postun libs -p /sbin/ldconfig
292 %post database -p %{_sbindir}/%{name}-post-updatedb
295 %defattr(644,root,root,755)
296 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/*.pdf
297 %attr(755,root,root) %{_bindir}/clamdscan
298 %attr(755,root,root) %{_bindir}/clamscan
299 %attr(755,root,root) %{_bindir}/freshclam
300 %attr(755,root,root) %{_bindir}/sigtool
301 %attr(755,root,root) %{_bindir}/clamconf
302 %attr(755,root,root) %{_sbindir}/clamd
303 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
304 %attr(755,clamav,root) %dir /var/lib/%{name}
305 %attr(640,clamav,root) %ghost /var/log/freshclam.log
306 %attr(750,clamav,clamav) %dir /var/run/%{name}
308 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
309 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
310 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
312 %attr(754,root,root) /etc/rc.d/init.d/clamd
313 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
314 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
316 %{_mandir}/man8/clamd*
320 %defattr(644,root,root,755)
321 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
322 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
323 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
324 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
325 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
326 %attr(755,root,root) %{_sbindir}/clamav-milter
327 %{_mandir}/man8/clamav-milter.8*
328 %attr(700,clamav,clamav) /var/spool/clamav
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_libdir}/lib*.so.*.*
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_bindir}/clamav-config
338 %attr(755,root,root) %{_libdir}/lib*.so
341 %{_pkgconfigdir}/*.pc
344 %defattr(644,root,root,755)
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
351 %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/%{name}/*.cvd