]> git.pld-linux.org Git - packages/python-cliff.git/blob - python-cliff.spec
2a0ca8fcc5c01cc05f91c0027100881619bf7274
[packages/python-cliff.git] / python-cliff.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
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 Summary(pl.UTF-8):      Command Line Interface Formulation Framework - szkielet formułowania linii poleceń
9 Name:           python-cliff
10 # keep 2.x here for python2 support
11 Version:        2.18.0
12 Release:        1
13 License:        Apache
14 Group:          Libraries/Python
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/
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.714
24 %if %{with python2}
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-pbr >= 2.0.0
27 BuildRequires:  python-setuptools
28 %if %{with tests}
29 BuildRequires:  python-PyYAML >= 3.12
30 BuildRequires:  python-cmd2 >= 0.8.0
31 BuildRequires:  python-coverage >= 4.0
32 BuildRequires:  python-mock >= 2.0
33 BuildRequires:  python-openstackdocstheme >= 1.11.0
34 BuildRequires:  python-prettytable >= 0.7.2
35 BuildRequires:  python-pyparsing >= 2.1.0
36 BuildRequires:  python-six >= 1.10.0
37 BuildRequires:  python-stevedore >= 1.20.0
38 BuildRequires:  python-subunit >= 1.0.0
39 BuildRequires:  python-testrepository >= 0.0.18
40 BuildRequires:  python-testscenarios >= 0.4
41 BuildRequires:  python-testtools >= 2.2.0
42 BuildRequires:  python-unicodecsv >= 0.8.0
43 BuildRequires:  sphinx-pdg-2 >= 1.7.0
44 %endif
45 %endif
46 %if %{with python3}
47 BuildRequires:  python3-modules >= 1:3.6
48 BuildRequires:  python3-pbr >= 2.0.0
49 %if %{with tests}
50 BuildRequires:  python3-PyYAML >= 3.12
51 BuildRequires:  python3-cmd2 >= 0.8.0
52 BuildRequires:  python3-coverage >= 4.0
53 BuildRequires:  python3-openstackdocstheme >= 1.11.0
54 BuildRequires:  python3-prettytable >= 0.7.2
55 BuildRequires:  python3-pyparsing >= 2.1.0
56 BuildRequires:  python3-six >= 1.10.0
57 BuildRequires:  python3-stevedore >= 1.20.0
58 BuildRequires:  python3-subunit >= 1.0.0
59 BuildRequires:  python3-testrepository >= 0.0.18
60 BuildRequires:  python3-testscenarios >= 0.4
61 BuildRequires:  python3-testtools >= 2.2.0
62 BuildRequires:  sphinx-pdg-3 >= 1.7.0
63 %endif
64 %endif
65 BuildRequires:  sed >= 4.0
66 Requires:       python-modules >= 1:2.7
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 %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
80 %package -n python3-cliff
81 Summary:        Command Line Interface Formulation Framework
82 Summary(pl.UTF-8):      Command Line Interface Formulation Framework - szkielet formułowania linii poleceń
83 Group:          Libraries/Python
84 Requires:       python3-modules >= 1:3.6
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
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
96 %prep
97 %setup -q -n cliff-%{version}
98 %patch0 -p1
99 %patch1 -p1
100 %patch2 -p1
101 %patch3 -p1
102
103 %build
104 %if %{with python2}
105 export PYTHON="%{__python}"
106 %py_build %{?with_tests:test}
107
108 %if %{with tests}
109 %{__rm} -r .testrepository
110 %endif
111 %endif
112
113 %if %{with python3}
114 export PYTHON="%{__python3}"
115 %py3_build %{?with_tests:test}
116
117 %if %{with tests}
118 %{__rm} -r .testrepository
119 %endif
120 %endif
121
122 %install
123 rm -rf $RPM_BUILD_ROOT
124
125 %if %{with python2}
126 %py_install
127
128 %py_postclean
129 %endif
130
131 %if %{with python3}
132 %py3_install
133 %endif
134
135 %if %{with python2}
136 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version}
137 cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version}
138 find $RPM_BUILD_ROOT%{_examplesdir}/python-cliff-%{version} -name '*.py' \
139         | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
140 %endif
141 %if %{with python3}
142 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version}
143 cp -a demoapp/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version}
144 find $RPM_BUILD_ROOT%{_examplesdir}/python3-cliff-%{version} -name '*.py' \
145         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
146 %endif
147
148 %clean
149 rm -rf $RPM_BUILD_ROOT
150
151 %if %{with python2}
152 %files
153 %defattr(644,root,root,755)
154 %doc AUTHORS ChangeLog README.rst
155 %{py_sitescriptdir}/cliff
156 %{py_sitescriptdir}/cliff-%{version}-py*.egg-info
157 %{_examplesdir}/python-cliff-%{version}
158 %endif
159
160 %if %{with python3}
161 %files -n python3-cliff
162 %defattr(644,root,root,755)
163 %doc AUTHORS ChangeLog README.rst
164 %{py3_sitescriptdir}/cliff
165 %{py3_sitescriptdir}/cliff-%{version}-py*.egg-info
166 %{_examplesdir}/python3-cliff-%{version}
167 %endif
This page took 0.069349 seconds and 2 git commands to generate.