summaryrefslogtreecommitdiffstats
path: root/meta-python/classes/pypi.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/classes/pypi.bbclass')
-rw-r--r--meta-python/classes/pypi.bbclass21
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 000000000..41a70e25c
--- /dev/null
+++ b/meta-python/classes/pypi.bbclass
@@ -0,0 +1,21 @@
1def pypi_package(d):
2 bpn = d.getVar('BPN', True)
3 if bpn.startswith('python-'):
4 return bpn[7:]
5 return bpn
6
7PYPI_PACKAGE ?= "${@pypi_package(d)}"
8
9def 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
14PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
15
16HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
17SECTION = "devel/python"
18SRC_URI += "${PYPI_SRC_URI}"
19S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
20
21inherit setuptools