]> git.pld-linux.org Git - packages/clamav.git/blame - clamav.spec
- updated dependencies, use system libmspack by default; release 2
[packages/clamav.git] / clamav.spec
CommitLineData
c935072a 1# TODO:
c8321415 2# - Make freshclam package (script and daemon)
d06ef0ed 3# - restart amavis in triggers if group membership was modified?
eba74cc1 4#
5# Conditional build:
d1044716 6%bcond_without milter # milter interface subpackage
da430249 7%if "%{pld_release}" == "ac"
d1044716 8%bcond_with llvm # LLVM support
00f337bd 9%else
d1044716 10%bcond_without llvm # LLVM support
da430249 11%endif
d1044716
JB
12%bcond_without system_libmspack # system libmspack library
13%bcond_with system_llvm # system LLVM (< 3.7)
da430249
JR
14
15%ifarch x32
16%undefine with_llvm
9279da12 17%endif
b014d766 18Summary: An anti-virus utility for Unix
8618c36b 19Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
e6c034d3 20Name: clamav
f63e74d3 21Version: 0.101.0
d1044716 22Release: 2
c81b4cf4 23License: GPL v2+
c3cae60d 24Group: Daemons
d1044716 25#Source0Download: http://www.clamav.net/download
9a0add22 26Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
f63e74d3 27# Source0-md5: 47c36d13ac814b9e29ed6f5fc1691373
4460ff0b
AM
28Source1: %{name}.init
29Source2: %{name}.sysconfig
eba74cc1 30Source3: %{name}-milter.init
719d471d 31Source4: %{name}-cron-updatedb
4a3f68d7 32Source5: %{name}.logrotate
3e84b306 33Source8: %{name}-post-updatedb
eba74cc1 34Source9: %{name}-milter.sysconfig
24adbaa3 35Source10: %{name}.tmpfiles
09a96373 36Source11: clamd.service
e5b99e12
JK
37Source12: cronjob-clamav.timer
38Source13: cronjob-clamav.service.in
1475e7a3 39Patch0: %{name}-pld_config.patch
40002522 40Patch1: %{name}-nolibs.patch
e335899e 41%if "%{pld_release}" == "ac"
453ff8b1 42Patch2: am-nosilentrules.patch
e335899e 43%endif
1337bca5 44Patch3: ac2.68.patch
d03f44fa 45Patch4: %{name}-openssl.patch
e1b3dbcb 46Patch5: %{name}-major.patch
90b9ff25 47Patch6: x32.patch
182b1736 48URL: http://www.clamav.net/
d1044716
JB
49BuildRequires: autoconf >= 2.59
50BuildRequires: automake >= 1:1.11
bc21dbca 51BuildRequires: bzip2-devel
4570eb6d 52BuildRequires: check-devel
e335899e 53BuildRequires: curl-devel
73b401c8 54BuildRequires: gmp-devel
d1044716 55BuildRequires: json-c-devel
bda09b13 56BuildRequires: libltdl-devel
9d42dc39 57%{?with_milter:BuildRequires: libmilter-devel}
d1044716 58%{?with_system_libmspack:BuildRequires: libmspack-devel}
fbdfce83 59BuildRequires: libstdc++-devel >= 5:3.4
2d1a6e1f 60BuildRequires: libtool
dd6d36d5 61%{?with_milter:BuildRequires: libwrap-devel}
d1044716 62BuildRequires: libxml2-devel >= 2
85d2d338 63%{?with_llvm:%{?with_system_llvm:BuildRequires: llvm-devel < 3.7}}
75268608 64BuildRequires: ncurses-devel
d1044716
JB
65BuildRequires: openssl-devel >= 0.9.8
66BuildRequires: pcre2-8-devel
67BuildRequires: pkgconfig >= 1:0.16
9279da12 68BuildRequires: rpm >= 4.4.9-56
09a96373 69BuildRequires: rpmbuild(macros) >= 1.647
d1044716
JB
70BuildRequires: systemd-devel
71BuildRequires: zlib-devel >= 1.2.2
dd6d36d5
ER
72Requires(post,preun): /sbin/chkconfig
73Requires(postun): /usr/sbin/groupdel
74Requires(postun): /usr/sbin/userdel
75Requires(postun,pre): /usr/sbin/usermod
0e86f481 76Requires(pre): /bin/id
49797116 77Requires(pre): /usr/bin/getgid
78Requires(pre): /usr/sbin/groupadd
79Requires(pre): /usr/sbin/useradd
28e95a65
ŁK
80Requires(post,preun,postun): systemd-units >= 38
81Requires: systemd-units >= 38
d985d248 82Requires(triggerpostun): sed >= 4.0
d4117574 83Requires: %{name}-libs = %{epoch}:%{version}-%{release}
dd6d36d5 84Requires: /usr/sbin/usermod
f40f9e2f 85Requires: rc-scripts >= 0.4.1.23
6475233d 86Suggests: clamav-database
4792d085 87Suggests: cronjobs
49797116 88Provides: group(clamav)
89Provides: user(clamav)
d0ecd394 90Conflicts: logrotate < 3.7-4
e6c034d3 91BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
92
e6c034d3 93%description
066e1c29
ER
94Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
95especially for e-mail scanning on mail gateways. It provides a number
96of utilities including a flexible and scalable multi-threaded daemon,
97a command line scanner and advanced tool for automatic database
98updates. The core of the package is an anti-virus engine available in
99a form of shared library.
100
101Here is a list of the main features:
102- command-line scanner
103- fast, multi-threaded daemon with support for on-access scanning
104- milter interface for sendmail
105- advanced database updater with support for scripted updates and
106 digital signatures
107- virus scanner C library
8618c36b 108- on-access scanning (Linux® and FreeBSD®)
066e1c29
ER
109- virus database updated multiple times per day (see home page for
110 total number of signatures)
111- built-in support for various archive formats, including Zip, RAR,
112 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
113- built-in support for almost all mail file formats
114- built-in support for ELF executables and Portable Executable files
115 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
116 obfuscated with SUE, Y0da Cryptor and others
117- built-in support for popular document formats including MS Office
118 and MacOffice files, HTML, RTF and PDF
e6c034d3 119
d8cf2de3 120%description -l pl.UTF-8
8618c36b 121Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
eba74cc1 122uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
123"on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
8618c36b 124Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
ba45f729 125napisany w C i zgodny z POSIXem.
e6c034d3 126
4460ff0b 127%package libs
f98d218a 128Summary: Shared libraries for clamav
da5aee7a 129Summary(pl.UTF-8): Biblioteki dzielone clamav
f98d218a 130Group: Libraries
d1044716 131Requires: zlib >= 1.2.2
4460ff0b
AM
132
133%description libs
134Shared libraries for clamav.
135
d8cf2de3 136%description libs -l pl.UTF-8
4460ff0b
AM
137Biblioteki dzielone clamav.
138
486b4f0f
JB
139%package milter
140Summary: ClamAV filter using milter interface
8618c36b 141Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
eba74cc1 142Group: Daemons
d4117574 143Requires: %{name} = %{epoch}:%{version}-%{release}
893a866a 144Requires: postfix
7c438a38 145#Requires: sendmail >= 8.11
eba74cc1 146Requires: tcp_wrappers
eba74cc1 147
148%description milter
149ClamAV sendmail filter using MILTER interface.
150
d8cf2de3 151%description milter -l pl.UTF-8
8618c36b 152Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
eba74cc1 153
4460ff0b 154%package devel
f98d218a 155Summary: clamav - Development header files and libraries
8618c36b 156Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
f98d218a 157Group: Development/Libraries
d4117574 158Requires: %{name}-libs = %{epoch}:%{version}-%{release}
cc776ef1 159Requires: bzip2-devel
d03f44fa 160Requires: curl-devel
cc776ef1 161Requires: gmp-devel
d1044716
JB
162Requires: openssl-devel >= 0.9.8
163Requires: zlib-devel >= 1.2.2
4460ff0b
AM
164
165%description devel
166This package contains the development header files and libraries
167necessary to develop clamav client applications.
168
d8cf2de3 169%description devel -l pl.UTF-8
8618c36b 170Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
142cc22a 171klienckich clamav.
4460ff0b
AM
172
173%package static
dd6d36d5 174Summary: clamav static libraries
da5aee7a 175Summary(pl.UTF-8): Biblioteki statyczne clamav
f98d218a 176Group: Development/Libraries
d4117574 177Requires: %{name}-devel = %{epoch}:%{version}-%{release}
4460ff0b
AM
178
179%description static
f33eb2df 180clamav static libraries.
4460ff0b 181
d8cf2de3 182%description static -l pl.UTF-8
4460ff0b
AM
183Biblioteki statyczne clamav.
184
e6c034d3 185%prep
c81b4cf4 186%setup -q
c935072a 187%patch0 -p1
83eaf0c7 188%patch1 -p1
e335899e 189%if "%{pld_release}" == "ac"
453ff8b1 190%patch2 -p1
e335899e 191%endif
9a33c406 192%if "%{pld_release}" != "ac"
1337bca5 193%patch3 -p1
9a33c406 194%endif
f0c310ed 195#%patch4 -p1
e1b3dbcb 196%patch5 -p1
90b9ff25 197%patch6 -p1
82747f5b 198
e6c034d3 199%build
3dae9f9c
JR
200export CFLAGS="%{rpmcflags} -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99"
201export CXXFLAGS="%{rpmcxxflags} -std=gnu++98"
82747f5b 202%{__libtoolize}
c81b4cf4 203%{__aclocal} -I m4
ed667a13 204%{__autoconf}
82747f5b 205%{__autoheader}
ed667a13 206%{__automake}
92c5ef39 207%configure \
ca57b115 208 --disable-clamav \
5dcc5881 209 --enable-clamdtop \
a4e64f4e 210 %{?with_llvm:--enable-llvm %{!?with_system_llvm:--with-system-llvm=no}} \
142cc22a 211 %{?with_milter:--enable-milter} \
d1044716
JB
212 --disable-silent-rules \
213 --disable-zlib-vcheck \
20f26031 214 --with-dbdir=/var/lib/%{name} \
839be9e8 215 --with-ltdl-include=%{_includedir} \
d1044716
JB
216 --with-ltdl-lib=%{_libdir} \
217 --with-no-cache \
218 %{?with_system_libmspack:--with-system-libmspack}
a811cf23
ER
219
220%{__make} \
839be9e8 221 LIBTOOL=%{_bindir}/libtool
4d3c9f35 222
e6c034d3 223%install
224rm -rf $RPM_BUILD_ROOT
06e3ab45 225install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
c79a8ed7 226 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
28e95a65
ŁK
227 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
228 $RPM_BUILD_ROOT%{systemdunitdir}
92c5ef39
AM
229
230%{__make} install \
839be9e8 231 LIBTOOL=%{_bindir}/libtool \
92c5ef39 232 DESTDIR=$RPM_BUILD_ROOT
142cc22a 233%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
92c5ef39 234
d78cc52a 235cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
719d471d 2365 * * * * root %{_sbindir}/clamav-cron-updatedb
ca57b115 237EOF
92c5ef39 238
9279da12 239install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
4381c9a3 240%if %{with milter}
9279da12
ER
241install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
242cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
4381c9a3 243%endif
9279da12
ER
244cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
245install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
5dcc5881
AM
246for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
247 mv $i ${i%%.sample}
248done
9279da12 249cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
2b9f3e64 250
9279da12 251install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
4460ff0b 252
e335899e 253cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
24adbaa3 254
e335899e 255cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
e5b99e12
JK
256cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
257sed -e's#@sbindir@#%{_sbindir}#' < %{SOURCE13} > $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
28e95a65 258
c935072a
MK
259# NOTE: clamd uses sane rights to it's clamd.pid file
260# So better keep it dir
261# If it is fixed use of dir will be unecesary
d78cc52a 262install -d $RPM_BUILD_ROOT/var/run/%{name}
c935072a 263
d78cc52a 264:> $RPM_BUILD_ROOT/var/log/freshclam.log
ef21d0fa 265
e6c034d3 266%clean
92c5ef39 267rm -rf $RPM_BUILD_ROOT
e6c034d3 268
c935072a 269%triggerin -- amavis-ng
50d65e20 270%addusertogroup -q clamav amavis
c935072a
MK
271
272%triggerin -- amavisd-new
50d65e20 273%addusertogroup -q clamav amavis
c935072a
MK
274
275%triggerin -- amavisd
50d65e20 276%addusertogroup -q clamav amavis
c935072a 277
e278889f 278%pre
236dddf1
ER
279%groupadd -g 43 clamav
280%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
174915c1 281
66d1575d 282%post
66d1575d 283/sbin/chkconfig --add clamd
dd6d36d5 284%service clamd restart "Clam Antivirus daemon"
d78cc52a
ER
285touch /var/log/freshclam.log
286chown clamav:root /var/log/freshclam.log
287chmod 640 /var/log/freshclam.log
e5b99e12 288%systemd_post clamd.service cronjob-clamav.timer
66d1575d 289
66d1575d 290%preun
291if [ "$1" = "0" ]; then
dd6d36d5 292 %service clamd stop
66d1575d 293 /sbin/chkconfig --del clamd
294fi
e5b99e12 295%systemd_preun clamd.service cronjob-clamav.timer
e6c034d3 296
0c8c3ba4 297%postun
174915c1 298if [ "$1" = "0" ]; then
49797116 299 %userremove clamav
300 %groupremove clamav
174915c1 301fi
28e95a65 302%systemd_reload
174915c1 303
ed0b0327 304%triggerpostun -- %{name} < 0.80
1eab800a 305if [ -f /etc/clamav.conf.rpmsave ]; then
d093ed8c 306 echo "Renaming config to new name /etc/clamd.conf"
307 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
308 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
d4117574 309 echo "Changing config location in freshclam config"
f12ca2c1
ER
310 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
311fi
312
29f80fd8
ER
313%triggerpostun -- %{name} < 0.90-0.rc2.0.10
314%{__cp} -f /etc/clamd.conf{,.rpmsave}
315%{__sed} -i -e '
316 s,^LogSyslog$,& yes,
317 s,^FixStaleSocket$,& yes,
318 s,^AllowSupplementaryGroups$,& yes,
319 s,^ClamukoScanOnOpen$,& yes,
320 s,^ClamukoScanOnClose$,& yes,
321 s,^ClamukoScanOnExec$,& yes,
3bc0b921
AM
322 s,^LogTime$,& yes,
323 s,^ScanPE$,& yes,
29f80fd8
ER
324' /etc/clamd.conf
325%banner -e %{name}-0.90 <<EOF
326ClamAV config was automatically upgraded to 0.90 format. You should review it
327that it's still valid.
328EOF
329#'
330# unfortunately clamd has no configcheck option so we just have to start it
331# once again after config was broken after upgrade
332touch /var/lock/subsys/clamd
333%service -q clamd restart
1eab800a 334
09a96373
ŁK
335%triggerpostun -- %{name} < 0.97.7-4
336%systemd_trigger clamd.service
337
e5b99e12
JK
338%triggerpostun -- %{name} < 0.99.2-2
339%systemd_service_enable cronjob-clamav.timer
340
eba74cc1 341%post milter
342/sbin/chkconfig --add clamav-milter
dd6d36d5 343%service clamav-milter restart "Clam Antivirus daemon"
eba74cc1 344
4c570814 345%preun milter
eba74cc1 346if [ "$1" = "0" ]; then
dd6d36d5 347 %service clamav-milter stop
eba74cc1 348 /sbin/chkconfig --del clamav-milter
349fi
fba342ab 350
1475e7a3 351%post libs -p /sbin/ldconfig
352%postun libs -p /sbin/ldconfig
4460ff0b 353
e6c034d3 354%files
355%defattr(644,root,root,755)
a4e64f4e 356%doc ChangeLog.md NEWS.md README.md
79125c5b 357%attr(755,root,root) %{_bindir}/clambc
24f68046 358%attr(755,root,root) %{_bindir}/clamdscan
40002522 359%attr(755,root,root) %{_bindir}/clamdtop
24f68046 360%attr(755,root,root) %{_bindir}/clamscan
d03f44fa 361%attr(755,root,root) %{_bindir}/clamsubmit
24f68046 362%attr(755,root,root) %{_bindir}/freshclam
363%attr(755,root,root) %{_bindir}/sigtool
d78cc52a 364%attr(755,root,root) %{_bindir}/clamconf
24f68046 365%attr(755,root,root) %{_sbindir}/clamd
366%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
c8321415 367%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
839be9e8 368%{systemdtmpfilesdir}/%{name}.conf
f63e74d3
AG
369%{systemdunitdir}/clamav-daemon.service
370%{systemdunitdir}/clamav-daemon.socket
371%{systemdunitdir}/clamav-freshclam.service
09a96373 372%{systemdunitdir}/clamd.service
e5b99e12
JK
373%{systemdunitdir}/cronjob-clamav.service
374%{systemdunitdir}/cronjob-clamav.timer
ca57b115 375%attr(755,clamav,root) %dir /var/lib/%{name}
d78cc52a
ER
376%attr(640,clamav,root) %ghost /var/log/freshclam.log
377%attr(750,clamav,clamav) %dir /var/run/%{name}
c935072a 378
b5177881 379%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
0e86f481
JB
380%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
381%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
6586d93d 382
05eb87ef 383%attr(754,root,root) /etc/rc.d/init.d/clamd
7c801993
ER
384%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
385%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
59f1ef4d
BS
386%{_mandir}/man1/*
387%{_mandir}/man5/clamd*
388%{_mandir}/man5/freshclam*
eba74cc1 389%{_mandir}/man8/clamd*
390
391%if %{with milter}
392%files milter
393%defattr(644,root,root,755)
7c801993 394%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
9279da12 395%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
491eb046 396%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
eba74cc1 397#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
398#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
399#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
400%attr(755,root,root) %{_sbindir}/clamav-milter
59f1ef4d 401%{_mandir}/man5/clamav-milter*
eba74cc1 402%{_mandir}/man8/clamav-milter.8*
0e86f481 403%attr(700,clamav,clamav) /var/spool/clamav
eba74cc1 404%endif
4460ff0b
AM
405
406%files libs
407%defattr(644,root,root,755)
418bf14a 408%attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
f63e74d3 409%attr(755,root,root) %ghost %{_libdir}/libclamav.so.9
d1044716 410%if %{without system_libmspack}
a4e64f4e
AM
411%attr(755,root,root) %{_libdir}/libclammspack.*.*.*
412%attr(755,root,root) %ghost %{_libdir}/libclammspack.so.0
d1044716 413%endif
418bf14a 414%attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
f63e74d3 415%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.9
418bf14a 416%attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
f63e74d3 417%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.9
4460ff0b
AM
418
419%files devel
420%defattr(644,root,root,755)
24f68046 421%attr(755,root,root) %{_bindir}/clamav-config
418bf14a 422%attr(755,root,root) %{_libdir}/libclamav.so
d1044716 423%if %{without system_libmspack}
a4e64f4e 424%attr(755,root,root) %{_libdir}/libclammspack.so
d1044716 425%endif
418bf14a
JB
426%attr(755,root,root) %{_libdir}/libclamunrar.so
427%attr(755,root,root) %{_libdir}/libclamunrar_iface.so
428%{_libdir}/libclamav.la
d1044716 429%if %{without system_libmspack}
a4e64f4e 430%{_libdir}/libclammspack.la
d1044716 431%endif
418bf14a
JB
432%{_libdir}/libclamunrar.la
433%{_libdir}/libclamunrar_iface.la
434%{_includedir}/clamav.h
435%{_pkgconfigdir}/libclamav.pc
4460ff0b
AM
436
437%files static
438%defattr(644,root,root,755)
418bf14a 439%{_libdir}/libclamav.a
d1044716 440%if %{without system_libmspack}
a4e64f4e 441%{_libdir}/libclammspack.a
d1044716 442%endif
418bf14a
JB
443%{_libdir}/libclamunrar.a
444%{_libdir}/libclamunrar_iface.a
This page took 0.182178 seconds and 4 git commands to generate.