Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Makefile.PL Question

by baxy77bax (Deacon)
on Sep 04, 2015 at 09:26 UTC ( [id://1140977]=note: print w/replies, xml ) Need Help??


in reply to Makefile.PL Question

I appologize for being so cryptic. It is obvoius there was not enoug information in my post. so allow my to start from he top. my Makefile.PL looks like this :
use ExtUtils::MakeMaker; WriteMakefile( NAME => 'LC::Mod', VERSION_FROM => 'src/lib/LC/Mod.pm', dist => { 'COMPRESS' => 'gzip' }, PREREQ_PM => { # Require Getopt::Long at least 2.42 "Getopt::Long" => '2.42', # Require any version of File::Slurp "File::Slurp" => 0, } );
if my source tree looks like the first case illustrated in the first figure above, when I execute :
perl Makefile.PL
make
make test
sudo make install
everything is installed properly into my
/usr/local/lib/perl/5.14.2/auto/LC/Mod/...
directory. but if i set my source tree as in the second figure instalation does not copy my *.pm files into its required folder thus when i execute my application which uses this module i get a classic
Can't locate LC/Mod.pm in @INC (@INC contains: /etc/perl /usr/local/li +b/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/ +perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_per +l .) at t/LC.pl line 26.
also if i do the smylinks i run into the same problem. What am I missing??

baxy

Replies are listed 'Best First'.
Re^2: Makefile.PL Question
by stevieb (Canon) on Sep 04, 2015 at 15:51 UTC

    Update: Darn it, I don't think this will work either, because File::Copy::Recursive is not in corelist, and I haven't found anything else in core that can copy/move directories (yet). I'd still like to know if this fixes your issue though, just to satisfy my own curiosity. End update

    I'm only assuming that these issues are related to the t/ directory not being in the right place, but I'm not sure. Instead of my earlier note about using symlink() which is not cross-platform, can you try to copy the directory? (tested on nix and win):

    use ExtUtils::MakeMaker; use File::Copy::Recursive qw(dircopy); dircopy('apps', 't'); WriteMakefile ( 'PL_FILES' => {}, 'EXE_FILES' => [], 'NAME' => 'Devel::Examine::Subs', 'INSTALLDIRS' => 'site', ...

    Does that help?

      Hi stevieb, you can move (rename) directories with File::Copy:

      #!/usr/bin/perl use strict; use warnings; use File::Copy 'mv'; mkdir( 'Project/src' ) or die $!; mv('Project/lib', 'Project/src/lib' ) or die $!; mv('Project/t', 'Project/src/apps' ) or die $!; __END__
      $ ls -lR Project total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:20 Makefile.PL drwxr-xr-x 3 nick staff 102 Sep 4 09:21 lib drwxr-xr-x 3 nick staff 102 Sep 4 09:21 t Project/lib: total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:21 Modul.pm Project/t: total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:21 test $
      $ perl 1141027.pl $
      $ ls -lR Project total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:20 Makefile.PL drwxr-xr-x 4 nick staff 136 Sep 4 09:26 src Project/src: total 0 drwxr-xr-x 3 nick staff 102 Sep 4 09:21 apps drwxr-xr-x 3 nick staff 102 Sep 4 09:21 lib Project/src/apps: total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:21 test Project/src/lib: total 0 -rw-r--r-- 1 nick staff 0 Sep 4 09:21 Modul.pm
      The way forward always starts with a minimal test.
Re^2: Makefile.PL Question ( ExtUtils::MakeMaker PMLIBDIRS sub MY::libscan )
by Anonymous Monk on Sep 05, 2015 at 08:11 UTC

    What am I missing??

    A good reason to use "src" instead of "lib"

    A good reason you're avoiding PMLIBDIRS or PM option?

    Seriously, do you have me on ignore? Allergic to manuals documented solutions?

    :P

    symlink or copying files yourself misses the point of having a toolkit like MakeMaker with conventions

    A try

    Gee, flaunting convention isn't the smartest idea, I end up with SAUCE in the module tree

    Luckily i've read PMLIBDIRS docs and I know what to do, append to Makefile.PL and I get

    convention is convention for a reason, its convenient:D

      I am so sorry.. i have no idea how a mannaged to miss your post.

      "A good reason to use "src" instead of "lib" " ,

      The reason is consistency due to general project requirenmants. so ...

      Thnx ++

Re^2: Makefile.PL Question
by Anonymous Monk on Sep 04, 2015 at 17:27 UTC

    Does the message about missing LC::Mod actually appear duirng "make test"? My guess is so because "t/LC.pl" is mentioned. But that could/should not be if you had replaced "t" with "src/apps"?.

      Ok, perl runs tests in default, implicit "t" directory. Apparently that can be changed by setting TESTS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found