2 # - build and package docs
3 # - tests need redis and mongo db
6 %bcond_with doc # don't build doc
7 %bcond_with tests # do not perform "make test"
8 %bcond_without python2 # CPython 2.x module
9 %bcond_without python3 # CPython 3.x module
11 %define module requests_cache
12 Summary: Persistent cache for requests library
13 Name: python-%{module}
17 Group: Libraries/Python
18 Source0: https://github.com/reclosedev/requests-cache/archive/v%{version}/%{module}-%{version}.tar.gz
19 # Source0-md5: 11dc472117610575df875237d661c38a
20 URL: https://github.com/reclosedev/requests-cache
21 BuildRequires: rpm-pythonprov
23 BuildRequires: python-modules
24 BuildRequires: python-setuptools
26 BuildRequires: python-requests >= 1.1.0
30 BuildRequires: python3-modules
31 BuildRequires: python3-setuptools
33 BuildRequires: python3-requests >= 1.1.0
37 BuildRequires: python3-sphinx
38 BuildRequires: sphinx-pdg
40 Requires: python-requests >= 1.1.0
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Requests-cache is a transparent persistent cache for the requests
48 %package -n python3-%{module}
49 Summary: Persistent cache for requests library
50 Group: Libraries/Python
51 Requires: python3-requests >= 1.1.0
53 %description -n python3-%{module}
54 Requests-cache is a transparent persistent cache for the requests
58 %setup -q -n requests-cache-%{version}
62 %py_build %{?with_tests:test}
66 %py3_build %{?with_tests:test}
70 sphinx-build docs html
71 rm -rf html/.{doctrees,buildinfo}
73 sphinx-build-3 docs html
74 rm -rf html/.{doctrees,buildinfo}
78 rm -rf $RPM_BUILD_ROOT
89 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc README.rst LICENSE
95 %{py_sitescriptdir}/%{module}
96 %{py_sitescriptdir}/%{module}-%{version}*
100 %files -n python3-%{module}
101 %defattr(644,root,root,755)
102 %doc README.rst LICENSE
103 %{py3_sitescriptdir}/%{module}
104 %{py3_sitescriptdir}/%{module}-%{version}*