]> git.pld-linux.org Git - packages/clamav.git/blame_incremental - clamav.spec
-up to 0.98.6
[packages/clamav.git] / clamav.spec
... / ...
CommitLineData
1# TODO:
2# - Make freshclam package (script and daemon)
3# - restart amavis in triggers if group membership was modified?
4#
5# Conditional build:
6%bcond_without milter # milter interface subpackage
7%if "%{pld_release}" == "ac"
8%bcond_with llvm # LLVM support
9%else
10%bcond_without llvm # LLVM support
11%endif
12
13Summary: An anti-virus utility for Unix
14Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
15Name: clamav
16Version: 0.98.6
17Release: 1
18License: GPL v2+
19Group: Daemons
20Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21# Source0-md5: 7f4f7e82a09e42c4ebf153d6d452d9d8
22Source1: %{name}.init
23Source2: %{name}.sysconfig
24Source3: %{name}-milter.init
25Source4: %{name}-cron-updatedb
26Source5: %{name}.logrotate
27Source8: %{name}-post-updatedb
28Source9: %{name}-milter.sysconfig
29Source10: %{name}.tmpfiles
30Source11: clamd.service
31Patch0: %{name}-pld_config.patch
32Patch1: %{name}-nolibs.patch
33%if "%{pld_release}" == "ac"
34Patch2: am-nosilentrules.patch
35%endif
36Patch3: ac2.68.patch
37Patch4: %{name}-openssl.patch
38Patch5: %{name}-major.patch
39URL: http://www.clamav.net/
40BuildRequires: autoconf
41BuildRequires: automake
42BuildRequires: bzip2-devel
43BuildRequires: curl-devel
44BuildRequires: gmp-devel
45BuildRequires: libltdl-devel
46%{?with_milter:BuildRequires: libmilter-devel}
47BuildRequires: libstdc++-devel
48BuildRequires: libtool
49%{?with_milter:BuildRequires: libwrap-devel}
50%{?with_llvm:BuildRequires: llvm-devel}
51BuildRequires: ncurses-devel
52BuildRequires: openssl-devel
53BuildRequires: rpm >= 4.4.9-56
54BuildRequires: rpmbuild(macros) >= 1.647
55BuildRequires: zlib-devel
56Requires(post,preun): /sbin/chkconfig
57Requires(postun): /usr/sbin/groupdel
58Requires(postun): /usr/sbin/userdel
59Requires(postun,pre): /usr/sbin/usermod
60Requires(pre): /bin/id
61Requires(pre): /usr/bin/getgid
62Requires(pre): /usr/sbin/groupadd
63Requires(pre): /usr/sbin/useradd
64Requires(post,preun,postun): systemd-units >= 38
65Requires: systemd-units >= 38
66Requires(triggerpostun): sed >= 4.0
67Requires: %{name}-libs = %{epoch}:%{version}-%{release}
68Requires: /usr/sbin/usermod
69Requires: rc-scripts >= 0.4.1.23
70Suggests: clamav-database
71Suggests: crondaemon
72Provides: group(clamav)
73Provides: user(clamav)
74Conflicts: logrotate < 3.7-4
75BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76
77%description
78Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
79especially for e-mail scanning on mail gateways. It provides a number
80of utilities including a flexible and scalable multi-threaded daemon,
81a command line scanner and advanced tool for automatic database
82updates. The core of the package is an anti-virus engine available in
83a form of shared library.
84
85Here is a list of the main features:
86- command-line scanner
87- fast, multi-threaded daemon with support for on-access scanning
88- milter interface for sendmail
89- advanced database updater with support for scripted updates and
90 digital signatures
91- virus scanner C library
92- on-access scanning (Linux® and FreeBSD®)
93- virus database updated multiple times per day (see home page for
94 total number of signatures)
95- built-in support for various archive formats, including Zip, RAR,
96 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
97- built-in support for almost all mail file formats
98- built-in support for ELF executables and Portable Executable files
99 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
100 obfuscated with SUE, Y0da Cryptor and others
101- built-in support for popular document formats including MS Office
102 and MacOffice files, HTML, RTF and PDF
103
104%description -l pl.UTF-8
105Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
106uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
107"on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
108Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
109napisany w C i zgodny z POSIXem.
110
111%package libs
112Summary: Shared libraries for clamav
113Summary(pl.UTF-8): Biblioteki dzielone clamav
114Group: Libraries
115
116%description libs
117Shared libraries for clamav.
118
119%description libs -l pl.UTF-8
120Biblioteki dzielone clamav.
121
122%package milter
123Summary: ClamAV filter using milter interface
124Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
125Group: Daemons
126Requires: %{name} = %{epoch}:%{version}-%{release}
127Requires: postfix
128#Requires: sendmail >= 8.11
129Requires: tcp_wrappers
130
131%description milter
132ClamAV sendmail filter using MILTER interface.
133
134%description milter -l pl.UTF-8
135Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
136
137%package devel
138Summary: clamav - Development header files and libraries
139Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
140Group: Development/Libraries
141Requires: %{name}-libs = %{epoch}:%{version}-%{release}
142Requires: bzip2-devel
143Requires: curl-devel
144Requires: gmp-devel
145Requires: openssl-devel
146Requires: zlib-devel
147
148%description devel
149This package contains the development header files and libraries
150necessary to develop clamav client applications.
151
152%description devel -l pl.UTF-8
153Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
154klienckich clamav.
155
156%package static
157Summary: clamav static libraries
158Summary(pl.UTF-8): Biblioteki statyczne clamav
159Group: Development/Libraries
160Requires: %{name}-devel = %{epoch}:%{version}-%{release}
161
162%description static
163clamav static libraries.
164
165%description static -l pl.UTF-8
166Biblioteki statyczne clamav.
167
168%prep
169%setup -q
170%patch0 -p1
171%patch1 -p1
172%if "%{pld_release}" == "ac"
173%patch2 -p1
174%endif
175%if "%{pld_release}" != "ac"
176%patch3 -p1
177%endif
178#%patch4 -p1
179%patch5 -p1
180
181%build
182%{__libtoolize}
183%{__aclocal} -I m4
184%{__autoconf}
185%{__autoheader}
186%{__automake}
187%configure \
188 --disable-silent-rules \
189 --disable-clamav \
190 --enable-clamdtop \
191 %{?with_llvm:--enable-llvm --with-system-llvm} \
192 %{?with_milter:--enable-milter} \
193 --with-dbdir=/var/lib/%{name} \
194 --with-no-cache \
195 --with-ltdl-include=%{_includedir} \
196 --with-ltdl-lib=%{_libdir}
197
198%{__make} \
199 LIBTOOL=%{_bindir}/libtool
200
201%install
202rm -rf $RPM_BUILD_ROOT
203install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
204 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
205 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
206 $RPM_BUILD_ROOT%{systemdunitdir}
207
208%{__make} install \
209 LIBTOOL=%{_bindir}/libtool \
210 DESTDIR=$RPM_BUILD_ROOT
211%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
212
213cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
2145 * * * * root %{_sbindir}/clamav-cron-updatedb
215EOF
216
217install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
218%if %{with milter}
219install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
220cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
221%endif
222cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
223install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
224for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
225 mv $i ${i%%.sample}
226done
227cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
228
229install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
230
231cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
232
233cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
234
235# NOTE: clamd uses sane rights to it's clamd.pid file
236# So better keep it dir
237# If it is fixed use of dir will be unecesary
238install -d $RPM_BUILD_ROOT/var/run/%{name}
239
240:> $RPM_BUILD_ROOT/var/log/freshclam.log
241
242%clean
243rm -rf $RPM_BUILD_ROOT
244
245%triggerin -- amavis-ng
246%addusertogroup -q clamav amavis
247
248%triggerin -- amavisd-new
249%addusertogroup -q clamav amavis
250
251%triggerin -- amavisd
252%addusertogroup -q clamav amavis
253
254%pre
255%groupadd -g 43 clamav
256%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
257
258%post
259/sbin/chkconfig --add clamd
260%service clamd restart "Clam Antivirus daemon"
261touch /var/log/freshclam.log
262chown clamav:root /var/log/freshclam.log
263chmod 640 /var/log/freshclam.log
264%systemd_post clamd.service
265
266%preun
267if [ "$1" = "0" ]; then
268 %service clamd stop
269 /sbin/chkconfig --del clamd
270fi
271%systemd_preun clamd.service
272
273%postun
274if [ "$1" = "0" ]; then
275 %userremove clamav
276 %groupremove clamav
277fi
278%systemd_reload
279
280%triggerpostun -- %{name} < 0.80
281if [ -f /etc/clamav.conf.rpmsave ]; then
282 echo "Renaming config to new name /etc/clamd.conf"
283 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
284 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
285 echo "Changing config location in freshclam config"
286 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
287fi
288
289%triggerpostun -- %{name} < 0.90-0.rc2.0.10
290%{__cp} -f /etc/clamd.conf{,.rpmsave}
291%{__sed} -i -e '
292 s,^LogSyslog$,& yes,
293 s,^FixStaleSocket$,& yes,
294 s,^AllowSupplementaryGroups$,& yes,
295 s,^ClamukoScanOnOpen$,& yes,
296 s,^ClamukoScanOnClose$,& yes,
297 s,^ClamukoScanOnExec$,& yes,
298 s,^LogTime$,& yes,
299 s,^ScanPE$,& yes,
300' /etc/clamd.conf
301%banner -e %{name}-0.90 <<EOF
302ClamAV config was automatically upgraded to 0.90 format. You should review it
303that it's still valid.
304EOF
305#'
306# unfortunately clamd has no configcheck option so we just have to start it
307# once again after config was broken after upgrade
308touch /var/lock/subsys/clamd
309%service -q clamd restart
310
311%triggerpostun -- %{name} < 0.97.7-4
312%systemd_trigger clamd.service
313
314%post milter
315/sbin/chkconfig --add clamav-milter
316%service clamav-milter restart "Clam Antivirus daemon"
317
318%preun milter
319if [ "$1" = "0" ]; then
320 %service clamav-milter stop
321 /sbin/chkconfig --del clamav-milter
322fi
323
324%post libs -p /sbin/ldconfig
325%postun libs -p /sbin/ldconfig
326
327%files
328%defattr(644,root,root,755)
329%doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
330%attr(755,root,root) %{_bindir}/clambc
331%attr(755,root,root) %{_bindir}/clamdscan
332%attr(755,root,root) %{_bindir}/clamdtop
333%attr(755,root,root) %{_bindir}/clamscan
334%attr(755,root,root) %{_bindir}/clamsubmit
335%attr(755,root,root) %{_bindir}/freshclam
336%attr(755,root,root) %{_bindir}/sigtool
337%attr(755,root,root) %{_bindir}/clamconf
338%attr(755,root,root) %{_sbindir}/clamd
339%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
340%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
341%{systemdtmpfilesdir}/%{name}.conf
342%{systemdunitdir}/clamd.service
343%attr(755,clamav,root) %dir /var/lib/%{name}
344%attr(640,clamav,root) %ghost /var/log/freshclam.log
345%attr(750,clamav,clamav) %dir /var/run/%{name}
346
347%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
348%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
349%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
350
351%attr(754,root,root) /etc/rc.d/init.d/clamd
352%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
353%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
354%{_mandir}/man[15]/*
355%{_mandir}/man8/clamd*
356
357%if %{with milter}
358%files milter
359%defattr(644,root,root,755)
360%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
361%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
362%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
363#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
364#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
365#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
366%attr(755,root,root) %{_sbindir}/clamav-milter
367%{_mandir}/man8/clamav-milter.8*
368%attr(700,clamav,clamav) /var/spool/clamav
369%endif
370
371%files libs
372%defattr(644,root,root,755)
373%attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
374%attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
375%attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
376%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
377%attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
378%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
379
380%files devel
381%defattr(644,root,root,755)
382%attr(755,root,root) %{_bindir}/clamav-config
383%attr(755,root,root) %{_libdir}/libclamav.so
384%attr(755,root,root) %{_libdir}/libclamunrar.so
385%attr(755,root,root) %{_libdir}/libclamunrar_iface.so
386%{_libdir}/libclamav.la
387%{_libdir}/libclamunrar.la
388%{_libdir}/libclamunrar_iface.la
389%{_includedir}/clamav.h
390%{_pkgconfigdir}/libclamav.pc
391
392%files static
393%defattr(644,root,root,755)
394%{_libdir}/libclamav.a
395%{_libdir}/libclamunrar.a
396%{_libdir}/libclamunrar_iface.a
This page took 0.082659 seconds and 4 git commands to generate.