]>
Commit | Line | Data |
---|---|---|
166e2be6 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Command Line Interface Formulation Framework | |
8 | Name: python-cliff | |
9 | Version: 2.8.0 | |
fe38ad01 | 10 | Release: 4 |
166e2be6 JK |
11 | License: Apache |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/9e/26/7db86b6fb7bcf335e691a274b8f5141006ea87e7783e43d7ef5a498a09da/cliff-%{version}.tar.gz | |
14 | # Source0-md5: 6f1fcd6deb8068984f3f0e594f02f2b7 | |
15 | URL: https://pypi.python.org/pypi/cliff | |
16 | BuildRequires: rpm-pythonprov | |
17 | BuildRequires: rpmbuild(macros) >= 1.714 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-pbr >= 2.0.0 | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | BuildRequires: python-PyYAML >= 3.10.0 | |
23 | BuildRequires: python-cmd2 >= 0.6.7 | |
24 | BuildRequires: python-coverage >= 4.0 | |
25 | BuildRequires: python-mock >= 2.0 | |
26 | BuildRequires: python-openstackdocstheme >= 1.11.0 | |
27 | BuildRequires: python-prettytable >= 0.7.1 | |
28 | BuildRequires: python-pyparsing >= 2.1.0 | |
29 | BuildRequires: python-six >= 1.9.0 | |
30 | BuildRequires: python-stevedore >= 1.20.0 | |
31 | BuildRequires: python-subunit >= 0.0.18 | |
32 | BuildRequires: python-testrepository >= 0.0.18 | |
33 | BuildRequires: python-testscenarios >= 0.4 | |
34 | BuildRequires: python-testtools >= 1.4.0 | |
35 | BuildRequires: python-unicodecsv >= 0.8.0 | |
36 | BuildRequires: sphinx-pdg-2 >= 1.6.2 | |
37 | %endif | |
38 | %endif | |
39 | %if %{with python3} | |
40 | BuildRequires: python3-modules | |
41 | BuildRequires: python3-pbr >= 2.0.0 | |
42 | %if %{with tests} | |
43 | BuildRequires: python3-PyYAML >= 3.10.0 | |
44 | BuildRequires: python3-cmd2 >= 0.6.7 | |
45 | BuildRequires: python3-coverage >= 4.0 | |
46 | BuildRequires: python3-mock >= 2.0 | |
47 | BuildRequires: python3-openstackdocstheme >= 1.11.0 | |
48 | BuildRequires: python3-prettytable >= 0.7.1 | |
49 | BuildRequires: python3-pyparsing >= 2.1.0 | |
50 | BuildRequires: python3-six >= 1.9.0 | |
51 | BuildRequires: python3-stevedore >= 1.20.0 | |
52 | BuildRequires: python3-subunit >= 0.0.18 | |
53 | BuildRequires: python3-testrepository >= 0.0.18 | |
54 | BuildRequires: python3-testscenarios >= 0.4 | |
55 | BuildRequires: python3-testtools >= 1.4.0 | |
56 | BuildRequires: sphinx-pdg-3 >= 1.6.2 | |
57 | %endif | |
58 | %endif | |
59 | BuildRequires: sed >= 4.0 | |
60 | Requires: python-PyYAML >= 3.10.0 | |
61 | Requires: python-cmd2 >= 0.6.7 | |
62 | Requires: python-prettytable >= 0.7.1 | |
63 | Requires: python-pyparsing >= 2.1.0 | |
64 | Requires: python-six >= 1.9.0 | |
65 | Requires: python-stevedore >= 1.20.0 | |
66 | Requires: python-unicodecsv >= 0.8.0 | |
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 | ||
75 | %package -n python3-cliff | |
76 | Summary: Command Line Interface Formulation Framework | |
77 | Group: Libraries/Python | |
78 | Requires: python3-PyYAML >= 3.10.0 | |
79 | Requires: python3-cmd2 >= 0.6.7 | |
80 | Requires: python3-prettytable >= 0.7.1 | |
81 | Requires: python3-pyparsing >= 2.1.0 | |
82 | Requires: python3-six >= 1.9.0 | |
83 | Requires: python3-stevedore >= 1.20.0 | |
84 | ||
85 | %description -n python3-cliff | |
86 | cliff is a framework for building command line programs. It uses | |
87 | setuptools entry points to provide subcommands, output formatters, and | |
88 | other extensions. | |
89 | ||
90 | %prep | |
91 | %setup -q -n cliff-%{version} | |
92 | ||
93 | %build | |
94 | %if %{with python2} | |
95 | %py_build %{?with_tests:test} | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %py3_build %{?with_tests:test} | |
100 | %endif | |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with python2} | |
106 | %py_install | |
107 | ||
108 | %py_postclean | |
109 | %endif | |
110 | ||
111 | %if %{with python3} | |
112 | %py3_install | |
113 | ||
114 | # python dependency generator does not support conditionals | |
115 | # remove python2-only dependencies here | |
116 | sed -i -e"/python_version<'3.0'/,+1 d" $RPM_BUILD_ROOT%{py3_sitescriptdir}/cliff-%{version}-py*.egg-info/requires.txt | |
117 | %endif | |
118 | ||
119 | %if %{with python2} | |
120 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} | |
121 | cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} | |
122 | find $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} -name '*.py' \ | |
123 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
124 | %endif | |
125 | %if %{with python3} | |
126 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} | |
127 | cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} | |
128 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} -name '*.py' \ | |
129 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
130 | %endif | |
131 | ||
132 | %clean | |
133 | rm -rf $RPM_BUILD_ROOT | |
134 | ||
135 | %if %{with python2} | |
136 | %files | |
137 | %defattr(644,root,root,755) | |
138 | %doc AUTHORS ChangeLog README.rst | |
139 | %{py_sitescriptdir}/cliff | |
140 | %{py_sitescriptdir}/cliff-%{version}-py*.egg-info | |
141 | %{_examplesdir}/python-cliff-%{version} | |
142 | %endif | |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-cliff | |
146 | %defattr(644,root,root,755) | |
147 | %doc AUTHORS ChangeLog README.rst | |
148 | %{py3_sitescriptdir}/cliff | |
149 | %{py3_sitescriptdir}/cliff-%{version}-py*.egg-info | |
150 | %{_examplesdir}/python3-cliff-%{version} | |
151 | %endif |