summaryrefslogtreecommitdiffstats
path: root/conf/generate-unit-conf/binder.inc
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-11-15 16:20:28 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:57 +0100
commit88531199d2f46f8758dd1ef3262e567cc849c0b8 (patch)
tree610ecc205121ddd7421755e07be878901830ed73 /conf/generate-unit-conf/binder.inc
parent597a0e00c4fcb1af745804be6249f08203084f62 (diff)
Generate afm-unit.conf using m4
The use of m4 to generate the afm-unit.conf and afm-unit-debug.conf files has benefits: - the sync between debug versus not debug is mechanical - it allows easier maintainance by improving readability and writability (ex: macros TARGET or UNIT_NAME_BASE) Change-Id: Ic0427bedf4f8a5b174318562336603077f174fa5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'conf/generate-unit-conf/binder.inc')
-rw-r--r--conf/generate-unit-conf/binder.inc44
1 files changed, 44 insertions, 0 deletions
diff --git a/conf/generate-unit-conf/binder.inc b/conf/generate-unit-conf/binder.inc
new file mode 100644
index 0000000..a99467a
--- /dev/null
+++ b/conf/generate-unit-conf/binder.inc
@@ -0,0 +1,44 @@
+
+IF_AGL_DEVEL
+X-AFM-http-port={{:#metadata.http-port}}
+ELSE
+IF_NOT_CONTENT(application/vnd.agl.service)
+X-AFM--http-port={{:#metadata.http-port}}
+ENDIF
+ENDIF
+
+ExecStart=/usr/bin/afb-daemon \
+ --name afbd-TARGET \
+ --rootdir={{:#metadata.install-dir}} \
+ --workdir={{&#metadata.app-data-dir}}/{{id}} \
+IF_AGL_DEVEL \
+ --verbose \
+ --verbose \
+ --monitoring \
+ --port={{:#metadata.http-port}} \
+ --token=HELLO \
+ --roothttp=ON_CONTENT(application/vnd.agl.service, ., ON_PERM(:public:no-htdocs, ., htdocs)) \
+ELSE \
+ IF_CONTENT(application/vnd.agl.service) \
+ --no-httpd \
+ ELSE \
+ --port={{:#metadata.http-port}} \
+ --random-token \
+ --roothttp=ON_PERM(:public:no-htdocs, ., htdocs) \
+ ENDIF \
+ENDIF \
+ ON_PERM(:public:applications:read, --alias=/icons:{{:#metadata.icons-dir}}) \
+ {{#required-api}} \
+ ON_VALUE(auto|ws, --ws-client=unix:%t/apis/ws/{{name}}) \
+ ON_VALUE(dbus, --dbus-client={{name}}) \
+ ON_VALUE(link, --binding=%t/apis/lib/{{name}}) \
+ ON_VALUE(cloud, --cloud-client={{name}}) \
+ ON_VALUE(local, --binding={{:#metadata.install-dir}}/{{name}}) \
+ {{/required-api}} \
+ {{#provided-api}} \
+ ON_VALUE(auto|ws, --ws-server=sd:{{name}}) \
+ ON_VALUE(dbus, --dbus-server={{name}}) \
+ {{/provided-api}} \
+ ON_CONTENT(text/html, --exec /usr/bin/web-runtime http://localhost:@p/{{content.src}}?token=@t) \
+ ON_CONTENT(application/vnd.agl.native, --exec {{:#metadata.install-dir}}/{{content.src}} @p @t)
+