Add mechanism to deploy the alexa-voiceagent credentials
[AGL/meta-agl-devel.git] / meta-speech-framework / meta-aac / recipes-apis / alexa-voiceagent-service / alexa-voiceagent-config_1.0.bb
1 SUMMARY = "Alexa service binding default configuration to connect to Alexa"
2 DESCRIPTION = "Alexa alexa-voiceagent-service binding configuration files"
3 HOMEPAGE = "https://github.com/alexa/alexa-auto-sdk/tree/master/platforms/agl/alexa-voiceagent-service"
4 SECTION = "apps"
5
6 LICENSE = "Apache-2.0"
7 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
8
9 SRC_URI = "file://AlexaAutoCoreEngineConfig.json.in"
10
11 inherit allarch
12
13 do_compile () {
14
15     if test x"${ALEXA_CLIENTID}" == x"" ; then
16         bbfatal "ALEXA CLIENTID not defined in your environment e.g. conf/local.conf"
17     fi
18
19     if test x"${ALEXA_SERIALNUMBER}" == x"" ; then
20         bbfatal "ALEXA SERIALNUMBER not defined in your environment e.g. conf/local.conf"
21     fi
22
23     if test x"${ALEXA_PRODUCTID}" == x"" ; then
24         bbfatal "ALEXA PRODUCTID not defined in your environment e.g. conf/local.conf"
25     fi
26
27 }
28
29 do_install () {
30     #replace
31     sed -e "s/@@ALEXA_CLIENTID@@/${ALEXA_CLIENTID}/" -e "s/@@ALEXA_SERIALNUMBER@@/${ALEXA_SERIALNUMBER}/" -e "s/@@ALEXA_PRODUCTID@@/${ALEXA_PRODUCTID}/" ${WORKDIR}/AlexaAutoCoreEngineConfig.json.in > ${WORKDIR}/AlexaAutoCoreEngineConfig.json
32
33     # install
34     install -D -m 644 ${WORKDIR}/AlexaAutoCoreEngineConfig.json ${D}${sysconfdir}/xdg/AGL/AlexaAutoCoreEngineConfig.json
35 }
36
37 RPROVIDES_${PN} += "virtual/alexa-voiceagent-config"
38