2006-08-25 04:12:43 +02:00
|
|
|
#!/usr/bin/perl -i -p
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
$prefix=shift;
|
|
|
|
$ver=shift;
|
2006-11-20 23:12:43 +01:00
|
|
|
$libdir=shift;
|
2006-08-25 04:12:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (/INSTALLDIR_AUTOREPLACE/) {
|
|
|
|
$_=qq{my \$installdir="$prefix";};
|
|
|
|
}
|
|
|
|
elsif (/VERSION_AUTOREPLACE/) {
|
|
|
|
$_=qq{our \$version="$ver";};
|
|
|
|
}
|
|
|
|
elsif (/^use lib/) {
|
2006-11-20 23:12:43 +01:00
|
|
|
if (grep { $_ eq $libdir } @INC) {
|
|
|
|
$_="";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$_="use lib '$libdir';\n";
|
|
|
|
}
|
2006-08-25 04:12:43 +02:00
|
|
|
}
|
2008-02-24 22:01:10 +01:00
|
|
|
elsif ($. == 1 && ($ENV{NOTAINT} || ! exists $ENV{NOTAINT}) && m{^(#!/usr/bin/perl) -T$}) {
|
2007-02-20 02:09:48 +01:00
|
|
|
$_=qq{$1\n};
|
|
|
|
}
|