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.9.5 |
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 python2-%{srcname} |
33 |
Summary: %{summary} |
34 |
Group: Development/Python |
35 |
BuildRequires: pkgconfig(python2) |
36 |
BuildRequires: python2dist(setuptools) |
37 |
%if %{with check} |
38 |
BuildRequires: python2dist(pexpect) |
39 |
BuildRequires: tcsh |
40 |
%endif |
41 |
%{?python_provide:%python_provide python2-%{srcname}} |
42 |
|
43 |
%description -n python2-%{srcname} %{_description} |
44 |
|
45 |
%package -n python3-%{srcname} |
46 |
Summary: %{summary} |
47 |
Group: Development/Python |
48 |
BuildRequires: pkgconfig(python3) |
49 |
BuildRequires: python3dist(setuptools) |
50 |
%if %{with check} |
51 |
BuildRequires: python3dist(pexpect) |
52 |
BuildRequires: tcsh |
53 |
%endif |
54 |
%{?python_provide:%python_provide python3-%{srcname}} |
55 |
|
56 |
# pkg_resources module is used from python-argcomplete-check-easy-install-script |
57 |
Requires: python3dist(setuptools) |
58 |
|
59 |
%description -n python3-%{srcname} %{_description} |
60 |
|
61 |
%prep |
62 |
%autosetup -n %{srcname}-%{version} |
63 |
|
64 |
# Drop bundled egg-info |
65 |
rm -rf %{srcname}.egg-info |
66 |
|
67 |
# Remove useless BRs |
68 |
sed -i -r -e '/tests_require = /s/"(coverage|flake8|wheel)"[, ]*//g' setup.py |
69 |
|
70 |
%build |
71 |
%py2_build |
72 |
%py3_build |
73 |
|
74 |
%install |
75 |
%py2_install |
76 |
%py3_install |
77 |
|
78 |
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ |
79 |
install -p -m0644 %{buildroot}%{python3_sitelib}/%{srcname}/bash_completion.d/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/ |
80 |
|
81 |
%if %{with check} |
82 |
%check |
83 |
export LC_ALL=C.UTF-8 |
84 |
%{__python2} setup.py test |
85 |
%{__python3} setup.py test |
86 |
%endif |
87 |
|
88 |
%files -n python2-%{srcname} |
89 |
%license LICENSE.rst |
90 |
%doc README.rst |
91 |
%{python2_sitelib}/%{srcname}-*.egg-info/ |
92 |
%{python2_sitelib}/%{srcname}/ |
93 |
|
94 |
%files -n python3-%{srcname} |
95 |
%license LICENSE.rst |
96 |
%doc README.rst |
97 |
%{python3_sitelib}/%{srcname}-*.egg-info/ |
98 |
%{python3_sitelib}/%{srcname}/ |
99 |
%{_bindir}/activate-global-python-argcomplete |
100 |
%{_bindir}/python-argcomplete-check-easy-install-script |
101 |
%{_bindir}/python-argcomplete-tcsh |
102 |
%{_bindir}/register-python-argcomplete |
103 |
%{_sysconfdir}/bash_completion.d/python-argcomplete.sh |