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