Blame SPECS/python3.11-pycparser.spec

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