3 # Reads debian/info, installs all files listed there into /usr/share/info
4 # and puts appropriate commands into the postinst.
6 use Debian::Debhelper::Dh_Lib;
9 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
10 $TMP=tmpdir($PACKAGE);
11 $file=pkgfile($PACKAGE,"info");
16 @info=filearray($file);
19 if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
24 if ( ! -d "$TMP/usr/share/info") {
25 doit("install","-d","$TMP/usr/share/info");
27 doit("cp",@info,"$TMP/usr/share/info");
28 doit("chmod","-R", "go=rX","$TMP/usr/share/info/");
29 doit("chmod","-R", "u+rw","$TMP/usr/share/info/");
32 foreach $file (@info) {
33 # Only register with install-info if this is a head file in
34 # a tree of info files.
35 if ($file !~ /-\d+$/ && ! $dh{NOSCRIPTS}) {
36 # Figure out what section this file goes in.
38 open (IN, "<$file") || die "$file: $!";
40 if (/INFO-DIR-SECTION\s+(.*)/) {
47 my $fn="/usr/share/info/".Debian::Debhelper::Dh_Lib::basename($file);
50 $section=~s:/:\\/:g; # allow / in section.
51 autoscript($PACKAGE,"postinst","postinst-info",
52 "s/#SECTION#/$section/g;s:#FILE#:$fn:");
55 autoscript($PACKAGE,"postinst","postinst-info-nosection",
58 autoscript($PACKAGE,"prerm","prerm-info", "s:#FILE#:$fn:");