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-04-28 21:37:17 +02:00
|
|
|
elsif ($. == 1 && ($ENV{NOTAINT} || ! exists $ENV{NOTAINT}) && m{^(#!.*perl.*?) -T$}) {
|
2007-02-20 02:09:48 +01:00
|
|
|
$_=qq{$1\n};
|
|
|
|
}
|
2008-04-29 04:13:12 +02:00
|
|
|
elsif (/^\$ENV{PATH}="(.*)";/) {
|
2008-04-28 19:44:37 +02:00
|
|
|
$_="\$ENV{PATH}=\"$1:$prefix/bin\";\n";
|
|
|
|
}
|