--- rpms/clamav/sme9/clamav.spec 2014/06/21 17:52:39 1.11 +++ 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.98.4 -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} @@ -164,6 +205,21 @@ you will need to install %{name}-devel. s|^#(User) .+$|$1 clamav|; ' etc/clamav-milter.conf.sample >etc/clamav-milter.conf +%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|; @@ -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} @@ -320,7 +401,7 @@ fi %files %defattr(-, root, root, 0755) -%doc AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README +%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 @@ -328,7 +409,6 @@ fi %doc %{_mandir}/man1/sigtool.1* %doc %{_mandir}/man1/clambc.1* %doc %{_mandir}/man1/clamscan.1* -%doc %{_mandir}/man1/clamsubmit.1* %doc %{_mandir}/man1/freshclam.1* %doc %{_mandir}/man5/freshclam.conf.5* %config(noreplace) %{_sysconfdir}/freshclam.conf @@ -339,10 +419,12 @@ 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 @@ -401,18 +483,58 @@ 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 +* 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 -- Updates to release 0.98.3. +- Updated to release 0.98.3. -* Sun Jan 26 2014 David Beveridge - 0.98.1-1 +* 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