]> git.pld-linux.org Git - packages/python-argcomplete.git/blob - python-argcomplete.spec
- disable python3 here
[packages/python-argcomplete.git] / python-argcomplete.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_with     tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_with     python3 # CPython 3.x module (built from python3-argcomplete.spec)
7
8 %define         module          argcomplete
9 %define         egg_name        argcomplete
10 %define         pypi_name       argcomplete
11 Summary:        Bash tab completion for argparse
12 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla argparse
13 Name:           python-%{pypi_name}
14 # keep 1.12.x here for python2 support
15 Version:        1.12.3
16 Release:        1
17 License:        Apache v2.0
18 Group:          Libraries/Python
19 #Source0Download: https://github.com/kislyuk/argcomplete/releases
20 Source0:        https://github.com/kislyuk/argcomplete/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
21 # Source0-md5:  de46337e0189224a6efd46569526bad8
22 URL:            https://github.com/kislyuk/argcomplete
23 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
24 BuildRequires:  glibc-localedb-all
25 %endif
26 %if %{with python2}
27 BuildRequires:  python-devel >= 1:2.7
28 BuildRequires:  python-setuptools
29 %if %{with tests}
30 BuildRequires:  python-importlib_metadata >= 0.23
31 BuildRequires:  python-importlib_metadata < 5
32 BuildRequires:  python-pexpect
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-devel >= 1:3.5
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
39 %if "%{py3_ver}" < "3.8"
40 BuildRequires:  python3-importlib_metadata >= 0.23
41 BuildRequires:  python3-importlib_metadata < 5
42 %endif
43 BuildRequires:  python3-pexpect
44 %endif
45 %endif
46 BuildRequires:  rpm-pythonprov
47 BuildRequires:  rpmbuild(macros) >= 1.714
48 %if %{with doc}
49 BuildRequires:  python3-guzzle_sphinx_theme
50 BuildRequires:  sphinx-pdg-3
51 %endif
52 %if %{with tests}
53 BuildRequires:  bash
54 BuildRequires:  fish
55 BuildRequires:  pip
56 BuildRequires:  tcsh
57 %endif
58 %if %{without python3}
59 # pkg_resources module is used from python-argcomplete-check-easy-install-script
60 Requires:       python-setuptools
61 %endif
62 BuildArch:      noarch
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %description
66 Argcomplete provides easy, extensible command line tab completion of
67 arguments for your Python script.
68
69 It makes two assumptions:
70 - You are using bash as your shell
71 - You are using argparse to manage your command line arguments/options
72
73 Argcomplete is particularly useful if your program has lots of options
74 or subparsers, and if your program can dynamically suggest completions
75 for your argument/option values (for example, if the user is browsing
76 resources over the network).
77
78 %description -l pl.UTF-8
79 Argcomplete zapewnia łatwe, rozszerzalne dopełnianie tabem argumentów
80 scriptów Pythona w wierszu poleceń.
81
82 Czyni dwa założenia:
83 - powłoką jest bash
84 - skrypt używa argparse do zarządzania argumentami/opcjami linii
85   poleceń
86
87 Argcomplete jest przydatne szczególnie wtedy, gdy program ma wiele
88 opcji lub podparserów, albo gdy może dynamicznie podpowiadać
89 dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda
90 zasoby sieciowe).
91
92 %package -n python3-%{pypi_name}
93 Summary:        Bash tab completion for argparse
94 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla argparse
95 Group:          Libraries/Python
96 # pkg_resources module is used from python-argcomplete-check-easy-install-script
97 Requires:       python3-setuptools
98
99 %description -n python3-%{pypi_name}
100 Argcomplete provides easy, extensible command line tab completion of
101 arguments for your Python script.
102
103 It makes two assumptions:
104 - You are using bash as your shell
105 - You are using argparse to manage your command line arguments/options
106
107 Argcomplete is particularly useful if your program has lots of options
108 or subparsers, and if your program can dynamically suggest completions
109 for your argument/option values (for example, if the user is browsing
110 resources over the network).
111
112 %description -n python3-%{pypi_name} -l pl.UTF-8
113 Argcomplete zapewnia łatwe, rozszerzalne dopełnianie tabem argumentów
114 scriptów Pythona w wierszu poleceń.
115
116 Czyni dwa założenia:
117 - powłoką jest bash
118 - skrypt używa argparse do zarządzania argumentami/opcjami linii
119   poleceń
120
121 Argcomplete jest przydatne szczególnie wtedy, gdy program ma wiele
122 opcji lub podparserów, albo gdy może dynamicznie podpowiadać
123 dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda
124 zasoby sieciowe).
125
126 %package -n bash-completion-python-argcomplete
127 Summary:        Bash completion for argparse
128 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla argparse
129 Group:          Applications/Shells
130 Requires:       bash-completion >= 2.0
131 Suggests:       %{name} = %{version}-%{release}
132 Suggests:       python3-%{pypi_name} = %{version}-%{release}
133
134 %description -n bash-completion-python-argcomplete
135 Bash completion for argparse based Python scripts.
136
137 %description -n bash-completion-python-argcomplete -l pl.UTF-8
138 Bashowe dopełnianie parametrów dla skryptów Pythona opartych na
139 argparse.
140
141 %prep
142 %setup -q -n %{pypi_name}-%{version}
143
144 %package apidocs
145 Summary:        API documentation for Python argcomplete module
146 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona argcomplete
147 Group:          Documentation
148
149 %description apidocs
150 API documentation for Python argcomplete module.
151
152 %description apidocs -l pl.UTF-8
153 Dokumentacja API modułu Pythona argcomplete.
154
155 %build
156 export LC_ALL=C.UTF-8
157 %if %{with python2}
158 %py_build
159
160 %if %{with tests}
161 %{__python} test/test.py
162 %endif
163 %endif
164
165 %if %{with python3}
166 %py3_build
167
168 %if %{with tests}
169 %{__python3} test/test.py
170 %endif
171 %endif
172
173 %if %{with doc}
174 sphinx-build-3 -b html docs docs/_build/html
175 %endif
176
177 %install
178 rm -rf $RPM_BUILD_ROOT
179 %if %{with python2}
180 %py_install
181
182 %py_postclean
183 %endif
184
185 %if %{with python3}
186 %{__rm} -r $RPM_BUILD_ROOT%{_bindir}
187 %py3_install
188 %endif
189
190 install -d $RPM_BUILD_ROOT%{bash_compdir}
191 cp -p argcomplete/bash_completion.d/python-argcomplete $RPM_BUILD_ROOT%{bash_compdir}
192
193 %clean
194 rm -rf $RPM_BUILD_ROOT
195
196 %if %{with python2}
197 %files
198 %defattr(644,root,root,755)
199 %doc Authors.rst Changes.rst README.rst
200 %if %{without python3}
201 %attr(755,root,root) %{_bindir}/activate-global-python-argcomplete
202 %attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script
203 %attr(755,root,root) %{_bindir}/python-argcomplete-tcsh
204 %attr(755,root,root) %{_bindir}/register-python-argcomplete
205 %endif
206 %{py_sitescriptdir}/%{module}
207 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
208 %endif
209
210 %if %{with python3}
211 %files -n python3-%{pypi_name}
212 %defattr(644,root,root,755)
213 %doc Authors.rst Changes.rst README.rst
214 %attr(755,root,root) %{_bindir}/activate-global-python-argcomplete
215 %attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script
216 %attr(755,root,root) %{_bindir}/python-argcomplete-tcsh
217 %attr(755,root,root) %{_bindir}/register-python-argcomplete
218 %{py3_sitescriptdir}/%{module}
219 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
220 %endif
221
222 %files -n bash-completion-python-argcomplete
223 %defattr(644,root,root,755)
224 %{bash_compdir}/python-argcomplete
225
226 %if %{with doc}
227 %files apidocs
228 %defattr(644,root,root,755)
229 %doc docs/_build/html/{_static,*.html,*.js}
230 %endif
This page took 0.092361 seconds and 3 git commands to generate.