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