Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Cannot create distro with Module::Build

by GUIfriend (Acolyte)
on Mar 28, 2013 at 11:13 UTC ( #1025939=perlquestion: print w/ replies, xml ) Need Help??
GUIfriend has asked for the wisdom of the Perl Monks concerning the following question:

I work with Windows XP and Strawberry Perl Portable Edition version 5.14.2. This is my 1st attempt to learn how to use Module::Build. I use a start script and a module. Their code looks as follows:

use strict; use warnings; use feature 'say'; use Mymoddir::Mymod; our $VERSION = v0.0.1; say 'start mymain'; my $answ = Mymoddir::Mymod::mysub('hello'); say "mysub returned: $answ";

-----

use strict; use warnings; use feature 'say'; package Mymoddir::Mymod; our $VERSION = v0.0.1; sub mysub { say 'mysub got: ', shift; return 'thanks'; }

The file structure for "perl Build.PL" is

build_distrib\Mydistro\script\mymain.pl build_distrib\Mydistro\lib\Mymoddir\Mymod.pm build_distrib\Build.PL

Build.PL reads

use 5.006; use strict; use warnings; use Module::Build; my $distro = 'Mydistro'; # Name of Distribution my $builder = Module::Build->new( dist_name => "$distro", dist_version => '0.000_001', module_name => "$distro/lib/Mymoddir/Mymod", license => 'perl', dist_author => q{GUIfriend<KWittrock@cpan.org>}, dist_abstract => 'Greetings', build_requires => { 'Test::More' => 0, }, requires => { 'perl' => 5.006, }, add_to_cleanup => [ "$distro-*" ], create_makefile_pl => 'traditional', );

I took the template of Build.PL from an earlier attempt to use Module::Starter::Smart (for a more complex program). Without the "module_name" parameter I get a warning

No 'module_name' was provided and it could not be inferred from other properties. This will prevent a packlist from being written for this file. Please set either 'module_name' or 'dist_version_from' in Build.PL.

After "Build dist" MANIFEST contains

Build.PL MANIFEST This list of files Mydistro/lib/Mymoddir/Mymod.pm Mydistro/script/mymain.pl Makefile.PL META.yml META.json

and that's what the tarball contains.

For a test installation, I unpack the tarball to
%tmp%\sudo\inst_mat

and then use the commands

cd /d %tmp%\sudo\inst_mat\Mydistro-0.000_001 perl Build.PL --destdir ..\..\sudodir verbose=1 Build Build install

There is only one file in the installation

%tmp%\sudo\sudodir\strawberry5.14\perl\site\lib\auto\Mydistro\lib\Mymo +ddir\Mymod\.packlist

... and it is empty. I don't get an error message.

I do hope that someone can tell me what I'm doing wrong.

Kind regards

GUIfriend

Comment on Cannot create distro with Module::Build
Select or Download Code
Re: Cannot create distro with Module::Build
by choroba (Abbot) on Mar 28, 2013 at 11:44 UTC
    I am not sure whether this is the cause of your problems, but
    module_name => "$distro/lib/Mymoddir/Mymod",
    seems wrong to me. The name should be something like Mymoddir::Mymod, see module_name at Module::Build::API.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Thank you for your kind help. After correcting this, the path of the .packlist file has changed from ...\auto\Mydistro\lib\Mymoddir\Mymod\.packlist to ...\auto\Mymoddir\Mymod\.packlist. Unfortunately this is the only change in the result.

Re: Cannot create distro with Module::Build
by Anonymous Monk on Mar 29, 2013 at 00:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1025939]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-04-18 00:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (460 votes), past polls