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