]> git.pld-linux.org Git - packages/clamav.git/blame_incremental - clamav.spec
- up to 0.103.1
[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%bcond_without system_libmspack # system libmspack library
13%bcond_with system_llvm # system LLVM (< 3.7)
14%bcond_without static_libs # static libraries
15
16%ifarch x32
17%undefine with_llvm
18%endif
19Summary: An anti-virus utility for Unix
20Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
21Name: clamav
22Version: 0.103.1
23Release: 1
24License: GPL v2+
25Group: Daemons
26#Source0Download: http://www.clamav.net/download
27Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
28# Source0-md5: f895e9a261937ed91f5cb3ead4791555
29Source1: %{name}.init
30Source2: %{name}.sysconfig
31Source3: %{name}-milter.init
32Source4: %{name}-cron-updatedb
33Source5: %{name}.logrotate
34Source8: %{name}-post-updatedb
35Source9: %{name}-milter.sysconfig
36Source10: %{name}.tmpfiles
37Source11: clamd.service
38Source12: cronjob-clamav.timer
39Source13: cronjob-clamav.service.in
40Patch0: %{name}-pld_config.patch
41Patch1: %{name}-nolibs.patch
42%if "%{pld_release}" == "ac"
43Patch2: am-nosilentrules.patch
44%endif
45Patch3: ac2.68.patch
46Patch4: x32.patch
47Patch5: %{name}-add-support-for-system-tomsfastmath.patch
48Patch6: %{name}-headers.patch
49URL: http://www.clamav.net/
50BuildRequires: autoconf >= 2.59
51BuildRequires: automake >= 1:1.11.1
52BuildRequires: bzip2-devel >= 1.0.5
53BuildRequires: check-devel
54BuildRequires: curl-devel >= 7.40
55BuildRequires: gmp-devel
56BuildRequires: json-c-devel
57BuildRequires: libltdl-devel
58%{?with_milter:BuildRequires: libmilter-devel}
59%{?with_system_libmspack:BuildRequires: libmspack-devel}
60BuildRequires: libstdc++-devel >= 5:3.4
61BuildRequires: libtool >= 2:2
62%{?with_milter:BuildRequires: libwrap-devel}
63BuildRequires: libxml2-devel >= 2
64%{?with_llvm:%{?with_system_llvm:BuildRequires: llvm-devel < 3.7}}
65BuildRequires: ncurses-devel
66BuildRequires: openssl-devel >= 0.9.8
67BuildRequires: pcre2-8-devel >= 10.30
68BuildRequires: pkgconfig >= 1:0.16
69BuildRequires: rpm >= 4.4.9-56
70BuildRequires: rpmbuild(macros) >= 1.647
71BuildRequires: systemd-devel
72BuildRequires: tomsfastmath-devel >= 0.13.1-2
73BuildRequires: zlib-devel >= 1.2.2
74Requires(post,preun): /sbin/chkconfig
75Requires(postun): /usr/sbin/groupdel
76Requires(postun): /usr/sbin/userdel
77Requires(postun,pre): /usr/sbin/usermod
78Requires(pre): /bin/id
79Requires(pre): /usr/bin/getgid
80Requires(pre): /usr/sbin/groupadd
81Requires(pre): /usr/sbin/useradd
82Requires(post,preun,postun): systemd-units >= 38
83Requires: systemd-units >= 38
84Requires(postun): sed >= 4.0
85Requires: %{name}-libs = %{epoch}:%{version}-%{release}
86Requires: /usr/sbin/usermod
87Requires: rc-scripts >= 0.4.1.23
88Suggests: clamav-database
89Suggests: cronjobs
90Provides: group(clamav)
91Provides: user(clamav)
92Conflicts: logrotate < 3.7-4
93BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
94
95%description
96Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
97especially for e-mail scanning on mail gateways. It provides a number
98of utilities including a flexible and scalable multi-threaded daemon,
99a command line scanner and advanced tool for automatic database
100updates. The core of the package is an anti-virus engine available in
101a form of shared library (available in clamav-libs).
102
103Here is a list of the main features:
104- command-line scanner
105- fast, multi-threaded daemon with support for on-access scanning
106- milter interface for sendmail
107- advanced database updater with support for scripted updates and
108 digital signatures
109- virus scanner C library
110- on-access scanning (Linux and FreeBSD)
111- virus database updated multiple times per day (see home page for
112 total number of signatures)
113- built-in support for various archive formats, including Zip, RAR,
114 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
115- built-in support for almost all mail file formats
116- built-in support for ELF executables and Portable Executable files
117 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
118 obfuscated with SUE, Y0da Cryptor and others
119- built-in support for popular document formats including MS Office
120 and MacOffice files, HTML, RTF and PDF
121
122%description -l pl.UTF-8
123Clam AntiVirus to mające otwarte źródła narzędzie antywirusowe dla
124systemów uniksowych, zaprojektowane szczególnie pod kątem skanowania
125poczty elektronicznej na bramkach pocztowych. Udostępnia wiele
126narzędzi, w tym elastycznego i skalowalnego, multiwątkowego demona,
127skaner działający z linii poleceń oraz zaawansowane narzędzie do
128automatycznej aktualizacji bazy danych. Główna część pakietu to
129silnik antywirusowy dostępny w postaci biblioteki współdzielonej
130(dostępnej w pakiecie clamav-libs).
131
132Lista podstawowych możliwości:
133- skaner działający z linii poleceń
134- szybki, wielowątkowy demon z obsługą skanowania przy odczycie
135- interfejs milter dla sendmaila
136- zaawansowane narzędzie do aktualizacji bazy danych z obsługą
137 aktualizacji oskryptowanych oraz podpisów cyfrowych
138- biblioteka C skanera antywirusowego
139- skanowanie przy odczycie (dla Linuksa i FreeBSD)
140- baza danych wirusów aktualizowana wiele razy dziennie (liczba
141 sygnatur dostępna na stronie projektu)
142- wbudowana obsługa różnych formatów archiwów, w tym Zip, RAR, Tar,
143 Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS i inne
144- wbudowana obsługa prawie wszystkich formatów plików pocztowych
145- wbudowana obsługa plików wykonywalnych ELF i PE skompresowanych
146 programami UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack oraz
147 zaciemnionych przy użyciu programów SUE, Y0da Cryptor i innych
148- wbudowana obsługa popularnych formatów dokumentów, w tym plików MS
149 Office, MacOffice, HTML, RTF i PDF
150
151%package libs
152Summary: Shared libraries for clamav
153Summary(pl.UTF-8): Biblioteki dzielone clamav
154Group: Libraries
155Requires: bzip2-libs >= 1.0.5
156Requires: curl-libs >= 7.40
157Requires: pcre2-8 >= 10.30
158Requires: zlib >= 1.2.2
159
160%description libs
161Shared libraries for clamav.
162
163%description libs -l pl.UTF-8
164Biblioteki dzielone clamav.
165
166%package milter
167Summary: ClamAV filter using milter interface
168Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
169Group: Daemons
170Requires: %{name} = %{epoch}:%{version}-%{release}
171Requires: postfix
172#Requires: sendmail >= 8.11
173Requires: tcp_wrappers
174
175%description milter
176ClamAV sendmail filter using MILTER interface.
177
178%description milter -l pl.UTF-8
179Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
180
181%package devel
182Summary: clamav - Development header files and libraries
183Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
184Group: Development/Libraries
185Requires: %{name}-libs = %{epoch}:%{version}-%{release}
186Requires: bzip2-devel >= 1.0.5
187Requires: curl-devel >= 7.40
188Requires: gmp-devel
189Requires: openssl-devel >= 0.9.8
190Requires: pcre2-8-devel >= 10.30
191Requires: zlib-devel >= 1.2.2
192
193%description devel
194This package contains the development header files and libraries
195necessary to develop clamav client applications.
196
197%description devel -l pl.UTF-8
198Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
199klienckich clamav.
200
201%package static
202Summary: clamav static libraries
203Summary(pl.UTF-8): Biblioteki statyczne clamav
204Group: Development/Libraries
205Requires: %{name}-devel = %{epoch}:%{version}-%{release}
206
207%description static
208clamav static libraries.
209
210%description static -l pl.UTF-8
211Biblioteki statyczne clamav.
212
213%prep
214%setup -q
215%patch0 -p1
216%patch1 -p1
217%if "%{pld_release}" == "ac"
218%patch2 -p1
219%endif
220%if "%{pld_release}" != "ac"
221%patch3 -p1
222%endif
223%patch4 -p1
224%patch5 -p1
225%patch6 -p1
226
227%build
228export CFLAGS="%{rpmcflags} -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99"
229export CXXFLAGS="%{rpmcxxflags} -std=gnu++98"
230%{__libtoolize}
231%{__aclocal} -I m4
232%{__autoconf}
233%{__autoheader}
234%{__automake}
235%configure \
236 --disable-clamav \
237 --enable-clamonacc \
238 --enable-clamdtop \
239 %{?with_llvm:--enable-llvm %{!?with_system_llvm:--with-system-llvm=no}} \
240 %{?with_milter:--enable-milter} \
241 --disable-silent-rules \
242 %{?with_static_libs:--enable-static} \
243 --disable-zlib-vcheck \
244 --with-dbdir=/var/lib/%{name} \
245 --with-ltdl-include=%{_includedir} \
246 --with-ltdl-lib=%{_libdir} \
247 --with-no-cache \
248 %{?with_system_libmspack:--with-system-libmspack}
249
250%{__make}
251
252%install
253rm -rf $RPM_BUILD_ROOT
254install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
255 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
256 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
257 $RPM_BUILD_ROOT%{systemdunitdir}
258
259%{__make} install \
260 DESTDIR=$RPM_BUILD_ROOT
261%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
262
263cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
2645 * * * * root %{_sbindir}/clamav-cron-updatedb
265EOF
266
267install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
268%if %{with milter}
269install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
270cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
271%endif
272cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
273install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
274for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
275 mv $i ${i%%.sample}
276done
277cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
278
279install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
280
281cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
282
283cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
284cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
285sed -e's#@sbindir@#%{_sbindir}#' < %{SOURCE13} > $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
286
287# NOTE: clamd uses sane rights to it's clamd.pid file
288# So better keep it dir
289# If it is fixed use of dir will be unecesary
290install -d $RPM_BUILD_ROOT/var/run/%{name}
291
292:> $RPM_BUILD_ROOT/var/log/freshclam.log
293
294%clean
295rm -rf $RPM_BUILD_ROOT
296
297%triggerin -- amavis-ng
298%addusertogroup -q clamav amavis
299
300%triggerin -- amavisd-new
301%addusertogroup -q clamav amavis
302
303%triggerin -- amavisd
304%addusertogroup -q clamav amavis
305
306%pre
307%groupadd -g 43 clamav
308%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
309
310%post
311/sbin/chkconfig --add clamd
312%service clamd restart "Clam Antivirus daemon"
313touch /var/log/freshclam.log
314chown clamav:root /var/log/freshclam.log
315chmod 640 /var/log/freshclam.log
316%systemd_post clamd.service cronjob-clamav.timer
317
318%preun
319if [ "$1" = "0" ]; then
320 %service clamd stop
321 /sbin/chkconfig --del clamd
322fi
323%systemd_preun clamd.service cronjob-clamav.timer
324
325%postun
326if [ "$1" = "0" ]; then
327 %userremove clamav
328 %groupremove clamav
329fi
330%systemd_reload
331
332%triggerpostun -- %{name} < 0.99.2-2
333if [ -f /etc/clamav.conf.rpmsave ]; then
334 echo "Renaming config to new name /etc/clamd.conf"
335 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
336 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
337 echo "Changing config location in freshclam config"
338 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
339fi
340
341%{__cp} -f /etc/clamd.conf{,.rpmsave}
342%{__sed} -i -e '
343 s,^LogSyslog$,& yes,
344 s,^FixStaleSocket$,& yes,
345 s,^AllowSupplementaryGroups$,& yes,
346 s,^ClamukoScanOnOpen$,& yes,
347 s,^ClamukoScanOnClose$,& yes,
348 s,^ClamukoScanOnExec$,& yes,
349 s,^LogTime$,& yes,
350 s,^ScanPE$,& yes,
351' /etc/clamd.conf
352%banner -e %{name}-0.90 <<EOF
353ClamAV config was automatically upgraded to 0.90 format. You should review it
354that it's still valid.
355EOF
356#'
357# unfortunately clamd has no configcheck option so we just have to start it
358# once again after config was broken after upgrade
359touch /var/lock/subsys/clamd
360%service -q clamd restart
361
362%systemd_trigger clamd.service
363
364%systemd_service_enable cronjob-clamav.timer
365
366%post milter
367/sbin/chkconfig --add clamav-milter
368%service clamav-milter restart "Clam Antivirus daemon"
369
370%preun milter
371if [ "$1" = "0" ]; then
372 %service clamav-milter stop
373 /sbin/chkconfig --del clamav-milter
374fi
375
376%post libs -p /sbin/ldconfig
377%postun libs -p /sbin/ldconfig
378
379%files
380%defattr(644,root,root,755)
381%doc ChangeLog.md NEWS.md README.md
382%attr(755,root,root) %{_bindir}/clambc
383%attr(755,root,root) %{_bindir}/clamdscan
384%attr(755,root,root) %{_bindir}/clamdtop
385%attr(755,root,root) %{_bindir}/clamscan
386%attr(755,root,root) %{_bindir}/clamsubmit
387%attr(755,root,root) %{_bindir}/freshclam
388%attr(755,root,root) %{_bindir}/sigtool
389%attr(755,root,root) %{_bindir}/clamconf
390%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
391%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
392%attr(755,root,root) %{_sbindir}/clamd
393%attr(755,root,root) %{_sbindir}/clamonacc
394%{systemdtmpfilesdir}/%{name}.conf
395%{systemdunitdir}/clamav-clamonacc.service
396%{systemdunitdir}/clamav-daemon.service
397%{systemdunitdir}/clamav-daemon.socket
398%{systemdunitdir}/clamav-freshclam.service
399%{systemdunitdir}/clamd.service
400%{systemdunitdir}/cronjob-clamav.service
401%{systemdunitdir}/cronjob-clamav.timer
402%attr(755,clamav,root) %dir /var/lib/%{name}
403%attr(640,clamav,root) %ghost /var/log/freshclam.log
404%attr(750,clamav,clamav) %dir /var/run/%{name}
405
406%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
407%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
408%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
409
410%attr(754,root,root) /etc/rc.d/init.d/clamd
411%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
412%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
413%{_mandir}/man1/clambc.1*
414%{_mandir}/man1/clamconf.1*
415%{_mandir}/man1/clamdscan.1*
416%{_mandir}/man1/clamdtop.1*
417%{_mandir}/man1/clamscan.1*
418%{_mandir}/man1/clamsubmit.1*
419%{_mandir}/man1/freshclam.1*
420%{_mandir}/man1/sigtool.1*
421%{_mandir}/man5/clamd.conf.5*
422%{_mandir}/man5/freshclam.conf.5*
423%{_mandir}/man8/clamd.8*
424%{_mandir}/man8/clamonacc.8*
425
426%if %{with milter}
427%files milter
428%defattr(644,root,root,755)
429%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
430%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
431%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
432#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
433%attr(755,root,root) %{_sbindir}/clamav-milter
434%{_mandir}/man5/clamav-milter.conf.5*
435%{_mandir}/man8/clamav-milter.8*
436%attr(700,clamav,clamav) /var/spool/clamav
437%endif
438
439%files libs
440%defattr(644,root,root,755)
441%attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
442%attr(755,root,root) %ghost %{_libdir}/libclamav.so.9
443%if %{without system_libmspack}
444%attr(755,root,root) %{_libdir}/libclammspack.*.*.*
445%attr(755,root,root) %ghost %{_libdir}/libclammspack.so.0
446%endif
447%attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
448%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.9
449%attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
450%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.9
451%attr(755,root,root) %{_libdir}/libfreshclam.so.*.*.*
452%attr(755,root,root) %ghost %{_libdir}/libfreshclam.so.2
453
454%files devel
455%defattr(644,root,root,755)
456%attr(755,root,root) %{_bindir}/clamav-config
457%attr(755,root,root) %{_libdir}/libclamav.so
458%if %{without system_libmspack}
459%attr(755,root,root) %{_libdir}/libclammspack.so
460%endif
461%attr(755,root,root) %{_libdir}/libclamunrar.so
462%attr(755,root,root) %{_libdir}/libfreshclam.so
463%attr(755,root,root) %{_libdir}/libclamunrar_iface.so
464%{_libdir}/libclamav.la
465%if %{without system_libmspack}
466%{_libdir}/libclammspack.la
467%endif
468%{_libdir}/libclamunrar.la
469%{_libdir}/libfreshclam.la
470%{_libdir}/libclamunrar_iface.la
471%dir %{_includedir}/clamav
472%{_includedir}/clamav/clamav.h
473%{_includedir}/clamav/clamav-types.h
474%{_includedir}/clamav/clamav-version.h
475%{_includedir}/clamav/libfreshclam.h
476%{_pkgconfigdir}/libclamav.pc
477
478%files static
479%defattr(644,root,root,755)
480%{_libdir}/libclamav.a
481%if %{without system_libmspack}
482%{_libdir}/libclammspack.a
483%endif
484%{_libdir}/libclamunrar.a
485%{_libdir}/libfreshclam.a
486%{_libdir}/libclamunrar_iface.a
This page took 0.029019 seconds and 4 git commands to generate.