2 # Make freshclam (script and daemon)
5 %bcond_without 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 URL: http://www.clamav.net/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: gmp-devel
35 BuildRequires: zlib-devel
36 Requires(post,preun): /sbin/chkconfig
37 Requires: %{name}-libs = %{version}-%{release}
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
43 AMaViS, compressed files, on-access scanning and includes a program
44 for auto-updating with support for digital signatures. The virus
45 database has over 20000 viruses, worms and trojans signatures. The
46 scanner is multithreaded, written in C, and POSIX compliant.
49 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
50 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
51 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
52 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
53 napisany w C i zgodny z POSIXem.
56 Summary: Shared libraries for clamav
57 Summary(pl): Biblioteki dzielone clamav
61 Shared libraries for clamav.
63 %description libs -l pl
64 Biblioteki dzielone clamav.
67 Summary: Clamav milter
69 Requires: %{name} = %{epoch}:%{version}-%{release}
70 Requires: sendmail >= 8.11
71 Requires: tcp_wrappers
72 BuildRequires: sendmail-devel >= 8.11
73 BuildRequires: tcp_wrappers
76 ClamAV sendmail filter using MILTER interface.
78 %description -l pl milter
79 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
82 Summary: clamav - Development header files and libraries
83 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
84 Group: Development/Libraries
85 Requires: %{name}-libs = %{version}-%{release}
88 This package contains the development header files and libraries
89 necessary to develop clamav client applications.
91 %description devel -l pl
92 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
96 Summary: clamav static libraris
97 Summary(pl): Biblioteki statyczne clamav
98 Group: Development/Libraries
99 Requires: %{name}-devel = %{version}-%{release}
102 clamav static libraries.
104 %description static -l pl
105 Biblioteki statyczne clamav.
108 Summary: Virus database for clamav
109 Summary(pl): Bazy wirusów dla clamav
111 Version: %{version}.%{database_version}
114 %description database
115 Virus database for clamav (updated %{database_version}).
117 %description database -l pl
118 Bazy wirusów dla clamav (aktualizowana %{database_version}).
131 %{?_with_milter:--enable-milter} \
132 --with-dbdir=/var/lib/%{name}
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
138 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
141 DESTDIR=$RPM_BUILD_ROOT
142 %{?_without_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
144 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
145 5 * * * * root %{_sbindir}/clamav-cron-updatedb
148 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
149 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
150 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
151 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
152 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
153 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/
154 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
155 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}/
156 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}/
157 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
159 # NOTE: clamd uses sane rights to it's clamd.pid file
160 # So better keep it dir
161 # If it is fixed use of dir will be unecesary
162 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
164 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
167 rm -rf $RPM_BUILD_ROOT
169 %triggerin -- amavis-ng
170 AMAVIS=$(/usr/bin/getgid amavis)
172 if [ $RESULT -eq 0 ]; then
173 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
174 echo "adding clamav to amavis group GID=$AMAVIS"
177 %triggerin -- amavisd-new
178 AMAVIS=$(/usr/bin/getgid amavis)
180 if [ $RESULT -eq 0 ]; then
181 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
182 echo "adding clamav to amavis group GID=$AMAVIS"
185 %triggerin -- amavisd
186 AMAVIS=$(/usr/bin/getgid amavis)
188 if [ $RESULT -eq 0 ]; then
189 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
190 echo "adding clamav to amavis group GID=$AMAVIS"
194 if [ -n "`getgid clamav`" ]; then
195 if [ "`getgid clamav`" != "43" ]; then
196 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
200 echo "Adding group clamav GID=43"
201 /usr/sbin/groupadd -g 43 -r -f clamav
203 if [ -n "`id -u clamav 2>/dev/null`" ]; then
204 if [ "`id -u clamav`" != "43" ]; then
205 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
209 echo "Adding user clamav UID=43"
210 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
214 /sbin/chkconfig --add clamd
215 if [ -f /var/lock/subsys/clamd ]; then
216 /etc/rc.d/init.d/clamd restart >&2
218 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
220 touch %{_var}/log/freshclam.log
221 chown clamav:root %{_var}/log/freshclam.log
222 chmod 640 %{_var}/log/freshclam.log
225 if [ "$1" = "0" ]; then
226 if [ -f /var/lock/subsys/clamd ]; then
227 /etc/rc.d/init.d/clamd stop
229 /sbin/chkconfig --del clamd
233 if [ "$1" = "0" ]; then
234 echo "Removing user clamav"
235 /usr/sbin/userdel clamav
236 echo "Removing group clamav"
237 /usr/sbin/groupdel clamav
241 /sbin/chkconfig --add clamav-milter
242 if [ -f /var/lock/subsys/clamav-milter ]; then
243 /etc/rc.d/init.d/clamd restart >&2
245 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
249 if [ "$1" = "0" ]; then
250 if [ -f /var/lock/subsys/clamav-milter ]; then
251 /etc/rc.d/init.d/clamav-milter stop
253 /sbin/chkconfig --del clamav-milter
256 %post libs -p /sbin/ldconfig
257 %postun libs -p /sbin/ldconfig
259 %post database -p %{_sbindir}/%{name}-post-updatedb
262 %defattr(644,root,root,755)
263 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
264 %attr(755,root,root) %{_bindir}/*
265 %attr(755,root,root) %{_sbindir}/*
266 %attr(755,clamav,root) %dir /var/lib/%{name}
267 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
268 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
270 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
271 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
272 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
274 %attr(754,root,root) /etc/rc.d/init.d/clamd
275 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
276 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
278 %{_mandir}/man8/clamd*
282 %defattr(644,root,root,755)
283 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
284 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
285 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
286 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
287 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
288 %attr(755,root,root) %{_sbindir}/clamav-milter
289 %{_mandir}/man8/clamav-milter.8*
290 %attr(700,clamav,clamav) /var/spool/clamav/
294 %defattr(644,root,root,755)
295 %attr(755,root,root) %{_libdir}/lib*.so.*.*
298 %defattr(644,root,root,755)
299 %attr(755,root,root) %{_libdir}/lib*.so
302 %{_pkgconfigdir}/*.pc
305 %defattr(644,root,root,755)
309 %defattr(644,root,root,755)
310 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd