X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=package%2Flibsolv.spec.in;h=6bcb4485591a3c4e25f9bc6a30841c98f8f30637;hb=refs%2Ftags%2Fupstream%2F0.7.27;hp=8d73267790f8fc096bd633f9edf1f5044073fee1;hpb=31516374d1d851d6eb366aa9f10f11b0395fa3ef;p=platform%2Fupstream%2Flibsolv.git diff --git a/package/libsolv.spec.in b/package/libsolv.spec.in index 8d73267..6bcb448 100644 --- a/package/libsolv.spec.in +++ b/package/libsolv.spec.in @@ -1,132 +1,172 @@ +# +# spec file for package libsolv +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define libname libsolv@LIBSOLV_SOVERSION@ + +%if 0%{?sle_version} >= 120300 || 0%{?suse_version} >= 1330 || !0%{?suse_version} +%bcond_without bz2 +%bcond_without xz +%else +%bcond_with bz2 +%bcond_with xz +%endif +%if 0%{?sle_version} >= 150000 || 0%{?suse_version} >= 1500 +%bcond_without zstd +%else +%bcond_with zstd +%endif +%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?mageia} >= 6 || 0%{?suse_version} >= 1330 +%bcond_without richdeps +%else +%bcond_with richdeps +%endif +# we need at least swig 1.3.40 for the bindings ($typemap support) +%if 0%{?suse_version} != 1110 +%bcond_without python3 +%if 0%{?suse_version} < 1550 +%bcond_without python +%else +%bcond_with python +%endif +%bcond_without ruby +%bcond_without perl +%else +%bcond_with python3 +%bcond_with python +%bcond_with ruby +%bcond_with perl +%endif +%bcond_without static +%bcond_with shared +%bcond_with zypp + Name: libsolv Version: @VERSION@ -Release: 1 -License: BSD 3-Clause -Url: git://gitorious.org/opensuse/libsolv.git +Release: 0 +Summary: Package dependency solver using a satisfiability algorithm +License: BSD-3-Clause +Group: Development/Libraries/C and C++ +URL: https://github.com/openSUSE/libsolv Source: libsolv-%{version}.tar.bz2 +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: libxml2-devel +BuildRequires: rpm-devel +BuildRequires: zlib-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -Group: Development/Libraries/C and C++ -Prefix: /usr -%bcond_without enable_static -%bcond_without disable_shared -%bcond_without perl_binding -%bcond_without python_binding -%bcond_without ruby_binding - -%if 0%{?mandriva_version} -# force this version on mandriva -BuildRequires: libneon0.26-devel -%endif -%if 0%{?fedora_version} -BuildRequires: db4-devel +%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia} +BuildRequires: db-devel %endif -%if 0%{?suse_version} -%if 0%{?suse_version} < 1030 -BuildRequires: expat -%else -BuildRequires: libexpat-devel -%endif -%if 0%{?suse_version} < 1100 -BuildRequires: graphviz + +%if %{with perl} +BuildRequires: perl +%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia} +BuildRequires: perl-devel %endif -%if 0%{?suse_version} > 1020 -BuildRequires: fdupes +BuildRequires: swig %endif -%else -BuildRequires: expat-devel + +%if %{with ruby} +%global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']") +BuildRequires: ruby +BuildRequires: ruby-devel +BuildRequires: swig %endif -BuildRequires: cmake rpm-devel gcc-c++ -BuildRequires: zlib-devel -%if %{with perl_binding} -BuildRequires: perl -%if 0%{?fedora_version} -BuildRequires: perl-devel +%if %{with python} +%global python_sitearch %(python -c "from sysconfig import get_path; print(get_path('platlib'))") +BuildRequires: python-devel +BuildRequires: swig %endif -BuildRequires: swig + +%if %{with python3} +%global python3_sitearch %(python3 -c "from sysconfig import get_path; print(get_path('platlib'))") +BuildRequires: python3-devel +BuildRequires: swig %endif -%if %{with ruby_binding} -%if 0%{?fedora_version} -%global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]') + +%if %{with bz2} +%if 0%{?suse_version} +BuildRequires: libbz2-devel %else -%global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"]') -%endif -BuildRequires: ruby ruby-devel -BuildRequires: swig +BuildRequires: bzip2-devel %endif -%if %{with python_binding} -%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);") -BuildRequires: python-devel -BuildRequires: swig %endif -Summary: A new approach to package dependency solving +%if %{with xz} +BuildRequires: xz-devel +%endif +%if %{with zstd} +BuildRequires: libzstd-devel +%endif %description -A new approach to package dependency solving - -Authors: --------- - Michael Schroeder - Klaus Kaempf - Stephan Kulow - Michael Matz - Duncan Mac-Vicar P. - -%if !%{with disable_shared} -%package -n libsolv@LIBSOLV_SOVERSION@ -Summary: A new approach to package dependency solving -Group: Development/Libraries/C and C++ +libsolv is a library for solving packages and reading repositories. +The solver uses a satisfiability algorithm. -%description -n libsolv@LIBSOLV_SOVERSION@ -A new approach to package dependency solving +%if %{with shared} +%package -n %{libname} +Summary: Package dependency solver using a satisfiability algorithm +Group: System/Libraries -Authors: --------- - Michael Schroeder - Klaus Kaempf - Stephan Kulow - Michael Matz - Duncan Mac-Vicar P. +%description -n %{libname} +libsolv is a library for solving packages and reading repositories. +It consists of two central blocks: Using a dictionary approach to +store and retrieve package and dependency information, and, using a +so-called satisfiability algorithm for resolving package +dependencies. %endif %package devel -Summary: A new approach to package dependency solving +Summary: Development files for libsolv, a package solver Group: Development/Libraries/C and C++ -Requires: libsolv-tools = %version -%if !%{with disable_shared} -Requires: libsolv@LIBSOLV_SOVERSION@ = %version +%if %{with shared} +Requires: %{libname} = %version %endif Requires: rpm-devel +Conflicts: libsatsolver-devel %description devel -Development files for libsolv, a new approach to package dependency solving - -Authors: --------- - Michael Schroeder - Klaus Kaempf - Stephan Kulow - Michael Matz - Duncan Mac-Vicar P. +Development files for libsolv, a library for solving packages and +reading repositories. %package tools -Summary: A new approach to package dependency solving -Group: Development/Libraries/C and C++ -Obsoletes: libsatsolver <= 0.0.15 -Provides: libsatsolver = %{version}-%{release} -Requires: gzip bzip2 coreutils +Summary: Utilities to work with .solv files +Group: System/Management +Conflicts: satsolver-tools-obsolete +Obsoletes: satsolver-tools < 0.18 +Provides: satsolver-tools = 0.18 +Requires: findutils %description tools -A new approach to package dependency solving. +libsolv is a library for solving packages and reading repositories. + +This subpackage contains utilities to create and work with the .solv +files used by libsolv. %package demo Summary: Applications demoing the libsolv library Group: System/Management Requires: curl -%if 0%{?fedora_version} +Conflicts: libsatsolver-demo +%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia} Requires: gnupg2 %endif %if 0%{?suse_version} @@ -141,114 +181,164 @@ Summary: Ruby bindings for the libsolv library Group: Development/Languages/Ruby %description -n ruby-solv -Ruby bindings for sat solver. +Ruby bindings for libsolv. %package -n python-solv -%if 0%{?py_requires:1} +%if 0%{?py_requires:1} && %{with python} %py_requires %endif Summary: Python bindings for the libsolv library Group: Development/Languages/Python %description -n python-solv -Python bindings for sat solver. +Python bindings for libsolv. + +%package -n python3-solv +Summary: Python3 bindings for the libsolv library +Group: Development/Languages/Python + +%description -n python3-solv +Python3 bindings for libsolv. %package -n perl-solv -Requires: perl = %{perl_version} Summary: Perl bindings for the libsolv library Group: Development/Languages/Perl +Requires: perl = %{perl_version} %description -n perl-solv -Perl bindings for sat solver. +Perl bindings for libsolv. %prep -%setup -n libsolv-%{version} +%setup -q %build -export CFLAGS="$RPM_OPT_FLAGS" +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects +export CFLAGS="%{optflags}" export CXXFLAGS="$CFLAGS" CMAKE_FLAGS= -%if 0%{?fedora_version} +%if 0%{?fedora} || 0%{?rhel} >= 6 CMAKE_FLAGS="-DFEDORA=1" %endif +%if 0%{?mageia} +CMAKE_FLAGS="-DMAGEIA=1" +%endif +%if 0%{?suse_version} +CMAKE_FLAGS="-DSUSE=1" +%endif -cmake $CMAKE_FLAGS \ +cmake . $CMAKE_FLAGS \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DLIB=%{_lib} \ -DCMAKE_VERBOSE_MAKEFILE=TRUE \ - -DCMAKE_BUILD_TYPE=Release \ - %{?with_enable_static:-DENABLE_STATIC=1} \ - %{?with_disable_shared:-DDISABLE_SHARED=1} \ - %{?with_perl_binding:-DENABLE_PERL=1} \ - %{?with_python_binding:-DENABLE_PYTHON=1} \ - %{?with_ruby_binding:-DENABLE_RUBY=1} \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWITH_LIBXML2=1 \ + -DENABLE_APPDATA=1 \ + -DENABLE_COMPS=1 \ + %{?with_static:-DENABLE_STATIC=1} \ + %{!?with_shared:-DDISABLE_SHARED=1} \ + %{?with_perl:-DENABLE_PERL=1} \ + %{?with_python:-DENABLE_PYTHON=1} \ + %{?with_python3:-DENABLE_PYTHON3=1} \ + %{?with_ruby:-DENABLE_RUBY=1} \ + %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \ + %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \ + %{?with_zstd:-DENABLE_ZSTD_COMPRESSION=1} \ + %{?with_zstd:-DENABLE_ZCHUNK_COMPRESSION=1} \ + %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \ + %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \ -DUSE_VENDORDIRS=1 \ -DCMAKE_SKIP_RPATH=1 -make %{?jobs:-j %jobs} +make %{?_smp_mflags} %install -make DESTDIR=$RPM_BUILD_ROOT install -%if %{with python_binding} +make DESTDIR=%{buildroot} install +ln -s repo2solv %{buildroot}/%{_bindir}/repo2solv.sh + %if 0%{?suse_version} -pushd $RPM_BUILD_ROOT/%{python_sitearch} -python %py_libdir/py_compile.py *.py -python -O %py_libdir/py_compile.py *.py -popd +%if %{with python} +%py_compile -O %{buildroot}/%{python_sitearch} +%endif +%if %{with python3} +%py3_compile %{buildroot}/%{python3_sitearch} %endif %endif -# we want to leave the .a file untouched -export NO_BRP_STRIP_DEBUG=true -%clean -rm -rf "$RPM_BUILD_ROOT" +%check +make ARGS=--output-on-failure test -%if !%{with disable_shared} -%post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig +%if %{with shared} +%post -n %{libname} -p /sbin/ldconfig -%postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig -%files -n libsolv@LIBSOLV_SOVERSION@ +%files -n %{libname} %defattr(-,root,root) -%doc LICENSE* +%license LICENSE* %{_libdir}/libsolv.so.* %{_libdir}/libsolvext.so.* %endif %files tools %defattr(-,root,root) +%if 0%{?suse_version} %exclude %{_bindir}/helix2solv +%exclude %{_mandir}/man1/helix2solv* +%endif +%exclude %{_mandir}/man1/solv.1* %exclude %{_bindir}/solv %{_bindir}/* +%{_mandir}/man1/* %files devel %defattr(-,root,root) +%if %{with static} +%{_libdir}/libsolv.a +%{_libdir}/libsolvext.a +%endif +%if %{with shared} %{_libdir}/libsolv.so %{_libdir}/libsolvext.so +%endif %{_includedir}/solv +%if 0%{?suse_version} %{_bindir}/helix2solv +%{_mandir}/man1/helix2solv* +%endif %{_datadir}/cmake/Modules/* +%{_libdir}/pkgconfig/libsolv*.pc +%{_mandir}/man3/* %files demo %defattr(-,root,root) %{_bindir}/solv +%{_mandir}/man1/solv.1* -%if %{with perl_binding} +%if %{with perl} %files -n perl-solv %defattr(-,root,root) %{perl_vendorarch}/* %endif -%if %{with ruby_binding} +%if %{with ruby} %files -n ruby-solv %defattr(-,root,root) %{ruby_vendorarch}/* %endif -%if %{with python_binding} +%if %{with python} %files -n python-solv %defattr(-,root,root) %{python_sitearch}/* %endif +%if %{with python3} +%files -n python3-solv +%defattr(-,root,root) +%{python3_sitearch}/*solv* +%if 0%{?suse_version} +%{python3_sitearch}/*/*solv* +%endif +%endif + %changelog