]> git.pld-linux.org Git - packages/clamav.git/blame - clamav.spec
fix cronjob-clamav.timer dependency
[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
9a0add22 22Version: 0.99.2
6cfca821 23Release: 3
c81b4cf4 24License: GPL v2+
c3cae60d 25Group: Daemons
9a0add22
AZ
26Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
27# Source0-md5: 61b51a04619aeafd965892a53f86d192
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
82747f5b 194%{__libtoolize}
c81b4cf4 195%{__aclocal} -I m4
ed667a13 196%{__autoconf}
82747f5b 197%{__autoheader}
ed667a13 198%{__automake}
92c5ef39 199%configure \
dabd77f1 200 --disable-zlib-vcheck \
5dcc5881 201 --disable-silent-rules \
ca57b115 202 --disable-clamav \
5dcc5881 203 --enable-clamdtop \
85d2d338 204 %{?with_llvm:--enable-llvm %{?with_system_llvm:--with-system-llvm}} \
142cc22a 205 %{?with_milter:--enable-milter} \
20f26031 206 --with-dbdir=/var/lib/%{name} \
8635bd29 207 --with-no-cache \
839be9e8 208 --with-ltdl-include=%{_includedir} \
a811cf23
ER
209 --with-ltdl-lib=%{_libdir}
210
211%{__make} \
839be9e8 212 LIBTOOL=%{_bindir}/libtool
4d3c9f35 213
e6c034d3 214%install
215rm -rf $RPM_BUILD_ROOT
06e3ab45 216install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
c79a8ed7 217 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
28e95a65
ŁK
218 $RPM_BUILD_ROOT%{systemdtmpfilesdir} \
219 $RPM_BUILD_ROOT%{systemdunitdir}
92c5ef39
AM
220
221%{__make} install \
839be9e8 222 LIBTOOL=%{_bindir}/libtool \
92c5ef39 223 DESTDIR=$RPM_BUILD_ROOT
142cc22a 224%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
92c5ef39 225
d78cc52a 226cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
719d471d 2275 * * * * root %{_sbindir}/clamav-cron-updatedb
ca57b115 228EOF
92c5ef39 229
9279da12 230install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
4381c9a3 231%if %{with milter}
9279da12
ER
232install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
233cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
4381c9a3 234%endif
9279da12
ER
235cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
236install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
5dcc5881
AM
237for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.conf.sample; do
238 mv $i ${i%%.sample}
239done
9279da12 240cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
2b9f3e64 241
9279da12 242install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
4460ff0b 243
e335899e 244cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
24adbaa3 245
e335899e 246cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
e5b99e12
JK
247cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
248sed -e's#@sbindir@#%{_sbindir}#' < %{SOURCE13} > $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
28e95a65 249
c935072a
MK
250# NOTE: clamd uses sane rights to it's clamd.pid file
251# So better keep it dir
252# If it is fixed use of dir will be unecesary
d78cc52a 253install -d $RPM_BUILD_ROOT/var/run/%{name}
c935072a 254
d78cc52a 255:> $RPM_BUILD_ROOT/var/log/freshclam.log
ef21d0fa 256
e6c034d3 257%clean
92c5ef39 258rm -rf $RPM_BUILD_ROOT
e6c034d3 259
c935072a 260%triggerin -- amavis-ng
50d65e20 261%addusertogroup -q clamav amavis
c935072a
MK
262
263%triggerin -- amavisd-new
50d65e20 264%addusertogroup -q clamav amavis
c935072a
MK
265
266%triggerin -- amavisd
50d65e20 267%addusertogroup -q clamav amavis
c935072a 268
e278889f 269%pre
236dddf1
ER
270%groupadd -g 43 clamav
271%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
174915c1 272
66d1575d 273%post
66d1575d 274/sbin/chkconfig --add clamd
dd6d36d5 275%service clamd restart "Clam Antivirus daemon"
d78cc52a
ER
276touch /var/log/freshclam.log
277chown clamav:root /var/log/freshclam.log
278chmod 640 /var/log/freshclam.log
e5b99e12 279%systemd_post clamd.service cronjob-clamav.timer
66d1575d 280
66d1575d 281%preun
282if [ "$1" = "0" ]; then
dd6d36d5 283 %service clamd stop
66d1575d 284 /sbin/chkconfig --del clamd
285fi
e5b99e12 286%systemd_preun clamd.service cronjob-clamav.timer
e6c034d3 287
0c8c3ba4 288%postun
174915c1 289if [ "$1" = "0" ]; then
49797116 290 %userremove clamav
291 %groupremove clamav
174915c1 292fi
28e95a65 293%systemd_reload
174915c1 294
ed0b0327 295%triggerpostun -- %{name} < 0.80
1eab800a 296if [ -f /etc/clamav.conf.rpmsave ]; then
d093ed8c 297 echo "Renaming config to new name /etc/clamd.conf"
298 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
299 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
d4117574 300 echo "Changing config location in freshclam config"
f12ca2c1
ER
301 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
302fi
303
29f80fd8
ER
304%triggerpostun -- %{name} < 0.90-0.rc2.0.10
305%{__cp} -f /etc/clamd.conf{,.rpmsave}
306%{__sed} -i -e '
307 s,^LogSyslog$,& yes,
308 s,^FixStaleSocket$,& yes,
309 s,^AllowSupplementaryGroups$,& yes,
310 s,^ClamukoScanOnOpen$,& yes,
311 s,^ClamukoScanOnClose$,& yes,
312 s,^ClamukoScanOnExec$,& yes,
3bc0b921
AM
313 s,^LogTime$,& yes,
314 s,^ScanPE$,& yes,
29f80fd8
ER
315' /etc/clamd.conf
316%banner -e %{name}-0.90 <<EOF
317ClamAV config was automatically upgraded to 0.90 format. You should review it
318that it's still valid.
319EOF
320#'
321# unfortunately clamd has no configcheck option so we just have to start it
322# once again after config was broken after upgrade
323touch /var/lock/subsys/clamd
324%service -q clamd restart
1eab800a 325
09a96373
ŁK
326%triggerpostun -- %{name} < 0.97.7-4
327%systemd_trigger clamd.service
328
e5b99e12
JK
329%triggerpostun -- %{name} < 0.99.2-2
330%systemd_service_enable cronjob-clamav.timer
331
eba74cc1 332%post milter
333/sbin/chkconfig --add clamav-milter
dd6d36d5 334%service clamav-milter restart "Clam Antivirus daemon"
eba74cc1 335
4c570814 336%preun milter
eba74cc1 337if [ "$1" = "0" ]; then
dd6d36d5 338 %service clamav-milter stop
eba74cc1 339 /sbin/chkconfig --del clamav-milter
340fi
fba342ab 341
1475e7a3 342%post libs -p /sbin/ldconfig
343%postun libs -p /sbin/ldconfig
4460ff0b 344
e6c034d3 345%files
346%defattr(644,root,root,755)
c5a8ecb5 347%doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
79125c5b 348%attr(755,root,root) %{_bindir}/clambc
24f68046 349%attr(755,root,root) %{_bindir}/clamdscan
40002522 350%attr(755,root,root) %{_bindir}/clamdtop
24f68046 351%attr(755,root,root) %{_bindir}/clamscan
d03f44fa 352%attr(755,root,root) %{_bindir}/clamsubmit
24f68046 353%attr(755,root,root) %{_bindir}/freshclam
354%attr(755,root,root) %{_bindir}/sigtool
d78cc52a 355%attr(755,root,root) %{_bindir}/clamconf
24f68046 356%attr(755,root,root) %{_sbindir}/clamd
357%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
c8321415 358%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
839be9e8 359%{systemdtmpfilesdir}/%{name}.conf
09a96373 360%{systemdunitdir}/clamd.service
e5b99e12
JK
361%{systemdunitdir}/cronjob-clamav.service
362%{systemdunitdir}/cronjob-clamav.timer
ca57b115 363%attr(755,clamav,root) %dir /var/lib/%{name}
d78cc52a
ER
364%attr(640,clamav,root) %ghost /var/log/freshclam.log
365%attr(750,clamav,clamav) %dir /var/run/%{name}
c935072a 366
b5177881 367%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
0e86f481
JB
368%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
369%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
6586d93d 370
05eb87ef 371%attr(754,root,root) /etc/rc.d/init.d/clamd
7c801993
ER
372%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
373%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
59f1ef4d
BS
374%{_mandir}/man1/*
375%{_mandir}/man5/clamd*
376%{_mandir}/man5/freshclam*
eba74cc1 377%{_mandir}/man8/clamd*
378
379%if %{with milter}
380%files milter
381%defattr(644,root,root,755)
7c801993 382%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
9279da12 383%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
491eb046 384%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
eba74cc1 385#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
386#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
387#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
388%attr(755,root,root) %{_sbindir}/clamav-milter
59f1ef4d 389%{_mandir}/man5/clamav-milter*
eba74cc1 390%{_mandir}/man8/clamav-milter.8*
0e86f481 391%attr(700,clamav,clamav) /var/spool/clamav
eba74cc1 392%endif
4460ff0b
AM
393
394%files libs
395%defattr(644,root,root,755)
418bf14a 396%attr(755,root,root) %{_libdir}/libclamav.so.*.*.*
85d2d338 397%attr(755,root,root) %ghost %{_libdir}/libclamav.so.7
418bf14a 398%attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.*
85d2d338 399%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.7
418bf14a 400%attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.*
85d2d338 401%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.7
4460ff0b
AM
402
403%files devel
404%defattr(644,root,root,755)
24f68046 405%attr(755,root,root) %{_bindir}/clamav-config
418bf14a
JB
406%attr(755,root,root) %{_libdir}/libclamav.so
407%attr(755,root,root) %{_libdir}/libclamunrar.so
408%attr(755,root,root) %{_libdir}/libclamunrar_iface.so
409%{_libdir}/libclamav.la
410%{_libdir}/libclamunrar.la
411%{_libdir}/libclamunrar_iface.la
412%{_includedir}/clamav.h
413%{_pkgconfigdir}/libclamav.pc
4460ff0b
AM
414
415%files static
416%defattr(644,root,root,755)
418bf14a
JB
417%{_libdir}/libclamav.a
418%{_libdir}/libclamunrar.a
419%{_libdir}/libclamunrar_iface.a
This page took 0.163939 seconds and 4 git commands to generate.