opendreambox-precompiled-binary: allow to override name, version and arch
[opendreambox.git] / meta-opendreambox / classes / opendreambox-precompiled-binary.bbclass
1 LICENSE = "CLOSED"
2 PRECOMPILED_NAME ?= "${PN}"
3 PRECOMPILED_ARCH ?= "${PACKAGE_ARCH}"
4 PRECOMPILED_VERSION ?= "${PV}"
5 PRECOMPILED_URI ?= "http://dreamboxupdate.com/download/${DISTRO}/${DISTRO_VERSION}/${@precompiledPath(d)};name=${PRECOMPILED_ARCH}"
6
7 SRC_URI += "${PRECOMPILED_URI}"
8
9 S = "${WORKDIR}/${PRECOMPILED_NAME}_${PRECOMPILED_VERSION}_${PRECOMPILED_ARCH}"
10
11 PACKAGES = "${PN}"
12
13 def precompiledPath(d):
14     pn = d.getVar('PRECOMPILED_NAME', True)
15     pv = d.getVar('PRECOMPILED_VERSION', True)
16     package_arch = d.getVar('PRECOMPILED_ARCH', True)
17     md5sum = d.getVarFlag('SRC_URI', '%s.md5sum' % package_arch)
18     if md5sum is None:
19         raise bb.parse.SkipPackage("No checksum found for precompiled binary package %s" % pn)
20     return '%s/%s/%s/%s/%s_%s_%s.tar.xz' % (pn, pv, package_arch, md5sum, pn, pv, package_arch)
21
22 do_install() {
23     cp -r * ${D}
24 }
25
26 INHIBIT_PACKAGE_STRIP = "1"