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 URL: http://www.clamav.net/
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: zlib-devel
34 BuildRequires: gmp-devel
35 Requires(post,preun): /sbin/chkconfig
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
41 AMaViS, compressed files, uses the virus database from
42 OpenAntivirus.org, and includes a program for auto-updating. The
43 scanner is multithreaded, written in C, and POSIX compliant.
46 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
47 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
48 wirusów z OpenAntivirus.org, i posiada system automatycznej
49 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
53 Summary: Shared libraries for clamav
54 Summary(pl): Biblioteki dzielone clamav
58 Shared libraries for clamav.
60 %description libs -l pl
61 Biblioteki dzielone clamav.
64 Summary: clamav - Development header files and libraries
65 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
66 Group: Development/Libraries
67 Requires: %{name}-libs = %{version}
70 This package contains the development header files and libraries
71 necessary to develop clamav client applications.
73 %description devel -l pl
74 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
78 Summary: clamav static libraris
79 Summary(pl): Biblioteki statyczne clamav
80 Group: Development/Libraries
81 Requires: %{name}-devel = %{version}
84 clamav static libraris.
86 %description static -l pl
87 Biblioteki statyczne clamav.
90 Summary: Virus database for clamav
91 Summary(pl): Bazy wirusów dla clamav
93 Version: %{version}.%{database_version}
97 Virus database for clamav (updated %{database_version})
99 %description database -l pl
100 Bazy wirusów dla clamav (aktualizowana %{database_version})
105 %{!?_with_bigZIPOSDET:%patch1 -p1}
114 --with-dbdir=/var/lib/%{name}
116 mv database/mirrors.txt{,.old}
117 echo clamav.sourceforge.net >database/mirrors.txt
118 cat database/mirrors.txt.old >>database/mirrors.txt
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \
123 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
126 DESTDIR=$RPM_BUILD_ROOT
128 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
129 5 * * * * root %{_sbindir}/clamav-cron-updatedb
132 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
134 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
135 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
136 install database/viruses.db* $RPM_BUILD_ROOT/var/lib/%{name}/
137 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
138 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
140 # NOTE: clamd uses sane rights to it's clamd.pid file
141 # So better keep it dir
142 # If it is fixed use of dir will be unecesary
143 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
144 # touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
147 rm -rf $RPM_BUILD_ROOT
149 %triggerin -- amavis-ng
150 AMAVIS=$(/usr/bin/getgid amavis)
152 if [ $RESULT -eq 0 ]; then
153 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
154 echo "adding clamav to amavis group GID=$AMAVIS"
157 %triggerin -- amavisd-new
158 AMAVIS=$(/usr/bin/getgid amavis)
160 if [ $RESULT -eq 0 ]; then
161 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
162 echo "adding clamav to amavis group GID=$AMAVIS"
165 %triggerin -- amavisd
166 AMAVIS=$(/usr/bin/getgid amavis)
168 if [ $RESULT -eq 0 ]; then
169 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
170 echo "adding clamav to amavis group GID=$AMAVIS"
175 if [ -n "`getgid clamav`" ]; then
176 if [ "`getgid clamav`" != "43" ]; then
177 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
181 echo "Adding group clamav GID=43"
182 /usr/sbin/groupadd -g 43 -r -f clamav
184 if [ -n "`id -u clamav 2>/dev/null`" ]; then
185 if [ "`id -u clamav`" != "43" ]; then
186 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
190 echo "Adding user clamav UID=43"
191 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
195 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
196 /sbin/chkconfig --add clamd
197 if [ -f /var/lock/subsys/clamd ]; then
198 /etc/rc.d/init.d/clamd restart >&2
200 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
204 if [ "$1" = "0" ]; then
205 if [ -f /var/lock/subsys/clamd ]; then
206 /etc/rc.d/init.d/clamd stop
208 /sbin/chkconfig --del clamd
212 if [ "$1" = "0" ]; then
213 echo "Removing user clamav"
214 /usr/sbin/userdel clamav
215 echo "Removing group clamav"
216 /usr/sbin/groupdel clamav
219 %post libs -p /sbin/ldconfig
220 %postun libs -p /sbin/ldconfig
223 %defattr(644,root,root,755)
224 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
225 %attr(755,root,root) %{_bindir}/*
226 %attr(755,root,root) %{_sbindir}/*
227 %attr(755,clamav,root) %dir /var/lib/%{name}
228 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
229 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
230 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
231 # %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
233 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
234 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
235 %attr(754,root,root) /etc/rc.d/init.d/clamd
236 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
240 %defattr(644,root,root,755)
241 %attr(755,root,root) %{_libdir}/lib*.so.*.*
244 %defattr(644,root,root,755)
245 %attr(755,root,root) %{_libdir}/lib*.so
250 %defattr(644,root,root,755)
254 %defattr(644,root,root,755)
255 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*