Fix cut'n'past-o.
[ikiwiki.git] / pm_filter
blob5ee5a1b9890d8b2b60ae67686aa1f841a7531d01
1 #!/usr/bin/perl -i -p
3 BEGIN {
4 $prefix=shift;
5 $ver=shift;
6 $libdir=shift;
9 if (/INSTALLDIR_AUTOREPLACE/) {
10 $_=qq{my \$installdir="$prefix";};
12 elsif (/VERSION_AUTOREPLACE/) {
13 $_=qq{our \$version="$ver";};
15 elsif (/^use lib/) {
16 # The idea here is to figure out if the libdir the Makefile.PL
17 # was configure to use is in perl's normal search path.
18 # If not, hard code it into ikiwiki.
19 if ((grep { $_ eq $libdir } @INC) &&
20 (! exists $ENV{PERL5LIB} || ! length $ENV{PERL5LIB} ||
21 $ENV{PERL5LIB} ne $libdir)) {
22 $_="";
24 else {
25 $_="use lib '$libdir';\n";
28 elsif ($. == 1 && ($ENV{NOTAINT} || ! exists $ENV{NOTAINT}) && m{^(#!.*perl.*?) -T$}) {
29 $_=qq{$1\n};
31 elsif (/^\$ENV{PATH}="(.*)";/) {
32 $_="\$ENV{PATH}=\"$1:$prefix/bin\";\n";