583d09
%global gitrev d970c44
583d09
# gitrev is output of: git rev-parse --short HEAD
583d09
583d09
%if 0%{?rhel} != 0 && 0%{?rhel} <= 7
583d09
# Do not build bindings for python3 for RHEL <= 7
583d09
%bcond_with python3
583d09
# python-flask is not in RHEL7
583d09
%bcond_with tests
583d09
%else
583d09
%bcond_without python3
583d09
%bcond_without tests
583d09
%endif
583d09
583d09
Name:           librepo
583d09
Version:        1.7.14
583d09
Release:        3.atomic.0%{?dist}
583d09
Summary:        Repodata downloading library
583d09
583d09
Group:          System Environment/Libraries
583d09
License:        LGPLv2+
583d09
URL:            https://github.com/Tojaj/librepo
583d09
# Use the following commands to generate the tarball:
583d09
#  git clone https://github.com/Tojaj/librepo.git
583d09
#  cd librepo
583d09
#  utils/make_tarball.sh %{gitrev}
583d09
Source0:        librepo-%{gitrev}.tar.xz
583d09
583d09
BuildRequires:  check-devel
583d09
BuildRequires:  cmake
583d09
BuildRequires:  doxygen
583d09
BuildRequires:  expat-devel
583d09
BuildRequires:  glib2-devel >= 2.22.0
583d09
BuildRequires:  gpgme-devel
583d09
BuildRequires:  libattr-devel
583d09
BuildRequires:  libcurl-devel >= 7.19.0
583d09
BuildRequires:  openssl-devel
583d09
583d09
# prevent provides from nonstandard paths:
583d09
%filter_provides_in %{python_sitearch}/.*\.so$
583d09
%if %{with python3}
583d09
%filter_provides_in %{python3_sitearch}/.*\.so$
583d09
%endif
583d09
%filter_setup
583d09
583d09
%description
583d09
A library providing C and Python (libcURL like) API to downloading repository
583d09
metadata.
583d09
583d09
%package devel
583d09
Summary:        Repodata downloading library
583d09
Group:          Development/Libraries
583d09
Requires:       %{name}%{?_isa} = %{version}-%{release}
583d09
583d09
%description devel
583d09
Development files for librepo.
583d09
583d09
%package -n python-librepo
583d09
Summary:        Python bindings for the librepo library
583d09
Group:          Development/Languages
583d09
BuildRequires:  pygpgme
583d09
BuildRequires:  python2-devel
583d09
%if %{with tests}
583d09
BuildRequires:  python-flask
583d09
BuildRequires:  python-nose
583d09
%endif
583d09
BuildRequires:  python-sphinx
583d09
BuildRequires:  pyxattr
583d09
Requires:       %{name}%{?_isa} = %{version}-%{release}
583d09
583d09
%description -n python-librepo
583d09
Python bindings for the librepo library.
583d09
583d09
%if %{with python3}
583d09
%package -n python3-librepo
583d09
Summary:        Python 3 bindings for the librepo library
583d09
Group:          Development/Languages
583d09
BuildRequires:  python3-pygpgme
583d09
BuildRequires:  python3-devel
583d09
BuildRequires:  python3-flask
583d09
BuildRequires:  python3-nose
583d09
BuildRequires:  python3-sphinx
583d09
BuildRequires:  python3-pyxattr
583d09
Requires:       %{name}%{?_isa} = %{version}-%{release}
583d09
583d09
%description -n python3-librepo
583d09
Python 3 bindings for the librepo library.
583d09
%endif
583d09
583d09
%prep
583d09
%setup -q -n librepo
583d09
583d09
%if %{with python3}
583d09
rm -rf py3
583d09
mkdir ../py3
583d09
cp -a . ../py3/
583d09
mv ../py3 ./
583d09
%endif
583d09
583d09
%build
583d09
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
583d09
make %{?_smp_mflags}
583d09
583d09
%if %{with python3}
583d09
pushd py3
583d09
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_DESIRED:str=3 .
583d09
make %{?_smp_mflags}
583d09
popd
583d09
%endif
583d09
583d09
%check
583d09
%if %{with tests}
583d09
make ARGS="-V" test
583d09
583d09
%if %{with python3}
583d09
pushd py3
583d09
make ARGS="-V" test
583d09
popd
583d09
%endif
583d09
%endif
583d09
583d09
%install
583d09
make install DESTDIR=$RPM_BUILD_ROOT
583d09
%if %{with python3}
583d09
pushd py3
583d09
make install DESTDIR=$RPM_BUILD_ROOT
583d09
popd
583d09
%endif
583d09
583d09
%post -p /sbin/ldconfig
583d09
583d09
%postun -p /sbin/ldconfig
583d09
583d09
%files
583d09
%doc COPYING README.md
583d09
%{_libdir}/librepo.so.*
583d09
583d09
%files devel
583d09
%{_libdir}/librepo.so
583d09
%{_libdir}/pkgconfig/librepo.pc
583d09
%{_includedir}/librepo/
583d09
583d09
%files -n python-librepo
583d09
%{python_sitearch}/librepo/
583d09
583d09
%if %{with python3}
583d09
%files -n python3-librepo
583d09
%{python3_sitearch}/
583d09
%endif
583d09
583d09
%changelog
583d09
* Fri May 15 2015 Colin Walters <walters@redhat.com> - 1.7.14-3.atomic.0
583d09
- First build for Atomic
583d09
583d09
* Tue Apr 14 2015 Colin Walters <walters@redhat.com> - 1.7.14-2
583d09
- Disable tests and drop python-flask build dependency on RHEL7, as
583d09
  it is not in the core
583d09
583d09
* Wed Feb   25 2015 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.14-2
583d09
- compat: fix ck_assert_msg() segfault in rhel-7
583d09
583d09
* Wed Feb   25 2015 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.14-1
583d09
- tests: Use g_assert_cmpuint instead of ck_assert_uint_eq (Pullrequest #43)
583d09
- Add LRO_OFFLINE
583d09
- Python: Handle: Raise ValueError instead of TypeError when an unknown option is specified
583d09
- Python: Result: Use ValueError instead of TypeError when an unknown option value is specified
583d09
- Add LR_VERSION constant with version string
583d09
- python: Import contants from C librepo module in a loop
583d09
- repoconf: Add support for failover and skip_if_unavailable options
583d09
- handle: Change of LRO_LOCAL causes invalidation of internal mirrorlist (related to RhBug: 1188600)
583d09
- Load local mirrorlists when LRO_LOCAL is on (related to RhBug: 1188600)
583d09
- util: Add lr_is_local_path()
583d09
- New module repoconf for reading *.repo files
583d09
- Add LRO_HTTPHEADER option (RhBug: 1181123)
583d09
583d09
* Fri Jan   23 2015 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.13-1
583d09
- Fix ABI compatibility (RhBug: 1185180)
583d09
- fastestmirror: Add LRO_FASTESTMIRRORTIMEOUT option
583d09
- downloader: Move broken mirror at the end of the list of mirrors (RhBug: 1183998)
583d09
- Make building tests and docs optional
583d09
- librepo: Don't download remote mirrorlist/metalink when LRO_LOCAL is specified (Resolves #41)
583d09
583d09
* Fri Jan   16 2015 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.12-1
583d09
- downloader: Allow max one resume + nicer message if xattr cannot be set (RhBug: 1130685)
583d09
- downloader: Resume only files that were originaly downloaded by Librepo (RhBug: 1130685)
583d09
- downloader: Show also calculated checksums in error message about bad checksum
583d09
- Python: Return all strings in unicode
583d09
583d09
* Mon Dec   22 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.11-2
583d09
- Make tests port agnostic
583d09
583d09
* Fri Dec   19 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.11-1
583d09
- Substitute vars in URL in the lr_downloadtarget_new()
583d09
- New module repoconf for reading of *.repo files
583d09
- Add LRE_VALUE code + LR_REPOCONF_ERROR error domain
583d09
- Fail if gpgcheck enabled but repomd.xml signature is not available
583d09
- Support for RHEL6
583d09
- Add LRO_GNUPGHOMEDIR option
583d09
- Refactoring to prevent RhBug: 1144741
583d09
- fastest_mirror: Use <0.0 (-1.0) instead of DBL_MAX when a connection time wasn't measured
583d09
- Add sanity checks in order to avoid bugs like: 1166533, 1160087
583d09
- Refactoring
583d09
583d09
* Mon Dec   1 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.10-1
583d09
- repomd: Add error reporting support to lr_yum_repomd_get_highest_timestamp()
583d09
  (RhBug: 1149436)
583d09
583d09
* Thu Nov  20 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.9-1
583d09
- handle: Fix memory leak when looking for local metalink/mirrorlist (Issue #33)
583d09
- Return -1 for LRR_YUM_TIMESTAMP if no repomd is available
583d09
- Use CURLOPT_ERRORBUFFER to get more useful error messages
583d09
- repoutil_yum: lr_repoutil_yum_check_repo: fix path handling
583d09
583d09
* Wed Sep  24 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.7-1
583d09
- Initialize struct sigaction vars correctly (RhBug: 1145656 )
583d09
583d09
* Tue Aug  12 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.6-1
583d09
- New option LRO_ADAPTIVEMIRRORSORTING
583d09
- Increase limits to make librepo more robust (RhBug: 1124349)
583d09
- New option LRO_ALLOWEDMIRRORFAILURES
583d09
- Refactoring
583d09
- Default value of LRO_MAXDOWNLOADSPERMIRROR changed from 2 to 3
583d09
583d09
* Tue Jul  8 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.5-1
583d09
- accepts unicoded destination as UTF-8 string (Related: RhBug:1108908)
583d09
- downloader: Do not print debug message about preparing internal mirror list
583d09
  if no internal mirror is available
583d09
- fastestmirror: subtract name lookup (dns) time from plain connect time
583d09
- fastestmirror: Small refactoring
583d09
583d09
* Thu Jun 26 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.4-3
583d09
- Increase default value of LRO_LOWSPEEDTIME from 10 to 30 (RhBug: 1109189)
583d09
583d09
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.4-2
583d09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
583d09
583d09
* Mon Jun   2 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.4-1
583d09
- Add LRO_IPRESOLVE option to set a kind of IP addresses to use when resolving host names
583d09
- Relicenced from GPLv2 to LGPLv2+
583d09
- error mesage is in unicode (RhBug:1096452)
583d09
583d09
* Tue May   6 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.3-1
583d09
- Fix some issues which were found by coverity scan
583d09
- Add missing support for Handle Mirror Failure Callback (hmfcb)
583d09
  while downloading repomd.xml (related to RhBug: 1093014)
583d09
- Add LRO_SSLVERIFYPEER and LRO_SSLVERIFYHOST options (RhBug: 1093014)
583d09
583d09
* Wed Apr  23 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.2-1
583d09
- Fix segfault in headercb if only base_url and no mirrolist is used (RhBug: 1090325)
583d09
- Set environmental variable LIBREPO_DEBUG enables librepo debug output to stderr
583d09
583d09
* Mon Apr   7 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.1-1
583d09
- Don't try to call cb if no cb is set (RhBug: 1083659)
583d09
583d09
* Mon Mar  31 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.0-1
583d09
- Support for xml:base tag in repomd.xml.
583d09
- Downloader: If checksums don't match, include the expected values and types
583d09
  in the error message.
583d09
- Handle: Add LRO_HMFCB and LRI_HMFCB options.
583d09
- API CHANGE: lr_download_single_cb() new param mfcb (LrMirrorFailureCb)
583d09
- API CHANGE: Removed cbdata param from lr_download_single_cb(). Use specific
583d09
  data for each target.
583d09
- New callback LrHandleMirrorFailureCb
583d09
- Python doc update (Check it out: http://tojaj.github.io/librepo/)
583d09
583d09
* Thu Mar 27 2014 Matěj Cepl <mcepl@redhat.com> - 1.6.0-2
583d09
- Make building of python3 components conditional
583d09
- replace all TABs with spaces
583d09
583d09
* Thu Feb  20 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.6.0-1
583d09
- Small API change: End callback now must return integer and not void)
583d09
- downloader: Check for the lr_interrupt regularly
583d09
- Handle exceptions in python callbacks as return values (RhBug: 1066321)
583d09
- Support for byterange of download (RhBug: 1058777)
583d09
583d09
* Tue Jan  28 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.2-2
583d09
- Ignore rsyc mirrors silently.
583d09
583d09
* Thu Jan  16 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.2-1
583d09
- Better download resume logic
583d09
583d09
* Fri Jan   3 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.1-1
583d09
-  Downloading: LRO_MAXSPEED has effect over whole downloading, it is not
583d09
   per target max speed anymore.
583d09
-  Sanitize progresscb (GitHub issue 24) (Thanks zde/zpavlas)
583d09
583d09
* Tue Dec  17 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.0-1
583d09
- Extend C example
583d09
- Add LRR_YUM_TIMESTAMP (GitHub issue #25)
583d09
- Close the correct file when using a metalink.xml file
583d09
- Add lr_check_packages()
583d09
- Enable checksum caching for already existing local packages
583d09
- Library: Call LR_PROGRESSCB with zeroized values, when total_to_download
583d09
  value is changed
583d09
- Skip fastestmirror detection of only one mirror is present
583d09
583d09
* Tue Nov  19 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.4.0-1
583d09
- Add LRO_FASTESTMIRRORCB
583d09
- Add LRO_LOWSPEEDTIME and LRO_LOWSPEEDLIMIT options. (RhBug: 1028444)
583d09
- Default connection timeout changed to 30sec instead of 300sec.
583d09
- unittests: Fix expired key (RhBug: 1031825)
583d09
583d09
* Thu Oct  31 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.3.0-1
583d09
- Some CURL error codes should be considered as fatal (RhBug: 1022994)
583d09
- fastestmirror: Add support for cache - New options: LRO_FASTESTMIRRORCACHE
583d09
  and LRO_FASTESTMIRRORMAXAGE
583d09
- fastestmirror: For download_packages() do fastestmirror detection for
583d09
  all handles in one shot
583d09
- Use <mm0:alternates> during repomd.xml download (RhBug: 1019103)
583d09
- Don't perform fastest mirror test if file already exists locally.
583d09
- fastestmirror.h:26:24: fatal error: mirrorlist.h: No such file
583d09
  or directory (#1018006)
583d09
583d09
* Mon Oct  07 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.1-1
583d09
- Open fd right before downloading and close them immediately after
583d09
  download. (RhBug: 1015957)
583d09
583d09
* Thu Oct  03 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-2
583d09
- Add target for Python 3 to the spec file
583d09
- Fix few python3 related issues
583d09
583d09
* Tue Oct  01 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-1
583d09
- Better detection of bad content of repomd.xml
583d09
- Close files properly (RhBug: 1012290)
583d09
- Add fastestmirror module + LRO_FASTESTMIRROR option
583d09
- downloader: Fix uninitialized total to download variable (GitHub issue 22)
583d09
- Add LRO_MIRRORLISTURL and LRO_METALINKURL. LRO_MIRRORLIST is deprecated.
583d09
- Few other small fixes
583d09
583d09
* Mon Sep  16 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.1.0-1
583d09
- New librepo.download_url(url, fd, handle=None) function in Python API.
583d09
- Low-level downloader interface is now public in C API.
583d09
- Small change of API lr_download_packages() and lr_packagetarget_new
583d09
  functions.
583d09
- In python download_packages() changed from method of Handle() to
583d09
  librepo module function without handle param.
583d09
  Param handle was moved to the PackageTarget class that takes handle
583d09
  as a optional param during constrution.
583d09
- Implements checking size of downloaded files (expectedsize
583d09
  param of downloading functions).
583d09
583d09
* Wed Aug  28 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.0.0-1
583d09
- Huge API changes
583d09
- Library starts to use GLib2
583d09
- Support for parallel downloads
583d09
- Better error reporting
583d09
- More GLib2 style C api
583d09
- More descriptive Python exception messages
583d09
- A lot of bugfixes
583d09
- Updated examples
583d09
583d09
* Thu Jul  25 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-3
583d09
- python: Raise exception if handle has bad repo type configured
583d09
  (RhBug: 988013)
583d09
583d09
* Mon Jul  22 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-2
583d09
- Bump version in versioh.h to 0.0.5
583d09
- Python: Fix Handle.mirrors to return empty list instead of None if
583d09
  no mirrors available (RhBug: 986228)
583d09
583d09
* Wed Jul  17 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-1
583d09
- Return LRE_ALREADYDOWNLOADED if the file exists even if no resume
583d09
  is specified. (GitHub issue 15)
583d09
- downloadtarget: New module, future replacement for curltarget module.
583d09
- Librepo migrated to lr_LrMirrorlist from lr_InternalMirrorlist.
583d09
- test: Run python unittest verbosely
583d09
- lrmirrorlis: New module. GLib2 ready replacement for the internal_mirrorlist
583d09
  module.
583d09
- package_downloader: Add LRE_ALREADYDOWNLOADED rc code. (GitHub issue 15)
583d09
- handle: After set python SIGINT handler back, check if librepo was
583d09
  interrupted by CTRL+C. (RhBug: 977803)
583d09
- cmake: Set required python version to 2. (GitHub issue 10)
583d09
- Fix missing VAR substitution for mirrorlist. (GitHub issue 11)
583d09
- cmake: Add FindXattr module.
583d09
- Add support for caching checksum as extended file attribute. (GitHub issue 8)
583d09
- util: Add lr_asprintf().
583d09
- util: Add lr_vasprintf().
583d09
- handle: Fix funky logic in internal error handling. (GitHub issue 9)
583d09
- Add lr_yum_repomd_get_age() function. (GitHub issue 6)
583d09
- test: Add test for LR_VERSION_CHECK macro.
583d09
- Add a LR_VERSION_CHECK macro
583d09
583d09
* Wed Jun 12 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.4-2
583d09
- examples: Add C example of usage.
583d09
- Fix predefined lists in types.h (GitHub issue 4). Thank you hughsie
583d09
- Add LRO_VARSUB and LRI_VARSUB. (RhBug: 965131)
583d09
- py: Change reported name from _librepo.Exception to librepo.LibrepoException
583d09
583d09
* Thu May  2 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.4-1
583d09
- Fix type conversion long long -> long.(RhBug: 957656)
583d09
- python: Handle.perfrom() could be called without Result().
583d09
- Add LRI_MAXMIRRORTRIES option. (RhBug: 954736)
583d09
- py: unittests: Add metalink.xml and mirrorlist files. (RhBug: 954294)
583d09
- Fix double free and memory leak. (RhBug: 954294)
583d09
- New option LRO_MAXMIRRORTRIES. (RhBug: 949517)
583d09
- LRI_MIRRORS return only content of mirrorlist file (without LRO_URL as first item).
583d09
- Add LRO_FETCHMIRRORS option.
583d09
583d09
* Mon Apr  8 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-3.git720d68d
583d09
- Add CURL_GLOBAL_ACK_EINTR flag to curl init.
583d09
- Proper multi handle cleanup. (RhBug: 947388)
583d09
- Support for read 'useragent' attr. (RhBug: 947346)
583d09
- Add valgrind supress files. (RhBug: 923214)
583d09
- Make python bindings interruptible (LRO_INTERRUPTIBLE) (RhBug: 919125)
583d09
- Add LRI_MIRRORS option (RhBug: 923198)
583d09
- Add LRI_METALINK option. (BzBug: 947767)
583d09
583d09
* Mon Mar 18 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-2.gitb3c3323
583d09
- py: Use standard python exception while accessing bad attrs. (RhBug: 920673)
583d09
- Default mask for newly created files is 0666. (RhBug: 922557)
583d09
583d09
* Thu Mar 14 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-1.git714e828
583d09
- Add LRI_PROGRESSCB and LRI_PROGRESSDATA options (RhBug: 919123)
583d09
- Bindings: More pythonic operations with handle's attributes (RhBug: 919124)
583d09
583d09
* Tue Oct  9 2012 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.1-1.gitc69642e
583d09
- Initial package