python3.14-pycparser/python3.14-pycparser.spec
Tomáš Hrnčiar dd8737779a Convert from Fedora for the Python 3.14 stack in RHEL
Fedora contributions by:
    Bohuslav Kabrda <bkabrda@redhat.com>
    Charalampos Stratakis <cstratak@redhat.com>
    Christian Heimes <cheimes@redhat.com>
    Dennis Gilmore <dennis@ausil.us>
    Eric Smith <brouhaha@fedoraproject.org>
    Igor Gnatenko <ignatenkobrain@fedoraproject.org>
    Iryna Shcherbina <ishcherb@redhat.com>
    Jos de Kloe <josdekloe@gmail.com> 2.09.1-2
    Lumír Balhar <lbalhar@redhat.com>
    Marcel Plch <mplch@redhat.com>
    Matthieu Saulnier <fantom@fedoraproject.org>
    Miro Hrončok <mhroncok@redhat.com>
    Nathaniel McCallum <npmccallum@redhat.com>
    Orion Poplawski <orion@cora.nwra.com>
    Rob Crittenden <rcritten@redhat.com>
    Robert Kuska <rkuska@redhat.com>
    Scott Tsai <scottt.tw@gmail.com> 2.09.1-1
    Stephen Gallagher <sgallagh@redhat.com>
    Tom Callaway <spot@fedoraproject.org>
    Tomáš Hrnčiar <thrnciar@redhat.com>
    Troy Dawson <tdawson@redhat.com>
2025-11-28 11:09:38 +01:00

69 lines
1.7 KiB
RPMSpec

%global python3_pkgversion 3.14
%bcond_without tests
Name: python%{python3_pkgversion}-pycparser
Summary: C parser and AST generator written in Python
Version: 2.22
Release: %autorelease
License: BSD-3-Clause
URL: http://github.com/eliben/pycparser
Source0: %{url}/archive/release_v%{version}.tar.gz
Source1: pycparser-0.91.1-remove-relative-sys-path.py
# This is Fedora-specific; I don't think we should request upstream to
# 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
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-ply
# for unit tests
%if %{with tests}
BuildRequires: gcc
%endif
%description
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
%autosetup -p1 -n pycparser-release_v%{version}
# remove embedded copy of ply
rm -r pycparser/ply
# Remove relative sys.path from the examples
%{python3} %{SOURCE1} examples
%generate_buildrequires
%pyproject_buildrequires
%build
pushd pycparser
%{python3} _build_tables.py
popd
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l pycparser
%check
%pyproject_check_import
%if %{with tests}
%py3_test_envvars %{python3} -m unittest discover
%endif
%files -n python%{python3_pkgversion}-pycparser -f %{pyproject_files}
%doc examples
%changelog
%autochangelog