1# This recipe requires online access to build, as it uses NPM for dependency
2# management and resolution.
3PR = "r1"
4PV = "1.0+git${SRCPV}"
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
7
8SRC_URI = "git://github.com/openbmc/phosphor-webui.git"
9SRCREV = "339db9a4c8610c5ecb92993c0bbc2219933bc858"
10S = "${WORKDIR}/git"
11
12DEPENDS_prepend = "nodejs-native "
13
14inherit allarch
15
16FILES_${PN} += "${datadir}/www/*"
17
18do_compile () {
19    cd ${S}
20    rm -rf node_modules
21    npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install
22    npm run-script build
23}
24
25do_install () {
26   # create directory structure
27   install -d ${D}${datadir}/www
28   cp -r ${S}/dist/** ${D}${datadir}/www
29   find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
30   find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
31}
32
33