1DH_INSTALLDEBCONF(1) Debhelper DH_INSTALLDEBCONF(1)
2
3
4
6 dh_installdebconf - install files used by debconf in package build
7 directories
8
10 dh_installdebconf [debhelper options] [-n] [-- params]
11
13 dh_installdebconf is a debhelper program that is responsible for
14 installing files used by debconf into package build directories.
15
16 It also automatically generates the postrm commands needed to interface
17 with debconf. The commands are added to the maintainer scripts by
18 dh_installdeb. See dh_installdeb(1) for an explanation of how that
19 works.
20
21 Note that if you use debconf, your package probably needs to depend on
22 it (it will be added to ${misc:Depends} by this program).
23
24 Note that for your config script to be called by dpkg, your postinst
25 needs to source debconf's confmodule. dh_installdebconf does not
26 install this statement into the postinst automatically as it is too
27 hard to do it right.
28
30 debian/package.config
31 This is the debconf config script, and is installed into the DEBIAN
32 directory in the package build directory.
33
34 Inside the script, the token #DEBHELPER# is replaced with shell
35 script snippets generated by other debhelper commands.
36
37 debian/package.templates
38 This is the debconf templates file, and is installed into the
39 DEBIAN directory in the package build directory.
40
41 debian/po/
42 If this directory is present, this program will automatically use
43 po2debconf(1) to generate merged templates files that include the
44 translations from there.
45
46 For this to work, your package should build-depend on po-debconf.
47
49 -n, --no-scripts
50 Do not modify postrm script.
51
52 -- params
53 Pass the params to po2debconf.
54
55 -DTOKEN=VALUE, --define TOKEN=VALUE
56 Define tokens to be replaced inside the maintainer scripts when it
57 is generated. Please note that the limitations described in
58 "Limitations in token names" also applies to tokens defined on the
59 command line. Invalid token names will trigger an error.
60
61 In the simple case, this parameter will cause #TOKEN# to be
62 replaced by VALUE. If VALUE starts with a literal @-sign, then
63 VALUE is expected to point to a file containing the actual value to
64 insert.
65
66 An explicit declared token with this parameter will replace built-
67 in tokens.
68
69 Test examples to aid with the understanding:
70
71 cat >> debian/config <<EOF
72 #SIMPLE#
73 #FILEBASED#
74 EOF
75 echo -n "Complex value" > some-file
76 dh_installdeb --define SIMPLE=direct --define FILEBASED=@some-file
77
78 In this example, #SIMPLE# will expand to direct and #FILEBASED#
79 will expand to Complex value.
80
81 It is also possible to set package-specific values for a given
82 token. This is useful when dh_installdebconf is acting on multiple
83 packages that need different values for the same token. This is
84 done by prefixing the token name with pkg.package-name..
85
86 This can be used as in the following example:
87
88 cat >> debian/foo.config <<EOF
89 # Script for #PACKAGE#
90 #TOKEN#
91 EOF
92 cat >> debian/bar.config <<EOF
93 # Script for #PACKAGE#
94 #TOKEN#
95 EOF
96 cat >> debian/baz.config <<EOF
97 # Script for #PACKAGE#
98 #TOKEN#
99 EOF
100 dh_installdebconf -pfoo -pbar -pbaz --define TOKEN=default --define pkg.bar.TOKEN=unique-bar-value \
101 --define pkg.baz.TOKEN=unique-baz-value
102
103 In this example, #TOKEN# will expand to default in
104 debian/foo.config, to unique-bar-value in debian/bar.config and to
105 unique-baz-value in debian/baz.config.
106
107 Note that the #pkg.*# tokens will be visible in all scripts acted
108 on. E.g. you can refer to #pkg.bar.TOKEN# inside
109 debian/foo.config and it will be replaced by unique-bar-value.
110
112 The dh_installdebconf will automatically replace the following tokens
113 inside a provided maintainer script (if not replaced via -D/--define):
114
115 #DEB_HOST_NAME#, #DEB_BUILD_NAME#, #DEB_TARGET_NAME#
116 These tokens are replaced with the respective variable from
117 dpkg-architecture(1). In almost all cases, you will want use the
118 #DEB_HOST_NAME variant in a script to ensure you get the right
119 value when cross-building.
120
121 On a best effort, tokens of this pattern that do not match a
122 variable in dpkg-architecture(1) will be left as-is.
123
124 #ENV.NAME#
125 These tokens of this form will be replaced with value of the
126 corresponding environment variable. If the environment variable is
127 unset, the token is replaced with the empty string.
128
129 Note that there are limits on which names can be used (see
130 "Limitations in token names").
131
132 #PACKAGE#
133 This token is by default replaced by the package name, which will
134 contain the concrete script.
135
136 Limitations in token names
137 All tokens intended to be substituted must match the regex:
138 #[A-Za-z0-9_.+]+#
139
140 Tokens that do not match that regex will be silently ignored if found
141 in the script template. Invalid token names passed to -D or --define
142 will cause dh_installdebconf to reject the command with an error in
143 most cases.
144
146 debhelper(7)
147
148 This program is a part of debhelper.
149
151 Joey Hess <joeyh@debian.org>
152
153
154
15513.11.4 2023-01-22 DH_INSTALLDEBCONF(1)