From 4422886c1f7f5a077c325535ef8acbf8ffa0d9b2 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Sep 28 2022 15:52:54 +0000 Subject: Unbundle libdeflate --- diff --git a/advancecomp.spec b/advancecomp.spec index f409506..62eeaf9 100644 --- a/advancecomp.spec +++ b/advancecomp.spec @@ -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 * Wed Jul 20 2022 Fedora Release Engineering - 2.1-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild