#
# Conditional build:
-%bcond_without tests # do not perform "make test"
+%bcond_with tests # do not perform "make test"
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
Summary: Bash tab completion for argparse
Name: python-%{pypi_name}
Version: 1.9.3
-Release: 1
+Release: 3
License: Apache v2.0
Group: Libraries/Python
Source0: https://github.com/kislyuk/argcomplete/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
URL: https://github.com/kislyuk/argcomplete
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
-%if %{with check}
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%endif
+%if %{with tests}
+BuildRequires: bash
BuildRequires: tcsh
+%if %{with python3}
+BuildRequires: python3-pexpect
+%endif
%endif
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%package -n python3-%{pypi_name}
Summary: %{summary}
Group: Libraries/Python
-BuildRequires: python3-devel
-BuildRequires: python3-setuptools
-%if %{with check}
-BuildRequires: python3-pexpect
-%endif
# pkg_resources module is used from python-argcomplete-check-easy-install-script
Requires: python3-setuptools
%endif
%if %{with python3}
+%{__rm} -r $RPM_BUILD_ROOT/%{_bindir}
%py3_install
%endif
%files
%defattr(644,root,root,755)
%doc README.rst LICENSE.rst
+%if %{without python3}
+%attr(755,root,root) %{_bindir}/activate-global-python-argcomplete
+%attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script
+%attr(755,root,root) %{_bindir}/python-argcomplete-tcsh
+%attr(755,root,root) %{_bindir}/register-python-argcomplete
+%endif
%{py_sitescriptdir}/%{module}
%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
%endif