5 dh_installinfo - install and register info files
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installinfo> [S<I<debhelper options>>] [B<-A>] [B<-n>] [S<I<file ...>>]
18 dh_installinfo is a debhelper program that is responsible for installing
19 info files and registering the files it installs with install-info.
21 Note that install-info determines some information about the info files by
22 parsing them, in particular, it looks at the INFO-DIR-SECTION line to
23 determine what section the info file belongs in.
25 Any filenames specified as parameters will be installed into the first
26 package dh_installinfo is told to act on. By default, this is the first
27 binary package in debian/control, but if you use -p, -i, or -a flags, it
28 will be the first package specified by those flags.
30 Files named debian/package.info can list other files to be installed.
32 dh_installinfo will automatically generate the postinst and prerm commands
33 needed to interface with install-info, updating the info dir. These
34 commands are inserted into the maintainer scripts by dh_installdeb.
35 See L<dh_installdeb(1)> for an explanation of how this works.
43 Install all files specified by command line parameters in ALL packages
46 =item B<-n>, B<--noscripts>
48 Do not modify postinst/prerm scripts.
52 Install these info files into the first package acted on. (Or in
53 all packages if -A is specified).
59 Note that this command is not idempotent. "dh_clean -k" should be called
60 between invocations of this command. Otherwise, it may cause multiple
61 instances of the same text to be added to maintainer scripts.
67 foreach my $package (@{$dh{DOPACKAGES}}) {
68 my $tmp=tmpdir($package);
69 my $file=pkgfile($package,"info");
74 @info=filearray($file, ".");
77 if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
82 if ( ! -d "$tmp/usr/share/info") {
83 doit("install","-d","$tmp/usr/share/info");
85 doit("cp",@info,"$tmp/usr/share/info");
86 doit("chmod","-R", "go=rX","$tmp/usr/share/info/");
87 doit("chmod","-R", "u+rw","$tmp/usr/share/info/");
90 foreach $file (@info) {
91 # Only register with install-info if this is a head file in
92 # a tree of info files.
93 if ($file !~ /-\d+$/ && ! $dh{NOSCRIPTS}) {
94 my $fn="/usr/share/info/".basename($file);
96 autoscript($package,"postinst","postinst-info",
98 autoscript($package,"prerm","prerm-info", "s:#FILE#:$fn:");
107 This program is a part of debhelper.
111 Joey Hess <joeyh@debian.org>