]>
Commit | Line | Data |
---|---|---|
4f8c26a0 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module requestbuilder | |
7 | Summary: Command line-driven HTTP request builder | |
8 | Name: python-%{module} | |
9 | Version: 0.2.3 | |
69d32aed | 10 | Release: 3 |
4f8c26a0 JK |
11 | License: ISC |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/r/requestbuilder/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: 3d9793e3a3b3dad23a8475e0480581db | |
15 | URL: https://github.com/boto/requestbuilder | |
16 | BuildRequires: rpm-pythonprov | |
2b7a625c | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
4f8c26a0 JK |
18 | %if %{with python2} |
19 | BuildRequires: python-modules | |
20 | BuildRequires: python-setuptools > 7.0 | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules | |
24 | BuildRequires: python3-setuptools > 7.0 | |
25 | %endif | |
26 | Requires: python-requests | |
27 | Requires: python-six | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Command line-driven HTTP request builder. | |
33 | ||
34 | %package -n python3-%{module} | |
35 | Summary: - | |
36 | Summary(pl.UTF-8): - | |
37 | Group: Libraries/Python | |
38 | Requires: python-requests | |
39 | Requires: python-six | |
40 | ||
41 | %description -n python3-%{module} | |
42 | Command line-driven HTTP request builder. | |
43 | ||
44 | %description -n python3-%{module} -l pl.UTF-8 | |
45 | ||
46 | %package apidocs | |
47 | Summary: %{module} API documentation | |
48 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
49 | Group: Documentation | |
50 | ||
51 | %description apidocs | |
52 | API documentation for %{module}. | |
53 | ||
54 | %description apidocs -l pl.UTF-8 | |
55 | Dokumentacja API %{module}. | |
56 | ||
57 | %prep | |
58 | %setup -q -n %{module}-%{version} | |
59 | ||
60 | %build | |
61 | %if %{with python2} | |
62 | # CC/CFLAGS is only for arch packages - remove on noarch packages | |
63 | CC="%{__cc}" \ | |
64 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
208cb3cf | 65 | %py_build %{?with_tests:test} |
4f8c26a0 JK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
69 | # CC/CFLAGS is only for arch packages - remove on noarch packages | |
70 | CC="%{__cc}" \ | |
71 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
208cb3cf | 72 | %py3_build %{?with_tests:test} |
4f8c26a0 JK |
73 | %endif |
74 | ||
75 | %if %{with doc} | |
76 | cd docs | |
77 | %{__make} -j1 html | |
78 | rm -rf _build/html/_sources | |
79 | %endif | |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
208cb3cf | 85 | %py_install |
4f8c26a0 JK |
86 | |
87 | %py_postclean | |
88 | %endif | |
89 | ||
90 | %if %{with python3} | |
208cb3cf | 91 | %py3_install |
4f8c26a0 JK |
92 | %endif |
93 | ||
94 | %clean | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %files | |
99 | %defattr(644,root,root,755) | |
100 | %{py_sitescriptdir}/%{module} | |
101 | %if "%{py_ver}" > "2.4" | |
102 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
103 | %endif | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %files -n python3-%{module} | |
108 | %defattr(644,root,root,755) | |
109 | %{py3_sitescriptdir}/%{module} | |
110 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
111 | %endif |