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