]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Change the package to build both static and dynamic
authorMichael Schroeder <mls@suse.de>
Thu, 20 Mar 2025 14:37:10 +0000 (15:37 +0100)
committerMichael Schroeder <mls@suse.de>
Thu, 20 Mar 2025 14:37:10 +0000 (15:37 +0100)
This is done for suse_version >= 1600, i.e. openSUSE and SLES16.
There will be a new subpackage called libsolv-devel-static.

package/libsolv.spec.in

index 2ee3f185033b64324aa040c0b97295960473c370..6cdf52bd7895f6541fbb58d6ba3aef2651d68855 100644 (file)
 %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