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