openmoko2.bbclass: add some ugly python foo to get the correct modulename and sourcedir
[vuplus_openembedded] / classes / openmoko2.bbclass
1 inherit autotools pkgconfig
2
3 HOMEPAGE = "http://www.openmoko.org"
4 OPENMOKO_RELEASE ?= "OM-2007.2"
5 OPENMOKO_MIRROR ?= "svn://svn.openmoko.org/trunk"
6
7 def openmoko_two_get_license(d):
8     import bb
9     openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
10     return "LGPL GPL".split()[section != "libs"]
11
12 def openmoko_two_get_subdir(d):
13     import bb
14     openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
15     if section == 'base': return ""
16     elif section == 'libs': return "libraries"
17     elif section in 'apps tools pim'.split(): return "applications"
18     elif section == "panel-plugin": return "panel-plugins"
19     elif section == "inputmethods": return "inputmethods"
20     else: return section
21
22 def openmoko_strip_two(d):
23     import bb
24     pname, openmokonumber = bb.data.getVar('PN', d, 1).split("2")
25     return pname
26
27
28 LICENSE = "${@openmoko_two_get_license(d)}"
29 SUBDIR = "${@openmoko_two_get_subdir(d)}"
30 PNAME = "${@openmoko_strip_two(d)}"
31
32 SRC_URI := "${OPENMOKO_MIRROR}/src/target/${OPENMOKO_RELEASE}/${SUBDIR};module=${PNAME};proto=http"
33 S = "${WORKDIR}/${PNAME}"
34
35 FILES_${PN} += "${datadir}/icons"