# dh_installdebconf

## NAME



           dh_installdebconf - install files used by debconf in package build
           directories
    


## SYNOPSIS



           **dh_installdebconf**[_debhelper options_] [**-n**] [**--**_params_]
    


## DESCRIPTION



           **dh_installdebconf** is a debhelper program that is responsible for
           installing files used by debconf into package build directories.
    
           It also automatically generates the _postrm_ commands needed to
           interface with debconf. The commands are added to the maintainer
           scripts by **dh_installdeb**. See dh_installdeb(1) for an explanation
           of how that works.
    
           Note that if you use debconf, your package probably needs to
           depend on it (it will be added to **${misc:Depends}** by this
           program).
    
           Note that for your config script to be called by **dpkg** , your
           _postinst_ needs to source debconf's confmodule. **dh_installdebconf**
           does not install this statement into the _postinst_ automatically as
           it is too hard to do it right.
    


## FILES



           debian/_package_.config
               This is the debconf _config_ script, and is installed into the
               _DEBIAN_ directory in the package build directory.
    
               Inside the script, the token **#DEBHELPER#** is replaced with
               shell script snippets generated by other debhelper commands.
    
           debian/_package_.templates
               This is the debconf _templates_ file, and is installed into the
               _DEBIAN_ directory in the package build directory.
    
           _debian/po/_
               If this directory is present, this program will automatically
               use **po2debconf**(1) to generate merged templates files that
               include the translations from there.
    
               For this to work, your package should build-depend on
               _po-debconf_.
    


## OPTIONS



           **-n** , **--no-scripts**
               Do not modify _postrm_ script.
    
           **--**_params_
               Pass the params to **po2debconf**.
    
           **-D** _TOKEN=VALUE_ , **--define** _TOKEN=VALUE_
               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**.
    


## SUBSTITUTION IN MAINTAINER SCRIPTS



           The **dh_installdebconf** will automatically replace the following
           tokens inside a provided maintainer script (if not replaced via
           **-D** /**--define**):
    
           #DEB_HOST__NAME_ #, #DEB_BUILD__NAME_ #, #DEB_TARGET__NAME_ #
               These tokens are replaced with the respective variable from
               dpkg-architecture(1).  In almost all cases, you will want use
               the **#DEB_HOST__NAME_ **variant in a script to ensure you get the
               right value when cross-building.
    
               On a best effort, tokens of this pattern that do not match a
               variable in dpkg-architecture(1) will be left as-is.
    
           #ENV._NAME_ #
               These tokens of this form will be replaced with value of the
               corresponding environment variable.  If the environment
               variable is unset, the token is replaced with the empty
               string.
    
               Note that there are limits on which names can be used (see
               "Limitations in token names").
    
           #PACKAGE#
               This token is by default replaced by the package name, which
               will contain the concrete script.
    
       **Limitations in token names**
           All tokens intended to be substituted must match the regex:
           #[A-Za-z0-9_.+]+#
    
           Tokens that do not match that regex will be silently ignored if
           found in the script template.  Invalid token names passed to **-D** or
           **--define** will cause **dh_installdebconf** to reject the command with
           an error in most cases.
    


* * *