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: 2599a2e6b06d1f8ca09fdef8bc17625c
14 Source2: %{name}.sysconfig
15 Source4: %{name}-cron-updatedb
16 Source5: %{name}.logrotate
17 # Remember to update date on each rebuild!!
18 %define database_version 20040416
19 Source6: http://www.clamav.net/database/daily.cvd
20 # Source6-md5: b7956b9c4850fdca0d3fca806c95ddc7
21 Source7: http://www.clamav.net/database/main.cvd
22 # Source7-md5: e85d9a1c57005458c3208bf94a888706
23 Patch0: %{name}-pld_config.patch
24 Patch1: %{name}-no_auto_libwrap.patch
25 URL: http://www.clamav.net/
26 BuildRequires: autoconf
27 BuildRequires: automake
28 BuildRequires: zlib-devel
29 BuildRequires: gmp-devel
30 Requires(post,preun): /sbin/chkconfig
31 Requires: %{name}-libs = %{version}-%{release}
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
37 AMaViS, compressed files, uses the virus database from
38 OpenAntivirus.org, and includes a program for auto-updating. The
39 scanner is multithreaded, written in C, and POSIX compliant.
42 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
43 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
44 wirusów z OpenAntivirus.org, i posiada system automatycznej
45 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
49 Summary: Shared libraries for clamav
50 Summary(pl): Biblioteki dzielone clamav
54 Shared libraries for clamav.
56 %description libs -l pl
57 Biblioteki dzielone clamav.
60 Summary: clamav - Development header files and libraries
61 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
62 Group: Development/Libraries
63 Requires: %{name}-libs = %{version}-%{release}
66 This package contains the development header files and libraries
67 necessary to develop clamav client applications.
69 %description devel -l pl
70 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
74 Summary: clamav static libraris
75 Summary(pl): Biblioteki statyczne clamav
76 Group: Development/Libraries
77 Requires: %{name}-devel = %{version}-%{release}
80 clamav static libraries.
82 %description static -l pl
83 Biblioteki statyczne clamav.
86 Summary: Virus database for clamav
87 Summary(pl): Bazy wirusów dla clamav
89 Version: %{version}.%{database_version}
93 Virus database for clamav (updated %{database_version}).
95 %description database -l pl
96 Bazy wirusów dla clamav (aktualizowana %{database_version}).
109 --with-dbdir=/var/lib/%{name}
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
115 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
118 DESTDIR=$RPM_BUILD_ROOT
120 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
121 5 * * * * root %{_sbindir}/clamav-cron-updatedb
125 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
126 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
127 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
128 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/
129 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
130 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}/
131 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}/
133 # NOTE: clamd uses sane rights to it's clamd.pid file
134 # So better keep it dir
135 # If it is fixed use of dir will be unecesary
136 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
139 rm -rf $RPM_BUILD_ROOT
141 %triggerin -- amavis-ng
142 AMAVIS=$(/usr/bin/getgid amavis)
144 if [ $RESULT -eq 0 ]; then
145 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
146 echo "adding clamav to amavis group GID=$AMAVIS"
149 %triggerin -- amavisd-new
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
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"
167 if [ -n "`getgid clamav`" ]; then
168 if [ "`getgid clamav`" != "43" ]; then
169 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
173 echo "Adding group clamav GID=43"
174 /usr/sbin/groupadd -g 43 -r -f clamav
176 if [ -n "`id -u clamav 2>/dev/null`" ]; then
177 if [ "`id -u clamav`" != "43" ]; then
178 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
182 echo "Adding user clamav UID=43"
183 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
187 /sbin/chkconfig --add clamd
188 if [ -f /var/lock/subsys/clamd ]; then
189 /etc/rc.d/init.d/clamd restart >&2
191 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
195 if [ "$1" = "0" ]; then
196 if [ -f /var/lock/subsys/clamd ]; then
197 /etc/rc.d/init.d/clamd stop
199 /sbin/chkconfig --del clamd
203 if [ "$1" = "0" ]; then
204 echo "Removing user clamav"
205 /usr/sbin/userdel clamav
206 echo "Removing group clamav"
207 /usr/sbin/groupdel clamav
210 %post libs -p /sbin/ldconfig
211 %postun libs -p /sbin/ldconfig
214 %defattr(644,root,root,755)
215 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
216 %attr(755,root,root) %{_bindir}/*
217 %attr(755,root,root) %{_sbindir}/*
218 %attr(755,clamav,root) %dir /var/lib/%{name}
219 #%%attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
220 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
222 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
223 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
224 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
226 %attr(754,root,root) /etc/rc.d/init.d/clamd
227 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
228 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{_libdir}/lib*.so.*.*
236 %defattr(644,root,root,755)
237 %attr(755,root,root) %{_libdir}/lib*.so
242 %defattr(644,root,root,755)
246 %defattr(644,root,root,755)
247 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd