2 # spec file for package libsolv
4 # Copyright (c) 2021 SUSE LLC
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via https://bugs.opensuse.org/
19 %define libname libsolv@LIBSOLV_SOVERSION@
21 %if 0%{?sle_version} >= 120300 || 0%{?suse_version} >= 1330 || !0%{?suse_version}
28 %if 0%{?sle_version} >= 150000 || 0%{?suse_version} >= 1500
33 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?mageia} >= 6 || 0%{?suse_version} >= 1330
34 %bcond_without richdeps
38 # we need at least swig 1.3.40 for the bindings ($typemap support)
39 %if 0%{?suse_version} != 1110
40 %bcond_without python3
41 %if 0%{?suse_version} < 1550
61 Summary: Package dependency solver using a satisfiability algorithm
63 Group: Development/Libraries/C and C++
64 URL: https://github.com/openSUSE/libsolv
65 Source: libsolv-%{version}.tar.bz2
67 BuildRequires: gcc-c++
68 BuildRequires: libxml2-devel
69 BuildRequires: rpm-devel
70 BuildRequires: zlib-devel
71 BuildRoot: %{_tmppath}/%{name}-%{version}-build
73 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
74 BuildRequires: db-devel
79 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
80 BuildRequires: perl-devel
86 %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")
88 BuildRequires: ruby-devel
93 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
94 BuildRequires: python-devel
99 %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
100 BuildRequires: python3-devel
105 %if 0%{?suse_version}
106 BuildRequires: libbz2-devel
108 BuildRequires: bzip2-devel
113 BuildRequires: xz-devel
117 BuildRequires: libzstd-devel
121 libsolv is a library for solving packages and reading repositories.
122 The solver uses a satisfiability algorithm.
125 %package -n %{libname}
126 Summary: Package dependency solver using a satisfiability algorithm
127 Group: System/Libraries
129 %description -n %{libname}
130 libsolv is a library for solving packages and reading repositories.
131 It consists of two central blocks: Using a dictionary approach to
132 store and retrieve package and dependency information, and, using a
133 so-called satisfiability algorithm for resolving package
138 Summary: Development files for libsolv, a package solver
139 Group: Development/Libraries/C and C++
141 Requires: %{libname} = %version
144 Conflicts: libsatsolver-devel
147 Development files for libsolv, a library for solving packages and
148 reading repositories.
151 Summary: Utilities to work with .solv files
152 Group: System/Management
153 Conflicts: satsolver-tools-obsolete
154 Obsoletes: satsolver-tools < 0.18
155 Provides: satsolver-tools = 0.18
158 libsolv is a library for solving packages and reading repositories.
160 This subpackage contains utilities to create and work with the .solv
161 files used by libsolv.
164 Summary: Applications demoing the libsolv library
165 Group: System/Management
167 Conflicts: libsatsolver-demo
168 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
171 %if 0%{?suse_version}
176 Applications demoing the libsolv library.
178 %package -n ruby-solv
179 Summary: Ruby bindings for the libsolv library
180 Group: Development/Languages/Ruby
182 %description -n ruby-solv
183 Ruby bindings for libsolv.
185 %package -n python-solv
186 %if 0%{?py_requires:1} && %{with python}
189 Summary: Python bindings for the libsolv library
190 Group: Development/Languages/Python
192 %description -n python-solv
193 Python bindings for libsolv.
195 %package -n python3-solv
196 Summary: Python3 bindings for the libsolv library
197 Group: Development/Languages/Python
199 %description -n python3-solv
200 Python3 bindings for libsolv.
202 %package -n perl-solv
203 Summary: Perl bindings for the libsolv library
204 Group: Development/Languages/Perl
205 Requires: perl = %{perl_version}
207 %description -n perl-solv
208 Perl bindings for libsolv.
214 %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
215 export CFLAGS="%{optflags}"
216 export CXXFLAGS="$CFLAGS"
219 %if 0%{?fedora} || 0%{?rhel} >= 6
220 CMAKE_FLAGS="-DFEDORA=1"
223 CMAKE_FLAGS="-DMAGEIA=1"
225 %if 0%{?suse_version}
226 CMAKE_FLAGS="-DSUSE=1"
229 cmake . $CMAKE_FLAGS \
230 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
232 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
233 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
237 %{?with_static:-DENABLE_STATIC=1} \
238 %{!?with_shared:-DDISABLE_SHARED=1} \
239 %{?with_perl:-DENABLE_PERL=1} \
240 %{?with_python:-DENABLE_PYTHON=1} \
241 %{?with_python3:-DENABLE_PYTHON3=1} \
242 %{?with_ruby:-DENABLE_RUBY=1} \
243 %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \
244 %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \
245 %{?with_zstd:-DENABLE_ZSTD_COMPRESSION=1} \
246 %{?with_zstd:-DENABLE_ZCHUNK_COMPRESSION=1} \
247 %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \
248 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
254 make DESTDIR=%{buildroot} install
255 ln -s repo2solv %{buildroot}/%{_bindir}/repo2solv.sh
257 %if 0%{?suse_version}
259 %py_compile -O %{buildroot}/%{python_sitearch}
262 %py3_compile %{buildroot}/%{python3_sitearch}
267 make ARGS=--output-on-failure test
270 %post -n %{libname} -p /sbin/ldconfig
272 %postun -n %{libname} -p /sbin/ldconfig
275 %defattr(-,root,root)
277 %{_libdir}/libsolv.so.*
278 %{_libdir}/libsolvext.so.*
282 %defattr(-,root,root)
283 %if 0%{?suse_version}
284 %exclude %{_bindir}/helix2solv
285 %exclude %{_mandir}/man1/helix2solv*
287 %exclude %{_mandir}/man1/solv.1*
288 %exclude %{_bindir}/solv
293 %defattr(-,root,root)
296 %{_libdir}/libsolvext.a
299 %{_libdir}/libsolv.so
300 %{_libdir}/libsolvext.so
303 %if 0%{?suse_version}
304 %{_bindir}/helix2solv
305 %{_mandir}/man1/helix2solv*
307 %{_datadir}/cmake/Modules/*
308 %{_libdir}/pkgconfig/libsolv*.pc
312 %defattr(-,root,root)
314 %{_mandir}/man1/solv.1*
318 %defattr(-,root,root)
324 %defattr(-,root,root)
329 %files -n python-solv
330 %defattr(-,root,root)
335 %files -n python3-solv
336 %defattr(-,root,root)
337 %{python3_sitearch}/*solv*
338 %if 0%{?suse_version}
339 %{python3_sitearch}/*/*solv*