2 # Make freshclam (script and daemon)
4 Summary: An anti-virus utility for Unix
5 Summary(pl): Antywirusowe narzêdzie dla Uniksów
11 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
12 # Source0-md5: 645d3d5b6d6bea2af6db92295b5c10af
14 Source2: %{name}.sysconfig
15 Source4: %{name}-cron-updatedb
16 Source5: %{name}.logrotate
17 # Remember to update date after databases upgrade
18 %define database_version 20040724
19 Source6: http://www.clamav.net/database/daily.cvd
20 # Source6-md5: dba9adc5fba54e2a7b7575ea88d23f91
21 Source7: http://www.clamav.net/database/main.cvd
22 # Source7-md5: fb569320447dff5b22acdbec2dbc5772
23 Source8: %{name}-post-updatedb
24 Patch0: %{name}-pld_config.patch
25 Patch1: %{name}-no_auto_libwrap.patch
26 Patch2: %{name}-af_unix.patch
27 URL: http://www.clamav.net/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: zlib-devel
31 BuildRequires: gmp-devel
32 Requires(post,preun): /sbin/chkconfig
33 Requires: %{name}-libs = %{version}-%{release}
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
39 AMaViS, compressed files, uses the virus database from
40 OpenAntivirus.org, and includes a program for auto-updating. The
41 scanner is multithreaded, written in C, and POSIX compliant.
44 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
45 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
46 wirusów z OpenAntivirus.org, i posiada system automatycznej
47 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
51 Summary: Shared libraries for clamav
52 Summary(pl): Biblioteki dzielone clamav
56 Shared libraries for clamav.
58 %description libs -l pl
59 Biblioteki dzielone clamav.
62 Summary: clamav - Development header files and libraries
63 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
64 Group: Development/Libraries
65 Requires: %{name}-libs = %{version}-%{release}
68 This package contains the development header files and libraries
69 necessary to develop clamav client applications.
71 %description devel -l pl
72 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
76 Summary: clamav static libraris
77 Summary(pl): Biblioteki statyczne clamav
78 Group: Development/Libraries
79 Requires: %{name}-devel = %{version}-%{release}
82 clamav static libraries.
84 %description static -l pl
85 Biblioteki statyczne clamav.
88 Summary: Virus database for clamav
89 Summary(pl): Bazy wirusów dla clamav
91 Version: %{version}.%{database_version}
95 Virus database for clamav (updated %{database_version}).
97 %description database -l pl
98 Bazy wirusów dla clamav (aktualizowana %{database_version}).
112 --with-dbdir=/var/lib/%{name}
116 rm -rf $RPM_BUILD_ROOT
117 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
118 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
121 DESTDIR=$RPM_BUILD_ROOT
123 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
124 5 * * * * root %{_sbindir}/clamav-cron-updatedb
128 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
129 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
130 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
131 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/
132 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
133 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}/
134 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}/
135 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
137 # NOTE: clamd uses sane rights to it's clamd.pid file
138 # So better keep it dir
139 # If it is fixed use of dir will be unecesary
140 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
142 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
145 rm -rf $RPM_BUILD_ROOT
147 %triggerin -- amavis-ng
148 AMAVIS=$(/usr/bin/getgid amavis)
150 if [ $RESULT -eq 0 ]; then
151 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
152 echo "adding clamav to amavis group GID=$AMAVIS"
155 %triggerin -- amavisd-new
156 AMAVIS=$(/usr/bin/getgid amavis)
158 if [ $RESULT -eq 0 ]; then
159 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
160 echo "adding clamav to amavis group GID=$AMAVIS"
163 %triggerin -- amavisd
164 AMAVIS=$(/usr/bin/getgid amavis)
166 if [ $RESULT -eq 0 ]; then
167 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
168 echo "adding clamav to amavis group GID=$AMAVIS"
173 if [ -n "`getgid clamav`" ]; then
174 if [ "`getgid clamav`" != "43" ]; then
175 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
179 echo "Adding group clamav GID=43"
180 /usr/sbin/groupadd -g 43 -r -f clamav
182 if [ -n "`id -u clamav 2>/dev/null`" ]; then
183 if [ "`id -u clamav`" != "43" ]; then
184 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
188 echo "Adding user clamav UID=43"
189 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
193 /sbin/chkconfig --add clamd
194 if [ -f /var/lock/subsys/clamd ]; then
195 /etc/rc.d/init.d/clamd restart >&2
197 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
199 touch %{_var}/log/freshclam.log
200 chown clamav:root %{_var}/log/freshclam.log
201 chmod 640 %{_var}/log/freshclam.log
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
222 %post database -p %{_sbindir}/%{name}-post-updatedb
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(640,clamav,root) %ghost %{_var}/log/freshclam.log
231 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
233 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
234 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
235 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.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
239 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_libdir}/lib*.so.*.*
247 %defattr(644,root,root,755)
248 %attr(755,root,root) %{_libdir}/lib*.so
251 %{_pkgconfigdir}/*.pc
254 %defattr(644,root,root,755)
258 %defattr(644,root,root,755)
259 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd