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