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