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