]> git.pld-linux.org Git - packages/python-argcomplete.git/blame - python-argcomplete.spec
- fix bconds
[packages/python-argcomplete.git] / python-argcomplete.spec
CommitLineData
985bbc54
ER
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module argcomplete
8%define egg_name argcomplete
9%define pypi_name argcomplete
10Summary: Bash tab completion for argparse
11Name: python-%{pypi_name}
12Version: 1.9.3
13Release: 1
14License: Apache v2.0
15Group: Libraries/Python
c2ac89bf 16Source0: https://github.com/kislyuk/argcomplete/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
985bbc54 17# Source0-md5: 18afda95a2726eb24df810645bef4b38
c2ac89bf 18URL: https://github.com/kislyuk/argcomplete
985bbc54
ER
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
1e3cd944
JR
21%if %{with python3}
22BuildRequires: python3-devel
23BuildRequires: python3-setuptools
24%endif
25%if %{with tests}
26BuildRequires: bash
985bbc54 27BuildRequires: tcsh
1e3cd944
JR
28%if %{with python3}
29BuildRequires: python3-pexpect
30%endif
985bbc54
ER
31%endif
32BuildArch: noarch
c2ac89bf
ER
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36Argcomplete provides easy, extensible command line tab completion of
37arguments for your Python script.
38
39It makes two assumptions:
985bbc54 40
c2ac89bf
ER
41 - You are using bash as your shell
42 - You are using argparse to manage your command line arguments/options
985bbc54 43
c2ac89bf
ER
44Argcomplete is particularly useful if your program has lots of options
45or subparsers, and if your program can dynamically suggest completions
46for your argument/option values (for example, if the user is browsing
47resources over the network).
985bbc54
ER
48
49%package -n python3-%{pypi_name}
50Summary: %{summary}
51Group: Libraries/Python
985bbc54
ER
52# pkg_resources module is used from python-argcomplete-check-easy-install-script
53Requires: python3-setuptools
54
c2ac89bf
ER
55%description -n python3-%{pypi_name}
56Argcomplete provides easy, extensible command line tab completion of
57arguments for your Python script.
58
59It makes two assumptions:
60
61 - You are using bash as your shell
62 - You are using argparse to manage your command line arguments/options
63
64Argcomplete is particularly useful if your program has lots of options
65or subparsers, and if your program can dynamically suggest completions
66for your argument/option values (for example, if the user is browsing
67resources over the network).
985bbc54
ER
68
69%prep
70%setup -q -n %{pypi_name}-%{version}
71
72# Remove useless BRs
73sed -i -r -e '/tests_require = /s/"(coverage|flake8|wheel)"[, ]*//g' setup.py
74
75%build
76export LC_ALL=C.UTF-8
77%if %{with python2}
78%py_build %{?with_tests:test}
79%endif
80
81%if %{with python3}
82%py3_build %{?with_tests:test}
83%endif
84
85%install
86rm -rf $RPM_BUILD_ROOT
87%if %{with python2}
88%py_install
89%py_postclean
90%endif
91
92%if %{with python3}
93%py3_install
94%endif
95
96install -d $RPM_BUILD_ROOT%{bash_compdir}
97install -p $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{pypi_name}/bash_completion.d/python-argcomplete.sh \
98 $RPM_BUILD_ROOT%{bash_compdir}
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
103%if %{with python2}
104%files
105%defattr(644,root,root,755)
106%doc README.rst LICENSE.rst
107%{py_sitescriptdir}/%{module}
108%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
109%endif
110
111%if %{with python3}
112%files -n python3-%{pypi_name}
113%defattr(644,root,root,755)
114%doc README.rst LICENSE.rst
115%attr(755,root,root) %{_bindir}/activate-global-python-argcomplete
116%attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script
117%attr(755,root,root) %{_bindir}/python-argcomplete-tcsh
118%attr(755,root,root) %{_bindir}/register-python-argcomplete
119%{py3_sitescriptdir}/%{module}
120%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
121%{bash_compdir}/python-argcomplete.sh
122%endif
This page took 0.035088 seconds and 4 git commands to generate.