5 dh_installinfo - install and register info files
10 use Debian::Debhelper::Dh_Lib;
14 dh_installinfo [debhelper options] [-A] [-n] [file ...]
18 dh_installinfo is a debhelper program that is responsible for installing
19 info files and registering them with install-info.
21 Any filenames specified as parameters will be installed into the first
22 package dh_installinfo is told to act on. By default, this is the first
23 binary package in debian/control, but if you use -p, -i, or -a flags, it
24 will be the first package specified by those flags.
26 Files named debian/package.info can list other files to be installed.
28 dh_installinfo will automatically generate the postinst and prerm commands
29 needed to interface with install-info. See L<dh_installdeb(1)> for an
30 explanation of how this works.
38 Install all files specified by command line parameters in ALL packages
41 =item B<-n>, B<--noscripts>
43 Do not modify postinst/prerm scripts.
47 Install these info files into the first package acted on. (Or in
48 all packages if -A is specified).
54 Note that this command is not idempotent. "dh_clean -k" should be called
55 between invocations of this command. Otherwise, it may cause multiple
56 instances of the same text to be added to maintainer scripts.
62 foreach my $package (@{$dh{DOPACKAGES}}) {
63 my $tmp=tmpdir($package);
64 my $file=pkgfile($package,"info");
69 @info=filearray($file, ".");
72 if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
77 if ( ! -d "$tmp/usr/share/info") {
78 doit("install","-d","$tmp/usr/share/info");
80 doit("cp",@info,"$tmp/usr/share/info");
81 doit("chmod","-R", "go=rX","$tmp/usr/share/info/");
82 doit("chmod","-R", "u+rw","$tmp/usr/share/info/");
85 foreach $file (@info) {
86 # Only register with install-info if this is a head file in
87 # a tree of info files.
88 if ($file !~ /-\d+$/ && ! $dh{NOSCRIPTS}) {
89 # Figure out what section this file goes in.
91 open (IN, "<$file") || die "$file: $!";
93 if (/INFO-DIR-SECTION\s+(.*)/) {
100 my $fn="/usr/share/info/".basename($file);
102 if ($section ne '') {
103 $section=~s:/:\\/:g; # allow / in section.
104 autoscript($package,"postinst","postinst-info",
105 "s/#SECTION#/$section/g;s:#FILE#:$fn:");
108 autoscript($package,"postinst","postinst-info-nosection",
111 autoscript($package,"prerm","prerm-info", "s:#FILE#:$fn:");
120 This program is a part of debhelper.
124 Joey Hess <joeyh@debian.org>