Accepting request 625316 from home:pluskalm:branches:security
- Update dendencies (pcre2, libjson-c and systemd) - Modernise spec file with spec-cleaner OBS-URL: https://build.opensuse.org/request/show/625316 OBS-URL: https://build.opensuse.org/package/show/security/clamav?expand=0&rev=171
This commit is contained in:
parent
7af09fc2e8
commit
fc65c3a5de
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 25 16:23:09 UTC 2018 - mpluskal@suse.com
|
||||
|
||||
- Update dendencies (pcre2, libjson-c and systemd)
|
||||
- Modernise spec file with spec-cleaner
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 17 14:21:35 UTC 2018 - security@suse.com
|
||||
|
||||
|
136
clamav.spec
136
clamav.spec
@ -16,49 +16,54 @@
|
||||
#
|
||||
|
||||
|
||||
%define clamav_check --enable-check
|
||||
Name: clamav
|
||||
Version: 0.100.1
|
||||
Release: 0
|
||||
Summary: Antivirus Toolkit
|
||||
License: GPL-2.0-only
|
||||
Group: Productivity/Security
|
||||
URL: http://www.clamav.net
|
||||
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
|
||||
Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig
|
||||
Source4: clamav-rpmlintrc
|
||||
Source6: clamav-tmpfiles.conf
|
||||
Source7: service.clamd
|
||||
Source8: service.freshclam
|
||||
Source9: service.clamav-milter
|
||||
Source11: clamav.keyring
|
||||
Patch1: clamav-conf.patch
|
||||
Patch4: clamav-disable-timestamps.patch
|
||||
Patch5: clamav-obsolete-config.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: bc
|
||||
BuildRequires: check-devel
|
||||
BuildRequires: libbz2-devel
|
||||
BuildRequires: libcurl-devel
|
||||
BuildRequires: libjson-c-devel
|
||||
BuildRequires: libopenssl-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: pcre2-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pwdutils
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: sed
|
||||
BuildRequires: sendmail-devel
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: zlib-devel
|
||||
%define clamav_check --enable-check
|
||||
Summary: Antivirus Toolkit
|
||||
License: GPL-2.0-only
|
||||
Group: Productivity/Security
|
||||
Version: 0.100.1
|
||||
Release: 0
|
||||
Url: http://www.clamav.net
|
||||
Requires(pre): %{_bindir}/awk
|
||||
Requires(pre): %{_sbindir}/groupadd
|
||||
Requires(pre): %{_sbindir}/useradd
|
||||
Requires(pre): %{_sbindir}/usermod
|
||||
Requires(pre): /bin/sed
|
||||
Requires(pre): /bin/tar
|
||||
Obsoletes: clamav-db < 0.88.3
|
||||
Provides: clamav-nodb = %{version}
|
||||
Obsoletes: clamav-nodb <= 0.98.4
|
||||
Requires(pre): %_sbindir/groupadd %_sbindir/useradd %_sbindir/usermod
|
||||
Requires(pre): /usr/bin/awk /bin/sed /bin/tar
|
||||
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz
|
||||
Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig
|
||||
Source11: clamav.keyring
|
||||
Source4: clamav-rpmlintrc
|
||||
Source6: clamav-tmpfiles.conf
|
||||
Source7: service.clamd
|
||||
Source8: service.freshclam
|
||||
Source9: service.clamav-milter
|
||||
Patch1: clamav-conf.patch
|
||||
Patch4: clamav-disable-timestamps.patch
|
||||
Patch5: clamav-obsolete-config.patch
|
||||
BuildRequires: systemd
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%systemd_requires
|
||||
|
||||
%description
|
||||
@ -90,7 +95,7 @@ viruses, malware and other malicious threats.
|
||||
%package devel
|
||||
Summary: Development files for libclamav, an antivirus engine
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libclamav7 = %version
|
||||
Requires: libclamav7 = %{version}
|
||||
|
||||
%description devel
|
||||
ClamAV is an antivirus engine designed for detecting trojans,
|
||||
@ -108,21 +113,21 @@ that want to make use of libclamav.
|
||||
%build
|
||||
CFLAGS="-fstack-protector"
|
||||
CXXFLAGS="-fstack-protector"
|
||||
export CFLAGS="%optflags $CFLAGS -fPIE -fno-strict-aliasing"
|
||||
export CXXFLAGS="%optflags $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
|
||||
export CFLAGS="%{optflags} $CFLAGS -fPIE -fno-strict-aliasing"
|
||||
export CXXFLAGS="%{optflags} $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
|
||||
export LDFLAGS="-pie"
|
||||
%if "%_lib" == "lib64"
|
||||
%if "%{_lib}" == "lib64"
|
||||
# tomsfastmath needs this for correct operation on 64-bit platforms
|
||||
CFLAGS="$CFLAGS -DFP_64BIT"
|
||||
%endif
|
||||
%configure \
|
||||
--disable-clamav \
|
||||
--disable-static \
|
||||
--with-dbdir=/var/lib/clamav \
|
||||
--with-dbdir=%{_localstatedir}/lib/clamav \
|
||||
--with-user=vscan \
|
||||
--with-group=vscan \
|
||||
--enable-milter \
|
||||
%clamav_check \
|
||||
%{clamav_check} \
|
||||
--enable-clamdtop \
|
||||
--disable-zlib-vcheck \
|
||||
--disable-timestamps
|
||||
@ -131,37 +136,37 @@ make V=1 %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install
|
||||
install -d -m755 %buildroot/var/lib/clamav
|
||||
install -d -m755 %buildroot/%_tmpfilesdir
|
||||
install -m644 %{S:6} %buildroot%_tmpfilesdir/clamav.conf
|
||||
mkdir -p %buildroot/var/spool/amavis
|
||||
mkdir -p -m 0755 %buildroot/run/clamav
|
||||
rm %buildroot/%_libdir/*.la
|
||||
install -d -m755 %{buildroot}%{_localstatedir}/lib/clamav
|
||||
install -d -m755 %{buildroot}/%{_tmpfilesdir}
|
||||
install -m644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/clamav.conf
|
||||
mkdir -p %{buildroot}%{_localstatedir}/spool/amavis
|
||||
mkdir -p -m 0755 %{buildroot}/run/clamav
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
|
||||
# libclammspack is not meant to be linked against by anything but
|
||||
# libclamav
|
||||
rm %buildroot%_libdir/pkgconfig/libclammspack.pc
|
||||
rm %buildroot%_libdir/libclammspack.so
|
||||
rm %{buildroot}%{_libdir}/pkgconfig/libclammspack.pc
|
||||
rm %{buildroot}%{_libdir}/libclammspack.so
|
||||
|
||||
# fix the new config file names
|
||||
pushd %buildroot/etc
|
||||
pushd %{buildroot}%{_sysconfdir}
|
||||
mv clamd.conf.sample clamd.conf
|
||||
mv clamav-milter.conf.sample clamav-milter.conf
|
||||
mv freshclam.conf.sample freshclam.conf
|
||||
popd
|
||||
|
||||
# Systemd...
|
||||
install -d -m 0755 %buildroot/%{_unitdir}
|
||||
install -m 0644 %{S:7} %buildroot/%{_unitdir}/clamd.service
|
||||
install -m 0644 %{S:8} %buildroot/%{_unitdir}/freshclam.service
|
||||
install -m 0644 %{S:9} %buildroot/%{_unitdir}/clamav-milter.service
|
||||
rm -f %buildroot/%{_unitdir}/clamav-daemon.service
|
||||
rm -f %buildroot/%{_unitdir}/clamav-daemon.socket
|
||||
rm -f %buildroot/%{_unitdir}/clamav-freshclam.service
|
||||
# this is broken if system does not have systemd so don't
|
||||
install -d -m 0755 %{buildroot}/%{_unitdir}
|
||||
install -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/clamd.service
|
||||
install -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/freshclam.service
|
||||
install -m 0644 %{SOURCE9} %{buildroot}/%{_unitdir}/clamav-milter.service
|
||||
rm -f %{buildroot}/%{_unitdir}/clamav-daemon.service
|
||||
rm -f %{buildroot}/%{_unitdir}/clamav-daemon.socket
|
||||
rm -f %{buildroot}/%{_unitdir}/clamav-freshclam.service
|
||||
# this is broken if system does not have systemd so don't
|
||||
# use it at all on systems without mandatory systemd
|
||||
for srvname in clamd freshclam clamav-milter;do
|
||||
(export PATH=/usr/sbin:/sbin:$PATH ;ln -sf $(which service) %{buildroot}/%{_sbindir}/rc${srvname})
|
||||
(export PATH=%{_prefix}/sbin:/sbin:$PATH ;ln -sf $(which service) %{buildroot}/%{_sbindir}/rc${srvname})
|
||||
done
|
||||
|
||||
%check
|
||||
@ -173,48 +178,47 @@ VALGRIND_GENSUP=1 make check
|
||||
|
||||
%post -n libclamav7 -p /sbin/ldconfig
|
||||
%postun -n libclamav7 -p /sbin/ldconfig
|
||||
|
||||
%post -n libclammspack0 -p /sbin/ldconfig
|
||||
%postun -n libclammspack0 -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%config(noreplace) %_sysconfdir/*.conf
|
||||
%config(noreplace) %{_sysconfdir}/*.conf
|
||||
#systemd...
|
||||
%{_unitdir}/clamd.service
|
||||
%{_unitdir}/freshclam.service
|
||||
%{_unitdir}/clamav-milter.service
|
||||
%_tmpfilesdir
|
||||
%doc COPYING*
|
||||
%{_tmpfilesdir}
|
||||
%license COPYING*
|
||||
%doc docs/*.pdf docs/html
|
||||
%doc %_mandir/*/*
|
||||
%_bindir/*
|
||||
%_sbindir/*
|
||||
%{_mandir}/*/*
|
||||
%{_bindir}/*
|
||||
%{_sbindir}/*
|
||||
%defattr(-,vscan,vscan)
|
||||
%dir %attr(750,vscan,vscan) /var/spool/amavis
|
||||
%dir /var/lib/clamav
|
||||
%dir %attr(750,vscan,vscan) %{_localstatedir}/spool/amavis
|
||||
%dir %{_localstatedir}/lib/clamav
|
||||
%ghost %attr(755,vscan,vscan) /run/clamav
|
||||
|
||||
%files -n libclamav7
|
||||
%_libdir/libclam*.so.7*
|
||||
%{_libdir}/libclam*.so.7*
|
||||
|
||||
%files -n libclammspack0
|
||||
%_libdir/libclammspack.so.0*
|
||||
%{_libdir}/libclammspack.so.0*
|
||||
|
||||
%files devel
|
||||
%_libdir/pkgconfig/*
|
||||
%_libdir/libclam*.so
|
||||
%_includedir/*
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_libdir}/libclam*.so
|
||||
%{_includedir}/*
|
||||
|
||||
%pre
|
||||
getent group vscan >/dev/null || %_sbindir/groupadd -r vscan || :
|
||||
getent group vscan >/dev/null || %{_sbindir}/groupadd -r vscan || :
|
||||
getent passwd vscan >/dev/null || \
|
||||
%_sbindir/useradd -r -o -g vscan -u 65 -s /bin/false \
|
||||
-c "Vscan account" -d /var/spool/amavis vscan || :
|
||||
%_sbindir/usermod vscan -g vscan 2> /dev/null || :
|
||||
%{_sbindir}/useradd -r -o -g vscan -u 65 -s /bin/false \
|
||||
-c "Vscan account" -d %{_localstatedir}/spool/amavis vscan || :
|
||||
%{_sbindir}/usermod vscan -g vscan 2> /dev/null || :
|
||||
%service_add_pre clamd.service freshclam.service clamav-milter.service
|
||||
|
||||
%post
|
||||
systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
|
||||
systemd-tmpfiles --create %{_tmpfilesdir}/clamav.conf
|
||||
%service_add_post clamd.service freshclam.service clamav-milter.service
|
||||
|
||||
%preun
|
||||
|
Loading…
x
Reference in New Issue
Block a user