%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 %else %bcond_without python3 %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.0 Release: 2%{?dist} Summary: Repodata downloading library License: LGPLv2+ URL: https://github.com/rpm-software-management/librepo Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc BuildRequires: check-devel BuildRequires: doxygen BuildRequires: expat-devel BuildRequires: glib2-devel >= 2.26.0 BuildRequires: gpgme-devel BuildRequires: libattr-devel BuildRequires: libcurl-devel >= 7.19.0 BuildRequires: openssl-devel %description A library providing C and Python (libcURL like) API to downloading repository metadata. %package devel Summary: Repodata downloading library 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}} BuildRequires: pygpgme BuildRequires: python2-devel %if %{with tests} BuildRequires: python-flask BuildRequires: python-nose %endif BuildRequires: python-sphinx BuildRequires: pyxattr 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} Summary: Python 3 bindings for the librepo library %{?python_provide:%python_provide python3-%{name}} BuildRequires: python3-pygpgme BuildRequires: python3-devel %if %{with tests} BuildRequires: python3-flask BuildRequires: python3-nose %endif BuildRequires: python3-sphinx BuildRequires: python3-pyxattr Requires: %{name}%{?_isa} = %{version}-%{release} %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 %build %if %{with python2} pushd build %cmake .. %make_build popd %endif # with python2 %if %{with python3} pushd build-py3 %cmake -DPYTHON_DESIRED:str=3 .. %make_build 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 %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 popd %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license COPYING %doc README.md %{_libdir}/%{name}.so.* %files devel %{_libdir}/%{name}.so %{_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 Sep 01 2017 Igor Gnatenko - 1.8.0-2 - Disable platform python on old releases * Wed Aug 23 2017 Igor Gnatenko - 1.8.0-1 - Update to 1.8.0 * Fri Aug 18 2017 Tomas Orsava - 1.7.20-9 - Added Patch 0 to fix a tearDown failure in the test suite * Thu Aug 10 2017 Petr Viktorin - 1.7.20-8 - Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack) * Thu Aug 03 2017 Fedora Release Engineering - 1.7.20-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 1.7.20-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 1.7.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Dec 13 2016 Charalampos Stratakis - 1.7.20-4 - Enable tests * Tue Dec 13 2016 Charalampos Stratakis - 1.7.20-3 - Rebuild for Python 3.6 - Disable tests for now * Sat Dec 10 2016 Igor Gnatenko - 1.7.20-2 - Rebuild for gpgme 1.18 * Thu Aug 25 2016 Tomas Mlcoch - 1.7.20-1 - Tests: Disable test_download_packages_with_resume_02 test - Update build utils to match new fedora spec schema * Wed Aug 24 2016 Tomas Mlcoch - 1.7.19-1 - Add yumrecord substitution mechanism (mluscon) - Fix a memory leak in signature verification (cwalters) * Tue Aug 09 2016 Igor Gnatenko - 1.7.18-4 - Add %%{?system_python_abi} - Trim ton of changelog * Tue Jul 19 2016 Fedora Release Engineering - 1.7.18-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Apr 07 2016 Igor Gnatenko - 1.7.18-2 - Adopt to new packaging guidelines - Cleanups in spec file * Fri Mar 4 2016 Tomas Mlcoch - 1.7.18-1 - Add new option LRO_FTPUSEEPSV - Update AUTHORS - downloader prepare_next_transfer(): simplify long line - downloader prepare_next_transfer(): add missing error check - downloader prepare_next_transfer(): cleanup error path - downloader prepare_next_transfer() - fix memory leak on error path (Alan Jenkins) - handle: Don't use proxy cache for downloads of metalink/mirrorlist - handle: Don't set CURLOPT_HTTPHEADER into curl handle immediately when specified - downloader: Implement logic for no_cache param in LrDownloadTarget (RhBug: 1297762) - Add no_cache param to LrDownloadTarget and lr_downloadtarget_new() - New test: always try to download from the fastest mirror (Alexander Todorov) - Doc: Fixed minor doc typo (Philippe Ombredanne) - Doc: Other updates - Doc: Update default values in doc to reflect reality