From b58c404928e13dc999f931aea9ab8cabe0ae8d71 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Fri, 13 May 2022 10:15:26 +0200 Subject: [PATCH] Introduce a switch for mingw builds and turn it off when building the flatpaks (flatpak-common module) --- openjpeg2.spec | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/openjpeg2.spec b/openjpeg2.spec index 9667202..9ec01ec 100644 --- a/openjpeg2.spec +++ b/openjpeg2.spec @@ -6,9 +6,15 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=1751749 %global _target_platform %{_vendor}-%{_target_os} +%if 0%{?flatpak} +%bcond_with mingw +%else +%bcond_without mingw +%endif + Name: openjpeg2 Version: 2.4.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: C-Library for JPEG 2000 # windirent.h is MIT, the rest is BSD @@ -49,6 +55,7 @@ BuildRequires: java-devel BuildRequires: xerces-j2 %endif +%if %{with mingw} BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-gcc BuildRequires: mingw32-zlib @@ -62,6 +69,7 @@ BuildRequires: mingw64-zlib BuildRequires: mingw64-libpng BuildRequires: mingw64-libtiff BuildRequires: mingw64-lcms2 +%endif %description @@ -226,6 +234,7 @@ OpenJPEG2 JP3D module command line tools %endif +%if %{with mingw} %package -n mingw32-%{name} Summary: MinGW Windows %{name} library BuildArch: noarch @@ -261,6 +270,7 @@ BuildArch: noarch %{?mingw_debug_package} +%endif %prep @@ -282,9 +292,11 @@ find thirdparty/ -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \; %{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data} %cmake_build +%if %{with mingw} # MinGW build %mingw_cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PKGCONFIG_FILES=ON . %mingw_make_build +%endif %install @@ -308,6 +320,7 @@ EOF chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer %endif +%if %{with mingw} # MinGW build %mingw_make_install @@ -319,6 +332,7 @@ rm -rf %{buildroot}%{mingw64_datadir}/doc %mingw_debug_install_post +%endif %check @@ -397,6 +411,7 @@ rm -rf %{buildroot}%{mingw64_datadir}/doc %{_bindir}/opj2_jp3d* %endif +%if %{with mingw} %files -n mingw32-%{name} %license LICENSE %{mingw32_bindir}/libopenjp2.dll @@ -422,9 +437,14 @@ rm -rf %{buildroot}%{mingw64_datadir}/doc %{mingw64_bindir}/opj2_compress.exe %{mingw64_bindir}/opj2_decompress.exe %{mingw64_bindir}/opj2_dump.exe +%endif %changelog +* Fri May 13 2022 Tomas Popela - 2.4.0-11 +- Introduce a switch for mingw builds and turn it off when building the flatpaks + (flatpak-common module) + * Mon Mar 28 2022 Sandro Mani - 2.4.0-10 - Backport fix for CVE-2022-1122