| |
@@ -1,16 +1,20 @@
|
| |
+ %bcond_without python2
|
| |
%if 0%{?rhel} && 0%{?rhel} <= 7
|
| |
# Do not build bindings for python3 for RHEL <= 7
|
| |
%bcond_with python3
|
| |
# python-flask is not in RHEL7
|
| |
%bcond_with tests
|
| |
+ # platform-python is not in RHEL7
|
| |
+ %bcond_with platform_python
|
| |
%else
|
| |
%bcond_without python3
|
| |
+ %bcond_without platform_python
|
| |
%bcond_without tests
|
| |
%endif
|
| |
|
| |
Name: librepo
|
| |
Version: 1.7.20
|
| |
- Release: 7%{?dist}
|
| |
+ Release: 8%{?dist}
|
| |
Summary: Repodata downloading library
|
| |
|
| |
License: LGPLv2+
|
| |
@@ -39,6 +43,7 @@
|
| |
%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}}
|
| |
@@ -54,11 +59,11 @@
|
| |
|
| |
%description -n python2-%{name}
|
| |
Python 2 bindings for the librepo library.
|
| |
+ %endif # with python2
|
| |
|
| |
%if %{with python3}
|
| |
%package -n python3-%{name}
|
| |
Summary: Python 3 bindings for the librepo library
|
| |
- %{?system_python_abi}
|
| |
%{?python_provide:%python_provide python3-%{name}}
|
| |
BuildRequires: python3-pygpgme
|
| |
BuildRequires: python3-devel
|
| |
@@ -74,16 +79,29 @@
|
| |
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 -n %{name}-%{name}-%{version}
|
| |
|
| |
- mkdir build build-py3
|
| |
+ mkdir build build-py3 build-platpy
|
| |
|
| |
%build
|
| |
+
|
| |
+ %if %{with python2}
|
| |
pushd build
|
| |
%cmake ..
|
| |
%make_build
|
| |
popd
|
| |
+ %endif # with python2
|
| |
|
| |
%if %{with python3}
|
| |
pushd build-py3
|
| |
@@ -92,25 +110,66 @@
|
| |
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
|
| |
- %endif
|
| |
+ %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
|
| |
|
| |
%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
|
| |
@@ -131,15 +190,25 @@
|
| |
%{_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
|
| |
+ * Thu Aug 10 2017 Petr Viktorin <pviktori@redhat.com> - 1.7.20-8
|
| |
+ - Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
|
| |
+
|
| |
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-7
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
| |
|
| |
These are changes needed for the Platform Python Stack Fedora change.
The Platform module on which everything else will depend will contain dnf, and that needs Python. To make everything work, we need to build an independent minimal Python stack containing all the libraries needed to build and run dnf, and that includes librepo.
We're creating the pull request now, so you can review the changes, but please don't build the platform-python subpackage until we push platform-python itself into Rawhide/f27.
We'll let you know when this can be built (or we'll build it).
If you have any comments on the change, please let us know by this Thursday (2017-08-17). We will have to push and build everything by the end of the week to comply with the Fedora 27 schedule.
If the change looks good, you can merge it -- or let us know and we'll handle the merging and building for you.
CC @churchyard