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