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