Conditional support for mingw in EPEL9

epel9
Orion Poplawski 3 years ago
parent 6e7a5f5198
commit d1154e133f

@ -1,7 +1,17 @@
#EL9.0 compat, should be fixed in 9.1
%if 0%{?el9}
# EL9.0 compat, should be fixed in 9.1
# https://bugzilla.redhat.com/show_bug.cgi?id=2080168
%global mingw32_pkg_name %(echo %{name} | sed -E 's/^(mingw-|)/mingw32-/')
%global mingw64_pkg_name %(echo %{name} | sed -E 's/^(mingw-|)/mingw64-/')
# EL9.0 only has mingw for x86_64
# https://bugzilla.redhat.com/show_bug.cgi?id=2096010
%ifarch x86_64
%bcond_without mingw
%else
%bcond_with mingw
%endif
%else
%bcond_withtout mingw
%endif
Name: uriparser
@ -22,11 +32,13 @@ BuildRequires: graphviz
BuildRequires: gtest-devel
BuildRequires: make
%if %{with mingw}
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc-c++
%endif
%description
@ -52,6 +64,7 @@ BuildArch: noarch
The %{name}-doc package contains HTML documentation files for %{name}.
%if %{with mingw}
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
BuildArch: noarch
@ -69,6 +82,7 @@ MinGW Windows %{name} library.
%{?mingw_debug_package}
%endif
@ -84,17 +98,20 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%cmake
%cmake_build
%if %{with mingw}
# MinGW build
%mingw_cmake -DURIPARSER_BUILD_TESTS=OFF -DURIPARSER_BUILD_DOCS=OFF
%mingw_make_build
%endif
%install
%cmake_install
%mingw_make_install
%if %{with mingw}
%mingw_make_install
%mingw_debug_install_post
%endif
%check
@ -117,6 +134,7 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%license COPYING
%doc %{_docdir}/%{name}/html
%if %{with mingw}
%files -n mingw32-%{name}
%license COPYING
%{mingw32_bindir}/uriparse.exe
@ -134,6 +152,7 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%{mingw64_libdir}/lib%{name}.dll.a
%{mingw64_libdir}/pkgconfig/lib%{name}.pc
%{mingw64_libdir}/cmake/%{name}-%{version}/
%endif
%changelog

Loading…
Cancel
Save