]>
Commit | Line | Data |
---|---|---|
ec8fe2e1 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # do build doc (missing deps) | |
4 | %bcond_with tests # do perform "make test" (missing deps) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Oslo Utility library | |
9 | Name: python-oslo.utils | |
e9c0e915 | 10 | Version: 3.36.3 |
b8f0d489 | 11 | Release: 3 |
ec8fe2e1 JK |
12 | License: Apache |
13 | Group: Libraries/Python | |
14 | Source0: https://files.pythonhosted.org/packages/source/o/oslo.utils/oslo.utils-%{version}.tar.gz | |
e9c0e915 | 15 | # Source0-md5: f4d23e51547a37b2e54bb1623e6d2534 |
ec8fe2e1 JK |
16 | URL: https://pypi.python.org/pypi/oslo.utils |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-pbr >= 2.0.0 | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-pbr >= 2.0.0 | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | BuildRequires: sed >= 4.0 | |
28 | Requires: python-debtcollector >= 1.2.0 | |
29 | Requires: python-funcsigs >= 0.4 | |
30 | Requires: python-iso8601 >= 0.1.11 | |
31 | Requires: python-monotonic >= 0.6 | |
32 | Requires: python-netaddr >= 0.7.13 | |
33 | Requires: python-netifaces >= 0.10.4 | |
34 | Requires: python-oslo.i18n >= 2.1.0 | |
35 | Requires: python-pbr >= 2.0.0 | |
36 | Requires: python-pyparsing >= 2.1.0 | |
37 | Requires: python-pytz >= 2013.6 | |
38 | Requires: python-six >= 1.9.0 | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | The oslo.utils library provides support for common utility type | |
44 | functions, such as encoding, exception handling, string manipulation, | |
45 | and time handling. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | ||
49 | %package -n python3-oslo.utils | |
50 | Summary: Oslo Utility library | |
51 | Group: Libraries/Python | |
52 | Requires: python3-debtcollector >= 1.2.0 | |
53 | Requires: python3-iso8601 >= 0.1.11 | |
54 | Requires: python3-monotonic >= 0.6 | |
55 | Requires: python3-netaddr >= 0.7.13 | |
56 | Requires: python3-netifaces >= 0.10.4 | |
57 | Requires: python3-oslo.i18n >= 2.1.0 | |
58 | Requires: python3-pbr >= 2.0.0 | |
59 | Requires: python3-pyparsing >= 2.1.0 | |
60 | Requires: python3-pytz >= 2013.6 | |
61 | Requires: python3-six >= 1.9.0 | |
62 | ||
63 | %description -n python3-oslo.utils | |
64 | The oslo.utils library provides support for common utility type | |
65 | functions, such as encoding, exception handling, string manipulation, | |
66 | and time handling. | |
67 | ||
68 | %package apidocs | |
69 | Summary: API documentation for Python oslo.utils module | |
70 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona oslo.utils | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for Pythona oslo.utils module. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API modułu Pythona oslo.utils. | |
78 | ||
79 | %prep | |
80 | %setup -q -n oslo.utils-%{version} | |
81 | ||
82 | %build | |
83 | %if %{with python2} | |
84 | %py_build %{?with_tests:test} | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_build %{?with_tests:test} | |
89 | %endif | |
90 | ||
91 | %if %{with doc} | |
92 | cd doc | |
93 | %{__make} -j1 html | |
94 | rm -rf _build/html/_sources | |
95 | %endif | |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %py_install | |
102 | ||
103 | # when files are installed in other way that standard 'setup.py | |
104 | # they need to be (re-)compiled | |
105 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
106 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
107 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
108 | ||
109 | %py_postclean | |
110 | %endif | |
111 | ||
112 | %if %{with python3} | |
113 | %py3_install | |
114 | ||
115 | # python dependency generator does not support conditionals | |
116 | # remove python2-only dependencies here | |
117 | sed -i -e"/python_version=='2./,+1 d" $RPM_BUILD_ROOT%{py3_sitescriptdir}/oslo.utils-%{version}-py*.egg-info/requires.txt | |
118 | %endif | |
119 | ||
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %if %{with python2} | |
124 | %files | |
125 | %defattr(644,root,root,755) | |
126 | %doc AUTHORS ChangeLog README.rst | |
127 | %{py_sitescriptdir}/oslo_utils | |
128 | %{py_sitescriptdir}/oslo.utils-%{version}-py*.egg-info | |
129 | %endif | |
130 | ||
131 | %if %{with python3} | |
132 | %files -n python3-oslo.utils | |
133 | %defattr(644,root,root,755) | |
134 | %doc AUTHORS ChangeLog README.rst | |
135 | %{py3_sitescriptdir}/oslo_utils | |
136 | %{py3_sitescriptdir}/oslo.utils-%{version}-py*.egg-info | |
137 | %endif | |
138 | ||
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
142 | %doc doc/_build/html/* | |
143 | %endif |