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