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 License: GPL-2.0-only
Group: Productivity/Security Group: Productivity/Security
URL: http://www.clamav.net URL: http://www.clamav.net
Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz Source0: http://www.clamav.net/downloads/production/%name-%version.tar.gz
Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig Source1: http://www.clamav.net/downloads/production/%name-%version.tar.gz.sig
Source4: clamav-rpmlintrc Source4: clamav-rpmlintrc
Source6: clamav-tmpfiles.conf Source6: clamav-tmpfiles.conf
Source7: service.clamd Source7: service.clamd
@ -56,14 +56,14 @@ BuildRequires: sendmail-devel
BuildRequires: systemd-devel BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel BuildRequires: zlib-devel
Requires(pre): %{_bindir}/awk Requires(pre): %_bindir/awk
Requires(pre): %{_sbindir}/groupadd Requires(pre): %_sbindir/groupadd
Requires(pre): %{_sbindir}/useradd Requires(pre): %_sbindir/useradd
Requires(pre): %{_sbindir}/usermod Requires(pre): %_sbindir/usermod
Requires(pre): /bin/sed Requires(pre): /bin/sed
Requires(pre): /bin/tar Requires(pre): /bin/tar
Obsoletes: clamav-db < 0.88.3 Obsoletes: clamav-db < 0.88.3
Provides: clamav-nodb = %{version} Provides: clamav-nodb = %version
Obsoletes: clamav-nodb <= 0.98.4 Obsoletes: clamav-nodb <= 0.98.4
%systemd_requires %systemd_requires
@ -96,7 +96,7 @@ viruses, malware and other malicious threats.
%package devel %package devel
Summary: Development files for libclamav, an antivirus engine Summary: Development files for libclamav, an antivirus engine
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: libclamav7 = %{version} Requires: libclamav7 = %version
%description devel %description devel
ClamAV is an antivirus engine designed for detecting trojans, ClamAV is an antivirus engine designed for detecting trojans,
@ -115,61 +115,61 @@ that want to make use of libclamav.
%build %build
CFLAGS="-fstack-protector" CFLAGS="-fstack-protector"
CXXFLAGS="-fstack-protector" CXXFLAGS="-fstack-protector"
export CFLAGS="%{optflags} $CFLAGS -fPIE -fno-strict-aliasing" export CFLAGS="%optflags $CFLAGS -fPIE -fno-strict-aliasing"
export CXXFLAGS="%{optflags} $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98" export CXXFLAGS="%optflags $CXXFLAGS -fPIE -fno-strict-aliasing -std=gnu++98"
export LDFLAGS="-pie" export LDFLAGS="-pie"
%if "%{_lib}" == "lib64" %if "%_lib" == "lib64"
# tomsfastmath needs this for correct operation on 64-bit platforms # tomsfastmath needs this for correct operation on 64-bit platforms
CFLAGS="$CFLAGS -DFP_64BIT" CFLAGS="$CFLAGS -DFP_64BIT"
%endif %endif
%configure \ %configure \
--disable-clamav \ --disable-clamav \
--disable-static \ --disable-static \
--with-dbdir=%{_localstatedir}/lib/clamav \ --with-dbdir=%_localstatedir/lib/clamav \
--with-user=vscan \ --with-user=vscan \
--with-group=vscan \ --with-group=vscan \
--enable-milter \ --enable-milter \
%{clamav_check} \ %clamav_check \
--enable-clamdtop \ --enable-clamdtop \
--disable-zlib-vcheck \ --disable-zlib-vcheck \
--disable-timestamps \ --disable-timestamps \
--disable-yara --disable-yara
make V=1 %{?_smp_mflags} make V=1 %?_smp_mflags
%install %install
%make_install %make_install
install -d -m755 %{buildroot}%{_localstatedir}/lib/clamav install -d -m755 %buildroot%_localstatedir/lib/clamav
install -d -m755 %{buildroot}/%{_tmpfilesdir} install -d -m755 %buildroot/%_tmpfilesdir
install -m644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/clamav.conf install -m644 %SOURCE6 %buildroot%_tmpfilesdir/clamav.conf
mkdir -p %{buildroot}%{_localstatedir}/spool/amavis mkdir -p %buildroot%_localstatedir/spool/amavis
mkdir -p -m 0755 %{buildroot}/run/clamav mkdir -p -m 0755 %buildroot/run/clamav
find %{buildroot} -type f -name "*.la" -delete -print find %buildroot -type f -name "*.la" -delete -print
# libclammspack is not meant to be linked against by anything but # libclammspack is not meant to be linked against by anything but
# libclamav # libclamav
rm %{buildroot}%{_libdir}/pkgconfig/libclammspack.pc rm %buildroot%_libdir/pkgconfig/libclammspack.pc
rm %{buildroot}%{_libdir}/libclammspack.so rm %buildroot%_libdir/libclammspack.so
# fix the new config file names # fix the new config file names
pushd %{buildroot}%{_sysconfdir} pushd %buildroot%_sysconfdir
mv clamd.conf.sample clamd.conf mv clamd.conf.sample clamd.conf
mv clamav-milter.conf.sample clamav-milter.conf mv clamav-milter.conf.sample clamav-milter.conf
mv freshclam.conf.sample freshclam.conf mv freshclam.conf.sample freshclam.conf
popd popd
# Systemd... # Systemd...
install -d -m 0755 %{buildroot}/%{_unitdir} install -d -m 0755 %buildroot/%_unitdir
install -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/clamd.service install -m 0644 %SOURCE7 %buildroot/%_unitdir/clamd.service
install -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/freshclam.service install -m 0644 %SOURCE8 %buildroot/%_unitdir/freshclam.service
install -m 0644 %{SOURCE9} %{buildroot}/%{_unitdir}/clamav-milter.service install -m 0644 %SOURCE9 %buildroot/%_unitdir/clamav-milter.service
rm -f %{buildroot}/%{_unitdir}/clamav-daemon.service rm -f %buildroot/%_unitdir/clamav-daemon.service
rm -f %{buildroot}/%{_unitdir}/clamav-daemon.socket rm -f %buildroot/%_unitdir/clamav-daemon.socket
rm -f %{buildroot}/%{_unitdir}/clamav-freshclam.service rm -f %buildroot/%_unitdir/clamav-freshclam.service
# this is broken if system does not have systemd so don't # this is broken if system does not have systemd so don't
# use it at all on systems without mandatory systemd # use it at all on systems without mandatory systemd
for srvname in clamd freshclam clamav-milter;do 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 done
%check %check
@ -185,43 +185,43 @@ VALGRIND_GENSUP=1 make check
%postun -n libclammspack0 -p /sbin/ldconfig %postun -n libclammspack0 -p /sbin/ldconfig
%files %files
%config(noreplace) %{_sysconfdir}/*.conf %config(noreplace) %_sysconfdir/*.conf
#systemd... #systemd...
%{_unitdir}/clamd.service %_unitdir/clamd.service
%{_unitdir}/freshclam.service %_unitdir/freshclam.service
%{_unitdir}/clamav-milter.service %_unitdir/clamav-milter.service
%{_tmpfilesdir} %_tmpfilesdir
%license COPYING* %license COPYING*
%doc docs/*.pdf docs/html %doc docs/*.pdf docs/html
%{_mandir}/*/* %_mandir/*/*
%{_bindir}/* %_bindir/*
%{_sbindir}/* %_sbindir/*
%defattr(-,vscan,vscan) %defattr(-,vscan,vscan)
%dir %attr(750,vscan,vscan) %{_localstatedir}/spool/amavis %dir %attr(750,vscan,vscan) %_localstatedir/spool/amavis
%dir %{_localstatedir}/lib/clamav %dir %_localstatedir/lib/clamav
%ghost %attr(755,vscan,vscan) /run/clamav %ghost %attr(755,vscan,vscan) /run/clamav
%files -n libclamav7 %files -n libclamav7
%{_libdir}/libclam*.so.7* %_libdir/libclam*.so.7*
%files -n libclammspack0 %files -n libclammspack0
%{_libdir}/libclammspack.so.0* %_libdir/libclammspack.so.0*
%files devel %files devel
%{_libdir}/pkgconfig/* %_libdir/pkgconfig/*
%{_libdir}/libclam*.so %_libdir/libclam*.so
%{_includedir}/* %_includedir/*
%pre %pre
getent group vscan >/dev/null || %{_sbindir}/groupadd -r vscan getent group vscan >/dev/null || %_sbindir/groupadd -r vscan
getent passwd vscan >/dev/null || \ getent passwd vscan >/dev/null || \
%{_sbindir}/useradd -r -o -g vscan -u 65 -s /bin/false \ %_sbindir/useradd -r -o -g vscan -u 65 -s /bin/false \
-c "Vscan account" -d %{_localstatedir}/spool/amavis vscan -c "Vscan account" -d %_localstatedir/spool/amavis vscan
%{_sbindir}/usermod vscan -g vscan %_sbindir/usermod vscan -g vscan
%service_add_pre clamd.service freshclam.service clamav-milter.service %service_add_pre clamd.service freshclam.service clamav-milter.service
%post %post
systemd-tmpfiles --create %{_tmpfilesdir}/clamav.conf systemd-tmpfiles --create %_tmpfilesdir/clamav.conf
%service_add_post clamd.service freshclam.service clamav-milter.service %service_add_post clamd.service freshclam.service clamav-milter.service
%preun %preun