]> git.pld-linux.org Git - packages/clamav.git/blame - clamav.spec
- R: rc-scripts >= 0.4.0.20 (because of --pidfile with full patch)
[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
da5aee7a 9Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
e6c034d3 10Name: clamav
1aae26c1 11Version: 0.95.1
a09ac879 12Release: 2
e77f89d2 13Epoch: 0
c81b4cf4 14License: GPL v2+
4460ff0b 15Group: Applications
9d42dc39 16Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
1aae26c1 17# Source0-md5: c802d4b372e455849cfcb0d776fc72d8
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
9d42dc39 32%{?with_milter:BuildRequires: libmilter-devel}
2d1a6e1f 33BuildRequires: libtool
dd6d36d5 34%{?with_milter:BuildRequires: libwrap-devel}
50d65e20 35BuildRequires: rpmbuild(macros) >= 1.514
e278889f 36BuildRequires: zlib-devel
dd6d36d5
ER
37Requires(post,preun): /sbin/chkconfig
38Requires(postun): /usr/sbin/groupdel
39Requires(postun): /usr/sbin/userdel
40Requires(postun,pre): /usr/sbin/usermod
0e86f481 41Requires(pre): /bin/id
49797116 42Requires(pre): /usr/bin/getgid
43Requires(pre): /usr/sbin/groupadd
44Requires(pre): /usr/sbin/useradd
d985d248 45Requires(triggerpostun): sed >= 4.0
d4117574 46Requires: %{name}-libs = %{epoch}:%{version}-%{release}
dd6d36d5 47Requires: /usr/sbin/usermod
6a92e05d 48Requires: bc
a09ac879 49Requires: rc-scripts >= 0.4.0.20
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
70- on-access scanning (Linux® and FreeBSD®)
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
JR
82%description -l pl.UTF-8
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.
e2414f52 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
da5aee7a 102Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
eba74cc1 103Group: Daemons
d4117574 104Requires: %{name} = %{epoch}:%{version}-%{release}
eba74cc1 105Requires: sendmail >= 8.11
106Requires: tcp_wrappers
eba74cc1 107
108%description milter
109ClamAV sendmail filter using MILTER interface.
110
d8cf2de3
JR
111%description milter -l pl.UTF-8
112Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
eba74cc1 113
4460ff0b 114%package devel
f98d218a 115Summary: clamav - Development header files and libraries
da5aee7a 116Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
f98d218a 117Group: Development/Libraries
d4117574 118Requires: %{name}-libs = %{epoch}:%{version}-%{release}
cc776ef1
JB
119Requires: bzip2-devel
120Requires: gmp-devel
121Requires: zlib-devel
4460ff0b
AM
122
123%description devel
124This package contains the development header files and libraries
125necessary to develop clamav client applications.
126
d8cf2de3
JR
127%description devel -l pl.UTF-8
128Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
142cc22a 129klienckich clamav.
4460ff0b
AM
130
131%package static
dd6d36d5 132Summary: clamav static libraries
da5aee7a 133Summary(pl.UTF-8): Biblioteki statyczne clamav
f98d218a 134Group: Development/Libraries
d4117574 135Requires: %{name}-devel = %{epoch}:%{version}-%{release}
4460ff0b
AM
136
137%description static
f33eb2df 138clamav static libraries.
4460ff0b 139
d8cf2de3 140%description static -l pl.UTF-8
4460ff0b
AM
141Biblioteki statyczne clamav.
142
e6c034d3 143%prep
c81b4cf4 144%setup -q
c935072a 145%patch0 -p1
83eaf0c7 146%patch1 -p1
82747f5b 147
e6c034d3 148%build
82747f5b 149%{__libtoolize}
c81b4cf4 150%{__aclocal} -I m4
ed667a13 151%{__autoconf}
82747f5b 152%{__autoheader}
ed667a13 153%{__automake}
92c5ef39 154%configure \
ca57b115 155 --disable-clamav \
142cc22a 156 %{?with_milter:--enable-milter} \
20f26031 157 --with-dbdir=/var/lib/%{name} \
8635bd29 158 --with-no-cache \
a811cf23
ER
159 --with-ltdl-include=/usr/include \
160 --with-ltdl-lib=%{_libdir}
161
162%{__make} \
163 LIBTOOL=/usr/bin/libtool
4d3c9f35 164
e6c034d3 165%install
166rm -rf $RPM_BUILD_ROOT
06e3ab45
TP
167install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
168 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
92c5ef39
AM
169
170%{__make} install \
20f26031 171 LIBTOOL=/usr/bin/libtool \
92c5ef39 172 DESTDIR=$RPM_BUILD_ROOT
142cc22a 173%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
92c5ef39 174
d78cc52a 175cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
719d471d 1765 * * * * root %{_sbindir}/clamav-cron-updatedb
ca57b115 177EOF
92c5ef39 178
05eb87ef 179install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
4381c9a3 180%if %{with milter}
eba74cc1 181install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
eba74cc1 182install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
4381c9a3 183%endif
184install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
719d471d 185install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
142cc22a 186install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
813b04f8 187install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
2b9f3e64 188
3e84b306 189install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
4460ff0b 190
c935072a
MK
191# NOTE: clamd uses sane rights to it's clamd.pid file
192# So better keep it dir
193# If it is fixed use of dir will be unecesary
d78cc52a 194install -d $RPM_BUILD_ROOT/var/run/%{name}
c935072a 195
d78cc52a 196:> $RPM_BUILD_ROOT/var/log/freshclam.log
ef21d0fa 197
e6c034d3 198%clean
92c5ef39 199rm -rf $RPM_BUILD_ROOT
e6c034d3 200
c935072a 201%triggerin -- amavis-ng
50d65e20 202%addusertogroup -q clamav amavis
c935072a
MK
203
204%triggerin -- amavisd-new
50d65e20 205%addusertogroup -q clamav amavis
c935072a
MK
206
207%triggerin -- amavisd
50d65e20 208%addusertogroup -q clamav amavis
c935072a 209
e278889f 210%pre
236dddf1
ER
211%groupadd -g 43 clamav
212%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
174915c1 213
66d1575d 214%post
66d1575d 215/sbin/chkconfig --add clamd
dd6d36d5 216%service clamd restart "Clam Antivirus daemon"
d78cc52a
ER
217touch /var/log/freshclam.log
218chown clamav:root /var/log/freshclam.log
219chmod 640 /var/log/freshclam.log
66d1575d 220
66d1575d 221%preun
222if [ "$1" = "0" ]; then
dd6d36d5 223 %service clamd stop
66d1575d 224 /sbin/chkconfig --del clamd
225fi
e6c034d3 226
0c8c3ba4 227%postun
174915c1 228if [ "$1" = "0" ]; then
49797116 229 %userremove clamav
230 %groupremove clamav
174915c1 231fi
232
ed0b0327 233%triggerpostun -- %{name} < 0.80
1eab800a 234if [ -f /etc/clamav.conf.rpmsave ]; then
d093ed8c 235 echo "Renaming config to new name /etc/clamd.conf"
236 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
237 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
d4117574 238 echo "Changing config location in freshclam config"
f12ca2c1
ER
239 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
240fi
241
29f80fd8
ER
242%triggerpostun -- %{name} < 0.90-0.rc2.0.10
243%{__cp} -f /etc/clamd.conf{,.rpmsave}
244%{__sed} -i -e '
245 s,^LogSyslog$,& yes,
246 s,^FixStaleSocket$,& yes,
247 s,^AllowSupplementaryGroups$,& yes,
248 s,^ClamukoScanOnOpen$,& yes,
249 s,^ClamukoScanOnClose$,& yes,
250 s,^ClamukoScanOnExec$,& yes,
3bc0b921
AM
251 s,^LogTime$,& yes,
252 s,^ScanPE$,& yes,
29f80fd8
ER
253' /etc/clamd.conf
254%banner -e %{name}-0.90 <<EOF
255ClamAV config was automatically upgraded to 0.90 format. You should review it
256that it's still valid.
257EOF
258#'
259# unfortunately clamd has no configcheck option so we just have to start it
260# once again after config was broken after upgrade
261touch /var/lock/subsys/clamd
262%service -q clamd restart
1eab800a 263
eba74cc1 264%post milter
265/sbin/chkconfig --add clamav-milter
dd6d36d5 266%service clamav-milter restart "Clam Antivirus daemon"
eba74cc1 267
4c570814 268%preun milter
eba74cc1 269if [ "$1" = "0" ]; then
dd6d36d5 270 %service clamav-milter stop
eba74cc1 271 /sbin/chkconfig --del clamav-milter
272fi
fba342ab 273
1475e7a3 274%post libs -p /sbin/ldconfig
275%postun libs -p /sbin/ldconfig
4460ff0b 276
e6c034d3 277%files
278%defattr(644,root,root,755)
c5a8ecb5 279%doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
24f68046 280%attr(755,root,root) %{_bindir}/clamdscan
40002522 281%attr(755,root,root) %{_bindir}/clamdtop
24f68046 282%attr(755,root,root) %{_bindir}/clamscan
283%attr(755,root,root) %{_bindir}/freshclam
284%attr(755,root,root) %{_bindir}/sigtool
d78cc52a 285%attr(755,root,root) %{_bindir}/clamconf
24f68046 286%attr(755,root,root) %{_sbindir}/clamd
287%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
c8321415 288%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
ca57b115 289%attr(755,clamav,root) %dir /var/lib/%{name}
c8321415 290%ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
d78cc52a
ER
291%attr(640,clamav,root) %ghost /var/log/freshclam.log
292%attr(750,clamav,clamav) %dir /var/run/%{name}
c935072a 293
b5177881 294%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
0e86f481
JB
295%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
296%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
6586d93d 297
05eb87ef 298%attr(754,root,root) /etc/rc.d/init.d/clamd
7c801993
ER
299%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
300%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
eba74cc1 301%{_mandir}/man[15]/*
302%{_mandir}/man8/clamd*
303
304%if %{with milter}
305%files milter
306%defattr(644,root,root,755)
7c801993 307%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
40002522 308%config(noreplace) %verify(not md5 mtime size) /etc/clamav-milter.conf
491eb046 309%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
eba74cc1 310#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
311#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
312#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
313%attr(755,root,root) %{_sbindir}/clamav-milter
314%{_mandir}/man8/clamav-milter.8*
0e86f481 315%attr(700,clamav,clamav) /var/spool/clamav
eba74cc1 316%endif
4460ff0b
AM
317
318%files libs
319%defattr(644,root,root,755)
263ab0bb 320%attr(755,root,root) %{_libdir}/lib*.so.*.*
40002522
AG
321%attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
322%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
323%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
4460ff0b
AM
324
325%files devel
326%defattr(644,root,root,755)
24f68046 327%attr(755,root,root) %{_bindir}/clamav-config
4460ff0b 328%attr(755,root,root) %{_libdir}/lib*.so
52d00604 329%{_libdir}/lib*.la
4460ff0b 330%{_includedir}/*.h
0d90572a 331%{_pkgconfigdir}/*.pc
4460ff0b
AM
332
333%files static
334%defattr(644,root,root,755)
335%{_libdir}/*.a
This page took 0.113547 seconds and 4 git commands to generate.