ec4f2a
%global libcurl_version 7.28.0
ec4f2a
982e5b
%if 0%{?rhel} && 0%{?rhel} <= 7
982e5b
# Do not build bindings for python3 for RHEL <= 7
982e5b
%bcond_with python3
982e5b
# python-flask is not in RHEL7
ec4f2a
%bcond_with pythontests
982e5b
%else
982e5b
%bcond_without python3
ec4f2a
%bcond_without pythontests
982e5b
%endif
982e5b
ec4f2a
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
ec4f2a
# Do not build bindings for python2 for RHEL > 7 and Fedora > 29
982e5b
%bcond_with python2
982e5b
%else
982e5b
%bcond_without python2
982e5b
%endif
982e5b
ec4f2a
%if 0%{?rhel}
ec4f2a
%bcond_with zchunk
ec4f2a
%else
ec4f2a
%bcond_without zchunk
ec4f2a
%endif
982e5b
982e5b
%global dnf_conflict 2.8.8
982e5b
982e5b
Name:           librepo
ec4f2a
Version:        1.10.3
ec4f2a
Release:        3%{?dist}
982e5b
Summary:        Repodata downloading library
982e5b
982e5b
License:        LGPLv2+
982e5b
URL:            https://github.com/rpm-software-management/librepo
982e5b
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
ec4f2a
Patch0:         0001-Handle-webservers-that-dont-support-ranges-when-downloading-zck.patch
ec4f2a
Patch1:         0002-Define-LRO_SUPPORTS_CACHEDIR-only-with-zchunk-RhBug17261411719830.patch
ec4f2a
Patch2:         0003-Fix-Verification-of-checksum-from-file-attr.patch
982e5b
982e5b
BuildRequires:  cmake
982e5b
BuildRequires:  gcc
982e5b
BuildRequires:  check-devel
982e5b
BuildRequires:  doxygen
982e5b
BuildRequires:  pkgconfig(glib-2.0)
982e5b
BuildRequires:  gpgme-devel
982e5b
BuildRequires:  libattr-devel
ec4f2a
BuildRequires:  libcurl-devel >= %{libcurl_version}
982e5b
BuildRequires:  pkgconfig(libxml-2.0)
982e5b
BuildRequires:  pkgconfig(libcrypto)
982e5b
BuildRequires:  pkgconfig(openssl)
ec4f2a
%if %{with zchunk}
ec4f2a
BuildRequires:  pkgconfig(zck) >= 0.9.11
ec4f2a
%endif
ec4f2a
Requires:       libcurl%{?_isa} >= %{libcurl_version}
982e5b
982e5b
%description
982e5b
A library providing C and Python (libcURL like) API to downloading repository
982e5b
metadata.
982e5b
982e5b
%package devel
982e5b
Summary:        Repodata downloading library
982e5b
Requires:       %{name}%{?_isa} = %{version}-%{release}
982e5b
982e5b
%description devel
982e5b
Development files for librepo.
982e5b
982e5b
%if %{with python2}
982e5b
%package -n python2-%{name}
982e5b
Summary:        Python bindings for the librepo library
982e5b
%{?python_provide:%python_provide python2-%{name}}
982e5b
%if 0%{?rhel} && 0%{?rhel} <= 7
982e5b
BuildRequires:  python-sphinx
982e5b
%else
982e5b
BuildRequires:  python2-sphinx
982e5b
%endif
982e5b
BuildRequires:  python2-devel
ec4f2a
%if %{with pythontests}
ec4f2a
BuildRequires:  python2-flask
ec4f2a
BuildRequires:  python2-nose
ec4f2a
BuildRequires:  python2-requests
ec4f2a
%if (0%{?rhel} && 0%{?rhel} <= 7)
982e5b
BuildRequires:  pyxattr
ec4f2a
BuildRequires:  pygpgme
982e5b
%else
982e5b
BuildRequires:  python2-pyxattr
ec4f2a
BuildRequires:  python2-gpg
982e5b
%endif
ec4f2a
%endif # with pythontests
982e5b
Requires:       %{name}%{?_isa} = %{version}-%{release}
982e5b
Conflicts:      python2-dnf < %{dnf_conflict}
982e5b
982e5b
%description -n python2-%{name}
982e5b
Python 2 bindings for the librepo library.
982e5b
%endif
982e5b
982e5b
%if %{with python3}
982e5b
%package -n python3-%{name}
982e5b
Summary:        Python 3 bindings for the librepo library
982e5b
%{?python_provide:%python_provide python3-%{name}}
982e5b
BuildRequires:  python3-devel
ec4f2a
%if %{with pythontests}
ec4f2a
BuildRequires:  python3-gpg
982e5b
BuildRequires:  python3-flask
982e5b
BuildRequires:  python3-nose
ec4f2a
BuildRequires:  python3-pyxattr
ec4f2a
BuildRequires:  python3-requests
982e5b
%endif
982e5b
BuildRequires:  python3-sphinx
982e5b
Requires:       %{name}%{?_isa} = %{version}-%{release}
982e5b
# Obsoletes Fedora 27 package
982e5b
Obsoletes:      platform-python-%{name} < %{version}-%{release}
982e5b
Conflicts:      python3-dnf < %{dnf_conflict}
982e5b
982e5b
%description -n python3-%{name}
982e5b
Python 3 bindings for the librepo library.
982e5b
%endif
982e5b
982e5b
%prep
982e5b
%autosetup -p1
982e5b
982e5b
mkdir build-py2
982e5b
mkdir build-py3
982e5b
982e5b
%build
982e5b
%if %{with python2}
982e5b
pushd build-py2
ec4f2a
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} ..
982e5b
  %make_build
982e5b
popd
982e5b
%endif
982e5b
982e5b
%if %{with python3}
982e5b
pushd build-py3
ec4f2a
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} ..
982e5b
  %make_build
982e5b
popd
982e5b
%endif
982e5b
982e5b
%check
982e5b
%if %{with python2}
982e5b
pushd build-py2
982e5b
  #ctest -VV
982e5b
  make ARGS="-V" test
982e5b
popd
982e5b
%endif
982e5b
982e5b
%if %{with python3}
982e5b
pushd build-py3
982e5b
  #ctest -VV
982e5b
  make ARGS="-V" test
982e5b
popd
982e5b
%endif
982e5b
982e5b
%install
982e5b
%if %{with python2}
982e5b
pushd build-py2
982e5b
  %make_install
982e5b
popd
982e5b
%endif
982e5b
982e5b
%if %{with python3}
982e5b
pushd build-py3
982e5b
  %make_install
982e5b
popd
982e5b
%endif
982e5b
982e5b
%if 0%{?rhel} && 0%{?rhel} <= 7
982e5b
%post -p /sbin/ldconfig
982e5b
%postun -p /sbin/ldconfig
982e5b
%else
982e5b
%ldconfig_scriptlets
982e5b
%endif
982e5b
982e5b
%files
982e5b
%license COPYING
982e5b
%doc README.md
982e5b
%{_libdir}/%{name}.so.*
982e5b
982e5b
%files devel
982e5b
%{_libdir}/%{name}.so
982e5b
%{_libdir}/pkgconfig/%{name}.pc
982e5b
%{_includedir}/%{name}/
982e5b
982e5b
%if %{with python2}
982e5b
%files -n python2-%{name}
982e5b
%{python2_sitearch}/%{name}/
982e5b
%endif
982e5b
982e5b
%if %{with python3}
982e5b
%files -n python3-%{name}
982e5b
%{python3_sitearch}/%{name}/
982e5b
%endif
982e5b
982e5b
%changelog
ec4f2a
* Fri Sep 06 2019 Marek Blaha <mblaha@redhat.com> - 1.10.3-3
ec4f2a
- Backport patch: Fix: Verification of checksum from file attr
ec4f2a
ec4f2a
* Wed Jul 31 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.10.3-2
ec4f2a
- Backport patch: Define LRO_SUPPORTS_CACHEDIR only with zchunk (RhBug:1726141,1719830)
ec4f2a
ec4f2a
* Tue Jun 11 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.10.3-1
ec4f2a
- Update to 1.10.3
ec4f2a
- Exit gpg-agent after repokey import (RhBug:1650266)
ec4f2a
ec4f2a
* Mon May 13 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.10.1-1
ec4f2a
- Update to 1.10.1
ec4f2a
- Reduce download delays
ec4f2a
- Add an option to preserve timestamps of the downloaded files (RhBug:1688537)
ec4f2a
- Append the '?' part of repo URL after the path
ec4f2a
- Fix memory leaks
ec4f2a
982e5b
* Tue Sep 25 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.2-1
982e5b
- Update to 1.9.2
982e5b
- Bug 1626495 - major performance regression with libcurl-7.61.1
982e5b
982e5b
* Mon Aug 13 2018 Daniel Mach <dmach@redhat.com> - 1.9.1-1
982e5b
- Update to 1.9.1
982e5b
982e5b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
982e5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
982e5b
982e5b
* Fri Jun 29 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.0-3
982e5b
- Rebuilt for Python 3.7
982e5b
982e5b
* Tue Jun 26 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-2
982e5b
- Fix ldconfig_scriptlets once more
982e5b
982e5b
* Tue Jun 26 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.0-1
982e5b
- Update to 1.9.0
982e5b
982e5b
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-9
982e5b
- Rebuilt for Python 3.7
982e5b
982e5b
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-8
982e5b
- Bootstrap for Python 3.7
982e5b
982e5b
* Thu Feb 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-7
982e5b
- Add if conditionals around pyxattr
982e5b
982e5b
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.8.1-6
982e5b
- Update Python 2 dependency declarations to new packaging standards
982e5b
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
982e5b
982e5b
* Wed Jan 31 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-5
982e5b
- Switch to %%ldconfig_scriptlets
982e5b
982e5b
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-4
982e5b
- Use better Obsoletes for platform-python
982e5b
982e5b
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-3
982e5b
- Fix typo in Obsoletes
982e5b
982e5b
* Fri Nov 03 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-2
982e5b
- Remove platform-python subpackage
982e5b
982e5b
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.1-1
982e5b
- Update to 1.8.1
982e5b
982e5b
* Fri Sep 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.0-2
982e5b
- Disable platform python on old releases
982e5b
982e5b
* Wed Aug 23 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.0-1
982e5b
- Update to 1.8.0
982e5b
982e5b
* Fri Aug 18 2017 Tomas Orsava <torsava@redhat.com> - 1.7.20-9
982e5b
- Added Patch 0 to fix a tearDown failure in the test suite
982e5b
982e5b
* Thu Aug 10 2017 Petr Viktorin <pviktori@redhat.com> - 1.7.20-8
982e5b
- Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
982e5b
982e5b
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-7
982e5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
982e5b
982e5b
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-6
982e5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
982e5b
982e5b
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-5
982e5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
982e5b
982e5b
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.7.20-4
982e5b
- Enable tests
982e5b
982e5b
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.7.20-3
982e5b
- Rebuild for Python 3.6
982e5b
- Disable tests for now
982e5b
982e5b
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.7.20-2
982e5b
- Rebuild for gpgme 1.18
982e5b
982e5b
* Thu Aug 25 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.20-1
982e5b
- Tests: Disable test_download_packages_with_resume_02 test
982e5b
- Update build utils to match new fedora spec schema
982e5b
982e5b
* Wed Aug 24 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.19-1
982e5b
- Add yumrecord substitution mechanism (mluscon)
982e5b
- Fix a memory leak in signature verification (cwalters)
982e5b
982e5b
* Tue Aug 09 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.18-4
982e5b
- Add %%{?system_python_abi}
982e5b
- Trim ton of changelog
982e5b
982e5b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.18-3
982e5b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
982e5b
982e5b
* Thu Apr 07 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.18-2
982e5b
- Adopt to new packaging guidelines
982e5b
- Cleanups in spec file
982e5b
982e5b
* Fri Mar  4 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.18-1
982e5b
- Add new option LRO_FTPUSEEPSV
982e5b
- Update AUTHORS
982e5b
- downloader prepare_next_transfer(): simplify long line
982e5b
- downloader prepare_next_transfer(): add missing error check
982e5b
- downloader prepare_next_transfer(): cleanup error path
982e5b
- downloader prepare_next_transfer() - fix memory leak on error path (Alan Jenkins)
982e5b
- handle: Don't use proxy cache for downloads of metalink/mirrorlist
982e5b
- handle: Don't set CURLOPT_HTTPHEADER into curl handle immediately when specified
982e5b
- downloader: Implement logic for no_cache param in LrDownloadTarget (RhBug: 1297762)
982e5b
- Add no_cache param to LrDownloadTarget and lr_downloadtarget_new()
982e5b
- New test: always try to download from the fastest mirror (Alexander Todorov)
982e5b
- Doc: Fixed minor doc typo (Philippe Ombredanne)
982e5b
- Doc: Other updates
982e5b
- Doc: Update default values in doc to reflect reality