Accepting request 514065 from home:cbosdonnat:branches:Virtualization

- Fix python binding package
  * Replace python-libguestfs by python[23]-libguestfs packages
  * Add egg-info to python[23]-libguestfs package

OBS-URL: https://build.opensuse.org/request/show/514065
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=399
This commit is contained in:
Cédric Bosdonnat 2017-08-02 16:04:59 +00:00 committed by Git OBS Bridge
parent ae33b331fe
commit 308f6baa27
2 changed files with 44 additions and 9 deletions

View File

@ -3,6 +3,9 @@ Tue Jul 18 14:07:54 UTC 2017 - cbosdonnat@suse.com
- Add missing dependency on guestfs-data (bsc#1048848)
- Add conflict with old virt-v2v (bsc#1050069)
- Fix python binding package
* Replace python-libguestfs by python[23]-libguestfs packages
* Add egg-info to python[23]-libguestfs package
-------------------------------------------------------------------
Mon Jul 17 07:05:10 UTC 2017 - dmueller@suse.com

View File

@ -302,21 +302,38 @@ Allows lua scripts to directly use libguestfs.
%endif
#
%if %{with python_bindings}
%package -n python-libguestfs
Summary: Provides Python support for libguestfs
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%package -n python2-libguestfs
Summary: Provides Python 2 support for libguestfs
License: GPL-2.0
Group: System/Filesystems
%define pyver %(python -c "import sys; print sys.version[:3]")
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-rpm-macros
%define _configure_python --enable-python
#
Provides: libguestfs-python = %{version}
Obsoletes: libguestfs-python < %{version}
Obsoletes: python-libguestfs < %{version}
Provides: python-libguestfs = %{version}
Requires: guestfs-data >= %{version}
%description -n python-libguestfs
Allows Python scripts to directly use libguestfs.
%description -n python2-libguestfs
Allows Python 2 scripts to directly use libguestfs.
%package -n python3-libguestfs
Summary: Provides Python 3 support for libguestfs
License: GPL-2.0
Group: System/Filesystems
%define _configure_python --enable-python
#
Obsoletes: libguestfs-python < %{version}
Obsoletes: python-libguestfs < %{version}
Provides: python-libguestfs = %{version}
Requires: guestfs-data >= %{version}
%description -n python3-libguestfs
Allows Python 3 scripts to directly use libguestfs.
%endif
#
%if %{with ruby_bindings}
@ -621,6 +638,17 @@ find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete
grep "%perl_vendorarch/" %{name}.files | tee t
mv t %{name}.files
%endif
%if %{with python_bindings}
pushd python
sed -i -e "s:libraries=:library_dirs=['$RPM_BUILD_ROOT/%{_libdir}'], libraries=:" setup.py
make stamp-extra-files
# Build needs libguestfs library to be installed
%python_build
%python_install
popd
%endif
#
find $RPM_BUILD_ROOT -name "*.la" -print -delete
rm -fv $RPM_BUILD_ROOT/%{_libdir}/*.a
@ -703,9 +731,13 @@ rm -rf $RPM_BUILD_ROOT
%endif
#
%if %{with python_bindings}
%files -n python-libguestfs
%files -n python2-libguestfs
%defattr(-,root,root)
%{_libdir}/python%{pyver}/site-packages/*
%{python2_sitearch}/*
%files -n python3-libguestfs
%defattr(-,root,root)
%{python3_sitearch}/*
%endif
#
%if %{with ruby_bindings}