Blame SPECS/python3.11-pycparser.spec

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