Add persistent storage grpc API
[AGL/meta-agl-demo.git] / recipes-demo / agl-persistent-storage-api / agl-persistent-storage-api_git.bb
1 DESCRIPTION = "A grpc API that provides persistent storage for the Automotive Grade Linux demo"
2 SUMMARY = "Our goal is to develop a grpc API for AGLthat serves as persistent storage API for the demo. The API will be written in Rust and make use of tonic for grpc functionality as well as RocksDB as a database backend, using rust-rocksdb. Use cases include retaining settings over a system shutdown (e.g. audio, HVAC, profile data, Wifi settings, radio presets, metric vs imperial units)."
3 LICENSE = "Apache-2.0"
4 LIC_FILES_CHKSUM = "file://LICENSE;md5=493c464569a4f93a01fc9025ee76a69b"
5
6 SRC_URI = "git://github.com/LSchwiedrzik/agl-persistent-storage-api.git;protocol=https;branch=master \
7            file://agl-persistent-storage-api.service \
8            "
9
10 # Modify these as desired
11 PV = "1.0+git${SRCPV}"
12 SRCREV = "f69d46510e5b13cdb559dbc077aced1f74e19f66"
13
14 S = "${WORKDIR}/git"
15
16 DEPENDS = "protobuf-native grpc-native rocksdb clang-native"
17 TOOLCHAIN = "clang"
18
19 require ${BPN}-crates.inc
20
21 inherit cargo cargo-update-recipe-crates systemd 
22 #useradd
23
24 SYSTEMD_SERVICE:${PN} = "${BPN}.service"
25
26 USERADD_PACKAGES = "${PN}"
27 USERADDEXTENSION = "useradd-staticids"
28 GROUPADD_PARAM:${PN} = "-g 903 persistent-api ;"
29 USERADD_PARAM:${PN} = "--system -g 903 -u 903 -o -d / --shell /bin/nologin persistent-api ;"
30
31 do_compile:prepend() {
32     export ROCKSDB_CXX_STD="--std=c99"
33     export ROCKSDB_INCLUDE_DIR="${RECIPE_SYSROOT}/usr/include"
34 }
35
36 do_install:append () {
37     # copy systemd service file into destination folder
38     mv ${D}/usr/bin/server ${D}/usr/bin/agl-service-persistent-storage
39     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
40         install -d ${D}${systemd_system_unitdir}
41         install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}
42     fi
43 }
44
45 FILES:${PN} += "${systemd_system_unitdir} ${datadir}"
46