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