aws-iot-sdk: minor fixes

* Create the certificates directory before copying files into it.
* Give the downloaded tarball a meaningful name (otherwise tarballs
  downloaded from GitHub don't have a proper name (only the version) and
  may collide with other packages with the same version.
* Allow to create certs package if certs are available at build time.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-06-15 12:51:38 +02:00
parent e6f072384d
commit 84f63905ac
2 changed files with 8 additions and 1 deletions

View File

@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=acc7a1bf87c055789657b148939e4b40"
DEPENDS = "mbedtls"
SRC_URI = " \
https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz \
https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
file://aws_iot_config.h.template \
file://awsiotsdk.pc \
file://Makefile \
@ -58,11 +58,16 @@ do_install() {
if [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ] && \
[ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ] && \
[ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ]; then
install -d ${D}${sysconfdir}/ssl/certs
install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ${D}${sysconfdir}/ssl/certs/
install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ${D}${sysconfdir}/ssl/certs/
install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ${D}${sysconfdir}/ssl/certs/
fi
}
PACKAGES =+ "${PN}-cert"
FILES_${PN}-cert = "${sysconfdir}/ssl/certs/"
ALLOW_EMPTY_${PN} = "1"

View File

@ -45,5 +45,7 @@ do_install() {
oe_runmake DESTDIR=${D} install
}
RRECOMMENDS_${PN} += "awsiotsdk-c-cert"
PACKAGE_ARCH = "${MACHINE_ARCH}"