Leo Tu | 9104c30 | 2022-08-18 05:17:39 +0000 | [diff] [blame] | 1 | SUMMARY = "Glome Config" |
| 2 | DESCRIPTION = "Glome config file provides a glome config file" |
| 3 | PR = "r1" |
| 4 | |
| 5 | # This is required to replace the glome/config that is removed in glome_git.bb |
| 6 | |
| 7 | LICENSE = "Apache-2.0" |
| 8 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 9 | |
| 10 | # Example Privkey: A0F1D0A0CB254839D04637F567325B850B5174850B129E811F5E203A42CC3B6C |
| 11 | GLOME_PUBLIC_KEY ?= "AC11D4582261F2D05CDDE1BD94383393D26C5C269642EE26D7EABD1EADC03C14" |
| 12 | GLOME_KEY_VERSION ?= "4" |
| 13 | GLOME_URL_PREFIX ?= "http://example-glome-service/" |
| 14 | |
| 15 | SRC_URI = "file://config.in" |
| 16 | |
| 17 | do_install:append() { |
| 18 | if [ -z '${GLOME_PUBLIC_KEY}' ]; then |
| 19 | echo 'Missing GLOME_PUBLIC_KEY' >&2 |
| 20 | exit 1 |
| 21 | fi |
| 22 | if [ -z '${GLOME_KEY_VERSION}' ]; then |
| 23 | echo 'Missing GLOME_KEY_VERSION' >&2 |
| 24 | exit 1 |
| 25 | fi |
| 26 | if [ -z '${GLOME_URL_PREFIX}' ]; then |
| 27 | echo 'Missing GLOME_URL_PREFIX' >&2 |
| 28 | exit 1 |
| 29 | fi |
| 30 | |
| 31 | sed ${WORKDIR}/config.in \ |
| 32 | -e 's#@PUBLIC_KEY@#${GLOME_PUBLIC_KEY}#' \ |
| 33 | -e 's#@KEY_VERSION@#${GLOME_KEY_VERSION}#' \ |
| 34 | -e 's#@URL_PREFIX@#${GLOME_URL_PREFIX}#' \ |
| 35 | > ${WORKDIR}/config |
| 36 | |
| 37 | install -d ${D}${sysconfdir}/glome |
| 38 | install -m 0644 ${WORKDIR}/config ${D}${sysconfdir}/glome |
| 39 | } |