Blame SPECS/python3.11-pycparser.spec

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