Blob Blame History Raw
# Created by pyp2rpm-1.1.1
%global pypi_name requests-cache

Name:           python-%{pypi_name}
Version:        0.4.13
Release:        7%{?dist}
Summary:        Persistent cache for requests library

License:        BSD
URL:            https://github.com/reclosedev/requests-cache
Source0:        https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

# Python 3 is default
BuildRequires:  python3-devel
BuildRequires:  python3-requests
BuildRequires:  python3-sphinx
# Python 2
BuildRequires:  python2-devel
BuildRequires:  python2-requests
BuildRequires:  python2-sphinx

%global _description\
Requests-cache is a transparent persistent\
cache for the requests (version >= 1.1.0) library.

%description %_description

%package -n     python3-%{pypi_name}
Summary:        Persistent cache for requests library

Requires:       python3-requests >= 1.1.0

%description -n python3-%{pypi_name}
Requests-cache is a transparent persistent
cache for the requests (version >= 1.1.0) library.

%package -n     python2-%{pypi_name}
Summary:        Persistent cache for requests library

Requires:       python2-requests >= 1.1.0

%description -n python2-%{pypi_name}
Requests-cache is a transparent persistent
cache for the requests (version >= 1.1.0) library.


%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

# generate html docs
sphinx-build docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
# generate html docs
sphinx-build-3 docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}



%build
%py2_build
%py3_build


%install
%py3_install
%py2_install

# Fix rpmlints:
for lib in `find %{buildroot}%{python3_sitelib}/requests_cache -name '*.py' -print`; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done
sed -i '1{\@^#!/usr/bin/python@d}' %{buildroot}%{python3_sitelib}/requests_cache/backends/storage/dbdict.py

sed -i 's/\r$//' html/_static/jquery.js
sed -i 's/\r$//' LICENSE

%files -n python3-%{pypi_name}
%doc html README.rst
%license LICENSE
%{python3_sitelib}/requests_cache
%{python3_sitelib}/requests_cache-%{version}*

%files -n python2-%{pypi_name}
%doc html README.rst
%license LICENSE
%{python2_sitelib}/requests_cache
%{python2_sitelib}/requests_cache-%{version}*


%changelog
* Thu Feb 14 2019 Richard Shaw <hobbes1069@gmail.com> - 0.4.13-7
- Build both python2 and python3 packages.

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.13-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Oct 12 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.13-5
- Python2 binary package has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.13-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.13-3
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sun Sep 17 2017 Miro Hrončok <mhroncok@redhat.com> - 0.4.13-1
- Updated to 0.4.13 (#1324920)
- Fixed Source0 URL
- Use python2- (Build)Requires

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.6-10
- Python 2 binary package renamed to python2-requests-cache
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.4.6-7
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.6-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.6-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Oct 30 2014 Ricky Elrod <relrod@redhat.com> - 0.4.6-2
- Fix rpmlint warnings: line endings in docs/license
- Fix rpmlint warnings: shebang line in non-scripts

* Wed Oct 29 2014 Ricky Elrod <relrod@redhat.com> - 0.4.6-1
- Initial package.