3 # Reads debian/info, installs all files listed there into /usr/share/info
4 # and puts appropriate commands into the postinst.
6 BEGIN { push @INC, "debian", "/usr/share/debhelper" }
10 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
11 $TMP=tmpdir($PACKAGE);
12 $file=pkgfile($PACKAGE,"info");
17 @info=filearray($file);
20 if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
25 if ( ! -d "$TMP/usr/share/info") {
26 doit("install","-d","$TMP/usr/share/info");
28 doit("cp",@info,"$TMP/usr/share/info");
29 doit("chmod","-R", "go=rX","$TMP/usr/share/info/");
30 doit("chmod","-R", "u+rw","$TMP/usr/share/info/");
33 foreach $file (@info) {
34 # Only register with install-info if this is a head file in
35 # a tree of info files.
36 if ($file=~/\.info$/ && ! $dh{NOSCRIPTS}) {
37 # Figure out what section this file goes in.
39 open (IN, "<$file") || die "$file: $!";
41 if (/INFO-DIR-SECTION\s+(.*)/) {
48 my $fn="/usr/share/info/".Dh_Lib::basename($file);
51 $section=~s:/:\\/:g; # allow / in section.
52 autoscript($PACKAGE,"postinst","postinst-info",
53 "s/#SECTION#/$section/g;s:#FILE#:$fn:");
56 autoscript($PACKAGE,"postinst","postinst-info-nosection",
59 autoscript($PACKAGE,"prerm","prerm-info", "s:#FILE#:$fn:");