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