]> git.pld-linux.org Git - packages/python-cliff.git/blame - python-cliff.spec
- don't package tests; release 2
[packages/python-cliff.git] / python-cliff.spec
CommitLineData
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
7Summary: Command Line Interface Formulation Framework
e74d25cf 8Summary(pl.UTF-8): Command Line Interface Formulation Framework - szkielet formułowania linii poleceń
166e2be6 9Name: python-cliff
e74d25cf
JB
10# keep 2.x here for python2 support
11Version: 2.18.0
269233ed 12Release: 2
166e2be6
JK
13License: Apache
14Group: Libraries/Python
e74d25cf
JB
15Source0: https://files.pythonhosted.org/packages/source/c/cliff/cliff-%{version}.tar.gz
16# Source0-md5: 66490f2c437f543f32afe9e518e3c080
17Patch0: %{name}-prettytable.patch
18Patch1: %{name}-mock.patch
19Patch2: %{name}-py310.patch
20Patch3: %{name}-py2-test.patch
21URL: https://pypi.org/project/cliff/
166e2be6
JK
22BuildRequires: rpm-pythonprov
23BuildRequires: rpmbuild(macros) >= 1.714
24%if %{with python2}
e74d25cf 25BuildRequires: python-modules >= 1:2.7
166e2be6
JK
26BuildRequires: python-pbr >= 2.0.0
27BuildRequires: python-setuptools
28%if %{with tests}
e74d25cf
JB
29BuildRequires: python-PyYAML >= 3.12
30BuildRequires: python-cmd2 >= 0.8.0
166e2be6
JK
31BuildRequires: python-coverage >= 4.0
32BuildRequires: python-mock >= 2.0
33BuildRequires: python-openstackdocstheme >= 1.11.0
e74d25cf 34BuildRequires: python-prettytable >= 0.7.2
166e2be6 35BuildRequires: python-pyparsing >= 2.1.0
e74d25cf 36BuildRequires: python-six >= 1.10.0
166e2be6 37BuildRequires: python-stevedore >= 1.20.0
e74d25cf 38BuildRequires: python-subunit >= 1.0.0
166e2be6
JK
39BuildRequires: python-testrepository >= 0.0.18
40BuildRequires: python-testscenarios >= 0.4
e74d25cf 41BuildRequires: python-testtools >= 2.2.0
166e2be6 42BuildRequires: python-unicodecsv >= 0.8.0
e74d25cf 43BuildRequires: sphinx-pdg-2 >= 1.7.0
166e2be6
JK
44%endif
45%endif
46%if %{with python3}
e74d25cf 47BuildRequires: python3-modules >= 1:3.6
166e2be6
JK
48BuildRequires: python3-pbr >= 2.0.0
49%if %{with tests}
e74d25cf
JB
50BuildRequires: python3-PyYAML >= 3.12
51BuildRequires: python3-cmd2 >= 0.8.0
166e2be6 52BuildRequires: python3-coverage >= 4.0
166e2be6 53BuildRequires: python3-openstackdocstheme >= 1.11.0
e74d25cf 54BuildRequires: python3-prettytable >= 0.7.2
166e2be6 55BuildRequires: python3-pyparsing >= 2.1.0
e74d25cf 56BuildRequires: python3-six >= 1.10.0
166e2be6 57BuildRequires: python3-stevedore >= 1.20.0
e74d25cf 58BuildRequires: python3-subunit >= 1.0.0
166e2be6
JK
59BuildRequires: python3-testrepository >= 0.0.18
60BuildRequires: python3-testscenarios >= 0.4
e74d25cf
JB
61BuildRequires: python3-testtools >= 2.2.0
62BuildRequires: sphinx-pdg-3 >= 1.7.0
166e2be6
JK
63%endif
64%endif
65BuildRequires: sed >= 4.0
e74d25cf 66Requires: python-modules >= 1:2.7
166e2be6
JK
67BuildArch: noarch
68BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70%description
71cliff is a framework for building command line programs. It uses
72setuptools entry points to provide subcommands, output formatters, and
73other extensions.
74
e74d25cf
JB
75%description -l pl.UTF-8
76cliff to szkielet do budowania programów działających z linii poleceń.
77Wykorzystuje punkty wejściowe setuptools do zapewnienia podpoleceń,
78funkcje formatujące wyjścia i inne rozszerzenia.
79
166e2be6
JK
80%package -n python3-cliff
81Summary: Command Line Interface Formulation Framework
e74d25cf 82Summary(pl.UTF-8): Command Line Interface Formulation Framework - szkielet formułowania linii poleceń
166e2be6 83Group: Libraries/Python
e74d25cf 84Requires: python3-modules >= 1:3.6
166e2be6
JK
85
86%description -n python3-cliff
87cliff is a framework for building command line programs. It uses
88setuptools entry points to provide subcommands, output formatters, and
89other extensions.
90
e74d25cf
JB
91%description -n python3-cliff -l pl.UTF-8
92cliff to szkielet do budowania programów działających z linii poleceń.
93Wykorzystuje punkty wejściowe setuptools do zapewnienia podpoleceń,
94funkcje 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 105export 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 114export 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
123rm -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}
140install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version}
141cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version}
142find $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} -name '*.py' \
143 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
144%endif
145%if %{with python3}
146install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version}
147cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version}
148find $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} -name '*.py' \
149 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
150%endif
151
152%clean
153rm -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
This page took 0.212348 seconds and 4 git commands to generate.