]>
Commit | Line | Data |
---|---|---|
a6a43135 JK |
1 | # Conditional build: |
2 | %bcond_without python2 # build python 2 module | |
3 | %bcond_without python3 # build python 3 module | |
c86c504e | 4 | |
4d7e4299 | 5 | %define module requests_oauthlib |
a6a43135 JK |
6 | Summary: First-class OAuth library support for python-requests |
7 | Name: python-%{module} | |
c86c504e | 8 | Version: 0.6.1 |
4e0f2445 | 9 | Release: 2 |
a6a43135 JK |
10 | License: ISC |
11 | Group: Development/Languages/Python | |
12 | Source0: https://pypi.python.org/packages/source/r/requests-oauthlib/requests-oauthlib-%{version}.tar.gz | |
c86c504e | 13 | # Source0-md5: f159bc7675ebe6a2d76798f4c00c5bf8 |
a6a43135 JK |
14 | URL: https://github.com/requests/requests-oauthlib |
15 | %if %{with python2} | |
16 | BuildRequires: python-distribute | |
17 | BuildRequires: python-modules >= 1:2.6 | |
18 | %endif | |
19 | %if %{with python3} | |
20 | BuildRequires: python3-distribute | |
21 | BuildRequires: python3-modules >= 1:3.2 | |
22 | %endif | |
23 | BuildRequires: rpm-pythonprov | |
26ac90b4 | 24 | BuildRequires: rpmbuild(macros) >= 1.710 |
a6a43135 JK |
25 | Requires: python-modules >= 1:2.6 |
26 | Requires: python-oauthlib >= 0.4.2 | |
27 | Requires: python-requests >= 1.0.0 | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | First-class OAuth library support for python-requests. | |
33 | ||
34 | %package -n python3-requests_oauthlib | |
35 | Summary: First-class OAuth library support for python-requests | |
36 | Group: Development/Languages/Python | |
37 | Requires: python3-modules >= 3.2 | |
38 | Requires: python3-oauthlib >= 0.4.2 | |
39 | Requires: python3-requests >= 1.0.0 | |
40 | ||
41 | %description -n python3-requests_oauthlib | |
42 | First-class OAuth library support for python-requests. | |
43 | ||
44 | %prep | |
45 | %setup -q -n requests-oauthlib-%{version} | |
46 | ||
47 | %build | |
48 | %if %{with python2} | |
4d7e4299 | 49 | %py_build |
a6a43135 JK |
50 | %endif |
51 | ||
52 | %if %{with python3} | |
4d7e4299 | 53 | %py3_build |
a6a43135 JK |
54 | %endif |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %if %{with python2} | |
4d7e4299 JR |
60 | %py_install |
61 | ||
a6a43135 JK |
62 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
63 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
64 | %py_postclean | |
65 | %endif | |
66 | ||
67 | %if %{with python3} | |
4d7e4299 | 68 | %py3_install |
a6a43135 JK |
69 | %endif |
70 | ||
71 | %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages} | |
72 | ||
73 | %clean | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %if %{with python2} | |
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc README.rst | |
80 | %{py_sitescriptdir}/%{module} | |
81 | %if "%{py_ver}" > "2.4" | |
82 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
83 | %endif | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
87 | %files -n python3-requests_oauthlib | |
88 | %defattr(644,root,root,755) | |
89 | %doc README.rst | |
90 | %{py3_sitescriptdir}/%{module} | |
91 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
92 | %endif |