92 lines
2.5 KiB
RPMSpec
92 lines
2.5 KiB
RPMSpec
## START: Set by rpmautospec
|
|
## (rpmautospec version 0.6.5)
|
|
## RPMAUTOSPEC: autorelease, autochangelog
|
|
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
|
release_number = 4;
|
|
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
|
print(release_number + base_release_number - 1);
|
|
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
|
## END: Set by rpmautospec
|
|
|
|
%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
|
|
|
|
# pycparser: BSD-3-Clause
|
|
# bundled ply: BSD-3-Clause
|
|
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
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
|
# for unit tests
|
|
%if %{with tests}
|
|
BuildRequires: gcc
|
|
%endif
|
|
|
|
# pycaparser bundles ply,
|
|
# which is the preferred upstream for both upstreams.
|
|
# See https://github.com/eliben/pycparser/pull/589
|
|
%global ply_version 3.9
|
|
Provides: bundled(python%{python3_pkgversion}dist(ply)) = %{ply_version}
|
|
|
|
%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 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
|
|
export %{py3_test_envvars}
|
|
%if %{with tests}
|
|
%{python3} -m unittest discover
|
|
%endif
|
|
%{python3} -c 'import pycparser; assert pycparser.ply.__version__ == "%{ply_version}"'
|
|
|
|
%files -n python%{python3_pkgversion}-pycparser -f %{pyproject_files}
|
|
%doc examples
|
|
|
|
%changelog
|
|
## START: Generated by rpmautospec
|
|
* Tue Jan 27 2026 Miro Hrončok <miro@hroncok.cz> - 2.22-4
|
|
- Keep the ply library bundled, as intended upstream
|
|
|
|
* Fri Nov 28 2025 Lukáš Zachar <lzachar@redhat.com> - 2.22-3
|
|
- Add gating
|
|
|
|
* Fri Nov 28 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.22-2
|
|
- Convert from Fedora for the Python 3.14 stack in RHEL
|
|
|
|
* Fri Nov 28 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.22-1
|
|
- RHEL: Rename SPEC to python3.14-pycparser.spec
|
|
## END: Generated by rpmautospec
|