Make mingw build conditional

epel9^2
Sandro Mani 2 years ago
parent 0a4bc85c6c
commit e80e2a021c

@ -1,3 +1,9 @@
%if 0%{?fedora}
%bcond_without mingw
%else
%bcond_with mingw
%endif
Name: uriparser Name: uriparser
Version: 0.9.7 Version: 0.9.7
Release: 1%{?dist} Release: 1%{?dist}
@ -14,11 +20,13 @@ BuildRequires: graphviz
BuildRequires: gtest-devel BuildRequires: gtest-devel
BuildRequires: make BuildRequires: make
%if %{with mingw}
BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc-c++ BuildRequires: mingw32-gcc-c++
BuildRequires: mingw64-filesystem >= 95 BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc-c++ BuildRequires: mingw64-gcc-c++
%endif
%description %description
@ -44,6 +52,7 @@ BuildArch: noarch
The %{name}-doc package contains HTML documentation files for %{name}. The %{name}-doc package contains HTML documentation files for %{name}.
%if %{with mingw}
%package -n mingw32-%{name} %package -n mingw32-%{name}
Summary: MinGW Windows %{name} library Summary: MinGW Windows %{name} library
BuildArch: noarch BuildArch: noarch
@ -61,7 +70,7 @@ MinGW Windows %{name} library.
%{?mingw_debug_package} %{?mingw_debug_package}
%endif
%prep %prep
@ -76,17 +85,19 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%cmake %cmake
%cmake_build %cmake_build
%if %{with mingw}
# MinGW build # MinGW build
%mingw_cmake -DURIPARSER_BUILD_TESTS=OFF -DURIPARSER_BUILD_DOCS=OFF %mingw_cmake -DURIPARSER_BUILD_TESTS=OFF -DURIPARSER_BUILD_DOCS=OFF
%mingw_make_build %mingw_make_build
%endif
%install %install
%cmake_install %cmake_install
%if %{with mingw}
%mingw_make_install %mingw_make_install
%mingw_debug_install_post %mingw_debug_install_post
%endif
%check %check
@ -109,6 +120,7 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%license COPYING %license COPYING
%doc %{_docdir}/%{name}/html %doc %{_docdir}/%{name}/html
%if %{with mingw}
%files -n mingw32-%{name} %files -n mingw32-%{name}
%license COPYING %license COPYING
%{mingw32_bindir}/uriparse.exe %{mingw32_bindir}/uriparse.exe
@ -126,6 +138,7 @@ sed -i 's/GENERATE_QHP\ =\ yes/GENERATE_QHP\ =\ no/g' doc/Doxyfile.in
%{mingw64_libdir}/lib%{name}.dll.a %{mingw64_libdir}/lib%{name}.dll.a
%{mingw64_libdir}/pkgconfig/lib%{name}.pc %{mingw64_libdir}/pkgconfig/lib%{name}.pc
%{mingw64_libdir}/cmake/%{name}-%{version}/ %{mingw64_libdir}/cmake/%{name}-%{version}/
%endif
%changelog %changelog

Loading…
Cancel
Save