]>
Commit | Line | Data |
---|---|---|
166e2be6 JK |
1 | # |
2 | # Conditional build: | |
e74d25cf | 3 | %bcond_without tests # unit tests |
166e2be6 JK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Command Line Interface Formulation Framework | |
e74d25cf | 8 | Summary(pl.UTF-8): Command Line Interface Formulation Framework - szkielet formułowania linii poleceń |
166e2be6 | 9 | Name: python-cliff |
e74d25cf JB |
10 | # keep 2.x here for python2 support |
11 | Version: 2.18.0 | |
269233ed | 12 | Release: 2 |
166e2be6 JK |
13 | License: Apache |
14 | Group: Libraries/Python | |
e74d25cf JB |
15 | Source0: https://files.pythonhosted.org/packages/source/c/cliff/cliff-%{version}.tar.gz |
16 | # Source0-md5: 66490f2c437f543f32afe9e518e3c080 | |
17 | Patch0: %{name}-prettytable.patch | |
18 | Patch1: %{name}-mock.patch | |
19 | Patch2: %{name}-py310.patch | |
20 | Patch3: %{name}-py2-test.patch | |
21 | URL: https://pypi.org/project/cliff/ | |
166e2be6 JK |
22 | BuildRequires: rpm-pythonprov |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
24 | %if %{with python2} | |
e74d25cf | 25 | BuildRequires: python-modules >= 1:2.7 |
166e2be6 JK |
26 | BuildRequires: python-pbr >= 2.0.0 |
27 | BuildRequires: python-setuptools | |
28 | %if %{with tests} | |
e74d25cf JB |
29 | BuildRequires: python-PyYAML >= 3.12 |
30 | BuildRequires: python-cmd2 >= 0.8.0 | |
166e2be6 JK |
31 | BuildRequires: python-coverage >= 4.0 |
32 | BuildRequires: python-mock >= 2.0 | |
33 | BuildRequires: python-openstackdocstheme >= 1.11.0 | |
e74d25cf | 34 | BuildRequires: python-prettytable >= 0.7.2 |
166e2be6 | 35 | BuildRequires: python-pyparsing >= 2.1.0 |
e74d25cf | 36 | BuildRequires: python-six >= 1.10.0 |
166e2be6 | 37 | BuildRequires: python-stevedore >= 1.20.0 |
e74d25cf | 38 | BuildRequires: python-subunit >= 1.0.0 |
166e2be6 JK |
39 | BuildRequires: python-testrepository >= 0.0.18 |
40 | BuildRequires: python-testscenarios >= 0.4 | |
e74d25cf | 41 | BuildRequires: python-testtools >= 2.2.0 |
166e2be6 | 42 | BuildRequires: python-unicodecsv >= 0.8.0 |
e74d25cf | 43 | BuildRequires: sphinx-pdg-2 >= 1.7.0 |
166e2be6 JK |
44 | %endif |
45 | %endif | |
46 | %if %{with python3} | |
e74d25cf | 47 | BuildRequires: python3-modules >= 1:3.6 |
166e2be6 JK |
48 | BuildRequires: python3-pbr >= 2.0.0 |
49 | %if %{with tests} | |
e74d25cf JB |
50 | BuildRequires: python3-PyYAML >= 3.12 |
51 | BuildRequires: python3-cmd2 >= 0.8.0 | |
166e2be6 | 52 | BuildRequires: python3-coverage >= 4.0 |
166e2be6 | 53 | BuildRequires: python3-openstackdocstheme >= 1.11.0 |
e74d25cf | 54 | BuildRequires: python3-prettytable >= 0.7.2 |
166e2be6 | 55 | BuildRequires: python3-pyparsing >= 2.1.0 |
e74d25cf | 56 | BuildRequires: python3-six >= 1.10.0 |
166e2be6 | 57 | BuildRequires: python3-stevedore >= 1.20.0 |
e74d25cf | 58 | BuildRequires: python3-subunit >= 1.0.0 |
166e2be6 JK |
59 | BuildRequires: python3-testrepository >= 0.0.18 |
60 | BuildRequires: python3-testscenarios >= 0.4 | |
e74d25cf JB |
61 | BuildRequires: python3-testtools >= 2.2.0 |
62 | BuildRequires: sphinx-pdg-3 >= 1.7.0 | |
166e2be6 JK |
63 | %endif |
64 | %endif | |
65 | BuildRequires: sed >= 4.0 | |
e74d25cf | 66 | Requires: python-modules >= 1:2.7 |
166e2be6 JK |
67 | BuildArch: noarch |
68 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
69 | ||
70 | %description | |
71 | cliff is a framework for building command line programs. It uses | |
72 | setuptools entry points to provide subcommands, output formatters, and | |
73 | other extensions. | |
74 | ||
e74d25cf JB |
75 | %description -l pl.UTF-8 |
76 | cliff to szkielet do budowania programów działających z linii poleceń. | |
77 | Wykorzystuje punkty wejściowe setuptools do zapewnienia podpoleceń, | |
78 | funkcje formatujące wyjścia i inne rozszerzenia. | |
79 | ||
166e2be6 JK |
80 | %package -n python3-cliff |
81 | Summary: Command Line Interface Formulation Framework | |
e74d25cf | 82 | Summary(pl.UTF-8): Command Line Interface Formulation Framework - szkielet formułowania linii poleceń |
166e2be6 | 83 | Group: Libraries/Python |
e74d25cf | 84 | Requires: python3-modules >= 1:3.6 |
166e2be6 JK |
85 | |
86 | %description -n python3-cliff | |
87 | cliff is a framework for building command line programs. It uses | |
88 | setuptools entry points to provide subcommands, output formatters, and | |
89 | other extensions. | |
90 | ||
e74d25cf JB |
91 | %description -n python3-cliff -l pl.UTF-8 |
92 | cliff to szkielet do budowania programów działających z linii poleceń. | |
93 | Wykorzystuje punkty wejściowe setuptools do zapewnienia podpoleceń, | |
94 | funkcje formatujące wyjścia i inne rozszerzenia. | |
95 | ||
166e2be6 JK |
96 | %prep |
97 | %setup -q -n cliff-%{version} | |
e74d25cf JB |
98 | %patch0 -p1 |
99 | %patch1 -p1 | |
100 | %patch2 -p1 | |
101 | %patch3 -p1 | |
166e2be6 JK |
102 | |
103 | %build | |
104 | %if %{with python2} | |
e74d25cf | 105 | export PYTHON="%{__python}" |
166e2be6 | 106 | %py_build %{?with_tests:test} |
e74d25cf JB |
107 | |
108 | %if %{with tests} | |
109 | %{__rm} -r .testrepository | |
110 | %endif | |
166e2be6 JK |
111 | %endif |
112 | ||
113 | %if %{with python3} | |
e74d25cf | 114 | export PYTHON="%{__python3}" |
166e2be6 | 115 | %py3_build %{?with_tests:test} |
e74d25cf JB |
116 | |
117 | %if %{with tests} | |
118 | %{__rm} -r .testrepository | |
119 | %endif | |
166e2be6 JK |
120 | %endif |
121 | ||
122 | %install | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
125 | %if %{with python2} | |
126 | %py_install | |
127 | ||
128 | %py_postclean | |
269233ed JB |
129 | |
130 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/cliff/tests | |
166e2be6 JK |
131 | %endif |
132 | ||
133 | %if %{with python3} | |
134 | %py3_install | |
269233ed JB |
135 | |
136 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/cliff/tests | |
166e2be6 JK |
137 | %endif |
138 | ||
139 | %if %{with python2} | |
140 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} | |
141 | cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} | |
142 | find $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} -name '*.py' \ | |
143 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
144 | %endif | |
145 | %if %{with python3} | |
146 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} | |
147 | cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} | |
148 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} -name '*.py' \ | |
149 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
150 | %endif | |
151 | ||
152 | %clean | |
153 | rm -rf $RPM_BUILD_ROOT | |
154 | ||
155 | %if %{with python2} | |
156 | %files | |
157 | %defattr(644,root,root,755) | |
158 | %doc AUTHORS ChangeLog README.rst | |
159 | %{py_sitescriptdir}/cliff | |
160 | %{py_sitescriptdir}/cliff-%{version}-py*.egg-info | |
161 | %{_examplesdir}/python-cliff-%{version} | |
162 | %endif | |
163 | ||
164 | %if %{with python3} | |
165 | %files -n python3-cliff | |
166 | %defattr(644,root,root,755) | |
167 | %doc AUTHORS ChangeLog README.rst | |
168 | %{py3_sitescriptdir}/cliff | |
169 | %{py3_sitescriptdir}/cliff-%{version}-py*.egg-info | |
170 | %{_examplesdir}/python3-cliff-%{version} | |
171 | %endif |