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 Patch3: %{name}-find_milter.patch
31 URL: http://www.clamav.net/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: bzip2-devel
35 %{?with_curl:BuildRequires: curl-devel}
36 BuildRequires: gmp-devel
37 BuildRequires: libtool
38 %{?with_milter:BuildRequires: libwrap-devel}
39 BuildRequires: rpmbuild(macros) >= 1.268
40 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
41 BuildRequires: zlib-devel
42 Requires(post,preun): /sbin/chkconfig
43 Requires(postun): /usr/sbin/groupdel
44 Requires(postun): /usr/sbin/userdel
45 Requires(postun,pre): /usr/sbin/usermod
46 Requires(pre): /bin/id
47 Requires(pre): /usr/bin/getgid
48 Requires(pre): /usr/sbin/groupadd
49 Requires(pre): /usr/sbin/useradd
50 Requires(triggerpostun): sed >= 4.0
51 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
52 Requires: /usr/sbin/usermod
55 Provides: group(clamav)
56 Provides: user(clamav)
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
61 AMaViS, compressed files, on-access scanning and includes a program
62 for auto-updating with support for digital signatures. The virus
63 database has over 85387 viruses, worms and trojans signatures. The
64 scanner is multithreaded, written in C, and POSIX compliant.
67 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
68 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
69 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
70 Baza wirusów zawiera ponad 85387 sygnatur. Skaner jest wielow±tkowy,
71 napisany w C i zgodny z POSIXem.
74 Summary: Shared libraries for clamav
75 Summary(pl): Biblioteki dzielone clamav
79 Shared libraries for clamav.
81 %description libs -l pl
82 Biblioteki dzielone clamav.
85 Summary: ClamAV filter using milter interface
86 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
88 Requires: %{name} = %{epoch}:%{version}-%{release}
89 Requires: sendmail >= 8.11
90 Requires: tcp_wrappers
93 ClamAV sendmail filter using MILTER interface.
95 %description milter -l pl
96 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
99 Summary: clamav - Development header files and libraries
100 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
101 Group: Development/Libraries
102 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
103 Requires: bzip2-devel
108 This package contains the development header files and libraries
109 necessary to develop clamav client applications.
111 %description devel -l pl
112 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
116 Summary: clamav static libraries
117 Summary(pl): Biblioteki statyczne clamav
118 Group: Development/Libraries
119 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
122 clamav static libraries.
124 %description static -l pl
125 Biblioteki statyczne clamav.
128 %setup -q %{?_rc:-n %{name}-%{version}%{_rc}}
134 # kill old libtool.m4 copy
135 head -n 489 acinclude.m4 > acinclude.m4.tmp
136 tail -n +4089 acinclude.m4 >> acinclude.m4.tmp
137 mv -f acinclude.m4.tmp acinclude.m4
147 %{!?with_curl:--without-libcurl} \
148 %{?with_milter:--enable-milter} \
149 --with-dbdir=/var/lib/%{name}
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
155 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
158 DESTDIR=$RPM_BUILD_ROOT
159 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
161 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
162 5 * * * * root %{_sbindir}/clamav-cron-updatedb
165 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
167 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
168 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
170 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
171 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
172 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
173 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
175 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
177 # NOTE: clamd uses sane rights to it's clamd.pid file
178 # So better keep it dir
179 # If it is fixed use of dir will be unecesary
180 install -d $RPM_BUILD_ROOT/var/run/%{name}
182 :> $RPM_BUILD_ROOT/var/log/freshclam.log
185 rm -rf $RPM_BUILD_ROOT
187 %triggerin -- amavis-ng
188 AMAVIS=$(/usr/bin/getgid amavis)
190 if [ $RESULT -eq 0 ]; then
191 echo "Adding clamav to amavis group GID=$AMAVIS"
192 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
195 %triggerin -- amavisd-new
196 AMAVIS=$(/usr/bin/getgid amavis)
198 if [ $RESULT -eq 0 ]; then
199 echo "Adding clamav to amavis group GID=$AMAVIS"
200 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
203 %triggerin -- amavisd
204 AMAVIS=$(/usr/bin/getgid amavis)
206 if [ $RESULT -eq 0 ]; then
207 echo "Adding clamav to amavis group GID=$AMAVIS"
208 /usr/sbin/usermod -G amavis clamav 1>&2
212 %groupadd -g 43 clamav
213 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
215 # FIXME: check this. is it proper after useradd macro?
216 # TODO: use addusertogroup macro?
217 if [ -n "`/usr/bin/getgid amavis`" ]; then
218 echo "Adding clamav to amavis group"
219 /usr/sbin/usermod -G amavis clamav 1>&2
223 /sbin/chkconfig --add clamd
224 %service clamd restart "Clam Antivirus daemon"
225 touch /var/log/freshclam.log
226 chown clamav:root /var/log/freshclam.log
227 chmod 640 /var/log/freshclam.log
230 if [ "$1" = "0" ]; then
232 /sbin/chkconfig --del clamd
236 if [ "$1" = "0" ]; then
241 %triggerpostun -- %{name} <= 0.75.1
242 if [ -f /etc/clamav.conf.rpmsave ]; then
243 echo "Renaming config to new name /etc/clamd.conf"
244 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
245 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
246 echo "Changing config location in freshclam config"
247 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
250 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
251 %{__cp} -f /etc/clamd.conf{,.rpmsave}
254 s,^FixStaleSocket$,& yes,
255 s,^AllowSupplementaryGroups$,& yes,
256 s,^ClamukoScanOnOpen$,& yes,
257 s,^ClamukoScanOnClose$,& yes,
258 s,^ClamukoScanOnExec$,& yes,
260 %banner -e %{name}-0.90 <<EOF
261 ClamAV config was automatically upgraded to 0.90 format. You should review it
262 that it's still valid.
265 # unfortunately clamd has no configcheck option so we just have to start it
266 # once again after config was broken after upgrade
267 touch /var/lock/subsys/clamd
268 %service -q clamd restart
271 /sbin/chkconfig --add clamav-milter
272 %service clamav-milter restart "Clam Antivirus daemon"
275 if [ "$1" = "0" ]; then
276 %service clamav-milter stop
277 /sbin/chkconfig --del clamav-milter
280 %post libs -p /sbin/ldconfig
281 %postun libs -p /sbin/ldconfig
284 %defattr(644,root,root,755)
285 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/*.pdf
286 %attr(755,root,root) %{_bindir}/clamdscan
287 %attr(755,root,root) %{_bindir}/clamscan
288 %attr(755,root,root) %{_bindir}/freshclam
289 %attr(755,root,root) %{_bindir}/sigtool
290 %attr(755,root,root) %{_bindir}/clamconf
291 %attr(755,root,root) %{_sbindir}/clamd
292 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
293 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
294 %attr(755,clamav,root) %dir /var/lib/%{name}
295 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
296 %attr(640,clamav,root) %ghost /var/log/freshclam.log
297 %attr(750,clamav,clamav) %dir /var/run/%{name}
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
300 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
301 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
303 %attr(754,root,root) /etc/rc.d/init.d/clamd
304 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
305 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
307 %{_mandir}/man8/clamd*
311 %defattr(644,root,root,755)
312 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
313 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
314 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
315 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
316 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
317 %attr(755,root,root) %{_sbindir}/clamav-milter
318 %{_mandir}/man8/clamav-milter.8*
319 %attr(700,clamav,clamav) /var/spool/clamav
323 %defattr(644,root,root,755)
324 %attr(755,root,root) %{_libdir}/lib*.so.*.*
327 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_bindir}/clamav-config
329 %attr(755,root,root) %{_libdir}/lib*.so
332 %{_pkgconfigdir}/*.pc
335 %defattr(644,root,root,755)