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 20040925
23 Source6: http://db.local.clamav.net/daily.cvd
24 # Source6-md5: 33008e54fb1d1a987f9953a0fd245d20
25 Source7: http://db.local.clamav.net/main.cvd
26 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
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 BuildRequires: libtool
38 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
39 BuildRequires: zlib-devel
40 Requires(post,preun): /sbin/chkconfig
41 Requires: %{name}-libs = %{version}-%{release}
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
47 AMaViS, compressed files, on-access scanning and includes a program
48 for auto-updating with support for digital signatures. The virus
49 database has over 20000 viruses, worms and trojans signatures. The
50 scanner is multithreaded, written in C, and POSIX compliant.
53 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
54 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
55 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
56 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
57 napisany w C i zgodny z POSIXem.
60 Summary: Shared libraries for clamav
61 Summary(pl): Biblioteki dzielone clamav
65 Shared libraries for clamav.
67 %description libs -l pl
68 Biblioteki dzielone clamav.
71 Summary: ClamAV filter using milter interface
72 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
74 Requires: %{name} = %{epoch}:%{version}-%{release}
75 Requires: sendmail >= 8.11
76 Requires: tcp_wrappers
79 ClamAV sendmail filter using MILTER interface.
81 %description -l pl milter
82 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
85 Summary: clamav - Development header files and libraries
86 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
87 Group: Development/Libraries
88 Requires: %{name}-libs = %{version}-%{release}
94 This package contains the development header files and libraries
95 necessary to develop clamav client applications.
97 %description devel -l pl
98 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
102 Summary: clamav static libraris
103 Summary(pl): Biblioteki statyczne clamav
104 Group: Development/Libraries
105 Requires: %{name}-devel = %{version}-%{release}
108 clamav static libraries.
110 %description static -l pl
111 Biblioteki statyczne clamav.
114 Summary: Virus database for clamav
115 Summary(pl): Bazy wirusów dla clamav
117 Version: %{version}.%{database_version}
120 %description database
121 Virus database for clamav (updated %{database_version}).
123 %description database -l pl
124 Bazy wirusów dla clamav (aktualizowana %{database_version}).
132 # kill old libtool.m4 copy
133 head -n 489 acinclude.m4 > acinclude.m4.tmp
134 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
135 mv -f acinclude.m4.tmp acinclude.m4
145 %{?with_milter:--enable-milter} \
146 --with-dbdir=/var/lib/%{name}
150 rm -rf $RPM_BUILD_ROOT
151 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
152 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
155 DESTDIR=$RPM_BUILD_ROOT
156 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
158 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
159 5 * * * * root %{_sbindir}/clamav-cron-updatedb
162 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
164 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
165 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
167 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
168 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
169 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
170 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
171 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
172 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
173 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
175 # NOTE: clamd uses sane rights to it's clamd.pid file
176 # So better keep it dir
177 # If it is fixed use of dir will be unecesary
178 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
180 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
183 rm -rf $RPM_BUILD_ROOT
185 %triggerin -- amavis-ng
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"
193 %triggerin -- amavisd-new
194 AMAVIS=$(/usr/bin/getgid amavis)
196 if [ $RESULT -eq 0 ]; then
197 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
198 echo "adding clamav to amavis group GID=$AMAVIS"
201 %triggerin -- amavisd
202 AMAVIS=$(/usr/bin/getgid amavis)
204 if [ $RESULT -eq 0 ]; then
205 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
206 echo "adding clamav to amavis group GID=$AMAVIS"
210 if [ -n "`getgid clamav`" ]; then
211 if [ "`getgid clamav`" != "43" ]; then
212 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
216 echo "Adding group clamav GID=43"
217 /usr/sbin/groupadd -g 43 -r -f clamav
219 if [ -n "`id -u clamav 2>/dev/null`" ]; then
220 if [ "`id -u clamav`" != "43" ]; then
221 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
225 echo "Adding user clamav UID=43"
226 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
230 /sbin/chkconfig --add clamd
231 if [ -f /var/lock/subsys/clamd ]; then
232 /etc/rc.d/init.d/clamd restart >&2
234 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
236 touch %{_var}/log/freshclam.log
237 chown clamav:root %{_var}/log/freshclam.log
238 chmod 640 %{_var}/log/freshclam.log
241 if [ "$1" = "0" ]; then
242 if [ -f /var/lock/subsys/clamd ]; then
243 /etc/rc.d/init.d/clamd stop
245 /sbin/chkconfig --del clamd
249 if [ "$1" = "0" ]; then
250 echo "Removing user clamav"
251 /usr/sbin/userdel clamav
252 echo "Removing group clamav"
253 /usr/sbin/groupdel clamav
258 /sbin/chkconfig --add clamav-milter
259 if [ -f /var/lock/subsys/clamav-milter ]; then
260 /etc/rc.d/init.d/clamd restart >&2
262 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
266 if [ "$1" = "0" ]; then
267 if [ -f /var/lock/subsys/clamav-milter ]; then
268 /etc/rc.d/init.d/clamav-milter stop
270 /sbin/chkconfig --del clamav-milter
273 %post libs -p /sbin/ldconfig
274 %postun libs -p /sbin/ldconfig
276 %post database -p %{_sbindir}/%{name}-post-updatedb
279 %defattr(644,root,root,755)
280 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
281 %attr(755,root,root) %{_bindir}/clamdscan
282 %attr(755,root,root) %{_bindir}/clamscan
283 %attr(755,root,root) %{_bindir}/freshclam
284 %attr(755,root,root) %{_bindir}/sigtool
285 %attr(755,root,root) %{_sbindir}/clamd
286 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
287 %attr(755,clamav,root) %dir /var/lib/%{name}
288 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
289 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
291 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
292 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
293 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
295 %attr(754,root,root) /etc/rc.d/init.d/clamd
296 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
297 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
299 %{_mandir}/man8/clamd*
303 %defattr(644,root,root,755)
304 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
305 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
306 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
307 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
308 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
309 %attr(755,root,root) %{_sbindir}/clamav-milter
310 %{_mandir}/man8/clamav-milter.8*
311 %attr(700,clamav,clamav) /var/spool/clamav/
315 %defattr(644,root,root,755)
316 %attr(755,root,root) %{_libdir}/lib*.so.*.*
319 %defattr(644,root,root,755)
320 %attr(755,root,root) %{_bindir}/clamav-config
321 %attr(755,root,root) %{_libdir}/lib*.so
324 %{_pkgconfigdir}/*.pc
327 %defattr(644,root,root,755)
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
333 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd