|
|
366c66 |
%global __python3 /usr/bin/python3.11
|
|
|
366c66 |
%global python3_pkgversion 3.11
|
|
|
366c66 |
|
|
|
366c66 |
%bcond_without tests
|
|
|
366c66 |
|
|
|
366c66 |
Name: python%{python3_pkgversion}-pycparser
|
|
|
366c66 |
Summary: C parser and AST generator written in Python
|
|
|
366c66 |
Version: 2.20
|
|
|
366c66 |
Release: 1%{?dist}
|
|
|
366c66 |
License: BSD
|
|
|
366c66 |
URL: http://github.com/eliben/pycparser
|
|
|
366c66 |
Source0: %{url}/archive/release_v%{version}.tar.gz
|
|
|
366c66 |
Source1: pycparser-0.91.1-remove-relative-sys-path.py
|
|
|
366c66 |
|
|
|
366c66 |
# This is Fedora-specific; I don't think we should request upstream to
|
|
|
366c66 |
# remove embedded libraries from their distribution, when we can remove
|
|
|
366c66 |
# them during packaging.
|
|
|
366c66 |
# It also ensures that pycparser uses the same YACC __tabversion__ as ply
|
|
|
366c66 |
# package to prevent "yacc table file version is out of date" problem.
|
|
|
366c66 |
Patch100: pycparser-unbundle-ply.patch
|
|
|
366c66 |
|
|
|
366c66 |
BuildArch: noarch
|
|
|
366c66 |
|
|
|
366c66 |
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
366c66 |
BuildRequires: python%{python3_pkgversion}-rpm-macros
|
|
|
366c66 |
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
|
366c66 |
BuildRequires: python%{python3_pkgversion}-ply
|
|
|
366c66 |
|
|
|
366c66 |
Requires: python%{python3_pkgversion}-ply
|
|
|
366c66 |
|
|
|
366c66 |
# for unit tests
|
|
|
366c66 |
%if %{with tests}
|
|
|
366c66 |
BuildRequires: cpp
|
|
|
366c66 |
%endif
|
|
|
366c66 |
|
|
|
366c66 |
%description
|
|
|
366c66 |
pycparser is a complete parser for the C language, written in pure Python.
|
|
|
366c66 |
It is a module designed to be easily integrated into applications that
|
|
|
366c66 |
need to parse C source code.
|
|
|
366c66 |
|
|
|
366c66 |
%prep
|
|
|
366c66 |
%autosetup -p1 -n pycparser-release_v%{version}
|
|
|
366c66 |
|
|
|
366c66 |
# remove embedded copy of ply
|
|
|
366c66 |
rm -r pycparser/ply
|
|
|
366c66 |
|
|
|
366c66 |
# Remove relative sys.path from the examples
|
|
|
366c66 |
%{python3} %{SOURCE1} examples
|
|
|
366c66 |
|
|
|
366c66 |
%build
|
|
|
366c66 |
%py3_build
|
|
|
366c66 |
pushd build/lib/pycparser
|
|
|
366c66 |
%{__python3} _build_tables.py
|
|
|
366c66 |
popd
|
|
|
366c66 |
|
|
|
366c66 |
%install
|
|
|
366c66 |
%py3_install
|
|
|
366c66 |
|
|
|
366c66 |
%check
|
|
|
366c66 |
%if %{with tests}
|
|
|
366c66 |
%{python3} tests/all_tests.py
|
|
|
366c66 |
%endif
|
|
|
366c66 |
|
|
|
366c66 |
%files -n python%{python3_pkgversion}-pycparser
|
|
|
366c66 |
%license LICENSE
|
|
|
366c66 |
%doc examples
|
|
|
366c66 |
%{python3_sitelib}/pycparser/
|
|
|
366c66 |
%{python3_sitelib}/pycparser-*.egg-info/
|
|
|
366c66 |
|
|
|
366c66 |
%changelog
|
|
|
366c66 |
* Tue Nov 29 2022 Charalampos Stratakis <cstratak@redhat.com> - 2.20-1
|
|
|
366c66 |
- Initial package
|
|
|
366c66 |
- Fedora contributions by:
|
|
|
366c66 |
Charalampos Stratakis <cstratak@redhat.com>
|
|
|
366c66 |
Christian Heimes <cheimes@redhat.com>
|
|
|
366c66 |
Dennis Gilmore <dennis@ausil.us>
|
|
|
366c66 |
Eric Smith <brouhaha@fedoraproject.org>
|
|
|
366c66 |
Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
|
366c66 |
Iryna Shcherbina <shcherbina.iryna@gmail.com>
|
|
|
366c66 |
Lumir Balhar <lbalhar@redhat.com>
|
|
|
366c66 |
Marcel Plch <mplch@redhat.com>
|
|
|
366c66 |
Miro HronĨok <miro@hroncok.cz>
|
|
|
366c66 |
Nathaniel McCallum <nathaniel@themccallums.org>
|
|
|
366c66 |
Orion Poplawski <orion@cora.nwra.com>
|
|
|
366c66 |
Robert Kuska <rkuska@redhat.com>
|
|
|
366c66 |
Slavek Kabrda <bkabrda@redhat.com>
|
|
|
366c66 |
Stephen Gallagher <sgallagh@redhat.com>
|
|
|
366c66 |
Tom Callaway <spot@fedoraproject.org>
|
|
|
366c66 |
Troy Dawson <tdawson@redhat.com>
|