--- rpms/clamav/sme9/clamav.spec 2013/06/05 05:31:32 1.2 +++ rpms/clamav/sme9/clamav.spec 2018/11/12 22:37:19 1.23 @@ -11,36 +11,77 @@ %{?rh7:%define _without_milter 1} %{?el2:%define _without_milter 1} +# Work around https://bugzilla.clamav.net/show_bug.cgi?id=12162 by bundling +# newer zlib version from RHEL/CentOS 7 (#1600458) +%global zlibversion 1.2.7 +%global zlibrelease 17%{?dist} + + Summary: Anti-virus software Name: clamav -Version: 0.97.8 -Release: 1%{?dist} -License: GPL +Version: 0.100.2 +Release: 2%{?dist} +# ClamAV is GPLv2, zlib is zlib, /contrib/dotzlib/ has Boost license +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +License: GPLv2 and zlib and Boost +%else +License: GPLv2 +%endif + + Group: Applications/System URL: http://www.clamav.net/ -Packager: Dag Wieers -Vendor: Dag Apt Repository, http://dag.wieers.com/apt/ - Source: http://downloads.sourceforge.net/project/clamav/clamav/%{version}/clamav-%{version}.tar.gz Source1: clamav.init Source2: clamav-milter.init Source10: http://db.local.clamav.net/main.cvd Source11: http://db.local.clamav.net/daily.cvd + +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +# Cheerfully borrowed from zlib.spec in RHEL/CentOS 7 +Source90: http://www.zlib.net/zlib-%{zlibversion}.tar.bz2 +#Source90: zlib-1.2.7.tar.bz2 +%endif + +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +# Cheerfully borrowed from zlib.spec in RHEL/CentOS 7, see +# also https://git.centos.org/tree/rpms!zlib.git/c7/SOURCES +Patch90: zlib-1.2.5-minizip-fixuncrypt.patch +# resolves: #805113 +Patch91: zlib-1.2.7-optimized-s390.patch +# resolves: #844791 +Patch92: zlib-1.2.7-z-block-flush.patch +# resolves: #1127330 +Patch93: zlib-1.2.7-fix-serious-but-very-rare-decompression-bug-in-inftr.patch +# resolves: #1337441 +Patch94: zlib-1.2.7-Fix-bug-where-gzopen-gzclose-would-write-an-empty-fi.patch +%endif + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: bzip2-devel BuildRequires: curl-devel BuildRequires: gmp-devel BuildRequires: ncurses-devel -BuildRequires: zlib-devel %{!?_without_milter:BuildRequires: sendmail-devel >= 8.12} BuildRequires: check-devel +BuildRequires: openssl-devel +BuildRequires: libxml2-devel +BuildRequires: pcre-devel +BuildRequires: xz ### Do not require the latest release of clamav-db specifically (people may use freshclam onward) #Requires: clamav-db = %{version}-%{release} Requires: clamav-db +Provides: bundled(libmspack) = 0.5-0.1.alpha.modified_by_clamav +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +Provides: bundled(zlib) = %{zlibversion}-%{zlibrelease} +%else +Requires: zlib-devel +%endif + ### Fedora Extras introduced them differently :( Obsoletes: libclamav <= %{version}-%{release} Obsoletes: clamav-lib <= %{version}-%{release} @@ -122,7 +163,7 @@ you will need to install %{name}-devel. s|^\@INSTALL_FRESHCLAM_CONF_TRUE\@|\t|g; ' database/Makefile.in etc/Makefile.in -%{__perl} -pi.orig -e ' +%{__perl} -pi -e ' s|^(Example)|#$1|; s|^#(LogFile) .+$|$1 %{_localstatedir}/log/clamav/clamd.log|; s|^#(LogFileMaxSize) .*|$1 0|; @@ -150,9 +191,9 @@ you will need to install %{name}-devel. s|^#(ArchiveMaxCompressionRatio) .+|$1 300|; s|^#(ArchiveBlockEncrypted)|$1|; s|^#(ArchiveBlockMax)|$1|; - ' etc/clamd.conf + ' etc/clamd.conf.sample >etc/clamd.conf -%{__perl} -pi.orig -e ' +%{__perl} -pi -e ' s|^(Example)|#$1|; s|^#(AllowSupplementaryGroups) .+$|$1 yes|; s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|; @@ -162,9 +203,24 @@ you will need to install %{name}-devel. s|^#(LogTime)|$1|; s|^#(MilterSocket) /.*$|$1 unix:%{_localstatedir}/clamav/clmilter.socket|; s|^#(User) .+$|$1 clamav|; - ' etc/clamav-milter.conf + ' etc/clamav-milter.conf.sample >etc/clamav-milter.conf -%{__perl} -pi.orig -e ' +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +# Cheerfully borrowed from zlib.spec in RHEL/CentOS 7, see +# https://git.centos.org/blob/rpms!zlib.git/c7/SPECS!zlib.spec +tar xfj %{SOURCE90} +pushd zlib-%{zlibversion} +%patch90 -p1 -b .fixuncrypt +%ifarch s390 s390x +%patch91 -p1 -b .optimized-deflate +%endif +%patch92 -p1 -b .z-flush +%patch93 -p1 +%patch94 -p1 +popd +%endif + +%{__perl} -p -e ' s|^(Checks) .+$|$1 24|; s|^(Example)|#$1|; s|^#(DatabaseDirectory) .+$|$1 %{_localstatedir}/clamav|; @@ -172,7 +228,7 @@ you will need to install %{name}-devel. s|^#(LogSyslog)|$1|; s|^#(NotifyClamd) .+$|$1 %{_sysconfdir}/clamd.conf|; s|^#(UpdateLogFile) .+$|$1 %{_localstatedir}/log/clamav/freshclam.log|; - ' etc/freshclam.conf + ' etc/freshclam.conf.sample >etc/freshclam.conf %{__cat} <clamd.logrotate %{_localstatedir}/log/clamav/clamd.log { @@ -210,6 +266,26 @@ CLAMAV_FLAGS="--config-file=%{_sysconfdi EOF %build + +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} +# Cheerfully borrowed from zlib.spec in RHEL/CentOS 7, see +# https://git.centos.org/blob/rpms!zlib.git/c7/SPECS!zlib.spec +pushd zlib-%{zlibversion} +%ifarch ppc64 ppc64le +export CFLAGS="$RPM_OPT_FLAGS -fPIC -O3" +%else +export CFLAGS="$RPM_OPT_FLAGS -fPIC" +%endif + +export LDFLAGS="$LDFLAGS -Wl,-z,relro" + +./configure --libdir=%{_libdir} --includedir=%{_includedir} --prefix=%{_prefix} --static +make %{?_smp_mflags} +make install DESTDIR=%{_builddir}/%{name}-%{version}/zlib-%{zlibversion}-%{zlibrelease} +popd +%endif + + %configure \ --program-prefix="%{?_program_prefix}" \ --disable-clamav \ @@ -223,8 +299,13 @@ EOF %{!?_without_milter:--enable-milter} \ --with-dbdir="%{_localstatedir}/clamav" \ --with-group="clamav" \ - --with-libcurl \ + --with-libcurl=%{_prefix} \ --with-user="clamav" + +%if 0%{?zlibversion:1} && 0%{?zlibrelease:1} + --with-zlib=%{_builddir}/%{name}-%{version}/zlib-%{zlibversion}-%{zlibrelease}%{_prefix} \ +%endif + ### Disable JIT until it is implemented securely (RHbz #573191) # --enable-llvm \ %{__make} %{?_smp_mflags} @@ -234,11 +315,14 @@ EOF %{__make} install DESTDIR="%{buildroot}" %{__install} -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd +%{__install} -Dp -m0644 etc/freshclam.conf %{buildroot}%{_sysconfdir}/freshclam.conf %{__install} -Dp -m0755 freshclam.cron %{buildroot}%{_sysconfdir}/cron.daily/freshclam %{__install} -Dp -m0644 freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam +%{__install} -Dp -m0644 etc/clamd.conf %{buildroot}%{_sysconfdir}/clamd.conf %{__install} -Dp -m0644 clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav %if %{!?_without_milter:1}0 +%{__install} -Dp -m0644 etc/clamav-milter.conf %{buildroot}%{_sysconfdir}/clamav-milter.conf %{__install} -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter %{__install} -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter %else @@ -317,8 +401,9 @@ fi %files %defattr(-, root, root, 0755) -%doc AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README -%doc docs/*.pdf etc/freshclam.conf +%doc ChangeLog.md COPYING* INSTALL.md NEWS.md README.md +%doc etc/freshclam.conf.sample +%doc docs/*.pdf ### Remove test virus documents as they trigger clamav #%doc test/ %doc %{_mandir}/man1/sigtool.1* @@ -334,14 +419,17 @@ fi %{_libdir}/libclamav.so.* %{_libdir}/libclamunrar.so.* %{_libdir}/libclamunrar_iface.so.* +%{_libdir}/libclammspack.so.* # moved from -devel to here so clamd can work with rars when clamav-devel is not installed. %{_libdir}/libclamav.so %{_libdir}/libclamunrar.so %{_libdir}/libclamunrar_iface.so +%{_libdir}/libclammspack.so +%exclude %{_sysconfdir}/freshclam.conf.sample %files -n clamd %defattr(-, root, root, 0755) -%doc etc/clamd.conf +%doc etc/clamd.conf.sample %doc %{_mandir}/man1/clambc.1* %doc %{_mandir}/man1/clamconf.1* %doc %{_mandir}/man1/clamdscan.1* @@ -361,11 +449,14 @@ fi %dir %{_localstatedir}/clamav/ %dir %{_localstatedir}/log/clamav/ %ghost %{_localstatedir}/log/clamav/clamd.log + %exclude %{_localstatedir}/clamav/* +%exclude %{_sysconfdir}/clamd.conf.sample %if %{!?_without_milter:1}0 %files milter %defattr(-, root, root, 0755) +%doc etc/clamav-milter.conf.sample %doc %{_mandir}/man5/clamav-milter.conf.5* %doc %{_mandir}/man8/clamav-milter.8* %config(noreplace) %{_sysconfdir}/clamav-milter.conf @@ -375,6 +466,7 @@ fi %else %exclude %{_mandir}/man5/clamav-milter.conf.5* %endif +%exclude %{_sysconfdir}/clamav-milter.conf.sample %files db %defattr(-, root, root, 0755) @@ -391,12 +483,64 @@ fi %{_bindir}/clamav-config %{_includedir}/clamav.h %{_libdir}/pkgconfig/libclamav.pc +%{_libdir}/pkgconfig/libclammspack.pc %exclude %{_libdir}/libclamav.la %exclude %{_libdir}/libclamunrar.la %exclude %{_libdir}/libclamunrar_iface.la +%exclude %{_libdir}/libclammspack.la %changelog -* Sat May 4 2013 David Beveridge - 0.97.8-1 +* Mon Nov 12 2018 John Crisp - 0.100.3-1 +- Bundle zlib 1.2.7-17.el7 to avoid malformed database errors (#1600458) +- [SME: 10645] + +* Wed Oct 24 2018 Daniel Berteaud - 0.100.2-1.sme +- Update to 0.100.2 [SME: 10579] + +* Wed Mar 14 2018 Daniel Berteaud - 0.99.4-1.sme +- Update to release 0.99.4 [SME: 10529] + +* Sat Jan 27 2018 Daniel Berteaud - 0.99.3-1.sme +- Update to release 0.99.3 [SME: 10499] + +* Tue May 3 2016 Daniel Berteaud - 0.99.2-1.sme +- Update to release 0.99.2 [SME: 9489] + +* Thu Mar 3 2016 Daniel Berteaud - 0.99.1-1.sme +- Update to release 0.99.1 [SME: 9267] + +* Tue Jan 12 2016 Daniel Berteaud - 0.99-2.sme +- Add pcre-devel to BuildRequires [SME: 9151] + +* Wed Jan 6 2016 Daniel Berteaud - 0.99-1.sme +- Update to release 0.99 [SME: 9151] + +* Wed May 13 2015 Daniel Berteaud - 0.98.7-1.sme +- Updated to release 0.98.7 [SME: 8922] + +* Thu Jan 29 2015 Daniel Berteaud - 0.98.6-1.sme +- Updated to release 0.98.6 [SME: 8822] + +* Tue Dec 16 2014 Daniel Berteaud - 0.98.5-1.sme +- Updated to release 0.98.5 [SME: 8729] + +* Sat Jun 21 2014 Ian Wells - 0.98.4-2.sme +- Add BuildRequires for openssl-devel and libxml2-devel [SME: 8457] +- Remove Packager and Vendor from spec file. + +* Thu Jun 17 2014 David Beveridge - 0.98.4-1 +- Updates to release 0.98.4. + +* Thu May 8 2014 David Beveridge - 0.98.3-1 +- Updated to release 0.98.3. + +* Sun Jan 26 2014 David Beveridge - 0.98.1-1 +- Updates to release 0.98.1. + +* Tue Sep 24 2013 Dag Wieers - 0.98-1 +- Updated to release 0.98. + +* Tue May 07 2013 David Hrbáč - 0.97.8-1 - Updated to release 0.97.8. * Wed Mar 20 2013 Dag Wieers - 0.97.7-1