Imported Upstream version 0.6.24
[platform/upstream/libsolv.git] / package / libsolv.spec.in
index 934ae2e..0009287 100644 (file)
@@ -26,6 +26,7 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %bcond_without disable_shared
 %bcond_without perl_binding
 %bcond_without python_binding
+%bcond_without python3_binding
 %bcond_without ruby_binding
 %bcond_with zypp
 
@@ -34,7 +35,7 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  libneon0.26-devel
 %endif
 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
-BuildRequires:  db4-devel
+BuildRequires:  db-devel
 %endif
 %if 0%{?suse_version}
 %if 0%{?suse_version} < 1030
@@ -64,16 +65,20 @@ BuildRequires:  perl-devel
 BuildRequires:  swig
 %endif
 %if %{with ruby_binding}
-%global ruby_vendorarch %(ruby  -r rbconfig -e "puts Config::CONFIG['vendorarchdir'].nil? ? Config::CONFIG['sitearchdir'] : Config::CONFIG['vendorarchdir']")
+%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
 %if %{with python_binding}
-%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
+%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
 BuildRequires:  python-devel
 BuildRequires:  swig
 %endif
+%if %{with python3_binding}
+%global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
+BuildRequires:  python3-devel
+%endif
 
 Summary:        A new approach to package dependency solving
 License:        BSD-3-Clause
@@ -146,6 +151,13 @@ Group:          Development/Languages/Python
 %description -n python-solv
 Python bindings for sat solver.
 
+%package -n python3-solv
+Summary:        Python3 bindings for the libsolv library
+Group:          Development/Languages/Python
+
+%description -n python3-solv
+Python3 bindings for sat solver.
+
 %package -n perl-solv
 Requires:       perl = %{perl_version}
 Summary:        Perl bindings for the libsolv library
@@ -166,10 +178,10 @@ CMAKE_FLAGS=
 CMAKE_FLAGS="-DFEDORA=1"
 %endif
 %if 0%{?suse_version}
-CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1"
+CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
 %endif
 
-cmake   $CMAKE_FLAGS \
+cmake  $CMAKE_FLAGS \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DLIB=%{_lib} \
        -DCMAKE_VERBOSE_MAKEFILE=TRUE \
@@ -178,6 +190,7 @@ cmake   $CMAKE_FLAGS \
        %{?with_disable_shared:-DDISABLE_SHARED=1} \
        %{?with_perl_binding:-DENABLE_PERL=1} \
        %{?with_python_binding:-DENABLE_PYTHON=1} \
+       %{?with_python3_binding:-DENABLE_PYTHON3=1} \
        %{?with_ruby_binding:-DENABLE_RUBY=1} \
        %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
        -DUSE_VENDORDIRS=1 \
@@ -186,13 +199,16 @@ make %{?jobs:-j %jobs}
 
 %install
 make DESTDIR=$RPM_BUILD_ROOT install
-%if %{with python_binding}
 %if 0%{?suse_version}
+%if %{with python_binding}
 pushd $RPM_BUILD_ROOT/%{python_sitearch}
 python %py_libdir/py_compile.py *.py
 python -O %py_libdir/py_compile.py *.py
 popd
 %endif
+%if %{with python3_binding}
+%py3_compile $RPM_BUILD_ROOT/%{python3_sitearch}
+%endif
 %endif
 %if %{with disable_shared}
 # we want to leave the .a file untouched
@@ -240,6 +256,7 @@ rm -rf "$RPM_BUILD_ROOT"
 %{_mandir}/man1/helix2solv*
 %endif
 %{_datadir}/cmake/Modules/*
+%{_libdir}/pkgconfig/libsolv.pc
 %{_mandir}/man3/*
 
 %files demo
@@ -264,4 +281,13 @@ rm -rf "$RPM_BUILD_ROOT"
 %{python_sitearch}/*
 %endif
 
+%if %{with python3_binding}
+%files -n python3-solv
+%defattr(-,root,root)
+%{python3_sitearch}/*solv*
+%if 0%{?suse_version}
+%{python3_sitearch}/*/*solv*
+%endif
+%endif
+
 %changelog