Remove clutter

OBS-URL: https://build.opensuse.org/package/show/security/clamav?expand=0&rev=174
This commit is contained in:
Reinhard Max 2018-07-31 09:13:16 +00:00 committed by Git OBS Bridge
parent 57aad7711c
commit c8e2e69a0c

View File

@ -24,8 +24,8 @@ 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
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
@ -56,14 +56,14 @@ BuildRequires: sendmail-devel
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
Requires(pre): %{_bindir}/awk
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
Requires(pre): %{_sbindir}/usermod
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}
Provides: clamav-nodb = %version
Obsoletes: clamav-nodb <= 0.98.4
%systemd_requires
@ -96,7 +96,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,
@ -115,61 +115,61 @@ 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=%{_localstatedir}/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 \
--disable-yara
make V=1 %{?_smp_mflags}
make V=1 %?_smp_mflags
%install
%make_install
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
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}%{_sysconfdir}
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 %{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
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=%{_prefix}/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
@ -185,43 +185,43 @@ VALGRIND_GENSUP=1 make check
%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}
%_unitdir/clamd.service
%_unitdir/freshclam.service
%_unitdir/clamav-milter.service
%_tmpfilesdir
%license COPYING*
%doc docs/*.pdf docs/html
%{_mandir}/*/*
%{_bindir}/*
%{_sbindir}/*
%_mandir/*/*
%_bindir/*
%_sbindir/*
%defattr(-,vscan,vscan)
%dir %attr(750,vscan,vscan) %{_localstatedir}/spool/amavis
%dir %{_localstatedir}/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 %{_localstatedir}/spool/amavis vscan
%{_sbindir}/usermod vscan -g vscan
%_sbindir/useradd -r -o -g vscan -u 65 -s /bin/false \
-c "Vscan account" -d %_localstatedir/spool/amavis vscan
%_sbindir/usermod vscan -g vscan
%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