Subject: | installation depends on $ENV{PATH} |
RHEL6.0 perl-5.10.1 which is totally separate to system perl
# perl Makefile.PL fails
enc2xs not found! at Makefile.PL line 28
# which enc2xs
which: no enc2xs in
(/opt/sbin:/opt/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin)
PATHLOOP:
for my $d (split /:/, $ENV{PATH}){
for my $f (qw/enc2xs enc2xs5.7.3/){
my $path = File::Spec->catfile($d, $f);
-x $path and $enc2xs = $path and last PATHLOOP;
}
}
$enc2xs or die "enc2xs not found!";
So I think the problem happens because it does not look
into the bin sub-directory of the perl it's being installed into.
Patch looks in the bin sub-directory of the perl this module
is being installed into.
Subject: | Encode-JIS2K-0.02.tar.gz.diff |
diff -u Encode-JIS2K-0.02.orig/Makefile.PL Encode-JIS2K-0.02/Makefile.PL
--- Encode-JIS2K-0.02.orig/Makefile.PL 2005-05-12 17:03:29.000000000 +1000
+++ Encode-JIS2K-0.02/Makefile.PL 2011-04-17 16:12:54.000000000 +1000
@@ -17,14 +17,21 @@
);
-my ($enc2xs, $encode_h) = ();
-PATHLOOP:
-for my $d (split /:/, $ENV{PATH}){
- for my $f (qw/enc2xs enc2xs5.7.3/){
- my $path = File::Spec->catfile($d, $f);
- -x $path and $enc2xs = $path and last PATHLOOP;
- }
+# from perlvar
+use Config; # first appeared in 5.00307
+my $secure_perl_path = $Config{perlpath};
+if ($^O ne 'VMS') {
+ my $secure_perl_path .= $Config{_exe}
+ unless $secure_perl_path =~ m/$Config{_exe}$/i;
}
+die "can't determine path to the perl I'm running under"
+ unless ($secure_perl_path);
+use File::Basename qw(dirname);
+my $dpath = dirname $secure_perl_path;
+my ($enc2xs, $encode_h) = ();
+my $enc2xs_fpath = File::Spec->catfile($dpath, 'enc2xs');
+$enc2xs = $enc2xs_fpath
+ if (-x $enc2xs_fpath);
$enc2xs or die "enc2xs not found!";
print "enc2xs is $enc2xs\n";
my %encode_h = ();