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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cannot create distro with Module::Build
by choroba (Cardinal) on Mar 28, 2013 at 11:44 UTC | |
by GUIfriend (Sexton) on Mar 28, 2013 at 16:46 UTC | |
|
Re: Cannot create distro with Module::Build
by Anonymous Monk on Mar 29, 2013 at 00:07 UTC |