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