--- loncom/build/make_rpm.pl 2000/12/11 19:03:01 1.3 +++ loncom/build/make_rpm.pl 2001/05/16 19:30:05 1.11 @@ -4,9 +4,6 @@ # Automatically generate RPM listing files # from file listing. -# GNU General Public License, Version 2, June 1991 -# See http://www.gnu.org/copyleft/gpl.html. - # This script does actually "build" the RPM. # This script also generates and then deletes temporary @@ -71,7 +68,7 @@ open (RPMRC,">$tag/SPECS/rpmrc"); foreach $line (@lines) { if ($line=~/^macrofiles/) { chop $line; - $line.=":./rpmmacros\n"; + $line.=":$currentdir/SPECS/rpmmacros\n"; } print RPMRC $line; } @@ -87,6 +84,165 @@ print RPMMACROS <$tag/SPECS/LON-CAPA-$tag-$version.spec"); print SPEC <) { chop $file; + my $comment=""; + if ($file=~/\s+\#(.*)$/) { + $file=~s/\s+\#(.*)$//; + $comment=$1; + } + my $config=""; + if ($comment=~/config/i) { + $config="\%config "; + } if (($type,$size,$octalmode,$user,$group)=find_info($file)) { $octalmode="0" . $octalmode if length($octalmode)<4; if ($pathprefix) { @@ -152,7 +318,7 @@ foreach $file (<>) { if ($type eq "files") { push @{$BinaryRootMakefile{$type}},"\tinstall -D -m $octalmode $pathprefix$file $binaryroot$file\n"; push @{$Makefile{$type}},"\tinstall -D -m $octalmode \$(SOURCE)$file \$(ROOT)$file\n"; - push @{$dotspecfile{$type}},"\%attr($octalmode,$user,$group) $file\n"; + push @{$dotspecfile{$type}},"$config\%attr($octalmode,$user,$group) $file\n"; } elsif ($type eq "directories") { push @{$BinaryRootMakefile{$type}},"\tinstall -m $octalmode -d $binaryroot$file\n"; @@ -207,7 +373,7 @@ sub find_info { return ("directories",split(/\t/,$line)); } elsif (($line=`find $file -type l -prune`)=~/^$file\n/) { - $line=`find $file -type l -prune -printf "\%h/\%l\t\%m\t\%u\t\%g"`; + $line=`find $file -type l -prune -printf "\%l\t\%m\t\%u\t\%g"`; return ("links",split(/\t/,$line)); }