debian/0000775000000000000000000000000012303362650007170 5ustar debian/watch0000664000000000000000000000016612150246433010224 0ustar version=3 opts=dversionmangle=s/\+dfsg// \ https://pypi.python.org/packages/source/p/pycparser/pycparser-(.+).tar.gz debian/source/0000775000000000000000000000000012201172200010453 5ustar debian/source/format0000664000000000000000000000001411771643177011714 0ustar 3.0 (quilt) debian/rules0000775000000000000000000000305612276721106010260 0ustar #!/usr/bin/make -f export PYBUILD_DESTDIR_python2=debian/python-pycparser export PYBUILD_DESTDIR_python3=debian/python3-pycparser export PYBUILD_TEST_ARGS={dir}/tests export PYBUILD_AFTER_TEST=rm -f {build_dir}/parser.out {build_dir}/lextab.py {build_dir}/yacctab.py %: dh $@ --with python2,python3 --buildsystem pybuild override_dh_auto_build: clean-generated-code cd pycparser && python _build_tables.py dh_auto_build override_dh_auto_clean: clean-generated-code dh_auto_clean override_dh_python2: dh_python2 dh_python-ply debian/python-pycparser/usr/lib/python2.7/dist-packages/pycparser/lextab.py \ debian/python-pycparser/usr/lib/python2.7/dist-packages/pycparser/yacctab.py override_dh_python3: dh_python3 # I blame jwilk for this temporary hack: (waiting for #714099) sed -e 's/python-/python3-/g' /usr/bin/dh_python-ply | \ perl - debian/python3-pycparser/usr/lib/python3/dist-packages/pycparser/lextab.py \ debian/python3-pycparser/usr/lib/python3/dist-packages/pycparser/yacctab.py clean-generated-code: cd pycparser && rm -f lextab.py yacctab.py c_ast.py get-packaged-orig-source: set -e -x; \ VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p'); \ uscan --noconf --force-download --rename --download-version=$$VER --destdir=.; \ tar -x --exclude=utils/cpp.exe --exclude=pycparser/ply -f pycparser_$$VER.orig.tar.gz; \ rm -f pycparser_$$VER.orig.tar.gz; \ GZIP=--best tar -cz --owner root --group root --mode a+rX \ -f pycparser_$$VER+dfsg.orig.tar.gz pycparser-$$VER; \ rm -rf pycparser-$$VER debian/tests/0000775000000000000000000000000012303362162010330 5ustar debian/tests/control0000664000000000000000000000006512074316377011750 0ustar Tests: unittests Depends: @, python-all, python3-all debian/tests/unittests0000775000000000000000000000042512074316377012335 0ustar #!/bin/sh set -efu pythons="$(pyversions -rv) $(py3versions -rv)" cp -a tests $ADTTMP mkdir $ADTTMP/utils ln -s /usr/share/python-pycparser/fake_libc_include $ADTTMP/utils cd "$ADTTMP" for py in $pythons; do echo "=== python$py ===" python$py tests/all_tests.py 2>&1 done debian/control0000664000000000000000000000255412303362155010601 0ustar Source: pycparser Section: python Priority: optional Maintainer: Debian Python Modules Team Uploaders: Stefano Rivera Build-Depends: debhelper (>= 8.1), dh-python, python-all (>= 2.6.6-3~), python-ply (>= 3.4-1~), python3-all (>= 3.1.2-6~), python3-ply Standards-Version: 3.9.4 Homepage: https://github.com/eliben/pycparser X-Python-Version: >= 2.6 X-Python3-Version: >= 3.2 XS-Testsuite: autopkgtest Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/pycparser/trunk/ Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/pycparser/trunk/ Package: python-pycparser Architecture: all Depends: ${misc:Depends}, ${python-ply:Depends}, ${python:Depends}, cpp Description: C parser in Python pycparser is a complete parser of the C language, written in pure Python using the PLY parsing library. It parses C code into an AST and can serve as a front-end for C compilers or analysis tools. Package: python3-pycparser Architecture: all Depends: ${misc:Depends}, ${python3-ply:Depends}, ${python3:Depends}, cpp Description: C parser in Python 3 pycparser is a complete parser of the C language, written in pure Python using the PLY parsing library. It parses C code into an AST and can serve as a front-end for C compilers or analysis tools. . This package contains the Python 3 version. debian/patches/0000775000000000000000000000000012201172200010602 5ustar debian/patches/system-ply0000664000000000000000000000174712200652760012701 0ustar Description: Use Debian's ply instead of the bundled ply We prefer to avoid bundled libraries in Debian, don't use the bundled ply. Author: Stefano Rivera Last-Update: 2013-01-12 Forwarded: not-needed --- a/pycparser/c_lexer.py +++ b/pycparser/c_lexer.py @@ -9,8 +9,8 @@ import re import sys -from .ply import lex -from .ply.lex import TOKEN +from ply import lex +from ply.lex import TOKEN class CLexer(object): --- a/pycparser/c_parser.py +++ b/pycparser/c_parser.py @@ -8,7 +8,7 @@ #------------------------------------------------------------------------------ import re -from .ply import yacc +from ply import yacc from . import c_ast from .c_lexer import CLexer --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ classifiers = [ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3',], - packages=['pycparser', 'pycparser.ply'], + packages=['pycparser'], package_data={'pycparser': ['*.cfg']}, ) debian/patches/series0000664000000000000000000000003212200652760012027 0ustar system-ply relative-tests debian/patches/relative-tests0000664000000000000000000000543612200652760013525 0ustar Description: Locate test data from __file__ Find c_files and fake_libc_include from __file__ of the unit test, rather than expecting the test suite to be run from a particular directory. Author: Stefano Rivera Forwarded: https://github.com/eliben/pycparser/pull/13 Last-Update: 2013-08-08 --- a/tests/test_c_parser.py +++ b/tests/test_c_parser.py @@ -1518,13 +1518,10 @@ """ Find a c file by name, taking into account the current dir can be in a couple of typical places """ - fullnames = [ - os.path.join('c_files', name), - os.path.join('tests', 'c_files', name)] - for fullname in fullnames: - if os.path.exists(fullname): - return open(fullname, 'rU') - assert False, "Unreachable" + testdir = os.path.dirname(__file__) + name = os.path.join(testdir, 'c_files', name) + assert os.path.exists(name) + return open(name, 'rU') def test_whole_file(self): # See how pycparser handles a whole, real C file. --- a/tests/test_general.py +++ b/tests/test_general.py @@ -15,31 +15,29 @@ """ Find a c file by name, taking into account the current dir can be in a couple of typical places """ - fullnames = [ - os.path.join('c_files', name), - os.path.join('tests', 'c_files', name)] - for fullname in fullnames: - if os.path.exists(fullname): - return fullname - assert False, "Unreachable" + testdir = os.path.dirname(__file__) + name = os.path.join(testdir, 'c_files', name) + assert os.path.exists(name) + return name def test_without_cpp(self): ast = parse_file(self._find_file('example_c_file.c')) self.assertTrue(isinstance(ast, c_ast.FileAST)) def test_with_cpp(self): - c_files_path = os.path.join('tests', 'c_files') - ast = parse_file(self._find_file('memmgr.c'), use_cpp=True, + memmgr_path = self._find_file('memmgr.c') + c_files_path = os.path.dirname(memmgr_path) + ast = parse_file(memmgr_path, use_cpp=True, cpp_path=CPPPATH, cpp_args='-I%s' % c_files_path) self.assertTrue(isinstance(ast, c_ast.FileAST)) - + + fake_libc = os.path.join(c_files_path, '..', '..', + 'utils', 'fake_libc_include') ast2 = parse_file(self._find_file('year.c'), use_cpp=True, - cpp_path=CPPPATH, - cpp_args=[ - r'-Iutils/fake_libc_include', - r'-I../utils/fake_libc_include']) - + cpp_path=CPPPATH, + cpp_args=[r'-I%s' % fake_libc]) + self.assertTrue(isinstance(ast2, c_ast.FileAST)) def test_cpp_funkydir(self): debian/compat0000664000000000000000000000000212150246433010366 0ustar 8 debian/python-pycparser.install0000664000000000000000000000006411771643177014125 0ustar utils/fake_libc_include /usr/share/python-pycparser debian/python-pycparser.examples0000664000000000000000000000001311771643177014267 0ustar examples/* debian/python3-pycparser.install0000664000000000000000000000006511771643177014211 0ustar utils/fake_libc_include /usr/share/python3-pycparser debian/changelog0000664000000000000000000000343212303362634011046 0ustar pycparser (2.10+dfsg-1ubuntu2) trusty; urgency=medium * Add missing cpp dependency, spotted by autopkgtest. -- Martin Pitt Wed, 26 Feb 2014 14:01:07 +0100 pycparser (2.10+dfsg-1ubuntu1) trusty; urgency=medium * Fix build failure with /usr/share/pyshared removed. -- Matthias Klose Wed, 12 Feb 2014 17:33:16 +0100 pycparser (2.10+dfsg-1) unstable; urgency=low * New upstream release. * Port to pybuild. * Patch: relative-tests. Find the test resources relative to __file__. * Updated homepage (moved to github). -- Stefano Rivera Fri, 09 Aug 2013 15:53:58 +0200 pycparser (2.09.1+dfsg-2) unstable; urgency=low [ Jakub Wilk ] * Run tests only if DEB_BUILD_OPTIONS=nocheck is not set. [ Stefano Rivera ] * Ensure auto-generated files are rebuilt, by deleting before build. * Use dh_python-ply to generate dependencies against python{3,}-ply. -- Stefano Rivera Wed, 26 Jun 2013 00:38:51 +0200 pycparser (2.09.1+dfsg-1) unstable; urgency=low [ Stefano Rivera ] * New upstream release. * Drop patch abort-on-test-failure, superseded upstream. * Upstream now bundles ply. Strip it. * Updated homepage (moved to bitbucket). * Bumped Standards-Version to 3.9.4. - Bumped debhelper B-D to 8.1, for build-{arch,indep} support. * Export PYTHONPATH in debian/rules to avoid running tests against an installed pycparser. * Add an autopkgtest to run the unit tests. * Switch watchfile URL to https. [ Jakub Wilk ] * Add Vcs-* fields. -- Stefano Rivera Sun, 26 May 2013 01:44:06 +0200 pycparser (2.07+dfsg-1) unstable; urgency=low * Initial release. (Closes: #581847) -- Stefano Rivera Sun, 24 Jun 2012 19:20:01 +0200 debian/python3-pycparser.docs0000664000000000000000000000001111771643177013462 0ustar README.* debian/copyright0000664000000000000000000000372112074316377011140 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pycparser Upstream-Contact: Eli Bendersky Source: http://pypi.python.org/pypi/pycparser lcc.exe was removed from the source package, as the license isn't DFSG-free and it isn't needed on Debian. The bundled ply was also dropped. Files: * Copyright: 2008-2013, Eli Bendersky License: bsd-3-bendersky Files: debian/* Copyright: 2012-2013, Stefano Rivera License: bsd-3-bendersky License: bsd-3-bendersky Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Eli Bendersky nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/python-pycparser.docs0000664000000000000000000000001111771643177013377 0ustar README.* debian/python3-pycparser.examples0000664000000000000000000000001311771643177014352 0ustar examples/*