This reverts commit 6580f3c0dd.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-11-03 22:15:22 +01:00
parent 0dc2ec20d1
commit 7ab611bd81

View File

@ -1,4 +1,3 @@
%bcond_without python2
%if 0%{?rhel} && 0%{?rhel} <= 7
# Do not build bindings for python3 for RHEL <= 7
%bcond_with python3
@ -9,15 +8,9 @@
%bcond_without tests
%endif
%if 0%{?fedora} >= 27 || 0%{?rhel} > 7
%bcond_without platform_python
%else
%bcond_with platform_python
%endif
Name: librepo
Version: 1.8.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Repodata downloading library
License: LGPLv2+
@ -46,7 +39,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development files for librepo.
%if %{with python2}
%package -n python2-%{name}
Summary: Python bindings for the librepo library
%{?python_provide:%python_provide python2-%{name}}
@ -62,7 +54,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python2-%{name}
Python 2 bindings for the librepo library.
%endif # with python2
%if %{with python3}
%package -n python3-%{name}
@ -77,34 +68,22 @@ BuildRequires: python3-nose
BuildRequires: python3-sphinx
BuildRequires: python3-pyxattr
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: python-platform-%{name} < 1.8.1-2
%description -n python3-%{name}
Python 3 bindings for the librepo library.
%endif
%if %{with platform_python}
%package -n platform-python-%{name}
Summary: Platform Python bindings for the librepo library
BuildRequires: platform-python-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n platform-python-%{name}
Python 3 bindings for the librepo library.
%endif # with platform_python
%prep
%autosetup -p1
mkdir build build-py3 build-platpy
mkdir build build-py3
%build
%if %{with python2}
pushd build
%cmake ..
%make_build
popd
%endif # with python2
%if %{with python3}
pushd build-py3
@ -113,66 +92,25 @@ pushd build-py3
popd
%endif
%if %{with platform_python}
pushd build-platpy
# librepo's CMakeLists override CMake's override mechanism!
# Bring it back.
sed '/unset(PYTHON_[^)]*)/d' -i ../librepo/python/python3/CMakeLists.txt
export python_so=%{_libdir}/`%{__platform_python} -c 'import sysconfig; print(sysconfig.get_config_var("LDLIBRARY"))'`
export python_include=`%{__platform_python} -c 'import sysconfig; print(sysconfig.get_path("include"))'`
%cmake \
-DPYTHON_EXECUTABLE:FILEPATH=%{__platform_python} \
-DPYTHON_LIBRARY=$python_so \
-DPYTHON_INCLUDE_DIR=$python_include \
-DPYTHON_DESIRED:str=3 \
..
%make_build
popd
%endif # with platform_python
%if %{with tests}
%check
%if %{with python2}
pushd build
#ctest -VV
make ARGS="-V" test
popd
%endif # with python2
%if %{with python3}
pushd build-py3
#ctest -VV
make ARGS="-V" test
popd
%endif # with python3
%if %{with platform_python}
pushd build-platpy
#ctest -VV
# Test suite requires the "nosetests" binary
#make ARGS="-V" test
popd
%endif # with platform_python
%endif # with tests
%endif
%endif
%install
%if %{with platform_python}
pushd build-platpy
%make_install
popd
%endif # with platform_python
%if %{with python2}
pushd build
%make_install
popd
%endif # with python2
%if %{with python3}
pushd build-py3
%make_install
@ -193,22 +131,18 @@ popd
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}/
%if %{with python2}
%files -n python2-%{name}
%{python2_sitearch}/%{name}/
%endif # with python2
%if %{with python3}
%files -n python3-%{name}
%{python3_sitearch}/%{name}/
%endif
%if %{with platform_python}
%files -n platform-python-%{name}
%{platform_python_sitearch}/%{name}/
%endif # with platform_python
%changelog
* Fri Nov 03 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-2
- Remove platform-python subpackage
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.1-1
- Update to 1.8.1