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 sysconfig import get_path; print(get_path('platlib'))")
94 BuildRequires: python-devel
99 %global python3_sitearch %(python3 -c "from sysconfig import get_path; print(get_path('platlib'))")
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
159 libsolv is a library for solving packages and reading repositories.
161 This subpackage contains utilities to create and work with the .solv
162 files used by libsolv.
165 Summary: Applications demoing the libsolv library
166 Group: System/Management
168 Conflicts: libsatsolver-demo
169 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
172 %if 0%{?suse_version}
177 Applications demoing the libsolv library.
179 %package -n ruby-solv
180 Summary: Ruby bindings for the libsolv library
181 Group: Development/Languages/Ruby
183 %description -n ruby-solv
184 Ruby bindings for libsolv.
186 %package -n python-solv
187 %if 0%{?py_requires:1} && %{with python}
190 Summary: Python bindings for the libsolv library
191 Group: Development/Languages/Python
193 %description -n python-solv
194 Python bindings for libsolv.
196 %package -n python3-solv
197 Summary: Python3 bindings for the libsolv library
198 Group: Development/Languages/Python
200 %description -n python3-solv
201 Python3 bindings for libsolv.
203 %package -n perl-solv
204 Summary: Perl bindings for the libsolv library
205 Group: Development/Languages/Perl
206 Requires: perl = %{perl_version}
208 %description -n perl-solv
209 Perl bindings for libsolv.
215 %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
216 export CFLAGS="%{optflags}"
217 export CXXFLAGS="$CFLAGS"
220 %if 0%{?fedora} || 0%{?rhel} >= 6
221 CMAKE_FLAGS="-DFEDORA=1"
224 CMAKE_FLAGS="-DMAGEIA=1"
226 %if 0%{?suse_version}
227 CMAKE_FLAGS="-DSUSE=1"
230 cmake . $CMAKE_FLAGS \
231 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
233 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
234 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
238 %{?with_static:-DENABLE_STATIC=1} \
239 %{!?with_shared:-DDISABLE_SHARED=1} \
240 %{?with_perl:-DENABLE_PERL=1} \
241 %{?with_python:-DENABLE_PYTHON=1} \
242 %{?with_python3:-DENABLE_PYTHON3=1} \
243 %{?with_ruby:-DENABLE_RUBY=1} \
244 %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \
245 %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \
246 %{?with_zstd:-DENABLE_ZSTD_COMPRESSION=1} \
247 %{?with_zstd:-DENABLE_ZCHUNK_COMPRESSION=1} \
248 %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \
249 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
255 make DESTDIR=%{buildroot} install
256 ln -s repo2solv %{buildroot}/%{_bindir}/repo2solv.sh
258 %if 0%{?suse_version}
260 %py_compile -O %{buildroot}/%{python_sitearch}
263 %py3_compile %{buildroot}/%{python3_sitearch}
268 make ARGS=--output-on-failure test
271 %post -n %{libname} -p /sbin/ldconfig
273 %postun -n %{libname} -p /sbin/ldconfig
276 %defattr(-,root,root)
278 %{_libdir}/libsolv.so.*
279 %{_libdir}/libsolvext.so.*
283 %defattr(-,root,root)
284 %if 0%{?suse_version}
285 %exclude %{_bindir}/helix2solv
286 %exclude %{_mandir}/man1/helix2solv*
288 %exclude %{_mandir}/man1/solv.1*
289 %exclude %{_bindir}/solv
294 %defattr(-,root,root)
297 %{_libdir}/libsolvext.a
300 %{_libdir}/libsolv.so
301 %{_libdir}/libsolvext.so
304 %if 0%{?suse_version}
305 %{_bindir}/helix2solv
306 %{_mandir}/man1/helix2solv*
308 %{_datadir}/cmake/Modules/*
309 %{_libdir}/pkgconfig/libsolv*.pc
313 %defattr(-,root,root)
315 %{_mandir}/man1/solv.1*
319 %defattr(-,root,root)
325 %defattr(-,root,root)
330 %files -n python-solv
331 %defattr(-,root,root)
336 %files -n python3-solv
337 %defattr(-,root,root)
338 %{python3_sitearch}/*solv*
339 %if 0%{?suse_version}
340 %{python3_sitearch}/*/*solv*