Make mingw build conditional, disable for EL9

This commit is contained in:
Orion Poplawski 2022-06-10 21:44:31 -06:00
parent 6578759b03
commit 546b9cf4f7
1 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,12 @@
%if 0%{?rhel} >= 9
%bcond_with mingw
%else
%bcond_without mingw
%endif
Name: libgeotiff
Version: 1.7.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: GeoTIFF format library
License: MIT
@ -20,6 +26,7 @@ BuildRequires: libjpeg-devel
BuildRequires: proj-devel
BuildRequires: zlib-devel
%if %{with mingw}
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-libtiff
@ -33,6 +40,7 @@ BuildRequires: mingw64-libtiff
BuildRequires: mingw64-libjpeg
BuildRequires: mingw64-proj
BuildRequires: mingw64-zlib
%endif
%description
@ -50,6 +58,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
The GeoTIFF library provides support for development of geotiff image format.
%if %{with mingw}
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
Obsoletes: mingw32-%{name}-static
@ -87,6 +96,7 @@ BuildArch: noarch
%{?mingw_debug_package}
%endif
%prep
@ -98,14 +108,18 @@ BuildArch: noarch
%cmake -DGEOTIFF_BIN_SUBDIR=bin -DGEOTIFF_INCLUDE_SUBDIR=include/%{name} -DGEOTIFF_LIB_SUBDIR=%{_lib}
%cmake_build
%if %{with mingw}
# MinGW build
%mingw_cmake -DGEOTIFF_BIN_SUBDIR=bin -DGEOTIFF_INCLUDE_SUBDIR=include/%{name}
%mingw_make_build
%endif
%install
%cmake_install
%if %{with mingw}
%mingw_make_install
%endif
# install pkgconfig file
@ -123,6 +137,7 @@ Libs: -L\${libdir} -lgeotiff
Cflags: -I\${includedir}
EOF
%if %{with mingw}
mkdir -p %{buildroot}%{mingw32_libdir}/pkgconfig/
cat > %{buildroot}%{mingw32_libdir}/pkgconfig/%{name}.pc <<EOF
prefix=%{mingw32_prefix}
@ -153,6 +168,7 @@ EOF
%mingw_debug_install_post
%endif
%check
@ -175,6 +191,7 @@ EOF
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/cmake/GeoTIFF/
%if %{with mingw}
%files -n mingw32-%{name}
%doc ChangeLog README
%license COPYING
@ -200,9 +217,13 @@ EOF
%files -n mingw64-%{name}-tools
%{mingw64_bindir}/*.exe
%endif
%changelog
* Fri Jun 10 2022 Orion Poplawski <orion@nwra.com> - 1.7.1-3
- Make mingw build conditional, disable for EL9
* Fri Mar 25 2022 Sandro Mani <manisandro@gmail.com> - 1.7.1-2
- Rebuild with mingw-gcc-12