aboutsummaryrefslogtreecommitdiffstats
path: root/conf/unit/generate-unit-conf/afm-unit
blob: 2a91067c2b3778e363f83682d740697d5594260a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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)
;-------------------------------------------------------------------------------