本文共 1347 字,大约阅读时间需要 4 分钟。
I suggest that you use Module::Build instead of ExtUtils::MakeMaker.
过程 6.2. MakeMaker
Makefile.PL
use ExtUtils::MakeMaker;WriteMakefile(NAME => 'Hello', VERSION => '1.00', EXE_FILES => ['hello']);
MANIFEST
Makefile.PLhello
hello
#!/usr/bin/env perluse strict;use warnings;print "Hello, world!\n";
$ chmod u+x hello
$ perl Makefile.PL
neo@master:~/neo/unit-test$ perl Makefile.PLChecking if your kit is complete...Looks goodWriting Makefile for Hello
$ make dist
neo@master:~/neo/unit-test$ make distrm -rf Hello-1.00\/usr/bin/perl "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'Hello-1.00', 'best');"mkdir Hello-1.00Generating META.ymlCould not add META.yml to MANIFEST: Could not open MANIFEST: No such file or directory at /usr/share/perl/5.8/ExtUtils/Manifest.pm line 565.tar cvf Hello-1.00.tar Hello-1.00Hello-1.00/Hello-1.00/helloHello-1.00/META.ymlHello-1.00/Makefile.PLrm -rf Hello-1.00gzip --best Hello-1.00.tarneo@master:~/neo/unit-test$ lshello Hello-1.00.tar.gz Makefile Makefile.PL MANIFEST
get tarball ready to install with tar zxvf Hello-1.00.tar.gz; cd Hello-1.00; perl Makefile.PL; make; make install
test
make test
TEST_FILE
make test TEST_FILE=t/hello.t
testdb
make testdb TEST_FILE=t/hello.t