Dist::Zilla::Plugin::DualLife - Distribute dual-life modules with Dist::Zilla
In your dist.ini:
[DualLife]
Dual-life modules, which are modules distributed both as part of the perl core and on CPAN, sometimes need a little special treatment. This module tries provide that for modules built with Dist::Zilla.
Dist::Zilla
Currently the only thing this module does is providing an INSTALLDIRS option to ExtUtils::MakeMaker's WriteMakefile function, so dual-life modules will be installed in the right section of @INC depending on different versions of perl.
INSTALLDIRS
ExtUtils::MakeMaker
WriteMakefile
@INC
As more things that need special handling for dual-life modules show up, this module will try to address them as well.
The options added to your Makefile.PL by this module are roughly equivalent to:
Makefile.PL
'INSTALLDIRS' => ($] >= 5.009005 && $] <= 5.011000 ? 'perl' : 'site'),
If the module didn't enter core in 5.009005, set the entered_core attribute appropriately:
entered_core
[DualLife] entered_core=5.006001
This module is a really gross hack
To do the things it does properly, Dist::Zilla's MakeMaker plugin would first have to be reworked a lot. If and whenever that happens, this module will be adapted accordingly and maybe stop being so horribly wrong.
MakeMaker
Only ExtUtils::MakeMaker is supported
If you decide to use an install tool other than ExtUtils::MakeMaker, this module will NOT work. However, that's only because I happen to use ExtUtils::MakeMaker only. If you prefer using Module::Build or something else instead and want to use this plugin with it, I'd be very to apply patches to make it work with those other install tools.
NOT
Module::Build
Only works with Makefile.PLs generated by Dist::Zilla::Plugin::MakeMaker
Dist::Zilla::Plugin::MakeMaker
This module rewrites the contents of an existing Makefile.PL to insert additional options. The heuristics it currently uses for that depend on the conventions currently used in Makefile.PLs generated with Dist::Zilla::Plugin::MakeMaker. If those change, this module will break. However, I'll do my best to update this plugin if that ever happens.
Hopefully we'll have a more extensible MakeMaker plugin at some point, so all these issues will go away.
Florian Ragwitz <rafl@debian.org>
This software is copyright (c) 2013 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::DualLife, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::DualLife
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::DualLife
For more information on module installation, please visit the detailed CPAN module installation guide.