Unbundle libdeflate

This commit is contained in:
Benjamin A. Beasley 2022-09-24 09:44:07 -04:00
commit b03d0ea739

View file

@ -12,6 +12,9 @@ Patch0: advancecomp-CVE-2019-8383.patch
# CVE-2019-9210 advancecomp: integer overflow in png_compress in pngex.cc
Patch1: advancecomp-CVE-2019-9210.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
@ -19,8 +22,17 @@ BuildRequires: make
BuildRequires: dos2unix
BuildRequires: tofrodos
# System library supported by upstream
BuildRequires: zlib-devel
%if 0%{?el7}
# No libdeflate package in EPEL7
Provides: bundled(libdeflate) = 0.6
%else
# Unbundled downstream
BuildRequires: pkgconfig(libdeflate)
%endif
%description
AdvanceCOMP contains recompression utilities for your .zip archives,
.png images, .mng video clips and .gz files.
@ -40,12 +52,33 @@ This package contains:
%autosetup -p1
dos2unix -k doc/*.txt
%if ! 0%{?el7}
# Patch out bundled libdeflate
rm -rvf libdeflate
sed -r -i '/libdeflate/d' Makefile.am
# Fix up #include paths. The find-then-modify pattern keeps us from discarding
# mtimes on any sources that do not need modification.
find . -type f -exec gawk \
'/^[[:blank:]]*#include.*libdeflate/ { print FILENAME; nextfile }' \
'{}' '+' |
xargs -r -t sed -r -i 's@^([[:blank:]]*#include.*)libdeflate/@\1@'
%endif
%build
autoreconf --force --install --verbose
# error: ISO C++17 does not allow dynamic exception specifications
%set_build_flags
export CXXFLAGS="-std=gnu++14 ${CXXFLAGS-}"
%if ! 0%{?el7}
# Link against system libdeflate
export CFLAGS="$(pkgconf --cflags libdeflate) ${CFLAGS-}"
export CXXFLAGS="$(pkgconf --cflags libdeflate) ${CXXFLAGS-}"
export LDFLAGS="$(pkgconf --libs libdeflate) ${LDFLAGS-}"
%endif
%configure
%make_build
@ -68,6 +101,7 @@ export CXXFLAGS="-std=gnu++14 ${CXXFLAGS-}"
- Spec file formatting tweaks
- Convert URLs from HTTP to HTTPS
- Use modern spec file macros (make_build/make_install/etc.)
- Unbundle libdeflate
* Mon Jul 27 2020 Jeff Law <law@redhat.com> - 2.1-15
- Force C++14 as the code is not ready for C++17