2 # spec file for package libsolv
4 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
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 http://bugs.opensuse.org/
18 %define libname libsolv@LIBSOLV_SOVERSION@
20 %if 0%{?sle_version} >= 120300 || 0%{?suse_version} >= 1330 || !0%{?suse_version}
27 %if 0%{?sle_version} >= 150000 || 0%{?suse_version} >= 1500
32 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?mageia} >= 6 || 0%{?suse_version} >= 1330
33 %bcond_without richdeps
37 # we need at least swig 1.3.40 for the bindings ($typemap support)
38 %if 0%{?suse_version} != 1110
39 %bcond_without python3
56 Summary: Package dependency solver using a satisfiability algorithm
58 Group: Development/Libraries/C and C++
59 Url: https://github.com/openSUSE/libsolv
60 Source: libsolv-%{version}.tar.bz2
62 BuildRequires: gcc-c++
63 BuildRequires: libxml2-devel
64 BuildRequires: rpm-devel
65 BuildRequires: zlib-devel
66 BuildRoot: %{_tmppath}/%{name}-%{version}-build
68 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
69 BuildRequires: db-devel
74 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
75 BuildRequires: perl-devel
81 %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")
83 BuildRequires: ruby-devel
88 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
89 BuildRequires: python-devel
94 %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
95 BuildRequires: python3-devel
100 %if 0%{?suse_version}
101 BuildRequires: libbz2-devel
103 BuildRequires: bzip2-devel
108 BuildRequires: xz-devel
112 BuildRequires: libzstd-devel
117 libsolv is a library for solving packages and reading repositories.
118 The solver uses a satisfiability algorithm.
121 %package -n %{libname}
122 Summary: Package dependency solver using a satisfiability algorithm
123 Group: System/Libraries
125 %description -n %{libname}
126 libsolv is a library for solving packages and reading repositories.
127 It consists of two central blocks: Using a dictionary approach to
128 store and retrieve package and dependency information, and, using a
129 so-called satisfiability algorithm for resolving package
134 Summary: Development files for libsolv, a package solver
135 Group: Development/Libraries/C and C++
137 Requires: %{libname} = %version
140 Conflicts: libsatsolver-devel
143 Development files for libsolv, a library for solving packages and
144 reading repositories.
147 Summary: Utilities to work with .solv files
148 Group: System/Management
149 Conflicts: satsolver-tools-obsolete
150 Obsoletes: satsolver-tools < 0.18
151 Provides: satsolver-tools = 0.18
154 libsolv is a library for solving packages and reading repositories.
156 This subpackage contains utilities to create and work with the .solv
157 files used by libsolv.
160 Summary: Applications demoing the libsolv library
161 Group: System/Management
163 Conflicts: libsatsolver-demo
164 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
167 %if 0%{?suse_version}
172 Applications demoing the libsolv library.
174 %package -n ruby-solv
175 Summary: Ruby bindings for the libsolv library
176 Group: Development/Languages/Ruby
178 %description -n ruby-solv
179 Ruby bindings for libsolv.
181 %package -n python-solv
182 %if 0%{?py_requires:1} && %{with python}
185 Summary: Python bindings for the libsolv library
186 Group: Development/Languages/Python
188 %description -n python-solv
189 Python bindings for libsolv.
191 %package -n python3-solv
192 Summary: Python3 bindings for the libsolv library
193 Group: Development/Languages/Python
195 %description -n python3-solv
196 Python3 bindings for libsolv.
198 %package -n perl-solv
199 Summary: Perl bindings for the libsolv library
200 Group: Development/Languages/Perl
201 Requires: perl = %{perl_version}
203 %description -n perl-solv
204 Perl bindings for libsolv.
210 export CFLAGS="%{optflags}"
211 export CXXFLAGS="$CFLAGS"
214 %if 0%{?fedora} || 0%{?rhel} >= 6
215 CMAKE_FLAGS="-DFEDORA=1"
218 CMAKE_FLAGS="-DMAGEIA=1"
220 %if 0%{?suse_version}
221 CMAKE_FLAGS="-DSUSE=1"
225 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
227 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
228 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
232 %{?with_static:-DENABLE_STATIC=1} \
233 %{!?with_shared:-DDISABLE_SHARED=1} \
234 %{?with_perl:-DENABLE_PERL=1} \
235 %{?with_python:-DENABLE_PYTHON=1} \
236 %{?with_python3:-DENABLE_PYTHON3=1} \
237 %{?with_ruby:-DENABLE_RUBY=1} \
238 %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \
239 %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \
240 %{?with_zstd:-DENABLE_ZSTD_COMPRESSION=1} \
241 %{?with_zstd:-DENABLE_ZCHUNK_COMPRESSION=1} \
242 %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \
243 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
249 make DESTDIR=%{buildroot} install
250 ln -s repo2solv %{buildroot}/%{_bindir}/repo2solv.sh
252 %if 0%{?suse_version}
254 %py_compile -O %{buildroot}/%{python_sitearch}
257 %py3_compile %{buildroot}/%{python3_sitearch}
261 # we want to leave the .a file untouched
262 export NO_BRP_STRIP_DEBUG=true
266 make ARGS=--output-on-failure test
269 %post -n %{libname} -p /sbin/ldconfig
271 %postun -n %{libname} -p /sbin/ldconfig
274 %defattr(-,root,root)
276 %{_libdir}/libsolv.so.*
277 %{_libdir}/libsolvext.so.*
281 %defattr(-,root,root)
282 %if 0%{?suse_version}
283 %exclude %{_bindir}/helix2solv
284 %exclude %{_mandir}/man1/helix2solv*
286 %exclude %{_mandir}/man1/solv.1*
287 %exclude %{_bindir}/solv
292 %defattr(-,root,root)
295 %{_libdir}/libsolvext.a
298 %{_libdir}/libsolv.so
299 %{_libdir}/libsolvext.so
302 %if 0%{?suse_version}
303 %{_bindir}/helix2solv
304 %{_mandir}/man1/helix2solv*
306 %{_datadir}/cmake/Modules/*
307 %{_libdir}/pkgconfig/libsolv*.pc
311 %defattr(-,root,root)
313 %{_mandir}/man1/solv.1*
317 %defattr(-,root,root)
323 %defattr(-,root,root)
328 %files -n python-solv
329 %defattr(-,root,root)
334 %files -n python3-solv
335 %defattr(-,root,root)
336 %{python3_sitearch}/*solv*
337 %if 0%{?suse_version}
338 %{python3_sitearch}/*/*solv*