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