Changeset 132 for trunk


Ignore:
Timestamp:
09/28/07 14:39:47 (17 years ago)
Author:
kdeugau
Message:

/trunk

Fiddle manpages into the correct format from whatever the upstream
install does.

RPM does info pages and several other bits; while this should be
simple to hack into supporting info pages I'm not so sure about
the other bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r131 r132  
    10051005  # and clean up
    10061006  unlink $installscriptfile;
     1007
     1008  # final bit: compress manpages if present
     1009  # done here cuz I don't grok shell well
     1010  # should probably error-check all kinds of things.  <g>
     1011  if (opendir MANROOT, "$buildroot/usr/share/man") {
     1012    my @mansects = readdir MANROOT;
     1013    closedir MANROOT;
     1014    foreach my $mandir (@mansects) {
     1015      next if $mandir !~ /^man/;
     1016      opendir MANPAGES, "$buildroot/usr/share/man/$mandir";
     1017      my @pagelist = readdir MANPAGES;
     1018      closedir MANPAGES;                        # Slightly safer to to this;  no accidental recursion.  O_o
     1019      foreach my $manpage (@pagelist) {
     1020        $manpage = "$buildroot/usr/share/man/$mandir/$manpage";
     1021        if ( -f $manpage) {
     1022          if ($manpage =~ /^(.+)\.(?:Z|gz|bz2)\n?$/) {
     1023            my $newpage = $1;
     1024            `gunzip $manpage` if $manpage =~ /\.(?:Z|gz)$/;
     1025            `bunzip2 $manpage` if $manpage =~ /\.bz2$/;
     1026            $manpage = $newpage;
     1027          }
     1028          `gzip -9 -n $manpage`;
     1029        } elsif ( -l $manpage) {
     1030          my $linkdest = readlink $manpage;
     1031          $linkdest =~ s/\.(?:Z|gz|bz2)//;
     1032          unlink $manpage;
     1033          $manpage =~ s/\.(?:Z|gz|bz2)//;
     1034          symlink "$linkdest.gz", "$manpage.gz" or print "DEBUG: wibble: symlinking manpage failed: $!\n";
     1035        }
     1036      }
     1037    }
     1038  } # if opendir MANROOT
    10071039} # end install()
    10081040
Note: See TracChangeset for help on using the changeset viewer.