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: sendmail-devel >= 8.11
36 BuildRequires: tcp_wrappers
37 BuildRequires: zlib-devel
38 Requires(post,preun): /sbin/chkconfig
39 Requires: %{name}-libs = %{version}-%{release}
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
45 AMaViS, compressed files, on-access scanning and includes a program
46 for auto-updating with support for digital signatures. The virus
47 database has over 20000 viruses, worms and trojans signatures. The
48 scanner is multithreaded, written in C, and POSIX compliant.
51 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
52 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
53 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
54 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
55 napisany w C i zgodny z POSIXem.
58 Summary: Shared libraries for clamav
59 Summary(pl): Biblioteki dzielone clamav
63 Shared libraries for clamav.
65 %description libs -l pl
66 Biblioteki dzielone clamav.
69 Summary: ClamAV filter using milter interface
70 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
72 Requires: %{name} = %{epoch}:%{version}-%{release}
73 Requires: sendmail >= 8.11
74 Requires: tcp_wrappers
77 ClamAV sendmail filter using MILTER interface.
79 %description -l pl milter
80 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
83 Summary: clamav - Development header files and libraries
84 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
85 Group: Development/Libraries
86 Requires: %{name}-libs = %{version}-%{release}
89 This package contains the development header files and libraries
90 necessary to develop clamav client applications.
92 %description devel -l pl
93 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
97 Summary: clamav static libraris
98 Summary(pl): Biblioteki statyczne clamav
99 Group: Development/Libraries
100 Requires: %{name}-devel = %{version}-%{release}
103 clamav static libraries.
105 %description static -l pl
106 Biblioteki statyczne clamav.
109 Summary: Virus database for clamav
110 Summary(pl): Bazy wirusów dla clamav
112 Version: %{version}.%{database_version}
115 %description database
116 Virus database for clamav (updated %{database_version}).
118 %description database -l pl
119 Bazy wirusów dla clamav (aktualizowana %{database_version}).
132 %{?with_milter:--enable-milter} \
133 --with-dbdir=/var/lib/%{name}
137 rm -rf $RPM_BUILD_ROOT
138 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
139 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
142 DESTDIR=$RPM_BUILD_ROOT
143 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
145 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
146 5 * * * * root %{_sbindir}/clamav-cron-updatedb
149 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
150 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
151 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
152 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
153 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
154 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
155 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
156 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
157 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
158 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
160 # NOTE: clamd uses sane rights to it's clamd.pid file
161 # So better keep it dir
162 # If it is fixed use of dir will be unecesary
163 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
165 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
168 rm -rf $RPM_BUILD_ROOT
170 %triggerin -- amavis-ng
171 AMAVIS=$(/usr/bin/getgid amavis)
173 if [ $RESULT -eq 0 ]; then
174 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
175 echo "adding clamav to amavis group GID=$AMAVIS"
178 %triggerin -- amavisd-new
179 AMAVIS=$(/usr/bin/getgid amavis)
181 if [ $RESULT -eq 0 ]; then
182 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
183 echo "adding clamav to amavis group GID=$AMAVIS"
186 %triggerin -- amavisd
187 AMAVIS=$(/usr/bin/getgid amavis)
189 if [ $RESULT -eq 0 ]; then
190 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
191 echo "adding clamav to amavis group GID=$AMAVIS"
195 if [ -n "`getgid clamav`" ]; then
196 if [ "`getgid clamav`" != "43" ]; then
197 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
201 echo "Adding group clamav GID=43"
202 /usr/sbin/groupadd -g 43 -r -f clamav
204 if [ -n "`id -u clamav 2>/dev/null`" ]; then
205 if [ "`id -u clamav`" != "43" ]; then
206 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
210 echo "Adding user clamav UID=43"
211 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
215 /sbin/chkconfig --add clamd
216 if [ -f /var/lock/subsys/clamd ]; then
217 /etc/rc.d/init.d/clamd restart >&2
219 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
221 touch %{_var}/log/freshclam.log
222 chown clamav:root %{_var}/log/freshclam.log
223 chmod 640 %{_var}/log/freshclam.log
226 if [ "$1" = "0" ]; then
227 if [ -f /var/lock/subsys/clamd ]; then
228 /etc/rc.d/init.d/clamd stop
230 /sbin/chkconfig --del clamd
234 if [ "$1" = "0" ]; then
235 echo "Removing user clamav"
236 /usr/sbin/userdel clamav
237 echo "Removing group clamav"
238 /usr/sbin/groupdel clamav
242 /sbin/chkconfig --add clamav-milter
243 if [ -f /var/lock/subsys/clamav-milter ]; then
244 /etc/rc.d/init.d/clamd restart >&2
246 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
250 if [ "$1" = "0" ]; then
251 if [ -f /var/lock/subsys/clamav-milter ]; then
252 /etc/rc.d/init.d/clamav-milter stop
254 /sbin/chkconfig --del clamav-milter
257 %post libs -p /sbin/ldconfig
258 %postun libs -p /sbin/ldconfig
260 %post database -p %{_sbindir}/%{name}-post-updatedb
263 %defattr(644,root,root,755)
264 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
265 %attr(755,root,root) %{_bindir}/*
266 %attr(755,root,root) %{_sbindir}/*
267 %attr(755,clamav,root) %dir /var/lib/%{name}
268 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
269 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
271 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
272 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
273 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
275 %attr(754,root,root) /etc/rc.d/init.d/clamd
276 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
277 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
279 %{_mandir}/man8/clamd*
283 %defattr(644,root,root,755)
284 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
285 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
286 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
287 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
288 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
289 %attr(755,root,root) %{_sbindir}/clamav-milter
290 %{_mandir}/man8/clamav-milter.8*
291 %attr(700,clamav,clamav) /var/spool/clamav/
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_libdir}/lib*.so.*.*
299 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_libdir}/lib*.so
303 %{_pkgconfigdir}/*.pc
306 %defattr(644,root,root,755)
310 %defattr(644,root,root,755)
311 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd