5 dh_installdeb - install files into the DEBIAN directory
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installdeb> [S<I<debhelper options>>]
18 dh_installdeb is a debhelper program that is responsible for installing
19 files into the DEBIAN directories in package build directories with the
22 dh_installdeb automatically installs the following files from debian/ into
32 The postinst, preinst, postrm, and prerm are handled specially: If a
33 corresponding file named debian/package.script.debhelper exists, the contents
34 of that file are merged into the script as follows: If the script exists,
35 then anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper
36 file is inserted. If the script does not exist, then a script is generated
37 from the .debhelper file. The .debhelper files are created by other debhelper
38 programs, such as L<dh_installmenu(1)>, and are shell script fragments.
40 In V3 compatibility mode and higher, all files in the etc/ directory in a
41 package will automatically be flagged as conffiles by this program, so
42 there is no need to list them manually in package.conffiles.
48 foreach my $package (@{$dh{DOPACKAGES}}) {
49 my $tmp=tmpdir($package);
51 if (! -d "$tmp/DEBIAN") {
52 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
55 if (is_udeb($package)) {
56 # For udebs, only do the postinst, and no #DEBHELPER#.
57 # Udebs also support menutest and isinstallable scripts.
58 foreach my $script (qw{postinst menutest isinstallable}) {
59 my $f=pkgfile($package,$script);
61 doit("install", "-o", 0, "-g", 0, "-m", 755,
62 $f, "$tmp/DEBIAN/$script");
68 # Install debian scripts.
69 foreach my $script (qw{postinst preinst prerm postrm}) {
70 debhelper_script_subst($package, $script);
73 if (! is_udeb($package)) {
74 # Install non-executable files
75 foreach my $file (qw{shlibs conffiles triggers}) {
76 my $f=pkgfile($package,$file);
78 doit("install","-o",0,"-g",0,"-m",644,"-p",$f,"$tmp/DEBIAN/$file");
83 # Automatic conffiles registration: If it is in /etc, it is a
85 if (! compat(2) && -d "$tmp/etc" && ! is_udeb($package)) {
86 complex_doit("find $tmp/etc -type f -printf '/etc/%P\n' >> $tmp/DEBIAN/conffiles");
88 if (-z "$tmp/DEBIAN/conffiles") {
89 doit("rm", "-f", "$tmp/DEBIAN/conffiles");
92 doit("chmod", 644, "$tmp/DEBIAN/conffiles");
101 This program is a part of debhelper.
105 Joey Hess <joeyh@debian.org>