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