diff options
-rw-r--r-- | dev-python/example_project/Manifest | 1 | ||||
-rw-r--r-- | dev-python/example_project/example_project-0.3.ebuild | 32 | ||||
-rw-r--r-- | dev-python/example_project/files/requirements.txt | 7 | ||||
-rw-r--r-- | dev-python/example_project/files/setup.py | 21 | ||||
-rw-r--r-- | dev-python/example_project/metadata.xml | 11 | ||||
-rw-r--r-- | dev-python/feedparser/feedparser-9999.ebuild | 53 | ||||
-rw-r--r-- | dev-python/feedparser/files/feedparser-9999-sgmllib.patch | 78 | ||||
-rw-r--r-- | dev-python/feedparser/metadata.xml | 11 |
8 files changed, 214 insertions, 0 deletions
diff --git a/dev-python/example_project/Manifest b/dev-python/example_project/Manifest new file mode 100644 index 0000000..16cd45a --- /dev/null +++ b/dev-python/example_project/Manifest @@ -0,0 +1 @@ +DIST tampakrap-example_project-6e7a33a.zip 9681 SHA256 b294e248df7aaa16878196f91443207b7563e6c25ec42b9703d907986b35c845 SHA512 59397977b8b7784101f432a7c6516bd68d5842f71c5d67e8c2511d5ac8f28f7bc2eb4c2430b2d7bcd6dba5a0c915468e7541de9198af77df34c871b2363d8d4b WHIRLPOOL d68d6299247bd0cfa2925cc9953535429f559f3e3c3dd07067ec434299ea0b13dd311b231368042d96f571900a2028667196bcca28526a00a945b7edad971e15 diff --git a/dev-python/example_project/example_project-0.3.ebuild b/dev-python/example_project/example_project-0.3.ebuild new file mode 100644 index 0000000..4b60d30 --- /dev/null +++ b/dev-python/example_project/example_project-0.3.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 +PYTHON_DEPEND="2:2.7" +PYTHON_RESTRICT_ABIS="3.*" +SUPPORT_PYTHON_ABIS=1 +inherit distutils + +MY_PN="tampakrap-${PN}-6e7a33a" +MY_P="tampakrap-${PN}-6e7a33a" +DESCRIPTION="super tampakrap's wonder of wonders example_project" +HOMEPAGE="https://github.com/tampakrap/example_project" +SRC_URI="https://github.com/tampakrap/${PN}/zipball/master/${MY_PN}.zip" +LICENSE="MIT" +SLOT="0" + +KEYWORDS="~amd64 ~x86" +IUSE="test mysql sqlite" + +RDEPEND="dev-python/django-setuptest + >=dev-python/django-1.4.1[mysql] + >=dev-python/pycurl-7.19.0 + dev-python/beautifulsoup + =dev-python/feedparser-9999 + >=dev-python/pycrypto-2.6" + +DEPEND="${RDEPEND} + dev-python/setuptools" + +S="${WORKDIR}/${MY_P}" diff --git a/dev-python/example_project/files/requirements.txt b/dev-python/example_project/files/requirements.txt new file mode 100644 index 0000000..183453a --- /dev/null +++ b/dev-python/example_project/files/requirements.txt @@ -0,0 +1,7 @@ +Packages required for this django project include; + + django-setuptest + >=django-1.4.1 (gentoo users require use flag mysql or sqlite) + >pycurl-7.19.0 + feedparser trunk as of September 2012 (gentoo users, feedparser-9999) + pycrypto-2.6 diff --git a/dev-python/example_project/files/setup.py b/dev-python/example_project/files/setup.py new file mode 100644 index 0000000..839c4ff --- /dev/null +++ b/dev-python/example_project/files/setup.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +from setuptools import setup, find_packages +from setuptest import test + +setup( + name='example_project', + version='0.3-dev', + description='test', + author='test', + packages=find_packages(), + cmdclass={'test': test}, + + license='???', + url='"https://github.com/tampakrap/example_project', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + ] +) diff --git a/dev-python/example_project/metadata.xml b/dev-python/example_project/metadata.xml new file mode 100644 index 0000000..5366461 --- /dev/null +++ b/dev-python/example_project/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>python</herd> + <maintainer><email>tampakrap@gentoo.org</email></maintainer> + <maintainer> + <email>della5@iinet.com.au</email> + <name>Ian Delaney aka idella4 proxy maintainer</name> + </maintainer> + +</pkgmetadata> diff --git a/dev-python/feedparser/feedparser-9999.ebuild b/dev-python/feedparser/feedparser-9999.ebuild new file mode 100644 index 0000000..946440b --- /dev/null +++ b/dev-python/feedparser/feedparser-9999.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" +SUPPORT_PYTHON_ABIS="1" +PYTHON_TESTS_RESTRICTED_ABIS="*-jython" +PYTHON_TESTS_FAILURES_TOLERANT_ABIS="*" + +inherit distutils eutils subversion + +ESVN_REPO_URI="http://feedparser.googlecode.com/svn/trunk/" +DESCRIPTION="Parse RSS and Atom feeds in Python" +HOMEPAGE="http://code.google.com/p/feedparser/ http://pypi.python.org/pypi/feedparser" + +# sgmllib is licensed under PSF-2. +LICENSE="BSD-2 PSF-2" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND="dev-python/setuptools" +RDEPEND="" + +DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1" +PYTHON_MODNAME="feedparser.py _feedparser_sgmllib.py" + +src_prepare() { + mv feedparser/sgmllib3.py feedparser/_feedparser_sgmllib.py || die "Renaming sgmllib3.py failed" + epatch "${FILESDIR}/${P}-sgmllib.patch" + + sed -e "/import feedparser/isys.path.insert(0, '../build/lib')" -i feedparser/feedparsertest.py + + distutils_src_prepare + + preparation() { + if [[ "${PYTHON_ABI}" == 3.* ]]; then + 2to3-${PYTHON_ABI} -nw --no-diffs feedparser/feedparsertest.py + else + # Avoid SyntaxErrors with Python 2. + echo "raise ImportError" > feedparser/_feedparser_sgmllib.py + fi + } + python_execute_function -s preparation +} + +src_test() { + testing() { + cd feedparser || return 1 + "$(PYTHON)" feedparsertest.py + } + python_execute_function -s testing +} diff --git a/dev-python/feedparser/files/feedparser-9999-sgmllib.patch b/dev-python/feedparser/files/feedparser-9999-sgmllib.patch new file mode 100644 index 0000000..63c12ba --- /dev/null +++ b/dev-python/feedparser/files/feedparser-9999-sgmllib.patch @@ -0,0 +1,78 @@ +From 812793c07d3202d3f5bc39091aec2e7071d000c8 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Sun, 1 Jan 2012 19:30:57 +0100 +Subject: [PATCH] Use shipped sgmllib for Python 3.x + +--- + feedparser/feedparser.py | 19 +++---------------- + setup.py | 2 +- + 2 files changed, 4 insertions(+), 17 deletions(-) + +diff --git a/feedparser/feedparser.py b/feedparser/feedparser.py +index 8275c29..9a8a053 100644 +--- a/feedparser/feedparser.py ++++ b/feedparser/feedparser.py +@@ -204,17 +204,9 @@ else: + try: + import sgmllib + except ImportError: +- # This is probably Python 3, which doesn't include sgmllib anymore +- _SGML_AVAILABLE = 0 ++ import _feedparser_sgmllib as sgmllib + +- # Mock sgmllib enough to allow subclassing later on +- class sgmllib(object): +- class SGMLParser(object): +- def goahead(self, i): +- pass +- def parse_starttag(self, i): +- pass +-else: ++if True: + _SGML_AVAILABLE = 1 + + # sgmllib defines a number of module-level regular expressions that are +@@ -2520,9 +2512,6 @@ class _RelativeURIResolver(_BaseHTMLProcessor): + _BaseHTMLProcessor.unknown_starttag(self, tag, attrs) + + def _resolveRelativeURIs(htmlSource, baseURI, encoding, _type): +- if not _SGML_AVAILABLE: +- return htmlSource +- + p = _RelativeURIResolver(baseURI, encoding, _type) + p.feed(htmlSource) + return p.output() +@@ -2803,8 +2792,6 @@ class _HTMLSanitizer(_BaseHTMLProcessor): + + + def _sanitizeHTML(htmlSource, encoding, _type): +- if not _SGML_AVAILABLE: +- return htmlSource + p = _HTMLSanitizer(encoding, _type) + htmlSource = htmlSource.replace('<![CDATA[', '<![CDATA[') + p.feed(htmlSource) +@@ -3890,7 +3877,7 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer + result['bozo'] = 1 + result['bozo_exception'] = feedparser.exc or e + use_strict_parser = 0 +- if not use_strict_parser and _SGML_AVAILABLE: ++ if not use_strict_parser: + feedparser = _LooseFeedParser(baseuri, baselang, 'utf-8', entities) + feedparser.feed(data.decode('utf-8', 'replace')) + result['feed'] = feedparser.feeddata +diff --git a/setup.py b/setup.py +index a4a60fe..8c15451 100644 +--- a/setup.py ++++ b/setup.py +@@ -16,7 +16,7 @@ setup( + download_url = 'http://code.google.com/p/feedparser/', + platforms = ['POSIX', 'Windows'], + package_dir = {'': 'feedparser'}, +- py_modules = ['feedparser'], ++ py_modules = ['feedparser', '_feedparser_sgmllib'], + keywords = ['atom', 'cdf', 'feed', 'parser', 'rdf', 'rss'], + classifiers = [ + 'Development Status :: 5 - Production/Stable', +-- +1.7.8.1 + diff --git a/dev-python/feedparser/metadata.xml b/dev-python/feedparser/metadata.xml new file mode 100644 index 0000000..5366461 --- /dev/null +++ b/dev-python/feedparser/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>python</herd> + <maintainer><email>tampakrap@gentoo.org</email></maintainer> + <maintainer> + <email>della5@iinet.com.au</email> + <name>Ian Delaney aka idella4 proxy maintainer</name> + </maintainer> + +</pkgmetadata> |