3 # clamd uses syslog but log from (crond) db update goes to
6 %define database_version 20030813
7 Summary: An anti-virus utility for Unix
8 Summary(pl): Antywirusowe narzêdzie dla Unixów
14 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
15 # Source0-md5: eddeba4e1f399f65bc71aa2b3e901543
17 Source2: %{name}.sysconfig
18 # gziped from http://clamav.elektrapro.com/database/:
19 Source3: %{name}-database-%{database_version}.tar.gz
20 # Source3-md5: a8848904249edd97b873a43032c0208f
21 Source4: %{name}-cron-updatedb
22 Patch0: %{name}-pld_config.patch
23 URL: http://www.clamav.net/
24 BuildRequires: autoconf
25 BuildRequires: automake
26 BuildRequires: zlib-devel
27 Requires(post,preun): /sbin/chkconfig
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
33 AMaViS, compressed files, uses the virus database from
34 OpenAntivirus.org, and includes a program for auto-updating. The
35 scanner is multithreaded, written in C, and POSIX compliant.
38 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
39 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
40 wirusów z OpenAntivirus.org, i posiada system automatycznej
41 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
45 Summary: Shared libraries for clamav
46 Summary(pl): Biblioteki dzielone clamav
50 Shared libraries for clamav.
52 %description libs -l pl
53 Biblioteki dzielone clamav.
56 Summary: clamav - Development header files and libraries
57 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
58 Group: Development/Libraries
59 Requires: %{name}-libs = %{version}
62 This package contains the development header files and libraries
63 necessary to develop clamav client applications.
65 %description devel -l pl
66 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
70 Summary: clamav static libraris
71 Summary(pl): Biblioteki statyczne clamav
72 Group: Development/Libraries
73 Requires: %{name}-devel = %{version}
76 clamav static libraris.
78 %description static -l pl
79 Biblioteki statyczne clamav.
82 Summary: Virus database for clamav
83 Summary(pl): Bazy wirusów dla clamav
85 Version: %{version}.%{database_version}
89 Virus database for clamav (updated %{database_version})
91 %description database -l pl
92 Bazy wirusów dla clamav (aktualizowana %{database_version})
105 --with-dbdir=/var/lib/%{name}
107 mv database/mirrors.txt{,.old}
108 echo clamav.sourceforge.net >database/mirrors.txt
109 cat database/mirrors.txt.old >>database/mirrors.txt
112 rm -rf $RPM_BUILD_ROOT
113 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \
114 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/log}
117 DESTDIR=$RPM_BUILD_ROOT
119 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
120 5 * * * * root %{_sbindir}/clamav-cron-updatedb
123 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
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/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
130 # NOTE: clamd uses sane rights to it's clamd.pid file
131 # So better keep it dir
132 # If it is fixed use of dir will be unecesary
133 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
134 # touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
137 rm -rf $RPM_BUILD_ROOT
139 # FIXME: Does %triggerin -- amavis-ng really have to written three times ?
140 # It's stolen from mksd.spec - if it's wrong fix mksd.spec too
142 %triggerin -- amavis-ng
143 AMAVIS=$(/usr/bin/getgid amavis)
145 if [ $RESULT -eq 0 ]; then
146 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
147 echo "adding clamav to amavis group GID=$AMAVIS"
150 %triggerin -- amavisd-new
151 AMAVIS=$(/usr/bin/getgid amavis)
153 if [ $RESULT -eq 0 ]; then
154 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
155 echo "adding clamav to amavis group GID=$AMAVIS"
158 %triggerin -- amavisd
159 AMAVIS=$(/usr/bin/getgid amavis)
161 if [ $RESULT -eq 0 ]; then
162 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
163 echo "adding clamav to amavis group GID=$AMAVIS"
168 if [ -n "`getgid clamav`" ]; then
169 if [ "`getgid clamav`" != "43" ]; then
170 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
174 echo "Adding group clamav GID=43"
175 /usr/sbin/groupadd -g 43 -r -f clamav
177 if [ -n "`id -u clamav 2>/dev/null`" ]; then
178 if [ "`id -u clamav`" != "43" ]; then
179 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
183 echo "Adding user clamav UID=43"
184 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
188 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
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
216 %defattr(644,root,root,755)
217 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
218 %attr(755,root,root) %{_bindir}/*
219 %attr(755,root,root) %{_sbindir}/*
220 %attr(755,clamav,root) %dir /var/lib/%{name}
221 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
222 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
223 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
224 # %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
226 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
227 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
228 %attr(754,root,root) /etc/rc.d/init.d/clamd
229 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
233 %defattr(644,root,root,755)
234 %attr(755,root,root) %{_libdir}/lib*.so.*.*
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_libdir}/lib*.so
243 %defattr(644,root,root,755)
247 %defattr(644,root,root,755)
248 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*