1 %define database_version 20030207
2 Summary: An anti-virus utility for Unix
3 Summary(pl): Antywirusowe narzêdzie dla Unixów
9 Source0: http://clamav.elektrapro.com/stable/%{name}-%{version}.tar.gz
10 # Source0-md5: 1c2e2adffe9ed4d15fe2167dd7bad591
12 Source2: %{name}.sysconfig
13 # gziped from http://clamav.elektrapro.com/database/:
14 Source3: %{name}-database-%{database_version}.tar.gz
15 URL: http://clamav.elektrapro.com/
16 Requires: %{name}-database
17 BuildRequires: autoconf
18 BuildRequires: automake
19 BuildRequires: zlib-devel
20 Requires(post,preun): /sbin/chkconfig
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
25 AMaViS, compressed files, uses the virus database from
26 OpenAntivirus.org, and includes a program for auto-updating. The
27 scanner is multithreaded, written in C, and POSIX compliant.
30 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
31 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
32 wirusów z OpenAntivirus.org, i posiada system automatycznej
33 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
37 Summary: Shared libraries for clamav
38 Summary(pl): Biblioteki dzielone clamav
42 Shared libraries for clamav.
44 %description libs -l pl
45 Biblioteki dzielone clamav.
48 Summary: clamav - Development header files and libraries
49 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
50 Group: Development/Libraries
51 Requires: %{name}-libs = %{version}
54 This package contains the development header files and libraries
55 necessary to develop clamav client applications.
57 %description devel -l pl
58 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
62 Summary: clamav staic libraris
63 Summary(pl): Biblioteki statyczne clamav
64 Group: Development/Libraries
65 Requires: %{name}-devel = %{version}
68 clamav static libraris.
70 %description static -l pl
71 Biblioteki statyczne clamav.
74 Summary: Virus database for clamav
75 Summary(pl): Bazy wirusów dla clamav
77 Version: %{version}.%{database_version}
81 Virus database for clamav (updated %{database_version})
83 %description database -l pl
84 Bazy wirusów dla clamav (aktualizowana %{database_version})
96 --with-dbdir=/var/lib/%{name}
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig}
102 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/cron.daily,%{_var}/log}
105 DESTDIR=$RPM_BUILD_ROOT
107 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
110 %{_bindir}/freshclam --quiet -l %{_var}/log/%{name}.log --daemon-notify
113 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
115 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
116 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
117 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
120 rm -rf $RPM_BUILD_ROOT
123 if [ -n "`getgid clamav`" ]; then
124 if [ "`getgid clamav`" != "43" ]; then
125 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
129 echo "Adding group clamav GID=43"
130 /usr/sbin/groupadd -g 43 -r -f clamav
132 if [ -n "`id -u clamav 2>/dev/null`" ]; then
133 if [ "`id -u clamav`" != "43" ]; then
134 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
138 echo "Adding user clamav UID=43"
139 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
143 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
144 /sbin/chkconfig --add clamd
145 if [ -f /var/lock/subsys/clamd ]; then
146 /etc/rc.d/init.d/clamd restart >&2
148 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
152 if [ "$1" = "0" ]; then
153 if [ -f /var/lock/subsys/clamd ]; then
154 /etc/rc.d/init.d/clamd stop
156 /sbin/chkconfig --del clamd
160 if [ "$1" = "0" ]; then
161 echo "Removing user clamav"
162 /usr/sbin/userdel clamav
163 echo "Removing group clamav"
164 /usr/sbin/groupdel clamav
167 %post libs -p /sbin/ldconfig
168 %postun libs -p /sbin/ldconfig
171 %defattr(644,root,root,755)
172 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
173 %attr(755,root,root) %{_bindir}/*
174 %attr(755,root,root) %{_sbindir}/*
175 %attr(755,clamav,root) %dir /var/lib/%{name}
176 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
177 %attr(750,root,root) %{_sysconfdir}/cron.daily/%{name}
178 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
179 %attr(754,root,root) /etc/rc.d/init.d/clamd
180 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_libdir}/lib*.so.*.*
188 %defattr(644,root,root,755)
189 %attr(755,root,root) %{_libdir}/lib*.so
194 %defattr(644,root,root,755)
198 %defattr(644,root,root,755)
199 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.db*