Prev: FAQ 4.52 How do I sort an array by (anything)?
Next: FAQ 5.11 How can I set up a footer format to be used with write()?
From: Klaus on 4 Aug 2010 13:07 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 <klaus03(a)gmail.com>') : ()), ); **************************************
From: Ilya Zakharevich on 4 Aug 2010 17:03 On 2010-08-04, Klaus <klaus03(a)gmail.com> wrote: > 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
From: Ilya Zakharevich on 4 Aug 2010 17:05 On 2010-08-04, Klaus <klaus03(a)gmail.com> wrote: > 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
From: Klaus on 5 Aug 2010 12:50 On 4 août, 23:05, Ilya Zakharevich <nospam-ab...(a)ilyaz.org> wrote: > On 2010-08-04, Klaus <klau...(a)gmail.com> wrote: > > > 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? 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
From: Klaus on 5 Aug 2010 12:57
On 4 août, 23:03, Ilya Zakharevich <nospam-ab...(a)ilyaz.org> wrote: > On 2010-08-04, Klaus <klau...(a)gmail.com> wrote: > > > 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?! 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) |