Skip to content

Commit 0a91daf

Browse files
committed
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.
1 parent 4f34f88 commit 0a91daf

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

package/libsolv.spec.in

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,15 @@
6060
%bcond_with ruby
6161
%bcond_with perl
6262
%endif
63+
64+
%if 0%{?suse_version} >= 1600
65+
%bcond_without static
66+
%bcond_without shared
67+
%else
6368
%bcond_without static
6469
%bcond_with shared
70+
%endif
71+
6572
%bcond_with zypp
6673

6774
Name: libsolv
@@ -167,6 +174,15 @@ Conflicts: libsatsolver-devel
167174
Development files for libsolv, a library for solving packages and
168175
reading repositories.
169176

177+
%package devel-static
178+
Summary: Development files for libsolv, a package solver
179+
Group: Development/Libraries/C and C++
180+
Requires: libsolv-devel = %version
181+
182+
%description devel-static
183+
Development files for libsolv, a library for solving packages and
184+
reading repositories.
185+
170186
%package tools-base
171187
Summary: Utilities used by libzypp to manage .solv files
172188
Group: System/Management
@@ -267,7 +283,7 @@ cmake . $CMAKE_FLAGS \
267283
-DENABLE_APPDATA=1 \
268284
-DENABLE_COMPS=1 \
269285
-DMULTI_SEMANTICS=1 \
270-
%{?with_static:-DENABLE_STATIC=1} \
286+
%{?with_static:-DENABLE_STATIC=1 -DENABLE_STATIC_TOOLS=1 -DENABLE_STATIC_BINDINGS=1} \
271287
%{!?with_shared:-DDISABLE_SHARED=1} \
272288
%{?with_perl:-DENABLE_PERL=1} \
273289
%{?with_python:-DENABLE_PYTHON=1} \
@@ -344,7 +360,7 @@ make ARGS=--output-on-failure test
344360

345361
%files devel
346362
%defattr(-,root,root)
347-
%if %{with static}
363+
%if %{with static} && !%{with shared}
348364
%{_libdir}/libsolv.a
349365
%{_libdir}/libsolvext.a
350366
%endif
@@ -361,6 +377,13 @@ make ARGS=--output-on-failure test
361377
%{_libdir}/pkgconfig/libsolv*.pc
362378
%{_mandir}/man3/*
363379

380+
%if %{with static} && %{with shared}
381+
%files devel-static
382+
%defattr(-,root,root)
383+
%{_libdir}/libsolv.a
384+
%{_libdir}/libsolvext.a
385+
%endif
386+
364387
%files demo
365388
%defattr(-,root,root)
366389
%{_bindir}/solv

0 commit comments

Comments
 (0)