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