aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2015-03-26 19:43:27 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2015-04-13 12:55:48 +0200
commitd9940cd2a536633259d6bed4536f863903f4638b (patch)
tree04802752d7f18dd6303e5271af5d33cf4488d520 /classes
parent374bc5db7eb17ccff3b1a49fc619e8e9ffec1f6a (diff)
downloadmeta-python2-d9940cd2a536633259d6bed4536f863903f4638b.tar.gz
meta-python2-d9940cd2a536633259d6bed4536f863903f4638b.tar.bz2
meta-python2-d9940cd2a536633259d6bed4536f863903f4638b.zip
pypi.bbclass: new class to ease writing pypi recipes
(From meta-openembedded commit: 0f568c5441b89c379c4afb845af43c0bbd8e6f63) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Tim Orling <ticotimo@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/pypi.bbclass21
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/pypi.bbclass b/classes/pypi.bbclass
new file mode 100644
index 00000000..41a70e25
--- /dev/null
+++ b/classes/pypi.bbclass
@@ -0,0 +1,21 @@
+def pypi_package(d):
+ bpn = d.getVar('BPN', True)
+ if bpn.startswith('python-'):
+ return bpn[7:]
+ return bpn
+
+PYPI_PACKAGE ?= "${@pypi_package(d)}"
+
+def pypi_src_uri(d):
+ package = d.getVar('PYPI_PACKAGE', True)
+ pv = d.getVar('PV', True)
+ return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv)
+
+PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
+
+HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
+SECTION = "devel/python"
+SRC_URI += "${PYPI_SRC_URI}"
+S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
+
+inherit setuptools