2016-04-05 17:54:10 +00:00
|
|
|
%global libname solv
|
|
|
|
|
2020-07-03 15:18:48 +00:00
|
|
|
%bcond_without python_bindings
|
2016-04-05 17:54:10 +00:00
|
|
|
%bcond_without perl_bindings
|
|
|
|
%bcond_without ruby_bindings
|
2016-05-30 09:54:25 +00:00
|
|
|
# Creates special prefixed pseudo-packages from appdata metadata
|
2017-03-18 15:58:37 +00:00
|
|
|
%bcond_without appdata
|
2016-05-30 09:54:25 +00:00
|
|
|
# Creates special prefixed "group:", "category:" pseudo-packages
|
|
|
|
%bcond_without comps
|
2021-06-16 16:25:29 +00:00
|
|
|
%bcond_without conda
|
2016-05-30 09:54:25 +00:00
|
|
|
# For rich dependencies
|
|
|
|
%bcond_without complex_deps
|
2016-08-31 11:52:57 +00:00
|
|
|
%bcond_without helix_repo
|
|
|
|
%bcond_without suse_repo
|
2016-06-06 13:09:15 +00:00
|
|
|
%bcond_without debian_repo
|
|
|
|
%bcond_without arch_repo
|
|
|
|
# For handling deb + rpm at the same time
|
2016-10-29 09:21:47 +00:00
|
|
|
%bcond_without multi_semantics
|
2018-10-28 17:00:14 +00:00
|
|
|
%bcond_without zchunk
|
2019-02-13 08:24:36 +00:00
|
|
|
%bcond_without zstd
|
2016-04-05 17:54:10 +00:00
|
|
|
|
2020-07-03 15:18:48 +00:00
|
|
|
%define __cmake_switch(b:) %[%{expand:%%{?with_%{-b*}}} ? "ON" : "OFF"]
|
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
Name: lib%{libname}
|
2021-07-18 14:26:17 +00:00
|
|
|
Version: 0.7.19
|
|
|
|
Release: %autorelease
|
2016-04-05 17:54:10 +00:00
|
|
|
Summary: Package dependency solver
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
URL: https://github.com/openSUSE/libsolv
|
2017-03-16 14:07:16 +00:00
|
|
|
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
2019-01-12 09:18:41 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gcc-c++
|
2018-01-29 16:49:53 +00:00
|
|
|
BuildRequires: ninja-build
|
2016-04-05 17:54:10 +00:00
|
|
|
BuildRequires: pkgconfig(rpm)
|
|
|
|
BuildRequires: zlib-devel
|
2017-03-16 14:07:16 +00:00
|
|
|
# -DWITH_LIBXML2=ON
|
|
|
|
BuildRequires: libxml2-devel
|
2016-04-05 17:54:10 +00:00
|
|
|
# -DENABLE_LZMA_COMPRESSION=ON
|
|
|
|
BuildRequires: xz-devel
|
|
|
|
# -DENABLE_BZIP2_COMPRESSION=ON
|
|
|
|
BuildRequires: bzip2-devel
|
2019-02-13 08:24:36 +00:00
|
|
|
%if %{with zstd}
|
2018-08-09 18:22:10 +00:00
|
|
|
# -DENABLE_ZSTD_COMPRESSION=ON
|
|
|
|
BuildRequires: libzstd-devel
|
2019-02-13 08:24:36 +00:00
|
|
|
%endif
|
2018-10-28 17:00:14 +00:00
|
|
|
%if %{with zchunk}
|
|
|
|
# -DENABLE_ZCHUNK_COMPRESSION=ON
|
|
|
|
BuildRequires: pkgconfig(zck)
|
|
|
|
%endif
|
2016-04-05 17:54:10 +00:00
|
|
|
|
2012-02-06 19:35:49 +00:00
|
|
|
%description
|
|
|
|
A free package dependency solver using a satisfiability algorithm. The
|
|
|
|
library is based on two major, but independent, blocks:
|
|
|
|
|
|
|
|
- Using a dictionary approach to store and retrieve package
|
|
|
|
and dependency information.
|
|
|
|
|
|
|
|
- Using satisfiability, a well known and researched topic, for
|
|
|
|
resolving package dependencies.
|
|
|
|
|
|
|
|
%package devel
|
2016-04-05 17:54:10 +00:00
|
|
|
Summary: Development files for %{name}
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
Requires: rpm-devel%{?_isa}
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%description devel
|
2016-04-05 17:54:10 +00:00
|
|
|
Development files for %{name}.
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%package tools
|
2016-04-05 17:54:10 +00:00
|
|
|
Summary: Package dependency solver tools
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
2018-10-28 17:00:14 +00:00
|
|
|
# repo2solv dependencies. Used as execl()
|
2021-07-18 14:26:17 +00:00
|
|
|
Requires: /usr/bin/find
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%description tools
|
|
|
|
Package dependency solver tools.
|
|
|
|
|
|
|
|
%package demo
|
2016-04-05 17:54:10 +00:00
|
|
|
Summary: Applications demoing the %{name} library
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
# solv dependencies. Used as execlp() and system()
|
2021-07-18 14:26:17 +00:00
|
|
|
Requires: /usr/bin/curl
|
|
|
|
Requires: /usr/bin/gpg2
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%description demo
|
2016-04-05 17:54:10 +00:00
|
|
|
Applications demoing the %{name} library.
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%if %{with perl_bindings}
|
|
|
|
%package -n perl-%{libname}
|
|
|
|
Summary: Perl bindings for the %{name} library
|
|
|
|
BuildRequires: swig
|
|
|
|
BuildRequires: perl-devel
|
2016-06-24 08:28:39 +00:00
|
|
|
BuildRequires: perl-generators
|
2016-04-05 17:54:10 +00:00
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%description -n perl-%{libname}
|
|
|
|
Perl bindings for the %{name} library.
|
2015-08-05 20:40:21 +00:00
|
|
|
%endif
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%if %{with ruby_bindings}
|
|
|
|
%package -n ruby-%{libname}
|
|
|
|
Summary: Ruby bindings for the %{name} library
|
|
|
|
BuildRequires: swig
|
|
|
|
BuildRequires: ruby-devel
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%description -n ruby-%{libname}
|
|
|
|
Ruby bindings for the %{name} library.
|
2015-08-05 20:40:21 +00:00
|
|
|
%endif
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2020-07-03 15:18:48 +00:00
|
|
|
%if %{with python_bindings}
|
2016-04-05 17:54:10 +00:00
|
|
|
%package -n python3-%{libname}
|
|
|
|
Summary: Python bindings for the %{name} library
|
2017-02-07 12:44:00 +00:00
|
|
|
%{?python_provide:%python_provide python3-%{libname}}
|
2016-04-05 17:54:10 +00:00
|
|
|
BuildRequires: swig
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n python3-%{libname}
|
|
|
|
Python bindings for the %{name} library.
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
Python 3 version.
|
|
|
|
%endif
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%prep
|
2018-11-28 12:09:06 +00:00
|
|
|
%autosetup -p1
|
2013-05-16 07:48:06 +00:00
|
|
|
|
2012-02-06 19:35:49 +00:00
|
|
|
%build
|
2020-07-03 15:18:48 +00:00
|
|
|
%cmake -GNinja \
|
|
|
|
-DFEDORA=1 \
|
|
|
|
-DENABLE_RPMDB=ON \
|
|
|
|
-DENABLE_RPMDB_BYRPMHEADER=ON \
|
|
|
|
-DENABLE_RPMDB_LIBRPM=ON \
|
|
|
|
-DENABLE_RPMPKG_LIBRPM=ON \
|
|
|
|
-DENABLE_RPMMD=ON \
|
|
|
|
-DENABLE_COMPS=%{__cmake_switch -b comps} \
|
|
|
|
-DENABLE_APPDATA=%{__cmake_switch -b appdata} \
|
|
|
|
-DUSE_VENDORDIRS=ON \
|
|
|
|
-DWITH_LIBXML2=ON \
|
|
|
|
-DENABLE_LZMA_COMPRESSION=ON \
|
|
|
|
-DENABLE_BZIP2_COMPRESSION=ON \
|
|
|
|
-DENABLE_ZSTD_COMPRESSION=%{__cmake_switch -b zstd} \
|
|
|
|
-DENABLE_ZCHUNK_COMPRESSION=%{__cmake_switch -b zchunk} \
|
2018-10-28 17:00:14 +00:00
|
|
|
%if %{with zchunk}
|
2020-07-03 15:18:48 +00:00
|
|
|
-DWITH_SYSTEM_ZCHUNK=ON \
|
2018-10-01 10:42:41 +00:00
|
|
|
%endif
|
2020-07-03 15:18:48 +00:00
|
|
|
-DENABLE_HELIXREPO=%{__cmake_switch -b helix_repo} \
|
|
|
|
-DENABLE_SUSEREPO=%{__cmake_switch -b suse_repo} \
|
|
|
|
-DENABLE_DEBIAN=%{__cmake_switch -b debian_repo} \
|
|
|
|
-DENABLE_ARCHREPO=%{__cmake_switch -b arch_repo} \
|
|
|
|
-DMULTI_SEMANTICS=%{__cmake_switch -b multi_semantics} \
|
|
|
|
-DENABLE_COMPLEX_DEPS=%{__cmake_switch -b complex_deps} \
|
2021-06-16 16:25:29 +00:00
|
|
|
-DENABLE_CONDA=%{__cmake_switch -b conda} \
|
2020-07-03 15:18:48 +00:00
|
|
|
-DENABLE_PERL=%{__cmake_switch -b perl_bindings} \
|
|
|
|
-DENABLE_RUBY=%{__cmake_switch -b ruby_bindings} \
|
|
|
|
-DENABLE_PYTHON=%{__cmake_switch -b python_bindings} \
|
|
|
|
%if %{with python_bindings}
|
|
|
|
-DPYTHON_EXECUTABLE=%{python3} \
|
2018-10-01 10:42:41 +00:00
|
|
|
%endif
|
2018-01-29 16:43:57 +00:00
|
|
|
%{nil}
|
2020-07-03 15:18:48 +00:00
|
|
|
%cmake_build
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%install
|
2020-07-03 15:18:48 +00:00
|
|
|
%cmake_install
|
2016-04-05 17:54:10 +00:00
|
|
|
|
2015-08-04 09:36:06 +00:00
|
|
|
%check
|
2020-07-03 15:18:48 +00:00
|
|
|
%ctest
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2020-11-16 13:39:56 +00:00
|
|
|
# Python smoke test (not tested in %%ctest):
|
|
|
|
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
|
|
|
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
|
2021-07-18 14:26:17 +00:00
|
|
|
%python3 -c 'import solv'
|
2020-11-16 13:39:56 +00:00
|
|
|
|
2012-02-06 19:35:49 +00:00
|
|
|
%files
|
2016-04-05 17:54:10 +00:00
|
|
|
%license LICENSE*
|
|
|
|
%doc README
|
|
|
|
%{_libdir}/%{name}.so.*
|
|
|
|
%{_libdir}/%{name}ext.so.*
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%files devel
|
2016-04-05 17:54:10 +00:00
|
|
|
%{_libdir}/%{name}.so
|
|
|
|
%{_libdir}/%{name}ext.so
|
|
|
|
%{_includedir}/%{libname}/
|
2015-09-10 16:52:37 +00:00
|
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
2017-02-15 11:05:45 +00:00
|
|
|
%{_libdir}/pkgconfig/%{name}ext.pc
|
2016-04-05 17:54:10 +00:00
|
|
|
# Own directory because we don't want to depend on cmake
|
|
|
|
%dir %{_datadir}/cmake/Modules/
|
|
|
|
%{_datadir}/cmake/Modules/FindLibSolv.cmake
|
|
|
|
%{_mandir}/man3/%{name}*.3*
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
# Some small macro to list tools with mans
|
|
|
|
%global solv_tool() \
|
|
|
|
%{_bindir}/%{1}\
|
|
|
|
%{_mandir}/man1/%{1}.1*
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%files tools
|
|
|
|
%solv_tool deltainfoxml2solv
|
|
|
|
%solv_tool dumpsolv
|
|
|
|
%solv_tool installcheck
|
|
|
|
%solv_tool mergesolv
|
|
|
|
%solv_tool repomdxml2solv
|
|
|
|
%solv_tool rpmdb2solv
|
|
|
|
%solv_tool rpmmd2solv
|
|
|
|
%solv_tool rpms2solv
|
|
|
|
%solv_tool testsolv
|
|
|
|
%solv_tool updateinfoxml2solv
|
2018-08-09 18:22:10 +00:00
|
|
|
%solv_tool repo2solv
|
2016-04-05 17:54:10 +00:00
|
|
|
%if %{with comps}
|
|
|
|
%solv_tool comps2solv
|
|
|
|
%endif
|
|
|
|
%if %{with appdata}
|
|
|
|
%solv_tool appdata2solv
|
|
|
|
%endif
|
|
|
|
%if %{with debian_repo}
|
|
|
|
%solv_tool deb2solv
|
|
|
|
%endif
|
|
|
|
%if %{with arch_repo}
|
|
|
|
%solv_tool archpkgs2solv
|
|
|
|
%solv_tool archrepo2solv
|
|
|
|
%endif
|
|
|
|
%if %{with helix_repo}
|
|
|
|
%solv_tool helix2solv
|
|
|
|
%endif
|
2016-08-31 11:52:57 +00:00
|
|
|
%if %{with suse_repo}
|
|
|
|
%solv_tool susetags2solv
|
|
|
|
%endif
|
2021-06-16 16:25:29 +00:00
|
|
|
%if %{with conda}
|
|
|
|
%{_bindir}/conda2solv
|
|
|
|
%endif
|
2016-08-31 11:52:57 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%files demo
|
2018-08-09 18:22:10 +00:00
|
|
|
%solv_tool solv
|
2012-02-06 19:35:49 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%if %{with perl_bindings}
|
|
|
|
%files -n perl-%{libname}
|
|
|
|
%{perl_vendorarch}/%{libname}.pm
|
|
|
|
%{perl_vendorarch}/%{libname}.so
|
2015-08-05 20:40:21 +00:00
|
|
|
%endif
|
2015-08-04 09:36:06 +00:00
|
|
|
|
2016-04-05 17:54:10 +00:00
|
|
|
%if %{with ruby_bindings}
|
|
|
|
%files -n ruby-%{libname}
|
|
|
|
%{ruby_vendorarchdir}/%{libname}.so
|
|
|
|
%endif
|
|
|
|
|
2020-07-03 15:18:48 +00:00
|
|
|
%if %{with python_bindings}
|
2016-04-05 17:54:10 +00:00
|
|
|
%files -n python3-%{libname}
|
|
|
|
%{python3_sitearch}/_%{libname}.so
|
|
|
|
%{python3_sitearch}/%{libname}.py
|
|
|
|
%{python3_sitearch}/__pycache__/%{libname}.*
|
|
|
|
%endif
|
2012-02-06 19:35:49 +00:00
|
|
|
|
|
|
|
%changelog
|
2021-07-18 14:26:17 +00:00
|
|
|
%autochangelog
|