"Geoffrey Lee" <[EMAIL PROTECTED]> writes:

> cat foo.spec | sed -e 's|/usr/bin|%{_bindir}|' > foo.spec.new ;mv -f
> foo.spec.new foo.spec

humm something like that :

#!/usr/bin/perl
my $file = shift or die "Need a file\n";
local *F;

open F, $file;

while (<F>) {
    s@(/usr|%{[_]?prefix})/bin@%{_bindir}@;
    s@(/usr|%{[_]?prefix})/man@%{_mandir}@;
    s@(/usr|%{[_]?prefix})/sbin@%{_sbindir}@;
    s@(/usr|%{[_]?prefix})/etc@%{_sysconfdir}@;
    s@(/usr|%{[_]?prefix})/lib@%{_libdir}@;
    s@(/usr|%{[_]?prefix})/include@%{_includedir}@;
    s@(/usr|%{[_]?prefix})/info@%{_infodir}@;
    print "$_\n";
}
close F;
    
thought i didn't tested it.

-- 
MandrakeSoft Inc                http://www.mandrakesoft.com
San-Francisco, CA USA                             --Chmouel

Reply via email to