fix el7 builds

This commit is contained in:
Jonathan 2022-12-03 11:57:24 -06:00
parent f09ccf2a9a
commit af8f2a51d7

View File

@ -1,6 +1,6 @@
Name: brotli Name: brotli
Version: 1.0.9 Version: 1.0.9
Release: 9%{?dist} Release: 10%{?dist}
Summary: Lossless compression algorithm Summary: Lossless compression algorithm
License: MIT License: MIT
@ -11,10 +11,12 @@ Patch0: 09b0992b6acb7faa6fd3b23f9bc036ea117230fc.patch
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
BuildRequires: devtoolset-7-toolchain, devtoolset-7-libatomic-devel BuildRequires: devtoolset-7-toolchain, devtoolset-7-libatomic-devel
BuildRequires: cmake3
%else
BuildRequires: cmake
%endif %endif
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
Requires: lib%{name}%{?_isa} = %{version}-%{release} Requires: lib%{name}%{?_isa} = %{version}-%{release}
@ -75,18 +77,25 @@ chmod 644 c/tools/brotli.c
%build %build
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
. /opt/rh/devtoolset-7/enable . /opt/rh/devtoolset-7/enable
%endif %cmake3 \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DCMAKE_INSTALL_LIBDIR="%{_libdir}"
%cmake3_build
%else
%cmake \ %cmake \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DCMAKE_INSTALL_LIBDIR="%{_libdir}" -DCMAKE_INSTALL_LIBDIR="%{_libdir}"
%cmake_build %cmake_build
%endif
%py3_build %py3_build
%install %install
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
. /opt/rh/devtoolset-7/enable . /opt/rh/devtoolset-7/enable
%endif %cmake3_install
%else
%cmake_install %cmake_install
%endif
# I couldn't find the option to not build the static libraries # I couldn't find the option to not build the static libraries
rm "%{buildroot}%{_libdir}/"*.a rm "%{buildroot}%{_libdir}/"*.a
@ -103,8 +112,10 @@ done
%check %check
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
. /opt/rh/devtoolset-7/enable . /opt/rh/devtoolset-7/enable
%endif %ctest3
%else
%ctest %ctest
%endif
%files %files
%{_bindir}/brotli %{_bindir}/brotli
@ -139,6 +150,9 @@ done
%changelog %changelog
* Sat Dec 03 2022 Jonathan Wright <jonathan@almalinux.org> - 1.0.9-10
- Fix EL7 builds
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-9 * Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild