2 # Make freshclam (script and daemon)
5 %bcond_with milter # without milter subpackage
6 %bcond_with curl # without curl
8 Summary: An anti-virus utility for Unix
9 Summary(pl): Antywirusowe narzêdzie dla Uniksów
15 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
16 # Source0-md5: 5c02d52c361f04098a9956478f8654a0
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 20041016
25 Source6: http://db.local.clamav.net/daily.cvd
26 # Source6-md5: 0407cabd808a894c5fdc6b4e79dff265
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_curl:BuildRequires: libidn-devel}
42 %{?with_milter:BuildRequires: libwrap-devel}
43 BuildRequires: libtool
44 BuildRequires: rpmbuild(macros) >= 1.159
45 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
46 BuildRequires: zlib-devel
47 Requires(pre): /bin/id
48 Requires(pre): /usr/bin/getgid
49 Requires(pre): /usr/sbin/groupadd
50 Requires(pre): /usr/sbin/useradd
51 Requires(postun): /usr/sbin/groupdel
52 Requires(postun): /usr/sbin/userdel
53 Requires(postun,pre): /usr/sbin/usermod
54 Requires(post,preun): /sbin/chkconfig
55 Requires: /usr/sbin/usermod
56 Requires: %{name}-libs = %{version}-%{release}
58 %{?with_curl:Requires: curl}
59 Provides: group(clamav)
60 Provides: user(clamav)
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
65 AMaViS, compressed files, on-access scanning and includes a program
66 for auto-updating with support for digital signatures. The virus
67 database has over 25000 viruses, worms and trojans signatures. The
68 scanner is multithreaded, written in C, and POSIX compliant.
71 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
72 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
73 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
74 Baza wirusów zawiera ponad 25000 sygnatur. Skaner jest wielow±tkowy,
75 napisany w C i zgodny z POSIXem.
78 Summary: Shared libraries for clamav
79 Summary(pl): Biblioteki dzielone clamav
83 Shared libraries for clamav.
85 %description libs -l pl
86 Biblioteki dzielone clamav.
89 Summary: ClamAV filter using milter interface
90 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
92 Requires: %{name} = %{epoch}:%{version}-%{release}
93 Requires: sendmail >= 8.11
94 Requires: tcp_wrappers
97 ClamAV sendmail filter using MILTER interface.
99 %description -l pl milter
100 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
103 Summary: clamav - Development header files and libraries
104 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
105 Group: Development/Libraries
106 Requires: %{name}-libs = %{version}-%{release}
107 Requires: bzip2-devel
112 This package contains the development header files and libraries
113 necessary to develop clamav client applications.
115 %description devel -l pl
116 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
120 Summary: clamav static libraris
121 Summary(pl): Biblioteki statyczne clamav
122 Group: Development/Libraries
123 Requires: %{name}-devel = %{version}-%{release}
126 clamav static libraries.
128 %description static -l pl
129 Biblioteki statyczne clamav.
132 Summary: Virus database for clamav
133 Summary(pl): Bazy wirusów dla clamav
135 Version: %{version}.%{database_version}
138 %description database
139 Virus database for clamav (updated %{database_version}).
141 %description database -l pl
142 Bazy wirusów dla clamav (aktualizowana %{database_version}).
150 # kill old libtool.m4 copy
151 head -n 489 acinclude.m4 > acinclude.m4.tmp
152 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
153 mv -f acinclude.m4.tmp acinclude.m4
163 %{?!with_curl:--without-libcurl} \
164 %{?with_milter:--enable-milter} \
165 --with-dbdir=/var/lib/%{name}
169 rm -rf $RPM_BUILD_ROOT
170 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
171 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
174 DESTDIR=$RPM_BUILD_ROOT
175 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
177 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
178 5 * * * * root %{_sbindir}/clamav-cron-updatedb
181 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
183 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
184 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
186 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
187 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
188 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
189 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
190 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
191 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
192 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
194 # NOTE: clamd uses sane rights to it's clamd.pid file
195 # So better keep it dir
196 # If it is fixed use of dir will be unecesary
197 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
199 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
202 rm -rf $RPM_BUILD_ROOT
204 %triggerin -- amavis-ng
205 AMAVIS=$(/usr/bin/getgid amavis)
207 if [ $RESULT -eq 0 ]; then
208 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
209 echo "adding clamav to amavis group GID=$AMAVIS"
212 %triggerin -- amavisd-new
213 AMAVIS=$(/usr/bin/getgid amavis)
215 if [ $RESULT -eq 0 ]; then
216 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
217 echo "adding clamav to amavis group GID=$AMAVIS"
220 %triggerin -- amavisd
221 AMAVIS=$(/usr/bin/getgid amavis)
223 if [ $RESULT -eq 0 ]; then
224 echo "adding clamav to amavis group GID=$AMAVIS"
225 /usr/sbin/usermod -G amavis clamav 1>&2
229 if [ -n "`/usr/bin/getgid clamav`" ]; then
230 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
231 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
235 echo "Adding group clamav GID=43"
236 /usr/sbin/groupadd -g 43 clamav
238 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
239 if [ "`/bin/id -u clamav`" != 43 ]; then
240 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
244 echo "Adding user clamav UID=43"
245 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
246 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
247 if [ -n "`/usr/bin/getgid amavis`" ]; then
248 echo "adding clamav to amavis group"
249 /usr/sbin/usermod -G amavis clamav 1>&2
254 /sbin/chkconfig --add clamd
255 if [ -f /var/lock/subsys/clamd ]; then
256 /etc/rc.d/init.d/clamd restart >&2
258 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
260 touch %{_var}/log/freshclam.log
261 chown clamav:root %{_var}/log/freshclam.log
262 chmod 640 %{_var}/log/freshclam.log
265 if [ "$1" = "0" ]; then
266 if [ -f /var/lock/subsys/clamd ]; then
267 /etc/rc.d/init.d/clamd stop
269 /sbin/chkconfig --del clamd
273 if [ "$1" = "0" ]; then
280 /sbin/chkconfig --add clamav-milter
281 if [ -f /var/lock/subsys/clamav-milter ]; then
282 /etc/rc.d/init.d/clamd restart >&2
284 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
288 if [ "$1" = "0" ]; then
289 if [ -f /var/lock/subsys/clamav-milter ]; then
290 /etc/rc.d/init.d/clamav-milter stop
292 /sbin/chkconfig --del clamav-milter
295 %post libs -p /sbin/ldconfig
296 %postun libs -p /sbin/ldconfig
298 %post database -p %{_sbindir}/%{name}-post-updatedb
301 %defattr(644,root,root,755)
302 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
303 %attr(755,root,root) %{_bindir}/clamdscan
304 %attr(755,root,root) %{_bindir}/clamscan
305 %attr(755,root,root) %{_bindir}/freshclam
306 %attr(755,root,root) %{_bindir}/sigtool
307 %attr(755,root,root) %{_sbindir}/clamd
308 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
309 %attr(755,clamav,root) %dir /var/lib/%{name}
310 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
311 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
313 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
314 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
315 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
317 %attr(754,root,root) /etc/rc.d/init.d/clamd
318 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
319 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
321 %{_mandir}/man8/clamd*
325 %defattr(644,root,root,755)
326 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
327 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
328 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
329 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
330 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
331 %attr(755,root,root) %{_sbindir}/clamav-milter
332 %{_mandir}/man8/clamav-milter.8*
333 %attr(700,clamav,clamav) /var/spool/clamav/
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/lib*.so.*.*
341 %defattr(644,root,root,755)
342 %attr(755,root,root) %{_bindir}/clamav-config
343 %attr(755,root,root) %{_libdir}/lib*.so
346 %{_pkgconfigdir}/*.pc
349 %defattr(644,root,root,755)
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
355 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd