1 |
%global modname argcomplete |
2 |
|
3 |
# Currently it's broken: https://github.com/kislyuk/argcomplete/issues/174 |
4 |
%bcond_with check |
5 |
|
6 |
Name: python-%{modname} |
7 |
Summary: Bash tab completion for argparse |
8 |
Version: 1.8.2 |
9 |
Release: %mkrel 2 |
10 |
Group: Development/Python |
11 |
License: ASL 2.0 |
12 |
URL: https://github.com/kislyuk/argcomplete |
13 |
Source0: %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz |
14 |
|
15 |
BuildRequires: pkgconfig(python2) |
16 |
BuildRequires: pythonegg(2)(setuptools) |
17 |
|
18 |
%if %{with check} |
19 |
BuildRequires: pythonegg(2)(pexpect) |
20 |
BuildRequires: tcsh |
21 |
%endif |
22 |
|
23 |
BuildArch: noarch |
24 |
|
25 |
%global _description \ |
26 |
Argcomplete provides easy, extensible command line tab completion of\ |
27 |
arguments for your Python script.\ |
28 |
\ |
29 |
It makes two assumptions:\ |
30 |
\ |
31 |
* You are using bash as your shell\ |
32 |
* You are using argparse to manage your command line arguments/options\ |
33 |
\ |
34 |
Argcomplete is particularly useful if your program has lots of\ |
35 |
options or subparsers, and if your program can dynamically suggest\ |
36 |
completions for your argument/option values (for example, if the user\ |
37 |
is browsing resources over the network). |
38 |
|
39 |
%description %{_description} |
40 |
|
41 |
Python 2 version. |
42 |
|
43 |
%package -n python3-%{modname} |
44 |
Summary: %{summary} |
45 |
Group: Development/Python |
46 |
|
47 |
BuildRequires: pkgconfig(python3) |
48 |
BuildRequires: pythonegg(3)(setuptools) |
49 |
|
50 |
%if %{with check} |
51 |
BuildRequires: pythonegg(3)(pexpect) |
52 |
BuildRequires: tcsh |
53 |
%endif |
54 |
|
55 |
# pkg_resources module is used from python-argcomplete-check-easy-install-script |
56 |
Requires: pythonegg(3)(setuptools) |
57 |
|
58 |
%description -n python3-%{modname} %{_description} |
59 |
|
60 |
Python 3 version. |
61 |
|
62 |
%prep |
63 |
%autosetup -n %{modname}-%{version} |
64 |
# Remove useless BRs |
65 |
sed -i -r -e '/tests_require = /s/"(coverage|flake8|wheel)"[, ]*//g' setup.py |
66 |
|
67 |
%build |
68 |
%py2_build |
69 |
%py3_build |
70 |
|
71 |
%install |
72 |
%py2_install |
73 |
%py3_install |
74 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ |
75 |
install -p -m0644 %{buildroot}%{python3_sitelib}/%{modname}/bash_completion.d/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/ |
76 |
|
77 |
%if %{with check} |
78 |
%check |
79 |
export LC_ALL=C.UTF-8 |
80 |
%{__python2} setup.py test |
81 |
%{__python3} setup.py test |
82 |
%endif |
83 |
|
84 |
%files |
85 |
%license LICENSE.rst |
86 |
%doc README.rst |
87 |
%{python2_sitelib}/%{modname}-*.egg-info/ |
88 |
%{python2_sitelib}/%{modname}/ |
89 |
|
90 |
%files -n python3-%{modname} |
91 |
%license LICENSE.rst |
92 |
%doc README.rst |
93 |
%{python3_sitelib}/%{modname}-*.egg-info/ |
94 |
%{python3_sitelib}/%{modname}/ |
95 |
%{_bindir}/activate-global-python-argcomplete |
96 |
%{_bindir}/python-argcomplete-check-easy-install-script |
97 |
%{_bindir}/python-argcomplete-tcsh |
98 |
%{_bindir}/register-python-argcomplete |
99 |
%{_sysconfdir}/bash_completion.d/python-argcomplete.sh |