# NOTE: "hgrev" and "version" should match, e.g. # revision 82ace14bb612 is tagged as "release_v2.09.1" in # https://bitbucket.org/eliben/pycparser %global hgrev 82ace14bb612 Name: python-pycparser Version: 2.09.1 Release: 1%{?dist} Summary: C parser and AST generator written in Python License: BSD URL: https://bitbucket.org/eliben/pycparser # tarball generated by bitbucket from mercurial tag: # https://bitbucket.org/eliben/pycparser/commits/%{hgrev} Source0: eliben-pycparser-%{hgrev}.tar.bz2 Source1: remove-relative-sys-path # https://bitbucket.org/eliben/pycparser/pull-request/2/tests-all_testspy-add-local-paths-to-the/diff Patch0: pycparser-unittests-sys-path.patch BuildArch: noarch BuildRequires: python2-devel # for unit tests BuildRequires: python-ply BuildRequires: dos2unix Requires: python-ply %description pycparser is a complete parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. %prep %setup -q -n eliben-pycparser-%{hgrev} %patch0 -p1 # examples cp %SOURCE1 . ./remove-relative-sys-path examples dos2unix LICENSE %build %{__python} setup.py build %install %{__python} setup.py install --skip-build --root %{buildroot} %check %{__python} tests/all_tests.py %files %doc examples LICENSE %{python_sitelib}/pycparser/ %{python_sitelib}/pycparser-*.egg-info %changelog * Fri Jan 18 2013 Scott Tsai 2.09.1-1 - upstream 2.09.1