File python-antlr4-python3-runtime.spec of Package failed_python-antlr4-python3-runtime
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-antlr4-python3-runtime
Version: 4.13.1
Release: 0
Summary: ANTLR runtime for Python 3
License: BSD-3-Clause
URL: https://www.antlr.org
Source: https://github.com/antlr/antlr4/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: LICENSE.txt
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{python3_version_nodots} < 35
Requires: python-typing
%endif
%python_subpackages
%description
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for
reading, processing, executing, or translating structured text or binary files.
This package contains the runtime for Python 3.
%prep
%setup -q -n antlr4-%{version}/runtime/Python3
cp %{SOURCE1} LICENSE.txt
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pygrun
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%prepare_alternative pygrun
%post
%python_install_alternative pygrun
%postun
%python_uninstall_alternative pygrun
%check
cd %{_builddir}/antlr4-%{version}/runtime/Python3
%{python_expand #
PYTHONPATH=%{buildroot}%{$python_sitelib} $python tests/run.py
}
%files %{python_files}
%doc README.txt
%license LICENSE.txt
%python_alternative %{_bindir}/pygrun
%{python_sitelib}/antlr4_python3_runtime-*.dist-info
%{python_sitelib}/antlr4-*.dist-info
%{python_sitelib}/antlr4
%changelog