]>
Commit | Line | Data |
---|---|---|
985bbc54 ER |
1 | # |
2 | # Conditional build: | |
0ad3784c | 3 | %bcond_without doc # Sphinx documentation |
8c859701 | 4 | %bcond_with tests # unit tests |
985bbc54 ER |
5 | |
6 | %define module argcomplete | |
985bbc54 | 7 | Summary: Bash tab completion for argparse |
8c859701 | 8 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla argparse |
bbb7d273 JB |
9 | Name: python3-%{module} |
10 | Version: 2.0.0 | |
0c7ee9eb | 11 | Release: 2 |
985bbc54 ER |
12 | License: Apache v2.0 |
13 | Group: Libraries/Python | |
8c859701 | 14 | #Source0Download: https://github.com/kislyuk/argcomplete/releases |
bbb7d273 JB |
15 | Source0: https://github.com/kislyuk/argcomplete/archive/v%{version}/%{module}-%{version}.tar.gz |
16 | # Source0-md5: 57d492ebd86eaa4f24c1c041252b1118 | |
c2ac89bf | 17 | URL: https://github.com/kislyuk/argcomplete |
0ad3784c JB |
18 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) |
19 | BuildRequires: glibc-localedb-all | |
20 | %endif | |
bbb7d273 | 21 | BuildRequires: python3-devel >= 1:3.6 |
1e3cd944 | 22 | BuildRequires: python3-setuptools |
8c859701 JB |
23 | %if %{with tests} |
24 | %if "%{py3_ver}" < "3.8" | |
25 | BuildRequires: python3-importlib_metadata >= 0.23 | |
288b6fa1 | 26 | BuildRequires: python3-importlib_metadata < 5 |
8c859701 JB |
27 | %endif |
28 | BuildRequires: python3-pexpect | |
29 | %endif | |
8c859701 JB |
30 | BuildRequires: rpm-pythonprov |
31 | BuildRequires: rpmbuild(macros) >= 1.714 | |
0ad3784c JB |
32 | %if %{with doc} |
33 | BuildRequires: python3-guzzle_sphinx_theme | |
34 | BuildRequires: sphinx-pdg-3 | |
35 | %endif | |
1e3cd944 JR |
36 | %if %{with tests} |
37 | BuildRequires: bash | |
0ad3784c JB |
38 | BuildRequires: fish |
39 | BuildRequires: pip | |
985bbc54 | 40 | BuildRequires: tcsh |
1e3cd944 | 41 | %endif |
8c859701 JB |
42 | # pkg_resources module is used from python-argcomplete-check-easy-install-script |
43 | Requires: python-setuptools | |
985bbc54 | 44 | BuildArch: noarch |
c2ac89bf ER |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
47 | %description | |
48 | Argcomplete provides easy, extensible command line tab completion of | |
49 | arguments for your Python script. | |
50 | ||
51 | It makes two assumptions: | |
8c859701 JB |
52 | - You are using bash as your shell |
53 | - You are using argparse to manage your command line arguments/options | |
985bbc54 | 54 | |
c2ac89bf ER |
55 | Argcomplete is particularly useful if your program has lots of options |
56 | or subparsers, and if your program can dynamically suggest completions | |
57 | for your argument/option values (for example, if the user is browsing | |
58 | resources over the network). | |
985bbc54 | 59 | |
8c859701 JB |
60 | %description -l pl.UTF-8 |
61 | Argcomplete zapewnia łatwe, rozszerzalne dopełnianie tabem argumentów | |
62 | scriptów Pythona w wierszu poleceń. | |
63 | ||
64 | Czyni dwa założenia: | |
65 | - powłoką jest bash | |
66 | - skrypt używa argparse do zarządzania argumentami/opcjami linii | |
67 | poleceń | |
68 | ||
69 | Argcomplete jest przydatne szczególnie wtedy, gdy program ma wiele | |
70 | opcji lub podparserów, albo gdy może dynamicznie podpowiadać | |
71 | dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda | |
72 | zasoby sieciowe). | |
73 | ||
bbb7d273 | 74 | %package -n bash-completion-python3-argcomplete |
8c859701 JB |
75 | Summary: Bash completion for argparse |
76 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla argparse | |
77 | Group: Applications/Shells | |
78 | Requires: bash-completion >= 2.0 | |
bbb7d273 JB |
79 | Requires: python3-%{module} = %{version}-%{release} |
80 | Obsoletes: bash-completion-python-argcomplete < 2 | |
8c859701 | 81 | |
bbb7d273 | 82 | %description -n bash-completion-python3-argcomplete |
8c859701 JB |
83 | Bash completion for argparse based Python scripts. |
84 | ||
bbb7d273 | 85 | %description -n bash-completion-python3-argcomplete -l pl.UTF-8 |
8c859701 JB |
86 | Bashowe dopełnianie parametrów dla skryptów Pythona opartych na |
87 | argparse. | |
88 | ||
985bbc54 | 89 | %prep |
bbb7d273 | 90 | %setup -q -n %{module}-%{version} |
985bbc54 | 91 | |
0ad3784c JB |
92 | %package apidocs |
93 | Summary: API documentation for Python argcomplete module | |
94 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona argcomplete | |
95 | Group: Documentation | |
96 | ||
97 | %description apidocs | |
98 | API documentation for Python argcomplete module. | |
99 | ||
100 | %description apidocs -l pl.UTF-8 | |
101 | Dokumentacja API modułu Pythona argcomplete. | |
985bbc54 ER |
102 | |
103 | %build | |
8c859701 | 104 | %py3_build |
8c859701 JB |
105 | |
106 | %if %{with tests} | |
107 | %{__python3} test/test.py | |
108 | %endif | |
985bbc54 | 109 | |
0ad3784c JB |
110 | %if %{with doc} |
111 | sphinx-build-3 -b html docs docs/_build/html | |
112 | %endif | |
113 | ||
985bbc54 ER |
114 | %install |
115 | rm -rf $RPM_BUILD_ROOT | |
8c859701 | 116 | |
985bbc54 | 117 | %py3_install |
985bbc54 ER |
118 | |
119 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
8c859701 | 120 | cp -p argcomplete/bash_completion.d/python-argcomplete $RPM_BUILD_ROOT%{bash_compdir} |
985bbc54 ER |
121 | |
122 | %clean | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
985bbc54 ER |
125 | %files |
126 | %defattr(644,root,root,755) | |
8c859701 | 127 | %doc Authors.rst Changes.rst README.rst |
935ce037 JR |
128 | %attr(755,root,root) %{_bindir}/activate-global-python-argcomplete |
129 | %attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script | |
130 | %attr(755,root,root) %{_bindir}/python-argcomplete-tcsh | |
131 | %attr(755,root,root) %{_bindir}/register-python-argcomplete | |
bbb7d273 JB |
132 | %{py3_sitescriptdir}/argcomplete |
133 | %{py3_sitescriptdir}/argcomplete-%{version}-py*.egg-info | |
8c859701 | 134 | |
bbb7d273 | 135 | %files -n bash-completion-python3-argcomplete |
8c859701 JB |
136 | %defattr(644,root,root,755) |
137 | %{bash_compdir}/python-argcomplete | |
0ad3784c JB |
138 | |
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
142 | %doc docs/_build/html/{_static,*.html,*.js} | |
143 | %endif |