]> git.donarmstrong.com Git - debhelper.git/blob - dh_installdebconf
r351: * dh_installdebconf: Automatically merge localized template
[debhelper.git] / dh_installdebconf
1 #!/usr/bin/perl -w
2 #
3 # Integration with debconf.
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
9         $TMP=tmpdir($PACKAGE);
10         $config=pkgfile($PACKAGE,"config");
11         $templates=pkgfile($PACKAGE,"templates");
12
13         if (! -d "$TMP/DEBIAN") {
14                 doit("install","-o","root","-g","root","-d","$TMP/DEBIAN");
15         }
16
17         if ($config ne '') {
18                 doit("install", "-o", "root", "-g", "root", "-m", 755, "-p",
19                      $config, "$TMP/DEBIAN/config");
20         }
21         
22         if ($templates ne '') {
23                 # Are there translated templates too?
24                 my @trans=glob("$templates.??");
25                 if (@trans) {
26                         complex_doit("debconf-mergetemplate @trans $templates > $TMP/DEBIAN/templates");
27                         chmod 0644, "$TMP/DEBIAN/templates";
28                         chown 0, 0, "$TMP/DEBIAN/templates";
29                 }
30                 else {
31                         doit("install", "-o", "root", "-g", "root", "-m", 644, "-p",
32                              $templates, "$TMP/DEBIAN/templates");
33                 }
34         }
35
36         if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) {
37                 autoscript($PACKAGE,"postrm","postrm-debconf");
38         }
39 }