summaryrefslogtreecommitdiffstats
path: root/conf/unit/afm-unit
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-05-15 20:49:14 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-06-04 09:52:31 +0200
commit5b801a3e7b0465f88b785a155dd430ba09c56568 (patch)
tree82e06c5e13c7a4652170e17665f74496539a7022 /conf/unit/afm-unit
parenta5cf62686366f4a69becf62aa4d953e034c9bee4 (diff)
afm-unit.conf: Refactor its generation
The process of generating the file /etc/afm-unit.conf had be reworked to be more straight forward. Before that commit, a manual operation (a "make") had to be done before committing the repository. This was not efficient, error prone and kept temporary files in conf. That commit changes it by calling m4 through cmake. Bug-AGL: SPEC-2436 Change-Id: Ia32a810286471dde8a01387d157e33277d67411d Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'conf/unit/afm-unit')
-rw-r--r--conf/unit/afm-unit109
1 files changed, 109 insertions, 0 deletions
diff --git a/conf/unit/afm-unit b/conf/unit/afm-unit
new file mode 100644
index 0000000..2a91067
--- /dev/null
+++ b/conf/unit/afm-unit
@@ -0,0 +1,109 @@
+divert(-1)
+--------------------------------------------------------------------------------
+dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
+include(macros.inc)
+-- Set the comment character of m4 to ; instead of #
+-- This is needed for substitution within lines starting with #
+changecom( ';')
+divert(0)dnl
+;-------------------------------------------------------------------------------
+; File:
+;
+; afm-unit.conf
+;
+; Mode:
+;
+; ON_AGL_DEVEL(DEVEL, RELEASE)
+;
+; Role:
+;
+; Configure how installation of widget produces unit files for systemd
+;
+; Processing and format:
+;
+; 1. File load
+;
+; Lines beginning with ; are firstly removed
+;
+; 2. File instantiation
+;
+; Mustache (extended) substitutions are applied using JSON
+; data deduced from config.xml file of the widget.
+;
+; 3. Extraction of units
+;
+; Extract produced units, pack it (remove empty lines and directives)
+;
+; Directives:
+;
+; Any directive occupy one whole line starting with %
+;
+; - %nl
+;
+; produce an empty line at the end
+;
+; - %begin systemd-unit
+; - %end systemd-unit
+;
+; delimit the produced unit
+;
+; - %systemd-unit user
+; - %systemd-unit system
+;
+; tells the kind of unit (user/system)
+;
+; - %systemd-unit service NAME
+; - %systemd-unit socket NAME
+;
+; gives the name and type of the unit
+;
+; - %systemd-unit wanted-by NAME
+;
+; tells to install a link to unit in the wants of NAME
+;
+; Setting variables:
+;
+; AFM uses the feature of systemd that completely ignores options prefixed
+; with X-
+;
+; Consequently, options starting with X-AFM- are recorded as public data
+; about the application and options starting starting with X-AFM-- are
+; recorded as private data.
+;
+; Examples:
+;
+; X-AFM-description={{description}}
+;
+; Records the description of the unit in the field "description"
+; of both the public and private object describing the unit.
+;
+; X-AFM--wgtdir={{:#metadata.install-dir}}
+;
+; Records the installation directory path in the field "wgtdir"
+; of the private object only.
+;
+;-------------------------------------------------------------------------------
+;---- F O R E A C H T A R G E T ----
+;-------------------------------------------------------------------------------
+{{#targets}}
+;-------------------------------------------------------------------------------
+include(service.inc)
+;-------------------------------------------------------------------------------
+;---- F O R E A C H P R O V I D E D A P I S ----
+;-------------------------------------------------------------------------------
+{{#provided-api}}
+{{#value=ws|auto}}
+include(provided-api.inc)
+{{/value=ws|auto}}
+{{/provided-api}}
+;-------------------------------------------------------------------------------
+;---- F O R E A C H P R O V I D E D B I N D I N G ----
+;-------------------------------------------------------------------------------
+{{#provided-binding}}
+include(provided-binding.inc)
+{{/provided-binding}}
+;-------------------------------------------------------------------------------
+{{/targets}}
+;-------------------------------------------------------------------------------
+; End of file afm-unit.conf mode ON_AGL_DEVEL(DEVEL, RELEASE)
+;-------------------------------------------------------------------------------