Introduce platform services
[src/app-framework-main.git] / conf / unit / afm-unit
1 divert(-1)
2 --------------------------------------------------------------------------------
3 dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
4 include(macros.inc)
5 -- Set the comment character of m4 to ; instead of #
6 -- This is needed for substitution within lines starting with #
7 changecom( ';')
8 divert(0)dnl
9 ;-------------------------------------------------------------------------------
10 ; File:
11 ;
12 ;    afm-unit.conf
13 ;
14 ; Mode:
15 ;
16 ;    ON_AGL_DEVEL(DEVEL, RELEASE)
17 ;
18 ; Role:
19 ;
20 ;    Configure how installation of widget produces unit files for systemd
21 ;
22 ; Processing and format:
23 ;
24 ;    1. File load
25 ;
26 ;           Lines beginning with ; are firstly removed
27 ;
28 ;    2. File instantiation
29 ;
30 ;           Mustache (extended) substitutions are applied using JSON
31 ;           data deduced from config.xml file of the widget.
32 ;
33 ;    3. Extraction of units
34 ;
35 ;           Extract produced units, pack it (remove empty lines and directives)
36 ;
37 ; Directives:
38 ;
39 ;    Any directive occupy one whole line starting with %
40 ;
41 ;     - %nl
42 ;
43 ;             produce an empty line at the end
44 ;
45 ;     - %begin systemd-unit
46 ;     - %end systemd-unit
47 ;
48 ;             delimit the produced unit
49 ;
50 ;     - %systemd-unit user
51 ;     - %systemd-unit system
52 ;
53 ;             tells the kind of unit (user/system)
54 ;
55 ;     - %systemd-unit service NAME
56 ;     - %systemd-unit socket NAME
57 ;
58 ;             gives the name and type of the unit
59 ;
60 ;     - %systemd-unit wanted-by NAME
61 ;
62 ;             tells to install a link to unit in the wants of NAME
63 ;
64 ; Setting variables:
65 ;
66 ;    AFM uses the feature of systemd that completely ignores options prefixed
67 ;    with X-
68 ;
69 ;    Consequently, options starting with X-AFM- are recorded as public data
70 ;    about the application and options starting starting with X-AFM-- are
71 ;    recorded as private data.
72 ;
73 ;    Examples:
74 ;
75 ;        X-AFM-description={{description}}
76 ;
77 ;              Records the description of the unit in the field "description"
78 ;              of both the public and private object describing the unit.
79 ;
80 ;        X-AFM--wgtdir={{:#metadata.install-dir}}
81 ;
82 ;              Records the installation directory path in the field "wgtdir"
83 ;              of the private object only.
84 ;
85 ;-------------------------------------------------------------------------------
86 ;----        F O R E A C H   T A R G E T                                    ----
87 ;-------------------------------------------------------------------------------
88 {{#targets}}
89 ;-------------------------------------------------------------------------------
90 include(service.inc)
91 IF_PERM(:partner:scope-platform)
92 ;-------------------------------------------------------------------------------
93 ;----        F O R E A C H   P R O V I D E D   A P I S           (PLATFORM) ----
94 ;-------------------------------------------------------------------------------
95 {{#provided-api}}
96 {{#value=ws|auto}}
97 include(provided-api-platform.inc)
98 {{/value=ws|auto}}
99 {{/provided-api}}
100 ;-------------------------------------------------------------------------------
101 ;----        F O R E A C H   P R O V I D E D   B I N D I N G     (PLATFORM) ----
102 ;-------------------------------------------------------------------------------
103 {{#provided-binding}}
104 include(provided-binding-platform.inc)
105 {{/provided-binding}}
106 ;-------------------------------------------------------------------------------
107 ELSE
108 ;-------------------------------------------------------------------------------
109 ;----        F O R E A C H   P R O V I D E D   A P I S           (USER)     ----
110 ;-------------------------------------------------------------------------------
111 {{#provided-api}}
112 {{#value=ws|auto}}
113 include(provided-api-user.inc)
114 {{/value=ws|auto}}
115 {{/provided-api}}
116 ;-------------------------------------------------------------------------------
117 ;----        F O R E A C H   P R O V I D E D   B I N D I N G     (USER)     ----
118 ;-------------------------------------------------------------------------------
119 {{#provided-binding}}
120 include(provided-binding-user.inc)
121 {{/provided-binding}}
122 ;-------------------------------------------------------------------------------
123 ENDIF
124 {{/targets}}
125 ;-------------------------------------------------------------------------------
126 ; End of file afm-unit.conf mode ON_AGL_DEVEL(DEVEL, RELEASE)
127 ;-------------------------------------------------------------------------------