2 # Make freshclam (script and daemon)
5 %bcond_with milter # without milter subpackage
7 Summary: An anti-virus utility for Unix
8 Summary(pl): Antywirusowe narzêdzie dla Uniksów
14 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
15 # Source0-md5: 2c85b7957eba9fd9e9ff8c2537ae006f
17 Source2: %{name}.sysconfig
18 Source3: %{name}-milter.init
19 Source4: %{name}-cron-updatedb
20 Source5: %{name}.logrotate
21 # Remember to update date after databases upgrade
22 %define database_version 20040731
23 Source6: http://www.clamav.net/database/daily.cvd
24 # Source6-md5: 8aa799fff39b3dd7c36a7dd796890b66
25 Source7: http://www.clamav.net/database/main.cvd
26 # Source7-md5: fb569320447dff5b22acdbec2dbc5772
27 Source8: %{name}-post-updatedb
28 Source9: %{name}-milter.sysconfig
29 Patch0: %{name}-pld_config.patch
30 Patch1: %{name}-no_auto_libwrap.patch
31 Patch2: %{name}-nolibs.patch
32 URL: http://www.clamav.net/
33 BuildRequires: autoconf
34 BuildRequires: automake
35 BuildRequires: gmp-devel
36 %{?with_milter:BuildRequires: libwrap-devel}
37 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
38 BuildRequires: zlib-devel
39 Requires(post,preun): /sbin/chkconfig
40 Requires: %{name}-libs = %{version}-%{release}
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
46 AMaViS, compressed files, on-access scanning and includes a program
47 for auto-updating with support for digital signatures. The virus
48 database has over 20000 viruses, worms and trojans signatures. The
49 scanner is multithreaded, written in C, and POSIX compliant.
52 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
53 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
54 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
55 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
56 napisany w C i zgodny z POSIXem.
59 Summary: Shared libraries for clamav
60 Summary(pl): Biblioteki dzielone clamav
64 Shared libraries for clamav.
66 %description libs -l pl
67 Biblioteki dzielone clamav.
70 Summary: ClamAV filter using milter interface
71 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
73 Requires: %{name} = %{epoch}:%{version}-%{release}
74 Requires: sendmail >= 8.11
75 Requires: tcp_wrappers
78 ClamAV sendmail filter using MILTER interface.
80 %description -l pl milter
81 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
84 Summary: clamav - Development header files and libraries
85 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
86 Group: Development/Libraries
87 Requires: %{name}-libs = %{version}-%{release}
93 This package contains the development header files and libraries
94 necessary to develop clamav client applications.
96 %description devel -l pl
97 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
101 Summary: clamav static libraris
102 Summary(pl): Biblioteki statyczne clamav
103 Group: Development/Libraries
104 Requires: %{name}-devel = %{version}-%{release}
107 clamav static libraries.
109 %description static -l pl
110 Biblioteki statyczne clamav.
113 Summary: Virus database for clamav
114 Summary(pl): Bazy wirusów dla clamav
116 Version: %{version}.%{database_version}
119 %description database
120 Virus database for clamav (updated %{database_version}).
122 %description database -l pl
123 Bazy wirusów dla clamav (aktualizowana %{database_version}).
131 # kill old libtool.m4 copy
132 head -n 489 acinclude.m4 > acinclude.m4.tmp
133 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
134 mv -f acinclude.m4.tmp acinclude.m4
144 %{?with_milter:--enable-milter} \
145 --with-dbdir=/var/lib/%{name}
149 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
151 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
154 DESTDIR=$RPM_BUILD_ROOT
155 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
157 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
158 5 * * * * root %{_sbindir}/clamav-cron-updatedb
161 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
163 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
164 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
166 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
167 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
168 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
169 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
170 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
171 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
172 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
174 # NOTE: clamd uses sane rights to it's clamd.pid file
175 # So better keep it dir
176 # If it is fixed use of dir will be unecesary
177 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
179 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
182 rm -rf $RPM_BUILD_ROOT
184 %triggerin -- amavis-ng
185 AMAVIS=$(/usr/bin/getgid amavis)
187 if [ $RESULT -eq 0 ]; then
188 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
189 echo "adding clamav to amavis group GID=$AMAVIS"
192 %triggerin -- amavisd-new
193 AMAVIS=$(/usr/bin/getgid amavis)
195 if [ $RESULT -eq 0 ]; then
196 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
197 echo "adding clamav to amavis group GID=$AMAVIS"
200 %triggerin -- amavisd
201 AMAVIS=$(/usr/bin/getgid amavis)
203 if [ $RESULT -eq 0 ]; then
204 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
205 echo "adding clamav to amavis group GID=$AMAVIS"
209 if [ -n "`getgid clamav`" ]; then
210 if [ "`getgid clamav`" != "43" ]; then
211 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
215 echo "Adding group clamav GID=43"
216 /usr/sbin/groupadd -g 43 -r -f clamav
218 if [ -n "`id -u clamav 2>/dev/null`" ]; then
219 if [ "`id -u clamav`" != "43" ]; then
220 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
224 echo "Adding user clamav UID=43"
225 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
229 /sbin/chkconfig --add clamd
230 if [ -f /var/lock/subsys/clamd ]; then
231 /etc/rc.d/init.d/clamd restart >&2
233 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
235 touch %{_var}/log/freshclam.log
236 chown clamav:root %{_var}/log/freshclam.log
237 chmod 640 %{_var}/log/freshclam.log
240 if [ "$1" = "0" ]; then
241 if [ -f /var/lock/subsys/clamd ]; then
242 /etc/rc.d/init.d/clamd stop
244 /sbin/chkconfig --del clamd
248 if [ "$1" = "0" ]; then
249 echo "Removing user clamav"
250 /usr/sbin/userdel clamav
251 echo "Removing group clamav"
252 /usr/sbin/groupdel clamav
257 /sbin/chkconfig --add clamav-milter
258 if [ -f /var/lock/subsys/clamav-milter ]; then
259 /etc/rc.d/init.d/clamd restart >&2
261 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
265 if [ "$1" = "0" ]; then
266 if [ -f /var/lock/subsys/clamav-milter ]; then
267 /etc/rc.d/init.d/clamav-milter stop
269 /sbin/chkconfig --del clamav-milter
272 %post libs -p /sbin/ldconfig
273 %postun libs -p /sbin/ldconfig
275 %post database -p %{_sbindir}/%{name}-post-updatedb
278 %defattr(644,root,root,755)
279 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
280 %attr(755,root,root) %{_bindir}/*
281 %attr(755,root,root) %{_sbindir}/*
282 %attr(755,clamav,root) %dir /var/lib/%{name}
283 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
284 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
286 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
287 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
288 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
290 %attr(754,root,root) /etc/rc.d/init.d/clamd
291 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
292 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
294 %{_mandir}/man8/clamd*
298 %defattr(644,root,root,755)
299 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
300 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
301 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
302 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
303 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
304 %attr(755,root,root) %{_sbindir}/clamav-milter
305 %{_mandir}/man8/clamav-milter.8*
306 %attr(700,clamav,clamav) /var/spool/clamav/
310 %defattr(644,root,root,755)
311 %attr(755,root,root) %{_libdir}/lib*.so.*.*
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_libdir}/lib*.so
318 %{_pkgconfigdir}/*.pc
321 %defattr(644,root,root,755)
325 %defattr(644,root,root,755)
326 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd