2 # Make freshclam (script and daemon)
5 %bcond_without milter # build without milter subpackage
6 %bcond_without database # build without databases subpackage
7 %bcond_with curl # enable curl support
12 Summary: An anti-virus utility for Unix
13 Summary(pl): Narzêdzie antywirusowe dla Uniksów
16 Release: 0.%{_rc}.%{_rel}
20 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}%{?_rc}.tar.gz
21 # Source0-md5: 91da47456ed28a7cfbfe17b033e15121
23 Source2: %{name}.sysconfig
24 Source3: %{name}-milter.init
25 Source4: %{name}-cron-updatedb
26 Source5: %{name}.logrotate
28 # Remember to update date after databases upgrade
29 %define database_version 20060808
30 Source6: http://db.local.clamav.net/daily.cvd
31 # Source6-md5: 03dfca1179e8209fa9ece6e75025d72d
32 Source7: http://db.local.clamav.net/main.cvd
33 # Source7-md5: 258f99d2893c66c1584dd9a52a237c75
34 Source8: %{name}-post-updatedb
36 Source9: %{name}-milter.sysconfig
37 Patch0: %{name}-pld_config.patch
38 Patch1: %{name}-no_auto_libwrap.patch
39 Patch2: %{name}-nolibs.patch
40 URL: http://www.clamav.net/
41 BuildRequires: autoconf
42 BuildRequires: automake
43 BuildRequires: bzip2-devel
44 %{?with_curl:BuildRequires: curl-devel}
45 BuildRequires: gmp-devel
46 BuildRequires: libtool
47 %{?with_milter:BuildRequires: libwrap-devel}
48 BuildRequires: rpmbuild(macros) >= 1.268
49 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
50 BuildRequires: zlib-devel
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(postun,pre): /usr/sbin/usermod
55 Requires(pre): /bin/id
56 Requires(pre): /usr/bin/getgid
57 Requires(pre): /usr/sbin/groupadd
58 Requires(pre): /usr/sbin/useradd
59 Requires(triggerpostun): sed >= 4.0
60 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
61 Requires: /usr/sbin/usermod
64 Provides: group(clamav)
65 Provides: user(clamav)
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
70 AMaViS, compressed files, on-access scanning and includes a program
71 for auto-updating with support for digital signatures. The virus
72 database has over 34000 viruses, worms and trojans signatures. The
73 scanner is multithreaded, written in C, and POSIX compliant.
76 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
77 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
78 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
79 Baza wirusów zawiera ponad 34000 sygnatur. Skaner jest wielow±tkowy,
80 napisany w C i zgodny z POSIXem.
83 Summary: Shared libraries for clamav
84 Summary(pl): Biblioteki dzielone clamav
88 Shared libraries for clamav.
90 %description libs -l pl
91 Biblioteki dzielone clamav.
94 Summary: ClamAV filter using milter interface
95 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
97 Requires: %{name} = %{epoch}:%{version}-%{release}
98 Requires: sendmail >= 8.11
99 Requires: tcp_wrappers
102 ClamAV sendmail filter using MILTER interface.
104 %description milter -l pl
105 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
108 Summary: clamav - Development header files and libraries
109 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
110 Group: Development/Libraries
111 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
112 Requires: bzip2-devel
117 This package contains the development header files and libraries
118 necessary to develop clamav client applications.
120 %description devel -l pl
121 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
125 Summary: clamav static libraries
126 Summary(pl): Biblioteki statyczne clamav
127 Group: Development/Libraries
128 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
131 clamav static libraries.
133 %description static -l pl
134 Biblioteki statyczne clamav.
137 Summary: Virus database for clamav
138 Summary(pl): Bazy wirusów dla clamav
139 Version: %{_ver}.%{database_version}
140 Group: Applications/Databases
143 %description database
144 Virus database for clamav (updated %{database_version}).
146 %description database -l pl
147 Bazy wirusów dla clamav (aktualizowana %{database_version}).
150 %setup -q %{?_rc:-n %{name}-%{_ver}%{_rc}}
155 # kill old libtool.m4 copy
156 head -n 489 acinclude.m4 > acinclude.m4.tmp
157 tail -n +4089 acinclude.m4 >> acinclude.m4.tmp
158 mv -f acinclude.m4.tmp acinclude.m4
168 %{!?with_curl:--without-libcurl} \
169 %{?with_milter:--enable-milter} \
170 --with-dbdir=/var/lib/%{name}
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
176 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
179 DESTDIR=$RPM_BUILD_ROOT
180 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
182 cat <<EOF >$RPM_BUILD_ROOT/etc/cron.d/%{name}
183 5 * * * * root %{_sbindir}/clamav-cron-updatedb
186 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
188 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
189 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
191 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
192 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
193 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
194 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
197 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
198 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
199 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
201 rm -f $RPM_BUILD_ROOT/var/lib/%{name}/{main,daily}.cvd
204 # NOTE: clamd uses sane rights to it's clamd.pid file
205 # So better keep it dir
206 # If it is fixed use of dir will be unecesary
207 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
209 :> $RPM_BUILD_ROOT%{_var}/log/freshclam.log
212 rm -rf $RPM_BUILD_ROOT
214 %triggerin -- amavis-ng
215 AMAVIS=$(/usr/bin/getgid amavis)
217 if [ $RESULT -eq 0 ]; then
218 echo "Adding clamav to amavis group GID=$AMAVIS"
219 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
222 %triggerin -- amavisd-new
223 AMAVIS=$(/usr/bin/getgid amavis)
225 if [ $RESULT -eq 0 ]; then
226 echo "Adding clamav to amavis group GID=$AMAVIS"
227 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
230 %triggerin -- amavisd
231 AMAVIS=$(/usr/bin/getgid amavis)
233 if [ $RESULT -eq 0 ]; then
234 echo "Adding clamav to amavis group GID=$AMAVIS"
235 /usr/sbin/usermod -G amavis clamav 1>&2
239 %groupadd -g 43 clamav
240 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
242 # FIXME: check this. is it proper after useradd macro?
243 # TODO: use addusertogroup macro?
244 if [ -n "`/usr/bin/getgid amavis`" ]; then
245 echo "Adding clamav to amavis group"
246 /usr/sbin/usermod -G amavis clamav 1>&2
250 /sbin/chkconfig --add clamd
251 %service clamd restart "Clam Antivirus daemon"
252 touch %{_var}/log/freshclam.log
253 chown clamav:root %{_var}/log/freshclam.log
254 chmod 640 %{_var}/log/freshclam.log
257 if [ "$1" = "0" ]; then
259 /sbin/chkconfig --del clamd
263 if [ "$1" = "0" ]; then
268 %triggerpostun -- %{name} <= 0.75.1
269 if [ -f /etc/clamav.conf.rpmsave ]; then
270 echo "Renaming config to new name /etc/clamd.conf"
271 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
272 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
273 echo "Changing config location in freshclam config"
274 sed -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
278 /sbin/chkconfig --add clamav-milter
279 %service clamav-milter restart "Clam Antivirus daemon"
282 if [ "$1" = "0" ]; then
283 %service clamav-milter stop
284 /sbin/chkconfig --del clamav-milter
287 %post libs -p /sbin/ldconfig
288 %postun libs -p /sbin/ldconfig
290 %post database -p %{_sbindir}/%{name}-post-updatedb
293 %defattr(644,root,root,755)
294 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/*.pdf
295 %attr(755,root,root) %{_bindir}/clamdscan
296 %attr(755,root,root) %{_bindir}/clamscan
297 %attr(755,root,root) %{_bindir}/freshclam
298 %attr(755,root,root) %{_bindir}/sigtool
299 %attr(755,root,root) %{_sbindir}/clamd
300 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
301 %attr(755,clamav,root) %dir /var/lib/%{name}
302 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
303 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
305 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
306 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
307 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
309 %attr(754,root,root) /etc/rc.d/init.d/clamd
310 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
311 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
313 %{_mandir}/man8/clamd*
317 %defattr(644,root,root,755)
318 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
319 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
320 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
321 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
322 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
323 %attr(755,root,root) %{_sbindir}/clamav-milter
324 %{_mandir}/man8/clamav-milter.8*
325 %attr(700,clamav,clamav) /var/spool/clamav
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_libdir}/lib*.so.*.*
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_bindir}/clamav-config
335 %attr(755,root,root) %{_libdir}/lib*.so
338 %{_pkgconfigdir}/*.pc
341 %defattr(644,root,root,755)
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
348 %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/%{name}/*.cvd