2013-08-01 12:15:57 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-Parsley
|
|
|
|
#
|
2025-03-25 04:23:09 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2013-08-01 12:15:57 +00:00
|
|
|
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-10-14 13:44:30 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-08-01 12:15:57 +00:00
|
|
|
#
|
|
|
|
|
2015-06-08 06:56:53 +00:00
|
|
|
|
2023-05-05 13:36:23 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2020-08-12 22:50:53 +00:00
|
|
|
%define modname Parsley
|
2018-08-23 11:18:12 +00:00
|
|
|
%define oldpython python
|
2013-08-01 12:15:57 +00:00
|
|
|
Name: python-Parsley
|
2018-08-23 11:18:12 +00:00
|
|
|
Version: 1.3
|
2013-08-01 12:15:57 +00:00
|
|
|
Release: 0
|
2018-08-25 20:09:36 +00:00
|
|
|
Summary: PEG algorithm based parser generator
|
2015-06-08 06:56:53 +00:00
|
|
|
License: MIT
|
2024-01-09 03:43:33 +00:00
|
|
|
URL: https://github.com/pyga/parsley
|
2020-08-12 22:50:53 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/P/%{modname}/%{modname}-%{version}.tar.gz
|
2024-01-09 03:43:33 +00:00
|
|
|
# PATCH-FIX-UPSTREAM gh#pyga/parsley#82
|
|
|
|
Patch0: support-python312.patch
|
2018-08-23 11:18:12 +00:00
|
|
|
BuildRequires: %{python_module Twisted}
|
2024-01-09 03:43:33 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2018-08-23 11:18:12 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-01-09 03:43:33 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2013-08-01 12:15:57 +00:00
|
|
|
BuildRequires: fdupes
|
2018-08-23 11:18:12 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-05-20 11:27:58 +00:00
|
|
|
Requires(post): update-alternatives
|
2025-03-25 04:23:09 +00:00
|
|
|
Requires(postun): update-alternatives
|
2018-08-23 11:18:12 +00:00
|
|
|
Provides: python-parsley
|
|
|
|
Obsoletes: %{oldpython}-Parsley-doc
|
|
|
|
Obsoletes: python-Parsley-doc
|
2013-08-01 12:15:57 +00:00
|
|
|
BuildArch: noarch
|
2018-08-23 11:18:12 +00:00
|
|
|
%python_subpackages
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
%description
|
2018-08-25 20:09:36 +00:00
|
|
|
Parsley is a parsing library. Most parser generators like ANTLR and
|
|
|
|
Bison are based on LL or LR parsing algorithms that compile to big
|
|
|
|
state machine tables, whereas Parsley, like pyparsing and
|
|
|
|
ZestyParser, uses the PEG algorithm, so each expression in the
|
|
|
|
grammar rules works like a Python expression. In particular,
|
|
|
|
alternatives are evaluated in order, unlike table-driven parsers such
|
|
|
|
as yacc, bison or PLY.
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
The binaries are prefixed with parsley-.
|
|
|
|
|
|
|
|
%prep
|
2024-01-09 03:43:33 +00:00
|
|
|
%autosetup -p1 -n %{modname}-%{version}
|
2018-08-23 11:18:12 +00:00
|
|
|
# Remove with bump, missing fixtures
|
|
|
|
rm -f ometa/test/test_vm_builder.py
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
%build
|
2018-08-23 11:18:12 +00:00
|
|
|
export LANG=en_US.UTF-8
|
2024-01-09 03:43:33 +00:00
|
|
|
%pyproject_wheel
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
%install
|
2018-08-23 11:18:12 +00:00
|
|
|
export LANG=en_US.UTF-8
|
2024-01-09 03:43:33 +00:00
|
|
|
%pyproject_install
|
2013-08-01 12:15:57 +00:00
|
|
|
mkdir %{buildroot}/%{_bindir}
|
|
|
|
# rename binaries in order to avoid name clashes with other system packages
|
|
|
|
for f in {generate_parser,stage}; do
|
2018-08-23 11:18:12 +00:00
|
|
|
sed -i \
|
|
|
|
-e "s|^#!%{_bindir}/env python$|#!%{_bindir}/python3|" \
|
|
|
|
bin/$f
|
2013-08-01 12:15:57 +00:00
|
|
|
cp -v bin/$f %{buildroot}/%{_bindir}/parsley-$f
|
2020-05-20 11:27:58 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/parsley-$f
|
2013-08-01 12:15:57 +00:00
|
|
|
done
|
2015-06-08 06:56:53 +00:00
|
|
|
|
2018-08-23 11:18:12 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
%check
|
2018-08-23 11:18:12 +00:00
|
|
|
export LANG=en_US.UTF-8
|
2019-11-07 15:02:28 +00:00
|
|
|
%pytest ometa/test
|
|
|
|
%pytest terml/test
|
2018-08-23 11:18:12 +00:00
|
|
|
|
2020-05-20 11:27:58 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative parsley-stage
|
|
|
|
%python_install_alternative parsley-generate_parser
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative parsley-stage
|
|
|
|
%python_uninstall_alternative parsley-generate_parser
|
|
|
|
|
2018-08-23 11:18:12 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
|
|
|
%doc NEWS PKG-INFO README
|
2020-05-20 11:27:58 +00:00
|
|
|
%python_alternative %{_bindir}/parsley-stage
|
|
|
|
%python_alternative %{_bindir}/parsley-generate_parser
|
2024-01-09 03:43:33 +00:00
|
|
|
%{python_sitelib}/parsley.py
|
|
|
|
%pycache_only %{python_sitelib}/__pycache__/parsley.*.py*
|
|
|
|
%{python_sitelib}/terml
|
|
|
|
%{python_sitelib}/ometa
|
2025-04-14 06:09:49 +00:00
|
|
|
%{python_sitelib}/[Pp]arsley-%{version}.dist-info
|
2013-08-01 12:15:57 +00:00
|
|
|
|
|
|
|
%changelog
|