# Conditional build:
%bcond_without doc # Sphinx documentation
%bcond_with tests # unit tests
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
%define module argcomplete
-%define egg_name argcomplete
-%define pypi_name argcomplete
Summary: Bash tab completion for argparse
Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla argparse
-Name: python-%{pypi_name}
-# keep 1.12.x here for python2 support
-Version: 1.12.3
+Name: python3-%{module}
+Version: 2.0.0
Release: 1
License: Apache v2.0
Group: Libraries/Python
#Source0Download: https://github.com/kislyuk/argcomplete/releases
-Source0: https://github.com/kislyuk/argcomplete/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
-# Source0-md5: de46337e0189224a6efd46569526bad8
+Source0: https://github.com/kislyuk/argcomplete/archive/v%{version}/%{module}-%{version}.tar.gz
+# Source0-md5: 57d492ebd86eaa4f24c1c041252b1118
URL: https://github.com/kislyuk/argcomplete
%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
BuildRequires: glibc-localedb-all
%endif
-%if %{with python2}
-BuildRequires: python-devel >= 1:2.7
-BuildRequires: python-setuptools
-%if %{with tests}
-BuildRequires: python-importlib_metadata >= 0.23
-BuildRequires: python-importlib_metadata < 5
-BuildRequires: python-pexpect
-%endif
-%endif
-%if %{with python3}
-BuildRequires: python3-devel >= 1:3.5
+BuildRequires: python3-devel >= 1:3.6
BuildRequires: python3-setuptools
%if %{with tests}
%if "%{py3_ver}" < "3.8"
%endif
BuildRequires: python3-pexpect
%endif
-%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with doc}
BuildRequires: pip
BuildRequires: tcsh
%endif
-%if %{without python3}
# pkg_resources module is used from python-argcomplete-check-easy-install-script
Requires: python-setuptools
-%endif
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda
zasoby sieciowe).
-%package -n python3-%{pypi_name}
-Summary: Bash tab completion for argparse
-Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla argparse
-Group: Libraries/Python
-# pkg_resources module is used from python-argcomplete-check-easy-install-script
-Requires: python3-setuptools
-
-%description -n python3-%{pypi_name}
-Argcomplete provides easy, extensible command line tab completion of
-arguments for your Python script.
-
-It makes two assumptions:
-- You are using bash as your shell
-- You are using argparse to manage your command line arguments/options
-
-Argcomplete is particularly useful if your program has lots of options
-or subparsers, and if your program can dynamically suggest completions
-for your argument/option values (for example, if the user is browsing
-resources over the network).
-
-%description -n python3-%{pypi_name} -l pl.UTF-8
-Argcomplete zapewnia łatwe, rozszerzalne dopełnianie tabem argumentów
-scriptów Pythona w wierszu poleceń.
-
-Czyni dwa założenia:
-- powłoką jest bash
-- skrypt używa argparse do zarządzania argumentami/opcjami linii
- poleceń
-
-Argcomplete jest przydatne szczególnie wtedy, gdy program ma wiele
-opcji lub podparserów, albo gdy może dynamicznie podpowiadać
-dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda
-zasoby sieciowe).
-
-%package -n bash-completion-python-argcomplete
+%package -n bash-completion-python3-argcomplete
Summary: Bash completion for argparse
Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla argparse
Group: Applications/Shells
Requires: bash-completion >= 2.0
-Suggests: %{name} = %{version}-%{release}
-Suggests: python3-%{pypi_name} = %{version}-%{release}
+Requires: python3-%{module} = %{version}-%{release}
+Obsoletes: bash-completion-python-argcomplete < 2
-%description -n bash-completion-python-argcomplete
+%description -n bash-completion-python3-argcomplete
Bash completion for argparse based Python scripts.
-%description -n bash-completion-python-argcomplete -l pl.UTF-8
+%description -n bash-completion-python3-argcomplete -l pl.UTF-8
Bashowe dopełnianie parametrów dla skryptów Pythona opartych na
argparse.
%prep
-%setup -q -n %{pypi_name}-%{version}
+%setup -q -n %{module}-%{version}
%package apidocs
Summary: API documentation for Python argcomplete module
Dokumentacja API modułu Pythona argcomplete.
%build
-export LC_ALL=C.UTF-8
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-%{__python} test/test.py
-%endif
-%endif
-
-%if %{with python3}
%py3_build
%if %{with tests}
%{__python3} test/test.py
%endif
-%endif
%if %{with doc}
sphinx-build-3 -b html docs docs/_build/html
%install
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
-%py_install
-%py_postclean
-%endif
-
-%if %{with python3}
-%{__rm} -r $RPM_BUILD_ROOT%{_bindir}
%py3_install
-%endif
install -d $RPM_BUILD_ROOT%{bash_compdir}
cp -p argcomplete/bash_completion.d/python-argcomplete $RPM_BUILD_ROOT%{bash_compdir}
%clean
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
%files
%defattr(644,root,root,755)
%doc Authors.rst Changes.rst README.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
-
-%if %{with python3}
-%files -n python3-%{pypi_name}
-%defattr(644,root,root,755)
-%doc Authors.rst Changes.rst README.rst
-%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
-%{py3_sitescriptdir}/%{module}
-%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
-%endif
+%{py3_sitescriptdir}/argcomplete
+%{py3_sitescriptdir}/argcomplete-%{version}-py*.egg-info
-%files -n bash-completion-python-argcomplete
+%files -n bash-completion-python3-argcomplete
%defattr(644,root,root,755)
%{bash_compdir}/python-argcomplete