fb378d
%bcond_without tests
fb378d
fb378d
Name:           python-pycparser
fb378d
Summary:        C parser and AST generator written in Python
fb378d
Version:        2.20
fb378d
Release:        3%{?dist}
fb378d
License:        BSD
fb378d
URL:            http://github.com/eliben/pycparser
fb378d
Source0:        %{url}/archive/release_v%{version}.tar.gz
fb378d
Source1:        pycparser-0.91.1-remove-relative-sys-path.py
fb378d
fb378d
# This is Fedora-specific; I don't think we should request upstream to
fb378d
# remove embedded libraries from their distribuution, when we can remove
fb378d
# them during packaging.
fb378d
# It also ensures that pycparser uses the same YACC __tabversion__ as ply
fb378d
# package to prevent "yacc table file version is out of date" problem.
fb378d
Patch100:       pycparser-unbundle-ply.patch
fb378d
fb378d
BuildArch:      noarch
fb378d
# Exclude i686 arch. Due to a modularity issue it's being added to the
fb378d
# x86_64 compose of CRB, but we don't want to ship it at all.
fb378d
# See: https://projects.engineering.redhat.com/browse/RCM-72605
fb378d
ExcludeArch:    i686
fb378d
fb378d
BuildRequires:  python%{python3_pkgversion}-devel
fb378d
BuildRequires:  python%{python3_pkgversion}-rpm-macros
fb378d
BuildRequires:  python%{python3_pkgversion}-setuptools
fb378d
BuildRequires:  python%{python3_pkgversion}-ply
fb378d
fb378d
# for unit tests
fb378d
%if %{with tests}
fb378d
BuildRequires:  cpp
fb378d
%endif
fb378d
fb378d
%description
fb378d
pycparser is a complete parser for the C language, written in pure Python.
fb378d
It is a module designed to be easily integrated into applications that
fb378d
need to parse C source code.
fb378d
fb378d
%package -n python%{python3_pkgversion}-pycparser
fb378d
Summary:        %{summary}
fb378d
Requires:       python%{python3_pkgversion}-ply
fb378d
%{?python_provide:%python_provide python%{python3_pkgversion}-pycparser}
fb378d
fb378d
%description -n python%{python3_pkgversion}-pycparser
fb378d
pycparser is a complete parser for the C language, written in pure Python.
fb378d
It is a module designed to be easily integrated into applications that
fb378d
need to parse C source code.
fb378d
fb378d
%prep
fb378d
%autosetup -p1 -n pycparser-release_v%{version}
fb378d
fb378d
# remove embedded copy of ply
fb378d
rm -r pycparser/ply
fb378d
fb378d
# Remove relative sys.path from the examples
fb378d
%{python3} %{SOURCE1} examples
fb378d
fb378d
%build
fb378d
%py3_build
fb378d
pushd build/lib/pycparser
fb378d
%{python3} _build_tables.py
fb378d
popd
fb378d
fb378d
%install
fb378d
%py3_install
fb378d
fb378d
%check
fb378d
%if %{with tests}
fb378d
%{python3} tests/all_tests.py
fb378d
%endif
fb378d
fb378d
%files -n python%{python3_pkgversion}-pycparser
fb378d
%license LICENSE
fb378d
%doc examples
fb378d
%{python3_sitelib}/pycparser/
fb378d
%{python3_sitelib}/pycparser-*.egg-info/
fb378d
fb378d
%changelog
fb378d
* Mon Jan 18 2021 Tomas Orsava <torsava@redhat.com> - 2.20-3
fb378d
- Convert from Fedora to the python39 module in RHEL8
fb378d
- Resolves: rhbz#1877430
fb378d
fb378d
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.20-2
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
fb378d
fb378d
* Fri Jun 05 2020 Miro Hrončok <mhroncok@redhat.com> - 2.20-1
fb378d
- Update to 2.20 (#1810349)
fb378d
fb378d
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 2.19-3
fb378d
- Rebuilt for Python 3.9
fb378d
fb378d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-2
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
fb378d
fb378d
* Fri Nov 08 2019 Lumír Balhar <lbalhar@redhat.com> - 2.19-1
fb378d
- New usptream version 2.19
fb378d
fb378d
* Sun Oct 20 2019 Miro Hrončok <mhroncok@redhat.com> - 2.14-23
fb378d
- Subpackage python2-ply has been removed
fb378d
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
fb378d
fb378d
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.14-22
fb378d
- Rebuilt for Python 3.8.0rc1 (#1748018)
fb378d
fb378d
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.14-21
fb378d
- Rebuilt for Python 3.8
fb378d
fb378d
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-20
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
fb378d
fb378d
* Mon Jun 10 2019 Marcel Plch <mplch@redhat.com> - 2.14-19
fb378d
- Avoid invalid unicode escape sequences in Py3.8
fb378d
fb378d
* Tue Feb 26 2019 Christian Heimes <cheimes@redhat.com> - 2.14-18
fb378d
- Add build dependency on cpp for unit tests
fb378d
- Add dependency on python-ply version to prevent "yacc table file version is out of date"
fb378d
- Fixes RHBZ#1668230
fb378d
fb378d
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-17
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
fb378d
fb378d
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-16
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
fb378d
fb378d
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.14-15
fb378d
- Rebuilt for Python 3.7
fb378d
fb378d
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.14-14
fb378d
- Update Python 2 dependency declarations to new packaging standards
fb378d
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
fb378d
fb378d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-13
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
fb378d
fb378d
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 2.14-12
fb378d
- Cleanup spec file conditionals
fb378d
fb378d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-11
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fb378d
fb378d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-10
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
fb378d
fb378d
* Fri Jan 6 2017 Orion Poplawski <orion@cora.nwra.com> - 2.14-9
fb378d
- Ship python2-pycparser
fb378d
- Modernize spec
fb378d
fb378d
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 2.14-8
fb378d
- Rebuild for Python 3.6
fb378d
fb378d
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.14-7
fb378d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
fb378d
fb378d
* Fri Jul  8 2016 Tom Callaway <spot@fedoraproject.org> - 2.14-6
fb378d
- rebuild to update yacctab.py
fb378d
fb378d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-5
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fb378d
fb378d
* Tue Oct 13 2015 Robert Kuska <rkuska@redhat.com> - 2.14-4
fb378d
- Rebuilt for Python3.5 rebuild
fb378d
fb378d
* Tue Jul 14 2015 Stephen Gallagher <sgallagh@redhat.com> - 2.14-3
fb378d
- Rebuild alongside python-ply 3.6
fb378d
fb378d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.14-2
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
fb378d
fb378d
* Tue Jun 09 2015 Nathaniel McCallum <npmccallum@redhat.com> - 2.14-1
fb378d
- Update to 2.14
fb378d
fb378d
* Wed Aug 20 2014 Eric Smith <brouhaha@fedoraproject.org> 2.10-1
fb378d
- Update to latest upstream.
fb378d
fb378d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.09.1-9
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fb378d
fb378d
* Mon May 12 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.09.1-8
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
fb378d
fb378d
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.09.1-7
fb378d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fb378d
fb378d
* Tue Jul 23 2013 Eric Smith <brouhaha@fedoraproject.org> 2.09.1-6
fb378d
- Added Python 3 support.
fb378d
fb378d
* Mon Jul 22 2013 Eric Smith <brouhaha@fedoraproject.org> 2.09.1-5
fb378d
- Renumbered Fedora-specific Patch1 to Patch100
fb378d
- Added new Patch1 to fix table generation when the build system
fb378d
  already has a python-pycparser package installed.
fb378d
- Submitted Patch0 and Patch1 as upstream issues.
fb378d
- Added comments about patches.
fb378d
fb378d
* Sun Jul 21 2013 Eric Smith <brouhaha@fedoraproject.org> 2.09.1-4
fb378d
- Upstream repository is now on github.
fb378d
- Fix rpmlint strange-permission complaint.
fb378d
- Rename patches, Source1 to all start with pycparser-{version}, to
fb378d
  simplify updating patches for future upstream releases.
fb378d
fb378d
* Sun Jul 21 2013 Eric Smith <brouhaha@fedoraproject.org> 2.09.1-3
fb378d
- Run _build_tables.py to build the lextab.py and yacctab.py; otherwise
fb378d
  they have to be regenerated at runtime for no benefit.
fb378d
fb378d
* Tue Mar 19 2013 Jos de Kloe <josdekloe@gmail.com> 2.09.1-2
fb378d
- remove the embedded ply code
fb378d
fb378d
* Fri Jan 18 2013 Scott Tsai <scottt.tw@gmail.com> 2.09.1-1
fb378d
- upstream 2.09.1