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