#!/usr/bin/perl
$fn=shift;
$pkg='';
$pkg=$1 if ($fn=~/([a-zA-Z0-9]+)-00/);
print "
\n$pkg - install result\n\n\n";
print STDERR "inst2html: \"$fn\"\n";
open IN, $fn;
while () {
s/[\r\n]+//g;
s/\/Builds.*\/results//g;
s/\/Builds.*\/Rlib//g;
s/\/00_pkg_src//;
s/dlopen/dlopen<\/b>/g;
s/Error(.*)/Error<\/font>$1<\/b>/g;
s/(Symbol not found:\s+)(.*)/$1<\/font>$2<\/font><\/b>/g;
s/ERROR/ERROR<\/b><\/font>/g;
s/WARNING/WARNING<\/b><\/font>/g;
s/(error):/$1<\/font>:/gi;
s/(warning):/$1<\/font>:/gi;
s/([a-zA-Z\-_\/]+\.h)([ .:]|$)/$1<\/font>$2/g;
s/([a-zA-Z\-_\/]+\.l*o)([ .:]|$)/$1<\/font>$2/g;
s/([a-zA-Z\-_\/]+\.[SsRrCcMmf]p*\d*)([ .:]|$)/$1<\/font>$2/g;
# s/(\s+)(\-[\-a-zA-Z0-9._\/=]+)(\s|$)/$1$2<\/font>$3/g;
s/(\/usr\/[a-zA-Z\-0-9._\/]+)/$1<\/font>/g;
s/(\/bin\/[a-zA-Z\-0-9._\/]+)/$1<\/font>/g;
s/(\/Developer\/[a-zA-Z\-0-9._\/]+)/$1<\/font>/g;
s/^(\*{1,2} .*)/$1<\/b>/;
s/^(gcc.*)/$1<\/tt>/;
s/(gcc|make|grep|sed|egrep|awk|g\+\+|cc|libtool)(\s+)/$1<\/b>$2/g;
print "$_
\n";
}
close IN;
print "\n