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