1DH_INSTALLDEB(1)                   Debhelper                  DH_INSTALLDEB(1)
2
3
4

NAME

6       dh_installdeb - install files into the DEBIAN directory
7

SYNOPSIS

9       dh_installdeb [debhelperĀ options]
10

DESCRIPTION

12       dh_installdeb is a debhelper program that is responsible for installing
13       files into the DEBIAN directories in package build directories with the
14       correct permissions.
15

FILES

17       package.postinst
18       package.preinst
19       package.postrm
20       package.prerm
21           These maintainer scripts are installed into the DEBIAN directory.
22
23           dh_installdeb will perform substitution of known tokens of the
24           pattern #TOKEN#.  In generally, scripts will want to include the
25           #DEBHELPER# to benefit from the shell scripts generated by
26           debhelper commands (including those from dh_installdeb when it
27           processes package.maintscript files).
28
29           The #DEBHELPER# token should be placed on its own line as it is
30           often replaced by a multi-line shell script.
31
32       package.triggers
33       package.shlibs
34           These control files are installed into the DEBIAN directory.
35
36           Note that package.shlibs is only installed in compat level 9 and
37           earlier.  In compat 10, please use dh_makeshlibs(1).
38
39       package.conffiles
40           This file will be installed into the DEBIAN directory. The provided
41           file will be enriched by debhelper to include all the conffiles
42           auto-detected by debhelper (the maintainer should not list there as
43           debhelper assumes it should handle that part).
44
45           This file is primarily useful for using "special" entries such as
46           the remove-on-upgrade feature from dpkg.
47
48       package.maintscript
49           Lines in this file correspond to dpkg-maintscript-helper(1)
50           commands and parameters.  However, the "maint-script-parameters"
51           should not be included as debhelper will add those automatically.
52
53           Example:
54
55               # Correct
56               rm_conffile /etc/obsolete.conf 0.2~ foo
57               # INCORRECT
58               rm_conffile /etc/obsolete.conf 0.2~ foo -- "$@"
59
60           In compat 10 or later, any shell metacharacters will be escaped, so
61           arbitrary shell code cannot be inserted here.  For example, a line
62           such as "mv_conffile /etc/oldconffile /etc/newconffile" will insert
63           maintainer script snippets into all maintainer scripts sufficient
64           to move that conffile.
65
66           It was also the intention to escape shell metacharacters in
67           previous compat levels.  However, it did not work properly and as
68           such it was possible to embed arbitrary shell code in earlier
69           compat levels.
70
71           The dh_installdeb tool will do some basic validation of some of the
72           commands listed in this file to catch common mistakes.  The
73           validation is enabled as a warning since compat 10 and as a hard
74           error in compat 12.
75
76           Where possible, dh_installdeb may choose to rewrite some or all of
77           the entries into equivalent features supported in dpkg without
78           relying on maintainer scripts at its sole discretion (examples
79           include rewriting rm_conffile into dpkg's remove-on-upgrade).  The
80           minimum requirement for activating this feature is that debhelper
81           runs in compat 10 or later.
82
83           Supports substitution variables in compat 13 and later as
84           documented in debhelper(7).
85

OPTIONS

87       -DTOKEN=VALUE, --define TOKEN=VALUE
88           Define tokens to be replaced inside the maintainer scripts when it
89           is generated.  Please note that the limitations described in
90           "Limitations in token names" also applies to tokens defined on the
91           command line.  Invalid token names will trigger an error.
92
93           In the simple case, this parameter will cause #TOKEN# to be
94           replaced by VALUE.  If VALUE starts with a literal @-sign, then
95           VALUE is expected to point to a file containing the actual value to
96           insert.
97
98           An explicit declared token with this parameter will replace built-
99           in tokens.
100
101           Test examples to aid with the understanding:
102
103                   cat >> debian/postinst <<EOF
104                   #SIMPLE#
105                   #FILEBASED#
106                   EOF
107                   echo -n "Complex value" > some-file
108               dh_installdeb --define SIMPLE=direct --define FILEBASED=@some-file
109
110           In this example, #SIMPLE# will expand to direct and #FILEBASED#
111           will expand to Complex value.
112
113           It is also possible to set package-specific values for a given
114           token.  This is useful when dh_installdeb is acting on multiple
115           packages that need different values for the same token.  This is
116           done by prefixing the token name with pkg.package-name..
117
118           This can be used as in the following example:
119
120                   cat >> debian/foo.postinst <<EOF
121                   # Script for #PACKAGE#
122                   #TOKEN#
123                   EOF
124                   cat >> debian/bar.postinst <<EOF
125                   # Script for #PACKAGE#
126                   #TOKEN#
127                   EOF
128                   cat >> debian/baz.postinst <<EOF
129                   # Script for #PACKAGE#
130                   #TOKEN#
131                   EOF
132               dh_installdeb -pfoo -pbar -pbaz  --define TOKEN=default --define pkg.bar.TOKEN=unique-bar-value \
133                 --define pkg.baz.TOKEN=unique-baz-value
134
135           In this example, #TOKEN# will expand to default in
136           debian/foo.postinst, to unique-bar-value in debian/bar.postinst and
137           to unique-baz-value in debian/baz.postinst.
138
139           Note that the #pkg.*# tokens will be visible in all scripts acted
140           on.  E.g.  you can refer to #pkg.bar.TOKEN# inside
141           debian/foo.postinst and it will be replaced by unique-bar-value.
142

SUBSTITUTION IN MAINTAINER SCRIPTS

144       The dh_installdeb will automatically replace the following tokens
145       inside a provided maintainer script (if not replaced via -D/--define):
146
147       #DEBHELPER#
148           This token is by default replaced with generated shell snippets
149           debhelper commands.  This includes the snippets generated by
150           dh_installdeb from package.maintscript file (if present).
151
152       #DEB_HOST_NAME#, #DEB_BUILD_NAME#, #DEB_TARGET_NAME#
153           These tokens are replaced with the respective variable from
154           dpkg-architecture(1).  In almost all cases, you will want use the
155           #DEB_HOST_NAME variant in a script to ensure you get the right
156           value when cross-building.
157
158           On a best effort, tokens of this pattern that do not match a
159           variable in dpkg-architecture(1) will be left as-is.
160
161       #ENV.NAME#
162           These tokens of this form will be replaced with value of the
163           corresponding environment variable.  If the environment variable is
164           unset, the token is replaced with the empty string.
165
166           Note that there are limits on which names can be used (see
167           "Limitations in token names").
168
169       #PACKAGE#
170           This token is by default replaced by the package name, which will
171           contain the concrete script.
172
173   Limitations in token names
174       All tokens intended to be substituted must match the regex:
175       #[A-Za-z0-9_.+]+#
176
177       Tokens that do not match that regex will be silently ignored if found
178       in the script template.  Invalid token names passed to -D or --define
179       will cause dh_installdeb to reject the command with an error in most
180       cases.
181

SEE ALSO

183       debhelper(7)
184
185       This program is a part of debhelper.
186

AUTHOR

188       Joey Hess <joeyh@debian.org>
189
190
191
19213.11.4                           2023-01-22                  DH_INSTALLDEB(1)
Impressum