]>
Commit | Line | Data |
---|---|---|
96a5e342 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module | |
6 | ||
7 | %define module stevedore | |
8 | Summary: Manage dynamic plugins for Python applications | |
9 | Name: python-%{module} | |
10 | Version: 1.1.0 | |
11 | Release: 1 | |
12 | License: Apache v2.0 | |
13 | Group: Development/Languages | |
14 | Source0: http://pypi.python.org/packages/source/s/stevedore/stevedore-%{version}.tar.gz | |
15 | # Source0-md5: b7f30055c32410f8f9b6cf1b55bdc68a | |
16 | URL: https://github.com/dreamhost/stevedore | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.219 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | #BuildRequires: python-discover | |
23 | BuildRequires: python-mock | |
24 | #BuildRequires: python-oslotest | |
25 | BuildRequires: python-pbr | |
26 | BuildRequires: python-six | |
27 | BuildRequires: python-testrepository | |
28 | %endif | |
29 | %endif | |
30 | %if %{with python3} | |
31 | BuildRequires: python3-devel | |
32 | #BuildRequires: python3-discover | |
33 | BuildRequires: python3-mock | |
34 | #BuildRequires: python3-oslotest | |
35 | BuildRequires: python3-pbr | |
36 | BuildRequires: python3-setuptools | |
37 | BuildRequires: python3-six | |
38 | #BuildRequires: python3-testrepository | |
39 | %endif | |
40 | Requires: python-setuptools | |
41 | Requires: python-six | |
42 | BuildArch: noarch | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | Manage dynamic plugins for Python applications | |
47 | ||
48 | %package -n python3-stevedore | |
49 | Summary: Manage dynamic plugins for Python applications | |
50 | Group: Development/Libraries | |
51 | Requires: python3-setuptools | |
52 | Requires: python3-six | |
53 | ||
54 | %description -n python3-stevedore | |
55 | Manage dynamic plugins for Python applications | |
56 | ||
57 | %prep | |
58 | %setup -q -n stevedore-%{version} | |
59 | ||
60 | %build | |
61 | %if %{with python2} | |
62 | %{__python} setup.py build --build-base build-2 | |
63 | ||
64 | %if %{with tests} | |
65 | PYTHONPATH=. nosetests-%{py_ver} | |
66 | %endif | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
70 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
71 | ||
72 | %if %{with tests} | |
73 | PYTHONPATH=. nosetests-%{py3_ver} | |
74 | %endif | |
75 | %endif | |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
81 | %{__python} setup.py \ | |
82 | build --build-base build-2 \ | |
83 | install --skip-build \ | |
84 | --optimize=2 \ | |
85 | --root=$RPM_BUILD_ROOT | |
86 | ||
2a313414 | 87 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/stevedore/tests |
c552d429 | 88 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/stevedore/example |
2a313414 | 89 | |
96a5e342 ER |
90 | %py_postclean |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %{__python3} setup.py \ | |
95 | build --build-base build-3 \ | |
96 | install --skip-build \ | |
97 | --optimize=2 \ | |
98 | --root=$RPM_BUILD_ROOT | |
2a313414 ER |
99 | |
100 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/stevedore/tests | |
c552d429 | 101 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/stevedore/example |
96a5e342 ER |
102 | %endif |
103 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
110 | %doc README.rst LICENSE | |
111 | %{py_sitescriptdir}/stevedore | |
112 | %{py_sitescriptdir}/stevedore-%{version}-py*.egg-info | |
113 | %endif | |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-stevedore | |
117 | %defattr(644,root,root,755) | |
118 | %doc README.rst LICENSE | |
119 | %{py3_sitescriptdir}/stevedore | |
120 | %{py3_sitescriptdir}/stevedore-%{version}-py*.egg-info | |
121 | %endif |