From: Michael Schroeder Date: Thu, 20 Mar 2025 14:37:10 +0000 (+0100) Subject: Change the package to build both static and dynamic X-Git-Tag: 0.7.32~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a91dafc160b424800f8e9f13f934e84086e0870;p=thirdparty%2Flibsolv.git Change the package to build both static and dynamic This is done for suse_version >= 1600, i.e. openSUSE and SLES16. There will be a new subpackage called libsolv-devel-static. --- diff --git a/package/libsolv.spec.in b/package/libsolv.spec.in index 2ee3f185..6cdf52bd 100644 --- a/package/libsolv.spec.in +++ b/package/libsolv.spec.in @@ -60,8 +60,15 @@ %bcond_with ruby %bcond_with perl %endif + +%if 0%{?suse_version} >= 1600 +%bcond_without static +%bcond_without shared +%else %bcond_without static %bcond_with shared +%endif + %bcond_with zypp Name: libsolv @@ -167,6 +174,15 @@ Conflicts: libsatsolver-devel Development files for libsolv, a library for solving packages and reading repositories. +%package devel-static +Summary: Development files for libsolv, a package solver +Group: Development/Libraries/C and C++ +Requires: libsolv-devel = %version + +%description devel-static +Development files for libsolv, a library for solving packages and +reading repositories. + %package tools-base Summary: Utilities used by libzypp to manage .solv files Group: System/Management @@ -267,7 +283,7 @@ cmake . $CMAKE_FLAGS \ -DENABLE_APPDATA=1 \ -DENABLE_COMPS=1 \ -DMULTI_SEMANTICS=1 \ - %{?with_static:-DENABLE_STATIC=1} \ + %{?with_static:-DENABLE_STATIC=1 -DENABLE_STATIC_TOOLS=1 -DENABLE_STATIC_BINDINGS=1} \ %{!?with_shared:-DDISABLE_SHARED=1} \ %{?with_perl:-DENABLE_PERL=1} \ %{?with_python:-DENABLE_PYTHON=1} \ @@ -344,7 +360,7 @@ make ARGS=--output-on-failure test %files devel %defattr(-,root,root) -%if %{with static} +%if %{with static} && !%{with shared} %{_libdir}/libsolv.a %{_libdir}/libsolvext.a %endif @@ -361,6 +377,13 @@ make ARGS=--output-on-failure test %{_libdir}/pkgconfig/libsolv*.pc %{_mandir}/man3/* +%if %{with static} && %{with shared} +%files devel-static +%defattr(-,root,root) +%{_libdir}/libsolv.a +%{_libdir}/libsolvext.a +%endif + %files demo %defattr(-,root,root) %{_bindir}/solv