#!/afs/athena/contrib/perl5/perl -w

#$TOPDIR = "/mit/linux/packages/RedHat";
$TOPDIR = "/tmp";

$SPECDIR = "$TOPDIR/SPECS";

for $file (@ARGV) {
    open( S, "> $SPECDIR/$file.spec" ) || die "open: $!\n";
    print "Parsing $file...\n";

    print S <<EOH;
Description: $file
Name: $file
Version: 1.0
Release: 1
Copyright: MIT
Distribution: MIT SIPB Linux-Athena
Vendor: The MIT Student Information Processing Board
Group: Athena/$file
Root: /afs/sipb.mit.edu/system/i386_linux2/srvd.77.2

%files
EOH
    
    open( L, "$file" ) || die "open: $!\n";
    while ( <L> ) {
	next if m/^$/;
	print S "/$_";
    }

    close S;
    close L;
}
    
