1 %define database_version 20030117
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
11 Source2: %{name}.sysconfig
12 # gziped from http://clamav.elektrapro.com/database/:
13 Source3: %{name}-database-%{database_version}.tar.gz
14 URL: http://clamav.elektrapro.com/
15 Requires: %{name}-database
16 BuildRequires: autoconf
17 BuildRequires: automake
18 BuildRequires: zlib-devel
19 Requires(poest,preun): /sbin/chkconfig
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
24 AMaViS, compressed files, uses the virus database from
25 OpenAntivirus.org, and includes a program for auto-updating. The
26 scanner is multithreaded, written in C, and POSIX compliant.
29 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
30 uniksowych. Wspiera on AMaViSa, skompresowane pliki, u¿ywa bazy
31 wirusów z OpenAntivirus.org, i posiada system automatycznej
32 aktualizacji. Skaner jest wielow±tkowy, napisany w C i zgodny z
36 Summary: Shared libraries for clamav
37 Summary(pl): Biblioteki dzielone clamav
41 Shared libraries for clamav.
43 %description libs -l pl
44 Biblioteki dzielone clamav.
47 Summary: clamav - Development header files and libraries
48 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
49 Group: Development/Libraries
50 Requires: %{name}-libs = %{version}
53 This package contains the development header files and libraries
54 necessary to develop clamav client applications.
56 %description devel -l pl
57 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
61 Summary: clamav staic libraris
62 Summary(pl): Biblioteki statyczne clamav
63 Group: Development/Libraries
64 Requires: %{name}-devel = %{version}
67 clamav static libraris.
69 %description static -l pl
70 Biblioteki statyczne clamav.
73 Summary: Virus database for clamav
74 Summary(pl): Bazy wirusów dla clamav
76 Version: %{version}.%{database_version}
79 Virus database for clamav
81 %description database -l pl
82 Bazy wirusów dla clamav
86 %setup -q -n clamav-0.54 -a 3
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig}
100 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/cron.daily,%{_var}/log}
103 DESTDIR=$RPM_BUILD_ROOT
105 echo -e '#!/bin/sh\n%{_bindir}/freshclam --quiet -l %{_var}/log/%{name}.log --daemon-notify' \
106 > $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
108 touch $RPM_BUILD_ROOT%{_var}/log/%{name}.log
110 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
111 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
112 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
115 rm -rf $RPM_BUILD_ROOT
118 if [ -n "`getgid clamav`" ]; then
119 if [ "`getgid clamav`" != "43" ]; then
120 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
124 echo "Adding group clamav GID=43"
125 /usr/sbin/groupadd -g 43 -r -f clamav
127 if [ -n "`id -u clamav 2>/dev/null`" ]; then
128 if [ "`id -u clamav`" != "43" ]; then
129 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
133 echo "Adding user clamav UID=43"
134 /usr/sbin/useradd -u 43 -r -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
138 touch %{_var}/log/%{name}.log && chmod 640 %{_var}/log/%{name}.log && chown clamav %{_var}/log/%{name}.log
139 /sbin/chkconfig --add clamd
140 if [ -f /var/lock/subsys/clamd ]; then
141 /etc/rc.d/init.d/clamd restart >&2
143 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
147 if [ "$1" = "0" ]; then
148 echo "Removing user clamav"
149 /usr/sbin/userdel clamav
150 echo "Removing group clamav"
151 /usr/sbin/groupdel clamav
155 if [ "$1" = "0" ]; then
156 if [ -f /var/lock/subsys/clamd ]; then
157 /etc/rc.d/init.d/clamd stop
159 /sbin/chkconfig --del clamd
162 %post libs -p /sbin/ldconfig
163 %postun libs -p /sbin/ldconfig
166 %defattr(644,root,root,755)
167 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
168 %attr(755,root,root) %{_bindir}/*
169 %attr(755,root,root) %{_sbindir}/*
170 %attr(755,clamav,root) %dir %{_datadir}/%{name}
171 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
172 %attr(750,root,root) %{_sysconfdir}/cron.daily/%{name}
173 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
174 %attr(754,root,root) /etc/rc.d/init.d/clamd
175 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_libdir}/lib*.so.*.*
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_libdir}/lib*.so
189 %defattr(644,root,root,755)
193 %defattr(644,root,root,755)
194 %attr(644,clamav,root) %verify(not md5 size mtime) %{_datadir}/%{name}/*.db*