diff options
author | Andreas Oberritter <obi@opendreambox.org> | 2015-03-26 19:43:27 +0100 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-04-13 12:55:48 +0200 |
commit | d9940cd2a536633259d6bed4536f863903f4638b (patch) | |
tree | 04802752d7f18dd6303e5271af5d33cf4488d520 /classes | |
parent | 374bc5db7eb17ccff3b1a49fc619e8e9ffec1f6a (diff) | |
download | meta-python2-d9940cd2a536633259d6bed4536f863903f4638b.tar.gz |
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.bbclass | 21 |
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 |