3 # Reads debian/info, installs all files listed there into /usr/share/info
4 # and puts appropriate commands into the postinst.
7 use Debian::Debhelper::Dh_Lib;
10 foreach my $package (@{$dh{DOPACKAGES}}) {
11 my $tmp=tmpdir($package);
12 my $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 !~ /-\d+$/ && ! $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/".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:");