2 # - Make freshclam package (script and daemon)
3 # - restart amavis in triggers if group membership was modified?
6 %bcond_without milter # build without milter subpackage
7 %if "%{pld_release}" == "ac"
8 %bcond_with llvm # build without llvm support
10 %bcond_without llvm # build without llvm support
13 Summary: An anti-virus utility for Unix
14 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
20 Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21 # Source0-md5: 5cf25ed7778fa0cb6b140ad8f009befb
23 Source2: %{name}.sysconfig
24 Source3: %{name}-milter.init
25 Source4: %{name}-cron-updatedb
26 Source5: %{name}.logrotate
27 Source8: %{name}-post-updatedb
28 Source9: %{name}-milter.sysconfig
29 Patch0: %{name}-pld_config.patch
30 Patch1: %{name}-nolibs.patch
31 Patch2: am-nosilentrules.patch
32 URL: http://www.clamav.net/
33 BuildRequires: autoconf
34 BuildRequires: automake
35 BuildRequires: bzip2-devel
36 BuildRequires: gmp-devel
37 BuildRequires: libltdl-devel
38 %{?with_milter:BuildRequires: libmilter-devel}
39 BuildRequires: libstdc++-devel
40 BuildRequires: libtool
41 %{?with_milter:BuildRequires: libwrap-devel}
42 %{?with_llvm:BuildRequires: llvm-devel}
43 BuildRequires: ncurses-devel
44 BuildRequires: rpm >= 4.4.9-56
45 BuildRequires: rpmbuild(macros) >= 1.514
46 BuildRequires: zlib-devel
47 Requires(post,preun): /sbin/chkconfig
48 Requires(postun): /usr/sbin/groupdel
49 Requires(postun): /usr/sbin/userdel
50 Requires(postun,pre): /usr/sbin/usermod
51 Requires(pre): /bin/id
52 Requires(pre): /usr/bin/getgid
53 Requires(pre): /usr/sbin/groupadd
54 Requires(pre): /usr/sbin/useradd
55 Requires(triggerpostun): sed >= 4.0
56 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
57 Requires: /usr/sbin/usermod
58 Requires: rc-scripts >= 0.4.1.23
59 Suggests: clamav-database
60 Provides: group(clamav)
61 Provides: user(clamav)
62 Conflicts: logrotate < 3.7-4
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
67 especially for e-mail scanning on mail gateways. It provides a number
68 of utilities including a flexible and scalable multi-threaded daemon,
69 a command line scanner and advanced tool for automatic database
70 updates. The core of the package is an anti-virus engine available in
71 a form of shared library.
73 Here is a list of the main features:
74 - command-line scanner
75 - fast, multi-threaded daemon with support for on-access scanning
76 - milter interface for sendmail
77 - advanced database updater with support for scripted updates and
79 - virus scanner C library
80 - on-access scanning (Linux® and FreeBSD®)
81 - virus database updated multiple times per day (see home page for
82 total number of signatures)
83 - built-in support for various archive formats, including Zip, RAR,
84 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
85 - built-in support for almost all mail file formats
86 - built-in support for ELF executables and Portable Executable files
87 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
88 obfuscated with SUE, Y0da Cryptor and others
89 - built-in support for popular document formats including MS Office
90 and MacOffice files, HTML, RTF and PDF
92 %description -l pl.UTF-8
93 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
94 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
95 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
96 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
97 napisany w C i zgodny z POSIXem.
100 Summary: Shared libraries for clamav
101 Summary(pl.UTF-8): Biblioteki dzielone clamav
105 Shared libraries for clamav.
107 %description libs -l pl.UTF-8
108 Biblioteki dzielone clamav.
111 Summary: ClamAV filter using milter interface
112 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
114 Requires: %{name} = %{epoch}:%{version}-%{release}
116 #Requires: sendmail >= 8.11
117 Requires: tcp_wrappers
120 ClamAV sendmail filter using MILTER interface.
122 %description milter -l pl.UTF-8
123 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
126 Summary: clamav - Development header files and libraries
127 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
128 Group: Development/Libraries
129 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
130 Requires: bzip2-devel
135 This package contains the development header files and libraries
136 necessary to develop clamav client applications.
138 %description devel -l pl.UTF-8
139 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
143 Summary: clamav static libraries
144 Summary(pl.UTF-8): Biblioteki statyczne clamav
145 Group: Development/Libraries
146 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
149 clamav static libraries.
151 %description static -l pl.UTF-8
152 Biblioteki statyczne clamav.
168 %{?with_milter:--enable-milter} \
169 --with-dbdir=/var/lib/%{name} \
171 --with-ltdl-include=/usr/include \
172 --with-ltdl-lib=%{_libdir}
175 LIBTOOL=/usr/bin/libtool
178 rm -rf $RPM_BUILD_ROOT
179 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
180 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
183 LIBTOOL=/usr/bin/libtool \
184 DESTDIR=$RPM_BUILD_ROOT
185 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
187 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
188 5 * * * * root %{_sbindir}/clamav-cron-updatedb
191 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
193 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
194 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
196 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
197 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
198 cp -p etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
199 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
201 install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
203 # NOTE: clamd uses sane rights to it's clamd.pid file
204 # So better keep it dir
205 # If it is fixed use of dir will be unecesary
206 install -d $RPM_BUILD_ROOT/var/run/%{name}
208 :> $RPM_BUILD_ROOT/var/log/freshclam.log
211 rm -rf $RPM_BUILD_ROOT
213 %triggerin -- amavis-ng
214 %addusertogroup -q clamav amavis
216 %triggerin -- amavisd-new
217 %addusertogroup -q clamav amavis
219 %triggerin -- amavisd
220 %addusertogroup -q clamav amavis
223 %groupadd -g 43 clamav
224 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
227 /sbin/chkconfig --add clamd
228 %service clamd restart "Clam Antivirus daemon"
229 touch /var/log/freshclam.log
230 chown clamav:root /var/log/freshclam.log
231 chmod 640 /var/log/freshclam.log
234 if [ "$1" = "0" ]; then
236 /sbin/chkconfig --del clamd
240 if [ "$1" = "0" ]; then
245 %triggerpostun -- %{name} < 0.80
246 if [ -f /etc/clamav.conf.rpmsave ]; then
247 echo "Renaming config to new name /etc/clamd.conf"
248 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
249 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
250 echo "Changing config location in freshclam config"
251 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
254 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
255 %{__cp} -f /etc/clamd.conf{,.rpmsave}
258 s,^FixStaleSocket$,& yes,
259 s,^AllowSupplementaryGroups$,& yes,
260 s,^ClamukoScanOnOpen$,& yes,
261 s,^ClamukoScanOnClose$,& yes,
262 s,^ClamukoScanOnExec$,& yes,
266 %banner -e %{name}-0.90 <<EOF
267 ClamAV config was automatically upgraded to 0.90 format. You should review it
268 that it's still valid.
271 # unfortunately clamd has no configcheck option so we just have to start it
272 # once again after config was broken after upgrade
273 touch /var/lock/subsys/clamd
274 %service -q clamd restart
277 /sbin/chkconfig --add clamav-milter
278 %service clamav-milter restart "Clam Antivirus daemon"
281 if [ "$1" = "0" ]; then
282 %service clamav-milter stop
283 /sbin/chkconfig --del clamav-milter
286 %post libs -p /sbin/ldconfig
287 %postun libs -p /sbin/ldconfig
290 %defattr(644,root,root,755)
291 %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
292 %attr(755,root,root) %{_bindir}/clambc
293 %attr(755,root,root) %{_bindir}/clamdscan
294 %attr(755,root,root) %{_bindir}/clamdtop
295 %attr(755,root,root) %{_bindir}/clamscan
296 %attr(755,root,root) %{_bindir}/freshclam
297 %attr(755,root,root) %{_bindir}/sigtool
298 %attr(755,root,root) %{_bindir}/clamconf
299 %attr(755,root,root) %{_sbindir}/clamd
300 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
301 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
302 %attr(755,clamav,root) %dir /var/lib/%{name}
303 %attr(644,clamav,root) %ghost %verify(not md5 mtime size) /var/lib/clamav/*.cvd
304 %attr(640,clamav,root) %ghost /var/log/freshclam.log
305 %attr(750,clamav,clamav) %dir /var/run/%{name}
307 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
308 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
309 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
311 %attr(754,root,root) /etc/rc.d/init.d/clamd
312 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
313 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
315 %{_mandir}/man8/clamd*
319 %defattr(644,root,root,755)
320 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
321 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
322 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
323 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
324 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
325 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
326 %attr(755,root,root) %{_sbindir}/clamav-milter
327 %{_mandir}/man8/clamav-milter.8*
328 %attr(700,clamav,clamav) /var/spool/clamav
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_libdir}/lib*.so.*.*
334 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
335 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
336 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
339 %defattr(644,root,root,755)
340 %attr(755,root,root) %{_bindir}/clamav-config
341 %attr(755,root,root) %{_libdir}/lib*.so
344 %{_pkgconfigdir}/*.pc
347 %defattr(644,root,root,755)