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