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 20040420
19 Source6: http://www.clamav.net/database/daily.cvd
20 # Source6-md5: 91fae748a9702545492d1a045db4c630
21 Source7: http://www.clamav.net/database/main.cvd
22 # Source7-md5: e85d9a1c57005458c3208bf94a888706
23 Source8: %{name}-post-updatedb
24 Patch0: %{name}-pld_config.patch
25 Patch1: %{name}-no_auto_libwrap.patch
26 URL: http://www.clamav.net/
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: zlib-devel
30 BuildRequires: gmp-devel
31 Requires(post,preun): /sbin/chkconfig
32 Requires: %{name}-libs = %{version}-%{release}
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
38 AMaViS, compressed files, uses the virus database from
39 OpenAntivirus.org, and includes a program for auto-updating. The
40 scanner is multithreaded, written in C, and POSIX compliant.
43 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
44 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
45 wirusów z OpenAntivirus.org, i posiada system automatycznej
46 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
50 Summary: Shared libraries for clamav
51 Summary(pl): Biblioteki dzielone clamav
55 Shared libraries for clamav.
57 %description libs -l pl
58 Biblioteki dzielone clamav.
61 Summary: clamav - Development header files and libraries
62 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
63 Group: Development/Libraries
64 Requires: %{name}-libs = %{version}-%{release}
67 This package contains the development header files and libraries
68 necessary to develop clamav client applications.
70 %description devel -l pl
71 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
75 Summary: clamav static libraris
76 Summary(pl): Biblioteki statyczne clamav
77 Group: Development/Libraries
78 Requires: %{name}-devel = %{version}-%{release}
81 clamav static libraries.
83 %description static -l pl
84 Biblioteki statyczne clamav.
87 Summary: Virus database for clamav
88 Summary(pl): Bazy wirusów dla clamav
90 Version: %{version}.%{database_version}
94 Virus database for clamav (updated %{database_version}).
96 %description database -l pl
97 Bazy wirusów dla clamav (aktualizowana %{database_version}).
110 --with-dbdir=/var/lib/%{name}
114 rm -rf $RPM_BUILD_ROOT
115 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
116 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
119 DESTDIR=$RPM_BUILD_ROOT
121 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
122 5 * * * * root %{_sbindir}/clamav-cron-updatedb
126 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
127 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
128 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
129 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/
130 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
131 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}/
132 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}/
133 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
135 # NOTE: clamd uses sane rights to it's clamd.pid file
136 # So better keep it dir
137 # If it is fixed use of dir will be unecesary
138 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
141 rm -rf $RPM_BUILD_ROOT
143 %triggerin -- amavis-ng
144 AMAVIS=$(/usr/bin/getgid amavis)
146 if [ $RESULT -eq 0 ]; then
147 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
148 echo "adding clamav to amavis group GID=$AMAVIS"
151 %triggerin -- amavisd-new
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
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"
169 if [ -n "`getgid clamav`" ]; then
170 if [ "`getgid clamav`" != "43" ]; then
171 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
175 echo "Adding group clamav GID=43"
176 /usr/sbin/groupadd -g 43 -r -f clamav
178 if [ -n "`id -u clamav 2>/dev/null`" ]; then
179 if [ "`id -u clamav`" != "43" ]; then
180 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
184 echo "Adding user clamav UID=43"
185 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
189 /sbin/chkconfig --add clamd
190 if [ -f /var/lock/subsys/clamd ]; then
191 /etc/rc.d/init.d/clamd restart >&2
193 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
197 if [ "$1" = "0" ]; then
198 if [ -f /var/lock/subsys/clamd ]; then
199 /etc/rc.d/init.d/clamd stop
201 /sbin/chkconfig --del clamd
205 if [ "$1" = "0" ]; then
206 echo "Removing user clamav"
207 /usr/sbin/userdel clamav
208 echo "Removing group clamav"
209 /usr/sbin/groupdel clamav
212 %post libs -p /sbin/ldconfig
213 %postun libs -p /sbin/ldconfig
215 %post database -p %{_sbindir}/%{name}-post-updatedb
218 %defattr(644,root,root,755)
219 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
220 %attr(755,root,root) %{_bindir}/*
221 %attr(755,root,root) %{_sbindir}/*
222 %attr(755,clamav,root) %dir /var/lib/%{name}
223 #%%attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
224 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
226 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
227 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
228 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
230 %attr(754,root,root) /etc/rc.d/init.d/clamd
231 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
232 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
236 %defattr(644,root,root,755)
237 %attr(755,root,root) %{_libdir}/lib*.so.*.*
240 %defattr(644,root,root,755)
241 %attr(755,root,root) %{_libdir}/lib*.so
246 %defattr(644,root,root,755)
250 %defattr(644,root,root,755)
251 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd