diff options
author | Brandon Bayer <bbayer@multitech.com> | 2016-10-26 15:40:35 -0500 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2016-11-03 16:40:10 -0500 |
commit | 4d6aefceec69079f3069440f6a9d2f3ea30aee89 (patch) | |
tree | 46f0208a5287f2307fc8782ec9c3fee7cc4100d0 /recipes-core/annex-client | |
parent | 5e1da7aeca498961c20147c356990752a4cb2d87 (diff) | |
download | meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.tar.gz meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.tar.bz2 meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.zip |
feat: add annex-client
Diffstat (limited to 'recipes-core/annex-client')
-rw-r--r-- | recipes-core/annex-client/annex-client-from-src.bb | 27 | ||||
-rw-r--r-- | recipes-core/annex-client/annex-client.bb | 29 | ||||
-rw-r--r-- | recipes-core/annex-client/annex-client/annex-client.init | 43 |
3 files changed, 99 insertions, 0 deletions
diff --git a/recipes-core/annex-client/annex-client-from-src.bb b/recipes-core/annex-client/annex-client-from-src.bb new file mode 100644 index 0000000..ee7dee9 --- /dev/null +++ b/recipes-core/annex-client/annex-client-from-src.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "Provides the Multi-Tech MDM client" +SECTION = "remote-management" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PROVIDES = "annex-client-from-src" +DEPENDS = "jsoncpp curl protobuf cyrus-sasl protobuf-native annex-proto mts-io" + +PR = "r0" +SRCREV = "a696a7660bf153fec126cf971442c60961c51782" + +SRC_URI = "git://git@${MTS_INTERNAL_GIT}/multitech/annex-client.git;protocol=ssh;branch=master" + +S = "${WORKDIR}/git" + +do_compile() { + echo "directory: `pwd`" + mkdir -p annex_pb + cp ${STAGING_DIR_NATIVE}/annex.proto annex_pb/ + make all CFLAGS+="-DMLINUX_BUILD" +} + +# IMPORTANT NOTE: +# this recipe is only used for the annex-client Jenkin's job to build IPK. +# annex-client.bb is used to install the binary in an image +do_install() { + oe_runmake install DESTDIR=${D} SUBDIRS="src" +} diff --git a/recipes-core/annex-client/annex-client.bb b/recipes-core/annex-client/annex-client.bb new file mode 100644 index 0000000..1a0544a --- /dev/null +++ b/recipes-core/annex-client/annex-client.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "Provides the Multi-Tech MDM client" +SECTION = "remote-management" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PROVIDES = "annex-client" + +# NOTE: annex-client binary is built with Jenkin's job using annex-client-from-src.bb +# To update this, manually copy ipk from Jenkin's job to .net/downloads/ +PR = "r0" +SRC_URI = "http://multitech.net/downloads/annex-client-from-src_${PV}-${PR}.0_${TUNE_PKGARCH}.ipk \ + file://annex-client.init \ +" + +SRC_URI[md5sum] = "b17462ba3883df6a06b226b37a523eba" +SRC_URI[sha256sum] = "be903e7e27ad34832cb8045ef805f4e226aa6e254a3c995c5e61a0a9197a95b0" + +#inherit update-rc.d +# +#INITSCRIPT_NAME = "annex-client" +#INITSCRIPT_PARAMS = "defaults 95 1" +S = "${WORKDIR}" + +do_install() { + install -d ${D}${sbindir} + install -m 755 sbin/annexcd ${D}${sbindir} + + install -d ${D}${sysconfdir}/init.d + install -m 755 ${WORKDIR}/annex-client.init ${D}${sysconfdir}/init.d/annex-client +} diff --git a/recipes-core/annex-client/annex-client/annex-client.init b/recipes-core/annex-client/annex-client/annex-client.init new file mode 100644 index 0000000..4a5dc4b --- /dev/null +++ b/recipes-core/annex-client/annex-client/annex-client.init @@ -0,0 +1,43 @@ +#!/bin/bash + +MONITOR="/sbin/monitor-annexcd" +CLIENT="annexcd" + +start() { + if [[ $(pidof -x $MONITOR) ]]; then + echo "RM client is already running" + else + echo "Starting RM client" + $MONITOR & + fi +} + +stop() { + MONITOR_PID=$(pidof -x $MONITOR) + CLIENT_PID=$(pidof $CLIENT) + if [[ $MONITOR_PID ]]; then + echo "Stopping RM client" + kill $MONITOR_PID $CLIENT_PID + else + echo "RM client is not running" + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "Usage: /etc/init.d/annex-client {start|stop|restart}" >&2 + exit 1 + ;; +esac + +exit 0 |