3 # clamd uses syslog but log from (crond) db update goes to
7 # _with_bigZIPOSDET - increases zip file size
8 # should be used with samba scanning, on smtp-server
9 # may lead to DoS (memory usage up tu 1GB)
10 # It's configurable in CVS version of clamav, anyway.
12 %define database_version 20040210
13 Summary: An anti-virus utility for Unix
14 Summary(pl): Antywirusowe narzêdzie dla Unixów
20 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21 # Source0-md5: f2b8473190b6dc1fd9c64b9ebc49a5ad
23 Source2: %{name}.sysconfig
24 # bziped from http://www.clamav.net/database/
25 Source3: %{name}-database-%{database_version}.tar.bz2
26 # Source3-md5: 4affa1cae8a0edaaaa084ea57702c1e8
27 Source4: %{name}-cron-updatedb
28 Source5: %{name}.logrotate
29 Patch0: %{name}-pld_config.patch
30 Patch1: %{name}-oversize_zip.patch
31 Patch2: %{name}-remote_dos_exploit.patch
32 URL: http://www.clamav.net/
33 BuildRequires: autoconf
34 BuildRequires: automake
35 BuildRequires: zlib-devel
36 BuildRequires: gmp-devel
37 Requires(post,preun): /sbin/chkconfig
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, uses the virus database from
44 OpenAntivirus.org, and includes a program for auto-updating. The
45 scanner is multithreaded, written in C, and POSIX compliant.
48 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
49 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
50 wirusów z OpenAntivirus.org, i posiada system automatycznej
51 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
55 Summary: Shared libraries for clamav
56 Summary(pl): Biblioteki dzielone clamav
60 Shared libraries for clamav.
62 %description libs -l pl
63 Biblioteki dzielone clamav.
66 Summary: clamav - Development header files and libraries
67 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
68 Group: Development/Libraries
69 Requires: %{name}-libs = %{version}
72 This package contains the development header files and libraries
73 necessary to develop clamav client applications.
75 %description devel -l pl
76 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
80 Summary: clamav static libraris
81 Summary(pl): Biblioteki statyczne clamav
82 Group: Development/Libraries
83 Requires: %{name}-devel = %{version}
86 clamav static libraris.
88 %description static -l pl
89 Biblioteki statyczne clamav.
92 Summary: Virus database for clamav
93 Summary(pl): Bazy wirusów dla clamav
95 Version: %{version}.%{database_version}
99 Virus database for clamav (updated %{database_version})
101 %description database -l pl
102 Bazy wirusów dla clamav (aktualizowana %{database_version})
107 %{!?_with_bigZIPOSDET:%patch1 -p1}
117 --with-dbdir=/var/lib/%{name}
119 mv database/mirrors.txt{,.old}
120 echo clamav.sourceforge.net >database/mirrors.txt
121 cat database/mirrors.txt.old >>database/mirrors.txt
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
126 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
129 DESTDIR=$RPM_BUILD_ROOT
131 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
132 5 * * * * root %{_sbindir}/clamav-cron-updatedb
135 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
137 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
138 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
139 install database/viruses.db* $RPM_BUILD_ROOT/var/lib/%{name}/
140 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
141 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
142 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
144 # NOTE: clamd uses sane rights to it's clamd.pid file
145 # So better keep it dir
146 # If it is fixed use of dir will be unecesary
147 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
148 # touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
151 rm -rf $RPM_BUILD_ROOT
153 %triggerin -- amavis-ng
154 AMAVIS=$(/usr/bin/getgid amavis)
156 if [ $RESULT -eq 0 ]; then
157 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
158 echo "adding clamav to amavis group GID=$AMAVIS"
161 %triggerin -- amavisd-new
162 AMAVIS=$(/usr/bin/getgid amavis)
164 if [ $RESULT -eq 0 ]; then
165 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
166 echo "adding clamav to amavis group GID=$AMAVIS"
169 %triggerin -- amavisd
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"
179 if [ -n "`getgid clamav`" ]; then
180 if [ "`getgid clamav`" != "43" ]; then
181 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
185 echo "Adding group clamav GID=43"
186 /usr/sbin/groupadd -g 43 -r -f clamav
188 if [ -n "`id -u clamav 2>/dev/null`" ]; then
189 if [ "`id -u clamav`" != "43" ]; then
190 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
194 echo "Adding user clamav UID=43"
195 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
199 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
200 /sbin/chkconfig --add clamd
201 if [ -f /var/lock/subsys/clamd ]; then
202 /etc/rc.d/init.d/clamd restart >&2
204 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
208 if [ "$1" = "0" ]; then
209 if [ -f /var/lock/subsys/clamd ]; then
210 /etc/rc.d/init.d/clamd stop
212 /sbin/chkconfig --del clamd
216 if [ "$1" = "0" ]; then
217 echo "Removing user clamav"
218 /usr/sbin/userdel clamav
219 echo "Removing group clamav"
220 /usr/sbin/groupdel clamav
223 %post libs -p /sbin/ldconfig
224 %postun libs -p /sbin/ldconfig
227 %defattr(644,root,root,755)
228 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
229 %attr(755,root,root) %{_bindir}/*
230 %attr(755,root,root) %{_sbindir}/*
231 %attr(755,clamav,root) %dir /var/lib/%{name}
232 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
233 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
234 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
235 # %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
237 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
238 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
239 %attr(754,root,root) /etc/rc.d/init.d/clamd
240 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
241 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
245 %defattr(644,root,root,755)
246 %attr(755,root,root) %{_libdir}/lib*.so.*.*
249 %defattr(644,root,root,755)
250 %attr(755,root,root) %{_libdir}/lib*.so
255 %defattr(644,root,root,755)
259 %defattr(644,root,root,755)
260 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*