63e4893
%global gitrev cebcef0
2f1b90a
# gitrev is output of: git rev-parse --short HEAD
2f1b90a
8ac931f
%if 0%{?rhel} != 0 && 0%{?rhel} <= 7
8ac931f
# Do not build bindings for python3 for RHEL <= 7
8ac931f
%bcond_with python3
8ac931f
%else
8ac931f
%bcond_without python3
8ac931f
%endif
8ac931f
8ac931f
Name:           librepo
63e4893
Version:        1.7.2
8ac931f
Release:        1%{?dist}
8ac931f
Summary:        Repodata downloading library
8ac931f
8ac931f
Group:          System Environment/Libraries
8ac931f
License:        GPLv2+
8ac931f
URL:            https://github.com/Tojaj/librepo
e989a8a
# Use the following commands to generate the tarball:
e989a8a
#  git clone https://github.com/Tojaj/librepo.git
e989a8a
#  cd librepo
2f1b90a
#  utils/make_tarball.sh %{gitrev}
8ac931f
Source0:        librepo-%{gitrev}.tar.xz
e989a8a
8ac931f
BuildRequires:  check-devel
8ac931f
BuildRequires:  cmake
8ac931f
BuildRequires:  doxygen
8ac931f
BuildRequires:  expat-devel
5f933a6
BuildRequires:  glib2-devel >= 2.22.0
8ac931f
BuildRequires:  gpgme-devel
8ac931f
BuildRequires:  libattr-devel
8ac931f
BuildRequires:  libcurl-devel
8ac931f
BuildRequires:  openssl-devel
e8713e2
e8713e2
# prevent provides from nonstandard paths:
e8713e2
%filter_provides_in %{python_sitearch}/.*\.so$
8ac931f
%if %{with python3}
e8713e2
%filter_provides_in %{python3_sitearch}/.*\.so$
8ac931f
%endif
e8713e2
%filter_setup
e989a8a
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
Group:          Development/Libraries
8ac931f
Requires:       %{name}%{?_isa} = %{version}-%{release}
e989a8a
e989a8a
%description devel
e989a8a
Development files for librepo.
e989a8a
e989a8a
%package -n python-librepo
8ac931f
Summary:        Python bindings for the librepo library
8ac931f
Group:          Development/Languages
8ac931f
BuildRequires:  pygpgme
8ac931f
BuildRequires:  python2-devel
8ac931f
BuildRequires:  python-flask
8ac931f
BuildRequires:  python-nose
8ac931f
BuildRequires:  python-sphinx
8ac931f
Requires:       %{name}%{?_isa} = %{version}-%{release}
e989a8a
e989a8a
%description -n python-librepo
e989a8a
Python bindings for the librepo library.
e989a8a
8ac931f
%if %{with python3}
e8713e2
%package -n python3-librepo
e8713e2
Summary:        Python 3 bindings for the librepo library
e8713e2
Group:          Development/Languages
8ac931f
BuildRequires:  python3-pygpgme
e8713e2
BuildRequires:  python3-devel
e8713e2
BuildRequires:  python3-flask
e8713e2
BuildRequires:  python3-nose
e8713e2
BuildRequires:  python3-sphinx
e8713e2
Requires:       %{name}%{?_isa} = %{version}-%{release}
e8713e2
e8713e2
%description -n python3-librepo
e8713e2
Python 3 bindings for the librepo library.
8ac931f
%endif
e8713e2
e989a8a
%prep
e989a8a
%setup -q -n librepo
e989a8a
8ac931f
%if %{with python3}
e8713e2
rm -rf py3
e8713e2
mkdir ../py3
e8713e2
cp -a . ../py3/
e8713e2
mv ../py3 ./
8ac931f
%endif
e8713e2
e989a8a
%build
e989a8a
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
e989a8a
make %{?_smp_mflags}
e989a8a
8ac931f
%if %{with python3}
e8713e2
pushd py3
e8713e2
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_DESIRED:str=3 .
e8713e2
make %{?_smp_mflags}
e8713e2
popd
8ac931f
%endif
e8713e2
e989a8a
%check
e989a8a
make ARGS="-V" test
e989a8a
8ac931f
%if %{with python3}
e8713e2
pushd py3
e8713e2
make ARGS="-V" test
e8713e2
popd
8ac931f
%endif
e8713e2
e989a8a
%install
e989a8a
make install DESTDIR=$RPM_BUILD_ROOT
8ac931f
%if %{with python3}
e8713e2
pushd py3
e8713e2
make install DESTDIR=$RPM_BUILD_ROOT
e8713e2
popd
8ac931f
%endif
e989a8a
e989a8a
%post -p /sbin/ldconfig
e989a8a
e989a8a
%postun -p /sbin/ldconfig
e989a8a
e989a8a
%files
e989a8a
%doc COPYING README.md
e989a8a
%{_libdir}/librepo.so.*
e989a8a
e989a8a
%files devel
e989a8a
%{_libdir}/librepo.so
e989a8a
%{_libdir}/pkgconfig/librepo.pc
e989a8a
%{_includedir}/librepo/
e989a8a
e989a8a
%files -n python-librepo
e989a8a
%{python_sitearch}/librepo/
e989a8a
8ac931f
%if %{with python3}
e8713e2
%files -n python3-librepo
e8713e2
%{python3_sitearch}/
8ac931f
%endif
e8713e2
e989a8a
%changelog
63e4893
* Wed Apr  23 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.2-1
63e4893
- Fix segfault in headercb if only base_url and no mirrolist is used (RhBug: 1090325)
63e4893
- Set environmental variable LIBREPO_DEBUG enables librepo debug output to stderr
63e4893
d8a32d3
* Mon Apr   7 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.1-1
d8a32d3
- Don't try to call cb if no cb is set (RhBug: 1083659)
d8a32d3
8ac931f
* Mon Mar  31 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.7.0-1
8ac931f
- Support for xml:base tag in repomd.xml.
8ac931f
- Downloader: If checksums don't match, include the expected values and types
8ac931f
  in the error message.
8ac931f
- Handle: Add LRO_HMFCB and LRI_HMFCB options.
8ac931f
- API CHANGE: lr_download_single_cb() new param mfcb (LrMirrorFailureCb)
8ac931f
- API CHANGE: Removed cbdata param from lr_download_single_cb(). Use specific
8ac931f
  data for each target.
8ac931f
- New callback LrHandleMirrorFailureCb
8ac931f
- Python doc update (Check it out: http://tojaj.github.io/librepo/)
8ac931f
8ac931f
* Thu Mar 27 2014 Matěj Cepl <mcepl@redhat.com> - 1.6.0-2
8ac931f
- Make building of python3 components conditional
8ac931f
- replace all TABs with spaces
8ac931f
8ac931f
* Thu Feb  20 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.6.0-1
6244078
- Small API change: End callback now must return integer and not void)
6244078
- downloader: Check for the lr_interrupt regularly
6244078
- Handle exceptions in python callbacks as return values (RhBug: 1066321)
6244078
- Support for byterange of download (RhBug: 1058777)
6244078
ed55870
* Tue Jan  28 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.2-2
ed55870
- Ignore rsyc mirrors silently.
ed55870
7be6765
* Thu Jan  16 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.2-1
7be6765
- Better download resume logic
7be6765
9f25173
* Fri Jan   3 2014 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.1-1
9f25173
-  Downloading: LRO_MAXSPEED has effect over whole downloading, it is not
9f25173
   per target max speed anymore.
9f25173
-  Sanitize progresscb (GitHub issue 24) (Thanks zde/zpavlas)
9f25173
254ffe8
* Tue Dec  17 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.5.0-1
254ffe8
- Extend C example
254ffe8
- Add LRR_YUM_TIMESTAMP (GitHub issue #25)
254ffe8
- Close the correct file when using a metalink.xml file
254ffe8
- Add lr_check_packages()
254ffe8
- Enable checksum caching for already existing local packages
254ffe8
- Library: Call LR_PROGRESSCB with zeroized values, when total_to_download
254ffe8
  value is changed
254ffe8
- Skip fastestmirror detection of only one mirror is present
254ffe8
20e39e3
* Tue Nov  19 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.4.0-1
20e39e3
- Add LRO_FASTESTMIRRORCB
20e39e3
- Add LRO_LOWSPEEDTIME and LRO_LOWSPEEDLIMIT options. (RhBug: 1028444)
20e39e3
- Default connection timeout changed to 30sec instead of 300sec.
20e39e3
- unittests: Fix expired key (RhBug: 1031825)
20e39e3
2b5a88a
* Thu Oct  31 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.3.0-1
2b5a88a
- Some CURL error codes should be considered as fatal (RhBug: 1022994)
2b5a88a
- fastestmirror: Add support for cache - New options: LRO_FASTESTMIRRORCACHE
2b5a88a
  and LRO_FASTESTMIRRORMAXAGE
2b5a88a
- fastestmirror: For download_packages() do fastestmirror detection for
2b5a88a
  all handles in one shot
2b5a88a
- Use <mm0:alternates> during repomd.xml download (RhBug: 1019103)
2b5a88a
- Don't perform fastest mirror test if file already exists locally.
2b5a88a
- fastestmirror.h:26:24: fatal error: mirrorlist.h: No such file
2b5a88a
  or directory (#1018006)
19fbe2b
8255b83
* Mon Oct  07 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.1-1
8255b83
- Open fd right before downloading and close them immediately after
8255b83
  download. (RhBug: 1015957)
8255b83
e8713e2
* Thu Oct  03 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-2
e8713e2
- Add target for Python 3 to the spec file
e8713e2
- Fix few python3 related issues
e8713e2
5ea63a3
* Tue Oct  01 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-1
5ea63a3
- Better detection of bad content of repomd.xml
5ea63a3
- Close files properly (RhBug: 1012290)
5ea63a3
- Add fastestmirror module + LRO_FASTESTMIRROR option
5ea63a3
- downloader: Fix uninitialized total to download variable (GitHub issue 22)
5ea63a3
- Add LRO_MIRRORLISTURL and LRO_METALINKURL. LRO_MIRRORLIST is deprecated.
5ea63a3
- Few other small fixes
5ea63a3
03bd133
* Mon Sep  16 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.1.0-1
03bd133
- New librepo.download_url(url, fd, handle=None) function in Python API.
03bd133
- Low-level downloader interface is now public in C API.
03bd133
- Small change of API lr_download_packages() and lr_packagetarget_new
03bd133
  functions.
03bd133
- In python download_packages() changed from method of Handle() to
03bd133
  librepo module function without handle param.
03bd133
  Param handle was moved to the PackageTarget class that takes handle
03bd133
  as a optional param during constrution.
03bd133
- Implements checking size of downloaded files (expectedsize
03bd133
  param of downloading functions).
03bd133
35ccc4d
* Wed Aug  28 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.0.0-1
35ccc4d
- Huge API changes
35ccc4d
- Library starts to use GLib2
35ccc4d
- Support for parallel downloads
35ccc4d
- Better error reporting
35ccc4d
- More GLib2 style C api
35ccc4d
- More descriptive Python exception messages
35ccc4d
- A lot of bugfixes
35ccc4d
- Updated examples
35ccc4d
8f0a778
* Thu Jul  25 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-3
8f0a778
- python: Raise exception if handle has bad repo type configured
8f0a778
  (RhBug: 988013)
8f0a778
f6676d6
* Mon Jul  22 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-2
f6676d6
- Bump version in versioh.h to 0.0.5
f6676d6
- Python: Fix Handle.mirrors to return empty list instead of None if
f6676d6
  no mirrors available (RhBug: 986228)
f6676d6
5f933a6
* Wed Jul  17 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.5-1
5f933a6
- Return LRE_ALREADYDOWNLOADED if the file exists even if no resume
5f933a6
  is specified. (GitHub issue 15)
5f933a6
- downloadtarget: New module, future replacement for curltarget module.
5f933a6
- Librepo migrated to lr_LrMirrorlist from lr_InternalMirrorlist.
5f933a6
- test: Run python unittest verbosely
5f933a6
- lrmirrorlis: New module. GLib2 ready replacement for the internal_mirrorlist
5f933a6
  module.
5f933a6
- package_downloader: Add LRE_ALREADYDOWNLOADED rc code. (GitHub issue 15)
5f933a6
- handle: After set python SIGINT handler back, check if librepo was
5f933a6
  interrupted by CTRL+C. (RhBug: 977803)
5f933a6
- cmake: Set required python version to 2. (GitHub issue 10)
5f933a6
- Fix missing VAR substitution for mirrorlist. (GitHub issue 11)
5f933a6
- cmake: Add FindXattr module.
5f933a6
- Add support for caching checksum as extended file attribute. (GitHub issue 8)
5f933a6
- util: Add lr_asprintf().
5f933a6
- util: Add lr_vasprintf().
5f933a6
- handle: Fix funky logic in internal error handling. (GitHub issue 9)
5f933a6
- Add lr_yum_repomd_get_age() function. (GitHub issue 6)
5f933a6
- test: Add test for LR_VERSION_CHECK macro.
5f933a6
- Add a LR_VERSION_CHECK macro
5f933a6
2f1b90a
* Wed Jun 12 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.4-2
2f1b90a
- examples: Add C example of usage.
2f1b90a
- Fix predefined lists in types.h (GitHub issue 4). Thank you hughsie
2f1b90a
- Add LRO_VARSUB and LRI_VARSUB. (RhBug: 965131)
2f1b90a
- py: Change reported name from _librepo.Exception to librepo.LibrepoException
2f1b90a
806c08d
* Thu May  2 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.4-1
806c08d
- Fix type conversion long long -> long.(RhBug: 957656)
806c08d
- python: Handle.perfrom() could be called without Result().
806c08d
- Add LRI_MAXMIRRORTRIES option. (RhBug: 954736)
806c08d
- py: unittests: Add metalink.xml and mirrorlist files. (RhBug: 954294)
806c08d
- Fix double free and memory leak. (RhBug: 954294)
806c08d
- New option LRO_MAXMIRRORTRIES. (RhBug: 949517)
806c08d
- LRI_MIRRORS return only content of mirrorlist file (without LRO_URL as first item).
806c08d
- Add LRO_FETCHMIRRORS option.
806c08d
772afb1
* Mon Apr  8 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-3.git720d68d
772afb1
- Add CURL_GLOBAL_ACK_EINTR flag to curl init.
772afb1
- Proper multi handle cleanup. (RhBug: 947388)
772afb1
- Support for read 'useragent' attr. (RhBug: 947346)
772afb1
- Add valgrind supress files. (RhBug: 923214)
772afb1
- Make python bindings interruptible (LRO_INTERRUPTIBLE) (RhBug: 919125)
772afb1
- Add LRI_MIRRORS option (RhBug: 923198)
772afb1
- Add LRI_METALINK option. (BzBug: 947767)
772afb1
bf07af3
* Mon Mar 18 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-2.gitb3c3323
bf07af3
- py: Use standard python exception while accessing bad attrs. (RhBug: 920673)
bf07af3
- Default mask for newly created files is 0666. (RhBug: 922557)
bf07af3
e989a8a
* Thu Mar 14 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.2-1.git714e828
e989a8a
- Add LRI_PROGRESSCB and LRI_PROGRESSDATA options (RhBug: 919123)
e989a8a
- Bindings: More pythonic operations with handle's attributes (RhBug: 919124)
e989a8a
5f933a6
* Tue Oct  9 2012 Tomas Mlcoch <tmlcoch at redhat.com> - 0.0.1-1.gitc69642e
e989a8a
- Initial package