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 20031115
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://clamav.elektrapro.com/database/:
25 Source3: %{name}-database-%{database_version}.tar.bz2
26 # Source3-md5: f1e7c6362a2c03439da41d237dc5d01c
27 Source4: %{name}-cron-updatedb
28 Patch0: %{name}-pld_config.patch
29 Patch1: %{name}-oversize_zip.patch
30 Patch2: %{name}-remote_dos_exploit.patch
31 URL: http://www.clamav.net/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: zlib-devel
35 BuildRequires: gmp-devel
36 Requires(post,preun): /sbin/chkconfig
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
42 AMaViS, compressed files, uses the virus database from
43 OpenAntivirus.org, and includes a program for auto-updating. The
44 scanner is multithreaded, written in C, and POSIX compliant.
47 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
48 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
49 wirusów z OpenAntivirus.org, i posiada system automatycznej
50 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
54 Summary: Shared libraries for clamav
55 Summary(pl): Biblioteki dzielone clamav
59 Shared libraries for clamav.
61 %description libs -l pl
62 Biblioteki dzielone clamav.
65 Summary: clamav - Development header files and libraries
66 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
67 Group: Development/Libraries
68 Requires: %{name}-libs = %{version}
71 This package contains the development header files and libraries
72 necessary to develop clamav client applications.
74 %description devel -l pl
75 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
79 Summary: clamav static libraris
80 Summary(pl): Biblioteki statyczne clamav
81 Group: Development/Libraries
82 Requires: %{name}-devel = %{version}
85 clamav static libraris.
87 %description static -l pl
88 Biblioteki statyczne clamav.
91 Summary: Virus database for clamav
92 Summary(pl): Bazy wirusów dla clamav
94 Version: %{version}.%{database_version}
98 Virus database for clamav (updated %{database_version})
100 %description database -l pl
101 Bazy wirusów dla clamav (aktualizowana %{database_version})
106 %{!?_with_bigZIPOSDET:%patch1 -p1}
116 --with-dbdir=/var/lib/%{name}
118 mv database/mirrors.txt{,.old}
119 echo clamav.sourceforge.net >database/mirrors.txt
120 cat database/mirrors.txt.old >>database/mirrors.txt
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \
125 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
128 DESTDIR=$RPM_BUILD_ROOT
130 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
131 5 * * * * root %{_sbindir}/clamav-cron-updatedb
134 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
136 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
137 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
138 install database/viruses.db* $RPM_BUILD_ROOT/var/lib/%{name}/
139 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
140 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
142 # NOTE: clamd uses sane rights to it's clamd.pid file
143 # So better keep it dir
144 # If it is fixed use of dir will be unecesary
145 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
146 # touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
149 rm -rf $RPM_BUILD_ROOT
151 %triggerin -- amavis-ng
152 AMAVIS=$(/usr/bin/getgid amavis)
154 if [ $RESULT -eq 0 ]; then
155 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
156 echo "adding clamav to amavis group GID=$AMAVIS"
159 %triggerin -- amavisd-new
160 AMAVIS=$(/usr/bin/getgid amavis)
162 if [ $RESULT -eq 0 ]; then
163 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
164 echo "adding clamav to amavis group GID=$AMAVIS"
167 %triggerin -- amavisd
168 AMAVIS=$(/usr/bin/getgid amavis)
170 if [ $RESULT -eq 0 ]; then
171 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
172 echo "adding clamav to amavis group GID=$AMAVIS"
177 if [ -n "`getgid clamav`" ]; then
178 if [ "`getgid clamav`" != "43" ]; then
179 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
183 echo "Adding group clamav GID=43"
184 /usr/sbin/groupadd -g 43 -r -f clamav
186 if [ -n "`id -u clamav 2>/dev/null`" ]; then
187 if [ "`id -u clamav`" != "43" ]; then
188 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
192 echo "Adding user clamav UID=43"
193 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
197 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
198 /sbin/chkconfig --add clamd
199 if [ -f /var/lock/subsys/clamd ]; then
200 /etc/rc.d/init.d/clamd restart >&2
202 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
206 if [ "$1" = "0" ]; then
207 if [ -f /var/lock/subsys/clamd ]; then
208 /etc/rc.d/init.d/clamd stop
210 /sbin/chkconfig --del clamd
214 if [ "$1" = "0" ]; then
215 echo "Removing user clamav"
216 /usr/sbin/userdel clamav
217 echo "Removing group clamav"
218 /usr/sbin/groupdel clamav
221 %post libs -p /sbin/ldconfig
222 %postun libs -p /sbin/ldconfig
225 %defattr(644,root,root,755)
226 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
227 %attr(755,root,root) %{_bindir}/*
228 %attr(755,root,root) %{_sbindir}/*
229 %attr(755,clamav,root) %dir /var/lib/%{name}
230 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
231 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
232 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
233 # %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
235 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
236 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
237 %attr(754,root,root) /etc/rc.d/init.d/clamd
238 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/lib*.so.*.*
246 %defattr(644,root,root,755)
247 %attr(755,root,root) %{_libdir}/lib*.so
252 %defattr(644,root,root,755)
256 %defattr(644,root,root,755)
257 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*