diff options
author | obache <obache@pkgsrc.org> | 2010-04-11 12:41:45 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2010-04-11 12:41:45 +0000 |
commit | ec520e8acfb97dbaaca14afe375593203daacc4e (patch) | |
tree | 5596689eaf4516e7560e0b0d66a6c8e2729ae33e /textproc/py-cElementTree | |
parent | 88d287e6686990f32c135bdc2a3df01962aaf077 (diff) | |
download | pkgsrc-ec520e8acfb97dbaaca14afe375593203daacc4e.tar.gz |
Import py-cElementTree-0 as textproc/py-cElementTree.
The cElementTree module is a C implementation of the ElementTree API, optimized
for fast parsing and low memory use. On typical documents, cElementTree is 15-20
times faster than the Python version of ElementTree, and uses 2-5 times less
memory. On modern hardware, that means that documents in the 50-100 megabyte
range can be manipulated in memory, and that documents in the 0-1 megabyte range
load in zero time (0.0 seconds). This allows you to drastically simplify many
kinds of XML applications.
Diffstat (limited to 'textproc/py-cElementTree')
-rw-r--r-- | textproc/py-cElementTree/DESCR | 7 | ||||
-rw-r--r-- | textproc/py-cElementTree/Makefile | 36 | ||||
-rw-r--r-- | textproc/py-cElementTree/PLIST | 2 | ||||
-rw-r--r-- | textproc/py-cElementTree/files/setup.py | 24 |
4 files changed, 69 insertions, 0 deletions
diff --git a/textproc/py-cElementTree/DESCR b/textproc/py-cElementTree/DESCR new file mode 100644 index 00000000000..cc075889cbd --- /dev/null +++ b/textproc/py-cElementTree/DESCR @@ -0,0 +1,7 @@ +The cElementTree module is a C implementation of the ElementTree API, optimized +for fast parsing and low memory use. On typical documents, cElementTree is 15-20 +times faster than the Python version of ElementTree, and uses 2-5 times less +memory. On modern hardware, that means that documents in the 50-100 megabyte +range can be manipulated in memory, and that documents in the 0-1 megabyte range +load in zero time (0.0 seconds). This allows you to drastically simplify many +kinds of XML applications. diff --git a/textproc/py-cElementTree/Makefile b/textproc/py-cElementTree/Makefile new file mode 100644 index 00000000000..df2a0b893c6 --- /dev/null +++ b/textproc/py-cElementTree/Makefile @@ -0,0 +1,36 @@ +# $NetBSD: Makefile,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $ +# + +PKGNAME= ${PYPKGPREFIX}-cElementTree-0 +CATEGORIES= textproc python + +MAINTAINER= obache@NetBSD.org +HOMEPAGE= http://www.effbot.org/zone/celementtree.htm +COMMENT= C implementation of Python ElementTree API + +PKG_DESTDIR_SUPPORT= user-destdir + +PYTHON_VERSIONS_ACCEPTED= 26 25 + +EXTRACT_ELEMENTS= ${PYSUBDIR}/Modules/_elementtree.c + +USE_TOOLS+= patch + +PYDISTUTILSPKG= yes +PY_PATCHPLIST= yes +PY_SETUP_SUBST+= EXPATPREFIX=${BUILDLINK_DIR} +PY_SETUP_SUBST+= EXPATRTPREFIX=${BUILDLINK_PREFIX.expat} + +PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX:Q} + +# ignore errors due to missing files (EXTRACT_ELEMENTS!) +do-patch: + (cd ${WRKSRC}; \ + for f in ${PATCHDIR}/patch-*;do \ + ${PATCH} --batch <$$f || ${TRUE}; \ + done) + +.include "../../textproc/expat/buildlink3.mk" +.include "../../lang/python/extension.mk" +.include "../../lang/python/srcdist.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/textproc/py-cElementTree/PLIST b/textproc/py-cElementTree/PLIST new file mode 100644 index 00000000000..8b33cda19b0 --- /dev/null +++ b/textproc/py-cElementTree/PLIST @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $ +${PYSITELIB}/_elementtree.so diff --git a/textproc/py-cElementTree/files/setup.py b/textproc/py-cElementTree/files/setup.py new file mode 100644 index 00000000000..9e7a3e56352 --- /dev/null +++ b/textproc/py-cElementTree/files/setup.py @@ -0,0 +1,24 @@ +# $NetBSD: setup.py,v 1.1.1.1 2010/04/11 12:41:45 obache Exp $ + +import distutils +from distutils.core import setup, Extension + +expatprefix = '@EXPATPREFIX@' +expatincl = expatprefix + '/include' +expatlib = expatprefix + '/lib' +expatrtprefix = '@EXPATPREFIX@' +expatrtlib = expatrtprefix + '/lib' + +setup( + ext_modules = [ + Extension( + '_elementtree', + ['Modules/_elementtree.c'], + define_macros=[('USE_EXPAT', None)], + include_dirs=[expatincl], + library_dirs=[expatlib], + runtime_library_dirs=[expatrtlib], + libraries=['expat'] + ) + ] +) |