1810190
%global libcurl_version 7.28.0
1810190
db4b133
%define __cmake_in_source_build 1
db4b133
Igor Gnatenko 98638e6
%if 0%{?rhel} && 0%{?rhel} <= 7
8ac931f
# Do not build bindings for python3 for RHEL <= 7
8ac931f
%bcond_with python3
000d698
# python-flask is not in RHEL7
f2cd372
%bcond_with pythontests
8ac931f
%else
8ac931f
%bcond_without python3
f2cd372
%bcond_without pythontests
8ac931f
%endif
72b8cea
4c40ec3
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
2c9b241
# Do not build bindings for python2 for RHEL > 7 and Fedora > 29
72b8cea
%bcond_with python2
72b8cea
%else
72b8cea
%bcond_without python2
72b8cea
%endif
72b8cea
2c9b241
%if 0%{?rhel}
2c9b241
%bcond_with zchunk
2c9b241
%else
2c9b241
%bcond_without zchunk
2c9b241
%endif
72b8cea
4ffba63
%global dnf_conflict 2.8.8
8ac931f
8ac931f
Name:           librepo
23a1e54
Version:        1.12.1
23a1e54
Release:        1%{?dist}
8ac931f
Summary:        Repodata downloading library
8ac931f
97216d4
License:        LGPLv2+
Igor Gnatenko 98638e6
URL:            https://github.com/rpm-software-management/librepo
3717051
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
1801697
5950c89
BuildRequires: make
8ac931f
BuildRequires:  cmake
Igor Gnatenko 98638e6
BuildRequires:  gcc
Igor Gnatenko 98638e6
BuildRequires:  check-devel
8ac931f
BuildRequires:  doxygen
ccfe185
BuildRequires:  pkgconfig(glib-2.0)
8ac931f
BuildRequires:  gpgme-devel
8ac931f
BuildRequires:  libattr-devel
1810190
BuildRequires:  libcurl-devel >= %{libcurl_version}
ccfe185
BuildRequires:  pkgconfig(libxml-2.0)
ccfe185
BuildRequires:  pkgconfig(libcrypto)
ccfe185
BuildRequires:  pkgconfig(openssl)
2c9b241
%if %{with zchunk}
2c9b241
BuildRequires:  pkgconfig(zck) >= 0.9.11
2c9b241
%endif
1810190
Requires:       libcurl%{?_isa} >= %{libcurl_version}
e8713e2
e989a8a
%description
e989a8a
A library providing C and Python (libcURL like) API to downloading repository
e989a8a
metadata.
e989a8a
e989a8a
%package devel
8ac931f
Summary:        Repodata downloading library
8ac931f
Requires:       %{name}%{?_isa} = %{version}-%{release}
e989a8a
e989a8a
%description devel
e989a8a
Development files for librepo.
e989a8a
72b8cea
%if %{with python2}
Igor Gnatenko 98638e6
%package -n python2-%{name}
8ac931f
Summary:        Python bindings for the librepo library
Igor Gnatenko 98638e6
%{?python_provide:%python_provide python2-%{name}}
4ffba63
%if 0%{?rhel} && 0%{?rhel} <= 7
4ffba63
BuildRequires:  python-sphinx
4ffba63
%else
4ffba63
BuildRequires:  python2-sphinx
000d698
%endif
4ffba63
BuildRequires:  python2-devel
f2cd372
%if %{with pythontests}
f2cd372
BuildRequires:  python2-flask
f2cd372
BuildRequires:  python2-nose
1bbb0bd
BuildRequires:  python2-requests
f2cd372
%if (0%{?rhel} && 0%{?rhel} <= 7)
4c0284f
BuildRequires:  pyxattr
f2cd372
BuildRequires:  pygpgme
4c0284f
%else
b00fe94
BuildRequires:  python2-pyxattr
f2cd372
BuildRequires:  python2-gpg
4c0284f
%endif
df27a54
%endif
df27a54
# endif with pythontests
8ac931f
Requires:       %{name}%{?_isa} = %{version}-%{release}
4ffba63
Conflicts:      python2-dnf < %{dnf_conflict}
e989a8a
Igor Gnatenko 98638e6
%description -n python2-%{name}
Igor Gnatenko 98638e6
Python 2 bindings for the librepo library.
72b8cea
%endif
e989a8a
8ac931f
%if %{with python3}
Igor Gnatenko 98638e6
%package -n python3-%{name}
e8713e2
Summary:        Python 3 bindings for the librepo library
Igor Gnatenko 98638e6
%{?python_provide:%python_provide python3-%{name}}
e8713e2
BuildRequires:  python3-devel
f2cd372
%if %{with pythontests}
f2cd372
BuildRequires:  python3-gpg
e8713e2
BuildRequires:  python3-flask
e8713e2
BuildRequires:  python3-nose
f2cd372
BuildRequires:  python3-pyxattr
1bbb0bd
BuildRequires:  python3-requests
Igor Gnatenko 98638e6
%endif
e8713e2
BuildRequires:  python3-sphinx
e8713e2
Requires:       %{name}%{?_isa} = %{version}-%{release}
4ffba63
# Obsoletes Fedora 27 package
52e93c8
Obsoletes:      platform-python-%{name} < %{version}-%{release}
4ffba63
Conflicts:      python3-dnf < %{dnf_conflict}
e8713e2
Igor Gnatenko 98638e6
%description -n python3-%{name}
e8713e2
Python 3 bindings for the librepo library.
8ac931f
%endif
e8713e2
e989a8a
%prep
3717051
%autosetup -p1
e989a8a
72b8cea
mkdir build-py2
72b8cea
mkdir build-py3
e8713e2
e989a8a
%build
72b8cea
%if %{with python2}
72b8cea
pushd build-py2
f2cd372
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} ..
Igor Gnatenko 98638e6
  %make_build
Igor Gnatenko 98638e6
popd
72b8cea
%endif
e989a8a
8ac931f
%if %{with python3}
Igor Gnatenko 98638e6
pushd build-py3
f2cd372
  %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} %{!?with_zchunk:-DWITH_ZCHUNK=OFF} -DENABLE_PYTHON_TESTS=%{?with_pythontests:ON}%{!?with_pythontests:OFF} ..
Igor Gnatenko 98638e6
  %make_build
e8713e2
popd
8ac931f
%endif
e8713e2
Igor Gnatenko 98638e6
%check
72b8cea
%if %{with python2}
72b8cea
pushd build-py2
13c4f6d
  #ctest -VV
13c4f6d
  make ARGS="-V" test
Igor Gnatenko 98638e6
popd
72b8cea
%endif
e989a8a
8ac931f
%if %{with python3}
Igor Gnatenko 98638e6
pushd build-py3
13c4f6d
  #ctest -VV
13c4f6d
  make ARGS="-V" test
e8713e2
popd
7ab611b
%endif
e8713e2
e989a8a
%install
72b8cea
%if %{with python2}
72b8cea
pushd build-py2
Igor Gnatenko 98638e6
  %make_install
Igor Gnatenko 98638e6
popd
72b8cea
%endif
72b8cea
8ac931f
%if %{with python3}
Igor Gnatenko 98638e6
pushd build-py3
Igor Gnatenko 98638e6
  %make_install
e8713e2
popd
8ac931f
%endif
e989a8a
07aca69
%if 0%{?rhel} && 0%{?rhel} <= 7
4ffba63
%post -p /sbin/ldconfig
4ffba63
%postun -p /sbin/ldconfig
07aca69
%else
07aca69
%ldconfig_scriptlets
07aca69
%endif
e989a8a
e989a8a
%files
Igor Gnatenko 98638e6
%license COPYING
Igor Gnatenko 98638e6
%doc README.md
Igor Gnatenko 98638e6
%{_libdir}/%{name}.so.*
e989a8a
e989a8a
%files devel
Igor Gnatenko 98638e6
%{_libdir}/%{name}.so
Igor Gnatenko 98638e6
%{_libdir}/pkgconfig/%{name}.pc
Igor Gnatenko 98638e6
%{_includedir}/%{name}/
e989a8a
72b8cea
%if %{with python2}
Igor Gnatenko 98638e6
%files -n python2-%{name}
Igor Gnatenko 98638e6
%{python2_sitearch}/%{name}/
72b8cea
%endif
e989a8a
8ac931f
%if %{with python3}
Igor Gnatenko 98638e6
%files -n python3-%{name}
Igor Gnatenko 98638e6
%{python3_sitearch}/%{name}/
8ac931f
%endif
e8713e2
e989a8a
%changelog
23a1e54
* Wed Oct 07 2020 Nicola Sella <nsella@redhat.com> - 1.12.1-1
23a1e54
* Update to 1.12.1
23a1e54
- Validate path read from repomd.xml (RhBug:1868639)
23a1e54
db4b133
* Fri Aug 07 2020 Nicola Sella <nsella@redhat.com> - 1.12.0-4
db4b133
spec: Fix building with new cmake macros
db4b133
3fadd75
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-3
3fadd75
- Second attempt - Rebuilt for
3fadd75
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
3fadd75
48496a0
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-2
48496a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
48496a0
df27a54
* Tue Jun 02 2020 Nicola Sella <nsella@redhat.com> - 1.12.0-1
df27a54
- Update to 1.12.0
df27a54
- Decode package URL when using for local filename (RhBug:1817130)
df27a54
- Fix memory leak in lr_download_metadata() and lr_yum_download_remote()
df27a54
- Download sources work when at least one of specified is working (RhBug:1775184)
df27a54
- Enable building on OSX
df27a54
3597628
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11.3-3
3597628
- Rebuilt for Python 3.9
3597628
166e07a
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11.3-2
166e07a
- Bootstrap for Python 3.9
166e07a
06d059c
* Wed Apr 01 2020 Ales Matej <amatej@fedoraproject.org> - 1.11.3-1
06d059c
- Update to 1.11.3
06d059c
- Prefer mirrorlist/metalink over baseurl (RhBug:1775184)
06d059c
5b935af
* Mon Feb 10 2020 Ales Matej <amatej@fedoraproject.org> - 1.11.1-4
5b935af
- Fix calling Python API without holding GIL (RhBug:1788918)
5b935af
Lukas Slebodnik 7193ef6
* Wed Feb 05 2020 Lukas Slebodnik <lslebodn@fedoraproject.org> - 1.11.1-3
Lukas Slebodnik 7193ef6
- Do not unref LrErr_Exception on exit (RhBug:1778854)
Lukas Slebodnik 7193ef6
8bcaf6c
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-2
8bcaf6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
8bcaf6c
b33a012
* Mon Dec 09 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.11.1-1
b33a012
- Update to 1.11.1
b33a012
- Create a directory for gpg sockets in /run/user/ (RhBug:1769831,1771012)
b33a012
3c20bd5
* Wed Nov 06 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.11.0-1
3c20bd5
- Update to 1.11.0
3c20bd5
- Retry mirrorlist/metalink downloads several times (RhBug:1741931)
3c20bd5
- Improve variable substitutions in URLs and add ${variable} support
3c20bd5
b83597d
* Tue Oct 01 2019 Ales Matej <amatej@redhat.com> - 1.10.6-1
b83597d
- Update to 1.10.6
b83597d
- Imporove handling of xattr to re-download damadged files (RhBug:1690894)
b83597d
- Rephrase repository GPG check error message (RhBug:1741442)
b83597d
- Add sleep before next try when all mirrors were tried (RhBug:1741931)
b83597d
- Raise logging level of error messages (RhBug:1737709)
b83597d
a3aa5d3
* Sun Aug 18 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.5-2
a3aa5d3
- Rebuilt for Python 3.8
a3aa5d3
b7f1e55
* Mon Jul 29 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.10.5-1
b7f1e55
- Update to 1.10.5
b7f1e55
- Exit gpg-agent after repokey import (RhBug:1650266)
b7f1e55
- Handle webservers that don't support ranges when downloading zck
b7f1e55
- Define LRO_SUPPORTS_CACHEDIR only with zchunk (RhBug:1726141)
b7f1e55
- Allow to use mirrors multiple times for a target (RhBug:1678588)
b7f1e55
- Allow to try baseurl multiple times (RhBug:1678588)
b7f1e55
d916149
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.2-3
d916149
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d916149
79c4077
* Thu May 23 2019 Jonathan Dieter <jdieter@gmail.com> - 1.10.2-2
79c4077
- Add upstream patch to make sure to check next transfer if current zck
79c4077
  transfer already exists
79c4077
1bbb0bd
* Mon May 20 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.10.2-1
1bbb0bd
- Update to 1.10.2
1bbb0bd
- Add an option to preserve timestamps of the downloaded files (RhBug:1688537)
1bbb0bd
- librepo: append the '?' part of repo URL after the path
1bbb0bd
- Fix librepo isn't able to load zchunk files from next server on failure
1bbb0bd
0cc00ce
* Tue Apr 02 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.9.6-2
0cc00ce
- Backport patch to fix segfault when using zchunk metadata
0cc00ce
1810190
* Wed Mar 27 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.9.6-1
1810190
- Update to 1.9.6
1810190
- Fix memory leaks
1810190
- Fix CPU usage when downloading packages (RhBug:1691856)
1810190
f2cd372
* Mon Mar 11 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.9.5-1
f2cd372
- Update to 1.9.5
f2cd372
- Reduce download delays
f2cd372
2c9b241
* Wed Feb 13 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 1.9.4-1
2c9b241
- Update to 1.9.4-1
2c9b241
- Add zchunk support
2c9b241
4889a08
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.2-3
4889a08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4889a08
4c40ec3
* Mon Jan 28 2019 Miro Hrončok <mhroncok@redhat.com> - 1.9.2-2
4c40ec3
- Subpackage python2-librepo has been removed
4c40ec3
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
4c40ec3
7896866
* Tue Sep 25 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.2-1
7896866
- Update to 1.9.2
7896866
- Fix major performance regression with libcurl-7.61.1
7896866
72b8cea
* Mon Aug 13 2018 Daniel Mach <dmach@redhat.com> - 1.9.1-1
72b8cea
- Update to 1.9.1
72b8cea
4b9ace7
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
4b9ace7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
4b9ace7
4ed6693
* Fri Jun 29 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.0-3
4ed6693
- Rebuilt for Python 3.7
4ed6693
07aca69
* Tue Jun 26 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-2
07aca69
- Fix ldconfig_scriptlets once more
07aca69
07aca69
* Tue Jun 26 2018 Jaroslav Mracek <jmracek@redhat.com> - 1.9.0-1
4ffba63
- Update to 1.9.0
4ffba63
1ede9da
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-9
1ede9da
- Rebuilt for Python 3.7
1ede9da
079b370
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-8
079b370
- Bootstrap for Python 3.7
079b370
4c0284f
* Thu Feb 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-7
4c0284f
- Add if conditionals around pyxattr
4c0284f
b00fe94
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.8.1-6
b00fe94
- Update Python 2 dependency declarations to new packaging standards
b00fe94
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
b00fe94
a892345
* Wed Jan 31 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-5
a892345
- Switch to %%ldconfig_scriptlets
a892345
52e93c8
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-4
52e93c8
- Use better Obsoletes for platform-python
52e93c8
e2bd7bd
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-3
e2bd7bd
- Fix typo in Obsoletes
e2bd7bd
7ab611b
* Fri Nov 03 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-2
7ab611b
- Remove platform-python subpackage
7ab611b
0dc2ec2
* Fri Sep 15 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.1-1
0dc2ec2
- Update to 1.8.1
0dc2ec2
c0e6847
* Fri Sep 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.0-2
c0e6847
- Disable platform python on old releases
c0e6847
3717051
* Wed Aug 23 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.8.0-1
3717051
- Update to 1.8.0
3717051
1801697
* Fri Aug 18 2017 Tomas Orsava <torsava@redhat.com> - 1.7.20-9
1801697
- Added Patch 0 to fix a tearDown failure in the test suite
1801697
6580f3c
* Thu Aug 10 2017 Petr Viktorin <pviktori@redhat.com> - 1.7.20-8
6580f3c
- Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
6580f3c
290194b
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-7
290194b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
290194b
928d541
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-6
928d541
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
928d541
b2f5e6c
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.20-5
b2f5e6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b2f5e6c
2400105
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.7.20-4
2400105
- Enable tests
2400105
372bbc1
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.7.20-3
372bbc1
- Rebuild for Python 3.6
372bbc1
- Disable tests for now
372bbc1
df92b7b
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.7.20-2
df92b7b
- Rebuild for gpgme 1.18
df92b7b
13c4f6d
* Thu Aug 25 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.20-1
13c4f6d
- Tests: Disable test_download_packages_with_resume_02 test
13c4f6d
- Update build utils to match new fedora spec schema
13c4f6d
acd76f1
* Wed Aug 24 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.19-1
acd76f1
- Add yumrecord substitution mechanism (mluscon)
acd76f1
- Fix a memory leak in signature verification (cwalters)
acd76f1
Igor Gnatenko 72804d3
* Tue Aug 09 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.18-4
Igor Gnatenko 72804d3
- Add %%{?system_python_abi}
Igor Gnatenko 72804d3
- Trim ton of changelog
Igor Gnatenko 72804d3
8d6e572
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.18-3
8d6e572
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
8d6e572
Igor Gnatenko 98638e6
* Thu Apr 07 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.18-2
Igor Gnatenko 98638e6
- Adopt to new packaging guidelines
Igor Gnatenko 98638e6
- Cleanups in spec file
Igor Gnatenko 98638e6
19670f5
* Fri Mar  4 2016 Tomas Mlcoch <tmlcoch@redhat.com> - 1.7.18-1
19670f5
- Add new option LRO_FTPUSEEPSV
19670f5
- Update AUTHORS
19670f5
- downloader prepare_next_transfer(): simplify long line
19670f5
- downloader prepare_next_transfer(): add missing error check
19670f5
- downloader prepare_next_transfer(): cleanup error path
19670f5
- downloader prepare_next_transfer() - fix memory leak on error path (Alan Jenkins)
19670f5
- handle: Don't use proxy cache for downloads of metalink/mirrorlist
19670f5
- handle: Don't set CURLOPT_HTTPHEADER into curl handle immediately when specified
19670f5
- downloader: Implement logic for no_cache param in LrDownloadTarget (RhBug: 1297762)
19670f5
- Add no_cache param to LrDownloadTarget and lr_downloadtarget_new()
19670f5
- New test: always try to download from the fastest mirror (Alexander Todorov)
19670f5
- Doc: Fixed minor doc typo (Philippe Ombredanne)
19670f5
- Doc: Other updates
19670f5
- Doc: Update default values in doc to reflect reality