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
8 Summary: An anti-virus utility for Unix
9 Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
16 Source0: http://downloads.sourceforge.net/clamav/0.96rc1/%{name}-%{version}.tar.gz
17 # Source0-md5: 28ac7bec4cc03627a8e2d6e8647ee661
19 Source2: %{name}.sysconfig
20 Source3: %{name}-milter.init
21 Source4: %{name}-cron-updatedb
22 Source5: %{name}.logrotate
23 Source8: %{name}-post-updatedb
24 Source9: %{name}-milter.sysconfig
25 Patch0: %{name}-pld_config.patch
26 Patch1: %{name}-nolibs.patch
27 URL: http://www.clamav.net/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: bzip2-devel
31 BuildRequires: gmp-devel
32 BuildRequires: libltdl-devel
33 %{?with_milter:BuildRequires: libmilter-devel}
34 BuildRequires: libtool
35 %{?with_milter:BuildRequires: libwrap-devel}
36 BuildRequires: rpmbuild(macros) >= 1.514
37 BuildRequires: zlib-devel
38 Requires(post,preun): /sbin/chkconfig
39 Requires(postun): /usr/sbin/groupdel
40 Requires(postun): /usr/sbin/userdel
41 Requires(postun,pre): /usr/sbin/usermod
42 Requires(pre): /bin/id
43 Requires(pre): /usr/bin/getgid
44 Requires(pre): /usr/sbin/groupadd
45 Requires(pre): /usr/sbin/useradd
46 Requires(triggerpostun): sed >= 4.0
47 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
48 Requires: /usr/sbin/usermod
49 Requires: rc-scripts >= 0.4.1.23
50 Provides: group(clamav)
51 Provides: user(clamav)
52 Conflicts: logrotate < 3.7-4
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
57 especially for e-mail scanning on mail gateways. It provides a number
58 of utilities including a flexible and scalable multi-threaded daemon,
59 a command line scanner and advanced tool for automatic database
60 updates. The core of the package is an anti-virus engine available in
61 a form of shared library.
63 Here is a list of the main features:
64 - command-line scanner
65 - fast, multi-threaded daemon with support for on-access scanning
66 - milter interface for sendmail
67 - advanced database updater with support for scripted updates and
69 - virus scanner C library
70 - on-access scanning (Linux® and FreeBSD®)
71 - virus database updated multiple times per day (see home page for
72 total number of signatures)
73 - built-in support for various archive formats, including Zip, RAR,
74 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
75 - built-in support for almost all mail file formats
76 - built-in support for ELF executables and Portable Executable files
77 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
78 obfuscated with SUE, Y0da Cryptor and others
79 - built-in support for popular document formats including MS Office
80 and MacOffice files, HTML, RTF and PDF
82 %description -l pl.UTF-8
83 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
84 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
85 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
86 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
87 napisany w C i zgodny z POSIXem.
90 Summary: Shared libraries for clamav
91 Summary(pl.UTF-8): Biblioteki dzielone clamav
95 Shared libraries for clamav.
97 %description libs -l pl.UTF-8
98 Biblioteki dzielone clamav.
101 Summary: ClamAV filter using milter interface
102 Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
104 Requires: %{name} = %{epoch}:%{version}-%{release}
105 %if "%{pld_release}" == "ti"
108 Requires: sendmail >= 8.11
110 Requires: tcp_wrappers
113 ClamAV sendmail filter using MILTER interface.
115 %description milter -l pl.UTF-8
116 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
119 Summary: clamav - Development header files and libraries
120 Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
121 Group: Development/Libraries
122 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
123 Requires: bzip2-devel
128 This package contains the development header files and libraries
129 necessary to develop clamav client applications.
131 %description devel -l pl.UTF-8
132 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
136 Summary: clamav static libraries
137 Summary(pl.UTF-8): Biblioteki statyczne clamav
138 Group: Development/Libraries
139 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
142 clamav static libraries.
144 %description static -l pl.UTF-8
145 Biblioteki statyczne clamav.
160 %{?with_milter:--enable-milter} \
161 --with-dbdir=/var/lib/%{name} \
163 --with-ltdl-include=/usr/include \
164 --with-ltdl-lib=%{_libdir}
167 LIBTOOL=/usr/bin/libtool
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
172 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
175 LIBTOOL=/usr/bin/libtool \
176 DESTDIR=$RPM_BUILD_ROOT
177 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
179 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
180 5 * * * * root %{_sbindir}/clamav-cron-updatedb
183 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
185 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
186 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
188 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
189 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
190 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
191 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
193 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
195 # NOTE: clamd uses sane rights to it's clamd.pid file
196 # So better keep it dir
197 # If it is fixed use of dir will be unecesary
198 install -d $RPM_BUILD_ROOT/var/run/%{name}
200 :> $RPM_BUILD_ROOT/var/log/freshclam.log
203 rm -rf $RPM_BUILD_ROOT
205 %triggerin -- amavis-ng
206 %addusertogroup -q clamav amavis
208 %triggerin -- amavisd-new
209 %addusertogroup -q clamav amavis
211 %triggerin -- amavisd
212 %addusertogroup -q clamav amavis
215 %groupadd -g 43 clamav
216 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
219 /sbin/chkconfig --add clamd
220 %service clamd restart "Clam Antivirus daemon"
221 touch /var/log/freshclam.log
222 chown clamav:root /var/log/freshclam.log
223 chmod 640 /var/log/freshclam.log
226 if [ "$1" = "0" ]; then
228 /sbin/chkconfig --del clamd
232 if [ "$1" = "0" ]; then
237 %triggerpostun -- %{name} < 0.80
238 if [ -f /etc/clamav.conf.rpmsave ]; then
239 echo "Renaming config to new name /etc/clamd.conf"
240 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
241 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
242 echo "Changing config location in freshclam config"
243 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
246 %triggerpostun -- %{name} < 0.90-0.rc2.0.10
247 %{__cp} -f /etc/clamd.conf{,.rpmsave}
250 s,^FixStaleSocket$,& yes,
251 s,^AllowSupplementaryGroups$,& yes,
252 s,^ClamukoScanOnOpen$,& yes,
253 s,^ClamukoScanOnClose$,& yes,
254 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 docs/*.pdf
284 %attr(755,root,root) %{_bindir}/clambc
285 %attr(755,root,root) %{_bindir}/clamdscan
286 %attr(755,root,root) %{_bindir}/clamdtop
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 %attr(644,clamav,root) %ghost %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 %config(noreplace) %verify(not md5 mtime size) /etc/clamav-milter.conf
314 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
315 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
316 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
317 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
318 %attr(755,root,root) %{_sbindir}/clamav-milter
319 %{_mandir}/man8/clamav-milter.8*
320 %attr(700,clamav,clamav) /var/spool/clamav
324 %defattr(644,root,root,755)
325 %attr(755,root,root) %{_libdir}/lib*.so.*.*
326 %attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
327 %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
328 %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_bindir}/clamav-config
333 %attr(755,root,root) %{_libdir}/lib*.so
336 %{_pkgconfigdir}/*.pc
339 %defattr(644,root,root,755)