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 | 0f568c5441b89c379c4afb845af43c0bbd8e6f63 (patch) | |
| tree | 1772f434db943a1da78c73485d7329bba6e58b65 /meta-python/classes/pypi.bbclass | |
| parent | 4d6e129b27e37a684d06913e5e21580661c91ea6 (diff) | |
| download | meta-openembedded-0f568c5441b89c379c4afb845af43c0bbd8e6f63.tar.gz | |
pypi.bbclass: new class to ease writing pypi recipes
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-python/classes/pypi.bbclass')
| -rw-r--r-- | meta-python/classes/pypi.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta-python/classes/pypi.bbclass b/meta-python/classes/pypi.bbclass new file mode 100644 index 0000000000..41a70e25c3 --- /dev/null +++ b/meta-python/classes/pypi.bbclass | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | def pypi_package(d): | ||
| 2 | bpn = d.getVar('BPN', True) | ||
| 3 | if bpn.startswith('python-'): | ||
| 4 | return bpn[7:] | ||
| 5 | return bpn | ||
| 6 | |||
| 7 | PYPI_PACKAGE ?= "${@pypi_package(d)}" | ||
| 8 | |||
| 9 | def pypi_src_uri(d): | ||
| 10 | package = d.getVar('PYPI_PACKAGE', True) | ||
| 11 | pv = d.getVar('PV', True) | ||
| 12 | return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv) | ||
| 13 | |||
| 14 | PYPI_SRC_URI ?= "${@pypi_src_uri(d)}" | ||
| 15 | |||
| 16 | HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/" | ||
| 17 | SECTION = "devel/python" | ||
| 18 | SRC_URI += "${PYPI_SRC_URI}" | ||
| 19 | S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" | ||
| 20 | |||
| 21 | inherit setuptools | ||
