#!/usr/bin/perl -w # # Integration with debconf. use strict; use Debian::Debhelper::Dh_Lib; init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $config=pkgfile($package,"config"); my $templates=pkgfile($package,"templates"); if (! -d "$tmp/DEBIAN") { doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); } if ($config ne '') { doit("install", "-o", 0, "-g", 0, "-m", 755, "-p", $config, "$tmp/DEBIAN/config"); } if ($templates ne '') { # Are there translated templates too? my @trans=(glob("$templates.??"), glob("$templates.??_??")); if (@trans) { complex_doit("debconf-mergetemplate @trans $templates > $tmp/DEBIAN/templates"); chmod 0644, "$tmp/DEBIAN/templates"; chown 0, 0, "$tmp/DEBIAN/templates"; } else { doit("install", "-o", 0, "-g", 0, "-m", 644, "-p", $templates, "$tmp/DEBIAN/templates"); } } if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) { autoscript($package,"postrm","postrm-debconf"); } }