From fd011d72318127fd92c216cccf2b46b0ddc46b7b Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 19:23:34 +0000 Subject: [PATCH] import UBI python-pycparser-2.20-16.el10 --- .gitignore | 2 +- .python-pycparser.metadata | 1 - SOURCES/pycparser-2.10-ply.patch | 38 ------ ...cparser-0.91.1-remove-relative-sys-path.py | 0 pycparser-unbundle-ply.patch | 51 ++++++++ ...on-pycparser.spec => python-pycparser.spec | 115 ++++++++++++------ sources | 1 + 7 files changed, 130 insertions(+), 78 deletions(-) delete mode 100644 .python-pycparser.metadata delete mode 100644 SOURCES/pycparser-2.10-ply.patch rename SOURCES/pycparser-0.91.1-remove-relative-sys-path.py => pycparser-0.91.1-remove-relative-sys-path.py (100%) create mode 100644 pycparser-unbundle-ply.patch rename SPECS/python-pycparser.spec => python-pycparser.spec (65%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index 46fbc6f..4340057 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/release_v2.19.tar.gz +release_v2.20.tar.gz diff --git a/.python-pycparser.metadata b/.python-pycparser.metadata deleted file mode 100644 index e5f304a..0000000 --- a/.python-pycparser.metadata +++ /dev/null @@ -1 +0,0 @@ -141582eb2a5ad9fee9bb7646cecb024f0406be8a SOURCES/release_v2.19.tar.gz diff --git a/SOURCES/pycparser-2.10-ply.patch b/SOURCES/pycparser-2.10-ply.patch deleted file mode 100644 index d1e1f53..0000000 --- a/SOURCES/pycparser-2.10-ply.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up pycparser-release_v2.10/pycparser/c_lexer.py.ply pycparser-release_v2.10/pycparser/c_lexer.py ---- pycparser-release_v2.10/pycparser/c_lexer.py.ply 2013-08-03 07:15:32.000000000 -0600 -+++ pycparser-release_v2.10/pycparser/c_lexer.py 2014-08-20 12:40:48.308461164 -0600 -@@ -9,8 +9,8 @@ - import re - import sys - --from .ply import lex --from .ply.lex import TOKEN -+from ply import lex -+from ply.lex import TOKEN - - - class CLexer(object): -diff -up pycparser-release_v2.10/pycparser/c_parser.py.ply pycparser-release_v2.10/pycparser/c_parser.py ---- pycparser-release_v2.10/pycparser/c_parser.py.ply 2013-08-03 07:15:32.000000000 -0600 -+++ pycparser-release_v2.10/pycparser/c_parser.py 2014-08-20 12:40:05.154894980 -0600 -@@ -8,7 +8,7 @@ - #------------------------------------------------------------------------------ - import re - --from .ply import yacc -+from ply import yacc - - from . import c_ast - from .c_lexer import CLexer -diff -up pycparser-release_v2.10/setup.py.ply pycparser-release_v2.10/setup.py ---- pycparser-release_v2.10/setup.py.ply 2013-08-03 07:15:32.000000000 -0600 -+++ pycparser-release_v2.10/setup.py 2014-08-20 12:40:05.154894980 -0600 -@@ -22,7 +22,7 @@ setup( - classifiers = [ - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3',], -- packages=['pycparser', 'pycparser.ply'], -+ packages=['pycparser'], - package_data={'pycparser': ['*.cfg']}, - ) - diff --git a/SOURCES/pycparser-0.91.1-remove-relative-sys-path.py b/pycparser-0.91.1-remove-relative-sys-path.py similarity index 100% rename from SOURCES/pycparser-0.91.1-remove-relative-sys-path.py rename to pycparser-0.91.1-remove-relative-sys-path.py diff --git a/pycparser-unbundle-ply.patch b/pycparser-unbundle-ply.patch new file mode 100644 index 0000000..0f0cd6b --- /dev/null +++ b/pycparser-unbundle-ply.patch @@ -0,0 +1,51 @@ +diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py +index 045d24e..9b3cbf2 100644 +--- a/pycparser/c_lexer.py ++++ b/pycparser/c_lexer.py +@@ -9,8 +9,8 @@ + import re + import sys + +-from .ply import lex +-from .ply.lex import TOKEN ++from ply import lex ++from ply.lex import TOKEN + + + class CLexer(object): +diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py +index 744ede8..50156a3 100644 +--- a/pycparser/c_parser.py ++++ b/pycparser/c_parser.py +@@ -8,7 +8,7 @@ + #------------------------------------------------------------------------------ + import re + +-from .ply import yacc ++from ply import yacc + + from . import c_ast + from .c_lexer import CLexer +diff --git a/setup.py b/setup.py +index 6dce89c..b3dbfb4 100644 +--- a/setup.py ++++ b/setup.py +@@ -8,6 +8,8 @@ except ImportError: + from distutils.command.install import install as _install + from distutils.command.sdist import sdist as _sdist + ++import ply ++ + + def _run_build_tables(dir): + from subprocess import check_call +@@ -60,7 +62,8 @@ setup( + 'Programming Language :: Python :: 3.6', + ], + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", +- packages=['pycparser', 'pycparser.ply'], ++ packages=['pycparser'], ++ install_requires=['ply==' + ply.__version__], + package_data={'pycparser': ['*.cfg']}, + cmdclass={'install': install, 'sdist': sdist}, + ) diff --git a/SPECS/python-pycparser.spec b/python-pycparser.spec similarity index 65% rename from SPECS/python-pycparser.spec rename to python-pycparser.spec index 53f8c41..b94df5a 100644 --- a/SPECS/python-pycparser.spec +++ b/python-pycparser.spec @@ -1,34 +1,26 @@ -# Ensure that pycparser uses the same YACC __tabversion__ as python-ply -# package to prevent "yacc table file version is out of date" problem. -%define ply_version %(LC_ALL=C rpm -q --qf '%%{VERSION}' python%{python3_pkgversion}-ply | grep -Eo '^[^.]+\.[^.]+') - %bcond_without tests Name: python-pycparser Summary: C parser and AST generator written in Python -Version: 2.19 -Release: 3%{?dist} -License: BSD +Version: 2.20 +Release: 16%{?dist} +License: BSD-3-Clause URL: http://github.com/eliben/pycparser -Source0: http://github.com/eliben/pycparser/archive/release_v%{version}.tar.gz +Source0: %{url}/archive/release_v%{version}.tar.gz Source1: pycparser-0.91.1-remove-relative-sys-path.py -Patch100: pycparser-2.10-ply.patch # This is Fedora-specific; I don't think we should request upstream to -# remove embedded libraries from their distribuution, when we can remove +# remove embedded libraries from their distribution, when we can remove # them during packaging. +# It also ensures that pycparser uses the same YACC __tabversion__ as ply +# package to prevent "yacc table file version is out of date" problem. +Patch100: pycparser-unbundle-ply.patch BuildArch: noarch -# Exclude i686 arch. Due to a modularity issue it's being added to the -# x86_64 compose of CRB, but we don't want to ship it at all. -# See: https://projects.engineering.redhat.com/browse/RCM-72605 -ExcludeArch: i686 -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: dos2unix -BuildRequires: python%{python3_pkgversion}-ply -BuildRequires: python%{python3_pkgversion}-rpm-macros +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-ply # for unit tests %if %{with tests} @@ -40,31 +32,28 @@ pycparser is a complete parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. -%package -n python%{python3_pkgversion}-pycparser -Summary: C parser and AST generator written in Python -Requires: python%{python3_pkgversion}-ply = %{ply_version} -%{?python_provide:%python_provide python%{python3_pkgversion}-pycparser} +%package -n python3-pycparser +Summary: %{summary} +%{?python_provide:%python_provide python3-pycparser} -%description -n python%{python3_pkgversion}-pycparser +%description -n python3-pycparser pycparser is a complete parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. %prep -%setup -q -n pycparser-release_v%{version} -%patch100 -p1 -F5 -b .ply +%autosetup -p1 -n pycparser-release_v%{version} # remove embedded copy of ply -rm -rf pycparser/ply +rm -r pycparser/ply -# examples -%{__python3} %{SOURCE1} examples -dos2unix LICENSE +# Remove relative sys.path from the examples +%{python3} %{SOURCE1} examples %build %py3_build pushd build/lib/pycparser -%{__python3} _build_tables.py +%{python3} _build_tables.py popd %install @@ -72,21 +61,71 @@ popd %check %if %{with tests} -%{__python3} tests/all_tests.py +%{python3} tests/all_tests.py %endif - -%files -n python%{python3_pkgversion}-pycparser + +%files -n python3-pycparser %license LICENSE %doc examples %{python3_sitelib}/pycparser/ %{python3_sitelib}/pycparser-*.egg-info/ %changelog -* Fri Dec 13 2019 Tomas Orsava - 2.19-3 -- Exclude unsupported i686 arch +* Tue Oct 29 2024 Troy Dawson - 2.20-16 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 -* Wed Nov 20 2019 Lumír Balhar - 2.19-2 -- Adjusted for Python 3.8 module in RHEL 8 +* Mon Jun 24 2024 Troy Dawson - 2.20-15 +- Bump release for June 2024 mass rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 2.20-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 2.20-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Aug 22 2023 Rob Crittenden - 2.20-12 +- migrated to SPDX license + +* Fri Jul 21 2023 Fedora Release Engineering - 2.20-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 2.20-10 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 2.20-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 2.20-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 2.20-7 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 2.20-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jul 27 2021 Fedora Release Engineering - 2.20-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 02 2021 Python Maint - 2.20-4 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 2.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jun 05 2020 Miro Hrončok - 2.20-1 +- Update to 2.20 (#1810349) + +* Sat May 23 2020 Miro Hrončok - 2.19-3 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 2.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Fri Nov 08 2019 Lumír Balhar - 2.19-1 - New usptream version 2.19 diff --git a/sources b/sources new file mode 100644 index 0000000..4789666 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (release_v2.20.tar.gz) = d2dc48727750ec0a80d5e3b0c9fba390c3647416a3e18cad59429edb9f55d043c7695c52301b037c93af5d96ffc85fcba7cd54d376abdb89e973759c59fa189d