2 # - Make freshclam package (script and daemon)
5 %bcond_without milter # build without milter subpackage
6 %bcond_with curl # enable curl support
10 Summary: An anti-virus utility for Unix
11 Summary(pl): Narzêdzie antywirusowe dla Uniksów
14 Release: 0.%{_rc}.%{_rel}
18 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}%{_rc}.tar.gz
19 # Source0-md5: 91da47456ed28a7cfbfe17b033e15121
21 Source2: %{name}.sysconfig
22 Source3: %{name}-milter.init
23 Source4: %{name}-cron-updatedb
24 Source5: %{name}.logrotate
25 Source8: %{name}-post-updatedb
26 Source9: %{name}-milter.sysconfig
27 Patch0: %{name}-pld_config.patch
28 Patch1: %{name}-no_auto_libwrap.patch
29 Patch2: %{name}-nolibs.patch
30 URL: http://www.clamav.net/
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: bzip2-devel
34 %{?with_curl:BuildRequires: curl-devel}
35 BuildRequires: gmp-devel
36 BuildRequires: libtool
37 %{?with_milter:BuildRequires: libwrap-devel}
38 BuildRequires: rpmbuild(macros) >= 1.268
39 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
40 BuildRequires: zlib-devel
41 Requires(post,preun): /sbin/chkconfig
42 Requires(postun): /usr/sbin/groupdel
43 Requires(postun): /usr/sbin/userdel
44 Requires(postun,pre): /usr/sbin/usermod
45 Requires(pre): /bin/id
46 Requires(pre): /usr/bin/getgid
47 Requires(pre): /usr/sbin/groupadd
48 Requires(pre): /usr/sbin/useradd
49 Requires(triggerpostun): sed >= 4.0
50 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
51 Requires: /usr/sbin/usermod
54 Provides: group(clamav)
55 Provides: user(clamav)
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
60 AMaViS, compressed files, on-access scanning and includes a program
61 for auto-updating with support for digital signatures. The virus
62 database has over 85387 viruses, worms and trojans signatures. The
63 scanner is multithreaded, written in C, and POSIX compliant.
66 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
67 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
68 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
69 Baza wirusów zawiera ponad 85387 sygnatur. Skaner jest wielow±tkowy,
70 napisany w C i zgodny z POSIXem.
73 Summary: Shared libraries for clamav
74 Summary(pl): Biblioteki dzielone clamav
78 Shared libraries for clamav.
80 %description libs -l pl
81 Biblioteki dzielone clamav.
84 Summary: ClamAV filter using milter interface
85 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
87 Requires: %{name} = %{epoch}:%{version}-%{release}
88 Requires: sendmail >= 8.11
89 Requires: tcp_wrappers
92 ClamAV sendmail filter using MILTER interface.
94 %description milter -l pl
95 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
98 Summary: clamav - Development header files and libraries
99 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
100 Group: Development/Libraries
101 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
102 Requires: bzip2-devel
107 This package contains the development header files and libraries
108 necessary to develop clamav client applications.
110 %description devel -l pl
111 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
115 Summary: clamav static libraries
116 Summary(pl): Biblioteki statyczne clamav
117 Group: Development/Libraries
118 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
121 clamav static libraries.
123 %description static -l pl
124 Biblioteki statyczne clamav.
127 %setup -q %{?_rc:-n %{name}-%{version}%{_rc}}
132 # kill old libtool.m4 copy
133 head -n 489 acinclude.m4 > acinclude.m4.tmp
134 tail -n +4089 acinclude.m4 >> acinclude.m4.tmp
135 mv -f acinclude.m4.tmp acinclude.m4
145 %{!?with_curl:--without-libcurl} \
146 %{?with_milter:--enable-milter} \
147 --with-dbdir=/var/lib/%{name}
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
153 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
156 DESTDIR=$RPM_BUILD_ROOT
157 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
159 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
160 5 * * * * root %{_sbindir}/clamav-cron-updatedb
163 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
165 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
166 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
168 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
169 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
170 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
171 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
173 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
175 # NOTE: clamd uses sane rights to it's clamd.pid file
176 # So better keep it dir
177 # If it is fixed use of dir will be unecesary
178 install -d $RPM_BUILD_ROOT/var/run/%{name}
180 :> $RPM_BUILD_ROOT/var/log/freshclam.log
183 rm -rf $RPM_BUILD_ROOT
185 %triggerin -- amavis-ng
186 AMAVIS=$(/usr/bin/getgid amavis)
188 if [ $RESULT -eq 0 ]; then
189 echo "Adding clamav to amavis group GID=$AMAVIS"
190 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
193 %triggerin -- amavisd-new
194 AMAVIS=$(/usr/bin/getgid amavis)
196 if [ $RESULT -eq 0 ]; then
197 echo "Adding clamav to amavis group GID=$AMAVIS"
198 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
201 %triggerin -- amavisd
202 AMAVIS=$(/usr/bin/getgid amavis)
204 if [ $RESULT -eq 0 ]; then
205 echo "Adding clamav to amavis group GID=$AMAVIS"
206 /usr/sbin/usermod -G amavis clamav 1>&2
210 %groupadd -g 43 clamav
211 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
213 # FIXME: check this. is it proper after useradd macro?
214 # TODO: use addusertogroup macro?
215 if [ -n "`/usr/bin/getgid amavis`" ]; then
216 echo "Adding clamav to amavis group"
217 /usr/sbin/usermod -G amavis clamav 1>&2
221 /sbin/chkconfig --add clamd
222 %service clamd restart "Clam Antivirus daemon"
223 touch /var/log/freshclam.log
224 chown clamav:root /var/log/freshclam.log
225 chmod 640 /var/log/freshclam.log
228 if [ "$1" = "0" ]; then
230 /sbin/chkconfig --del clamd
234 if [ "$1" = "0" ]; then
239 %triggerpostun -- %{name} <= 0.75.1
240 if [ -f /etc/clamav.conf.rpmsave ]; then
241 echo "Renaming config to new name /etc/clamd.conf"
242 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
243 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
244 echo "Changing config location in freshclam config"
245 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
248 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
249 %{__cp} -f /etc/clamd.conf{,.rpmsave}
252 s,^FixStaleSocket$,& yes,
253 s,^AllowSupplementaryGroups$,& yes,
254 s,^ClamukoScanOnOpen$,& yes,
255 s,^ClamukoScanOnClose$,& yes,
256 s,^ClamukoScanOnExec$,& yes,
258 %banner -e %{name}-0.90 <<EOF
259 ClamAV config was automatically upgraded to 0.90 format. You should review it
260 that it's still valid.
263 # unfortunately clamd has no configcheck option so we just have to start it
264 # once again after config was broken after upgrade
265 touch /var/lock/subsys/clamd
266 %service -q clamd restart
269 /sbin/chkconfig --add clamav-milter
270 %service clamav-milter restart "Clam Antivirus daemon"
273 if [ "$1" = "0" ]; then
274 %service clamav-milter stop
275 /sbin/chkconfig --del clamav-milter
278 %post libs -p /sbin/ldconfig
279 %postun libs -p /sbin/ldconfig
282 %defattr(644,root,root,755)
283 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/*.pdf
284 %attr(755,root,root) %{_bindir}/clamdscan
285 %attr(755,root,root) %{_bindir}/clamscan
286 %attr(755,root,root) %{_bindir}/freshclam
287 %attr(755,root,root) %{_bindir}/sigtool
288 %attr(755,root,root) %{_bindir}/clamconf
289 %attr(755,root,root) %{_sbindir}/clamd
290 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
291 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
292 %attr(755,clamav,root) %dir /var/lib/%{name}
293 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
294 %attr(640,clamav,root) %ghost /var/log/freshclam.log
295 %attr(750,clamav,clamav) %dir /var/run/%{name}
297 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
298 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
299 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
301 %attr(754,root,root) /etc/rc.d/init.d/clamd
302 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
303 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
305 %{_mandir}/man8/clamd*
309 %defattr(644,root,root,755)
310 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
311 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
312 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
313 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
314 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
315 %attr(755,root,root) %{_sbindir}/clamav-milter
316 %{_mandir}/man8/clamav-milter.8*
317 %attr(700,clamav,clamav) /var/spool/clamav
321 %defattr(644,root,root,755)
322 %attr(755,root,root) %{_libdir}/lib*.so.*.*
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_bindir}/clamav-config
327 %attr(755,root,root) %{_libdir}/lib*.so
330 %{_pkgconfigdir}/*.pc
333 %defattr(644,root,root,755)