Makefile.PL / ExtUtils::MakeMaker refuses to pick up files in /bin

K

Klaus

In my module File::Vctools http://search.cpan.org/~keichner/File-Vctools-0.06/
I have a couple of *.pl files that live in the /bin subdirectory of
the archive.

Here is the Build.PL that installs the module (using Module::Build as
the installer)

**************************************
use strict;
use warnings;
use 5.010;

use Module::Build;

unless ($^O eq 'MSWin32' or $^O eq 'linux') {
die "Error-0010: File::Vctools can only run on \$^O = 'MSWin32' or
'linux', but found \$^O = '$^O'";
}

Module::Build->new(
module_name => 'File::Vctools',
license => 'perl',
requires => {
'XML::Reader' => 0.37,
'Algorithm::Diff' => 1.19_02,
'File::Slurp' => 9999.12,
},
dist_abstract => 'Compare different versions of text files and
identify changes',
)->create_build_script;
**************************************

Everything works fine...

....except for the Makefile.PL that I want to offer for those who don't
want to (or can't)
install using Module::Build, so that they can install using
ExtUtils::MakeMaker instead.

The problem is that Makefile.PL / ExtUtils::MakeMaker refuses to pick
up the *.pl files located in /bin.

Is there an option that I can put into Makefile.PL so that the *.pl
files in /bin are
picked up by Makefile.PL ?

Anyway, here is the Makefile.PL (that does not pick up the *.pl files
in /bin)

**************************************
use 5.010;

use ExtUtils::MakeMaker;

unless ($^O eq 'MSWin32' or $^O eq 'linux') {
die "Error-0010: File::Vctools can only run on \$^O = 'MSWin32' or
'linux', but found \$^O = '$^O'";
}

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'File::Vctools',
VERSION_FROM => 'lib/File/Vctools.pm', # finds $VERSION
PREREQ_PM => {
'XML::Reader' => 0.37,
'Algorithm::Diff' => 1.19_02,
'File::Slurp' => 9999.12,
}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/File/Vctools.pm', # retrieve abstract
from module
AUTHOR => 'Klaus Eichner <[email protected]>') : ()),
);
**************************************
 
I

Ilya Zakharevich

unless ($^O eq 'MSWin32' or $^O eq 'linux') {
die "Error-0010: File::Vctools can only run on \$^O = 'MSWin32' or
'linux', but found \$^O = '$^O'";
}

Why do you think so?!

Puzzled,
Ilya
 
I

Ilya Zakharevich

The problem is that Makefile.PL / ExtUtils::MakeMaker refuses to pick
up the *.pl files located in /bin.

Is there an option that I can put into Makefile.PL so that the *.pl
files in /bin are
picked up by Makefile.PL ?

I do not know what you mean by "pick up"... Do you mean you want to
install some scripts? A lot of distributions do this; just look at
how they do this...

E.g., LWP, MP3::Tag...

Yours,
Ilya
 
K

Klaus

I do not know what you mean by "pick up"... Do you mean you want to
install some scripts?

Yes, I want to install some scripts.
A lot of distributions do this; just look at
how they do this...

E.g., LWP, MP3::Tag...

Thanks for your hints, I've found that the following line in
Makefile.PL

EXE_FILES => [ 'bin/vc_apply.pl', 'bin/vc_checkout.pl' ],

does what I want it to do.

I also found an excellent article "MakeMaker made easy" at
http://www.vromans.org/johan/articles/makemaker.html
 
K

Klaus

Why do you think so?!

Well, the package "File::Vctools" installs some *.pl scripts that in
turn, generate other *.pl scripts, these "other" *.pl scripts call
system() with slashes (on Linux) or backslashes (on Windows) as a
directory separator.

The whole package could probably be simplified, but as it stands now,
it is horribly complicated.

It is difficult to control what separator has to be used. I managed to
test successfully on Linux and on Windows, but I don't have any other
operating system available, so guessing what separator works for which
other operating system would certainly be a waste of testers time
(even if it is just an automated test / test smoker)
 
I

Ilya Zakharevich

Well, the package "File::Vctools" installs some *.pl scripts that in
turn, generate other *.pl scripts, these "other" *.pl scripts call
system() with slashes (on Linux) or backslashes (on Windows) as a
directory separator.

And system() calls WHAT? If used correctly [*], paths with slashes work
fine on Windows. As they do on hundreds of other OSes...

[*] Paths SHOULD be *quoted* (unless multi-arg system() is used)
anyway, right?

[If you KNOW that your system() uses some (broken) program which
bulks on /-paths on Windows, you can use \ on Windows, and /
otherwise. This would cover all but a handful of OSes.]
It is difficult to control what separator has to be used. I managed to
test successfully on Linux and on Windows, but I don't have any other
operating system available, so guessing what separator works for which
other operating system would certainly be a waste of testers time
(even if it is just an automated test / test smoker)

Using catdir()/catfile() is bullet-proof, but one may need to get used
to the idea that directories and files may "live in different
namespace worlds".

Yours,
Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,516
Members
44,985
Latest member
rsts

Latest Threads

Top