Define tokens to be replaced inside the maintainer scripts when it is generated. Please note that the limitations described in "Limitations in token names" also applies to tokens defined on the command line. Invalid token names will trigger an error.
In the simple case, this parameter will cause #TOKEN# to be replaced by VALUE. If VALUE starts with a literal @-sign, then VALUE is expected to point to a file containing the actual value to insert.
An explicit declared token with this parameter will replace built-in tokens.
Test examples to aid with the understanding:
cat >> debian/config <<EOF
#SIMPLE#
#FILEBASED#
EOF
echo -n "Complex value" > some-file
dh_installdeb --define SIMPLE=direct --define FILEBASED=@some-file
In this example, #SIMPLE# will expand to direct and #FILEBASED# will expand to Complex value.
It is also possible to set package-specific values for a given token. This is useful when dh_installdebconf is acting on multiple packages that need different values for the same token. This is done by prefixing the token name with pkg.package-name..
This can be used as in the following example:
cat >> debian/foo.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
cat >> debian/bar.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
cat >> debian/baz.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
dh_installdebconf -pfoo -pbar -pbaz --define TOKEN=default --define pkg.bar.TOKEN=unique-bar-value \
--define pkg.baz.TOKEN=unique-baz-value
In this example, #TOKEN# will expand to default in debian/foo.config, to unique-bar-value in debian/bar.config and to unique-baz-value in debian/baz.config.
Note that the #pkg.*# tokens will be visible in all scripts acted on. E.g. you can refer to #pkg.bar.TOKEN# inside debian/foo.config and it will be replaced by unique-bar-value.