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