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