source: BLFS/xsl/gen_config.xsl@ f53dc4c

ablfs
Last change on this file since f53dc4c was 63fc514, checked in by Pierre Labastie <pierre@…>, 13 years ago

Initial modificaiton of BLFS tools

  • Property mode set to 100644
File size: 4.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2
3<!-- $Id: gen_config.xsl 21 2012-02-16 15:06:19Z labastie $ -->
4
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
7
8 <xsl:output method="text"
9 encoding='ISO-8859-1'/>
10
11 <xsl:template match="/">
12 <xsl:apply-templates select="//list"/>
13 <xsl:text>comment ""
14
15menu "Default package for resolving MTA dependency"
16
17choice
18 prompt "Mail server"
19 config MS_sendmail
20 bool "sendmail"
21 config MS_postfix
22 bool "postfix"
23 config MS_exim
24 bool "exim"
25endchoice
26config MAIL_SERVER
27 string
28 default sendmail if MS_sendmail
29 default postfix if MS_postfix
30 default exim if MS_exim
31
32endmenu
33
34choice
35 prompt "Dependency level"
36 default DEPLVL_2
37
38 config DEPLVL_1
39 bool "Required dependencies only"
40
41 config DEPLVL_2
42 bool "Required and recommended dependencies"
43
44 config DEPLVL_3
45 bool "Required, recommended and optional dependencies"
46
47endchoice
48config optDependency
49 int
50 default 1 if DEPLVL_1
51 default 2 if DEPLVL_2
52 default 3 if DEPLVL_3
53
54
55config SUDO
56 bool "Build as User"
57 default y
58 help
59 Select if sudo will be used (you build as a normal user)
60 otherwise sudo is not needed (you build as root)
61</xsl:text>
62 </xsl:template>
63
64 <xsl:template match="list">
65 <xsl:if
66 test=".//package[(version and not(inst-version)) or
67 string(version) != string(inst-version)]">
68 <xsl:text>config&#9;MENU_</xsl:text>
69 <xsl:value-of select="@id"/>
70 <xsl:text>
71bool&#9;"</xsl:text>
72 <xsl:value-of select="name"/>
73 <xsl:text>"
74default&#9;n
75
76menu "</xsl:text>
77 <xsl:value-of select="name"/>
78 <xsl:text>"
79depends MENU_</xsl:text>
80 <xsl:value-of select="@id"/>
81 <xsl:text>
82
83</xsl:text>
84 <xsl:apply-templates select="sublist"/>
85 <xsl:text>endmenu
86
87</xsl:text>
88 </xsl:if>
89 </xsl:template>
90
91 <xsl:template match="sublist">
92 <xsl:if
93 test=".//package[(version and not(inst-version)) or
94 string(version) != string(inst-version)]">
95 <xsl:text>&#9;config&#9;MENU_</xsl:text>
96 <xsl:value-of select="@id"/>
97 <xsl:text>
98&#9;bool&#9;"</xsl:text>
99 <xsl:value-of select="name"/>
100 <xsl:text>"
101&#9;default&#9;n
102
103&#9;menu "</xsl:text>
104 <xsl:value-of select="name"/>
105 <xsl:text>"
106&#9;depends MENU_</xsl:text>
107 <xsl:value-of select="@id"/>
108 <xsl:text>
109
110</xsl:text>
111 <xsl:apply-templates select="package"/>
112 <xsl:text>&#9;endmenu
113
114</xsl:text>
115 </xsl:if>
116 </xsl:template>
117
118 <xsl:template match="package">
119 <xsl:if
120 test="(version and not(inst-version)) or
121 string(version) != string(inst-version)">
122 <xsl:text>&#9;&#9;config&#9;CONFIG_</xsl:text>
123 <xsl:value-of select="name"/>
124 <xsl:text>
125&#9;&#9;bool&#9;"</xsl:text>
126 <xsl:value-of select="name"/>
127 <xsl:text> </xsl:text>
128 <xsl:value-of select="version"/>
129 <xsl:if test="inst-version">
130 <xsl:text> [Installed </xsl:text>
131 <xsl:value-of select="inst-version"/>
132 <xsl:text>]</xsl:text>
133 </xsl:if>
134 <xsl:text>"
135&#9;&#9;default&#9;y
136
137</xsl:text>
138 </xsl:if>
139 <xsl:if
140 test="not(version) and ./module[not(inst-version) or
141 string(version) != string(inst-version)]">
142 <xsl:text>&#9;&#9;config&#9;MENU_</xsl:text>
143 <xsl:value-of select="translate(name,' ','_')"/>
144 <xsl:text>
145&#9;&#9;bool&#9;"</xsl:text>
146 <xsl:value-of select="name"/>
147 <xsl:text>"
148&#9;&#9;default&#9;n
149
150&#9;&#9;menu "</xsl:text>
151 <xsl:value-of select="name"/>
152 <xsl:text>"
153&#9;&#9;depends MENU_</xsl:text>
154 <xsl:value-of select="translate(name,' ','_')"/>
155 <xsl:text>
156
157</xsl:text>
158 <xsl:apply-templates select="module"/>
159 <xsl:text>&#9;&#9;endmenu
160
161</xsl:text>
162 </xsl:if>
163 </xsl:template>
164
165 <xsl:template match="module">
166 <xsl:if
167 test="not(inst-version) or
168 string(version) != string(inst-version)">
169 <xsl:text>&#9;&#9;&#9;config&#9;CONFIG_</xsl:text>
170 <xsl:value-of select="name"/>
171 <xsl:text>
172&#9;&#9;&#9;bool&#9;"</xsl:text>
173 <xsl:value-of select="name"/>
174 <xsl:text> </xsl:text>
175 <xsl:value-of select="version"/>
176 <xsl:if test="inst-version">
177 <xsl:text> [Installed </xsl:text>
178 <xsl:value-of select="inst-version"/>
179 <xsl:text>]</xsl:text>
180 </xsl:if>
181 <xsl:text>"
182&#9;&#9;&#9;default&#9;y
183
184</xsl:text>
185 </xsl:if>
186 </xsl:template>
187
188</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.