With the recent contretemps on non-open licenses on the module-authors
mailing list, I thought I'd look at the list of licenses that
Module::Build has a shorthand for.
Except that there is no list in the documentation for Module::Build, which
is where I'd expect to find it.
After searching through a few more document pages on CPAN, I decided to
look through the source instead, and I found the relevant item in
Module::Build::Base
my %licenses =
(
perl => 'http://dev.perl.org/licenses/',
gpl => 'http://www.opensource.org/licenses/gpl-license.php',
apache => 'http://apache.org/licenses/LICENSE-2.0',
artistic => 'http://opensource.org/licenses/artistic-license.php',
lgpl => 'http://opensource.org/licenses/artistic-license.php',
bsd => 'http://www.opensource.org/licenses/bsd-license.php',
gpl => 'http://www.opensource.org/licenses/gpl-license.php',
mit => 'http://opensource.org/licenses/mit-license.php',
mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
open_source => undef,
unrestricted => undef,
restrictive => undef,
unknown => undef,
);
sub valid_licenses {
return \%licenses;
}
I resumed searching through the available documentation in the
Module::Build subclass documentation, and it wasn't until I clicked on
Module::Build::API that I found it.
Now, there are a couple of problems here. One is that I wouldn't have
expected to find the valid licenses in Module::Build::API (in fact the
module description says "Normally you won't need to deal with these
methods unless you want to subclass Module::Build.") A simple Google
search of license + "Module::Build" brings up M::B, M::B::Convert,
M::B::PM_Filter, and M::B::Authoring in the first two pages, but not
M::B::API (which finally shows up on the seventh page).
Secondly, there's the classic problem of code-to-document disconnect. The
key 'open_source' in %licenses has undef as a value, but in M::B::API,
there's a link to 'http://www.opensource.org/licenses/'.
Some off-the-top-of-my-head proposals:
1) Perhaps the license list POD documentation should be in
Module::Build::Base, since that's where the %licenses hash is.
2) If so, is there a way to automatically include the %licenses variable
in POD documentation? I note that there is a Pod-Constants distribution
that does that, but I don't know if you want another dependency in
Module::Build.
3) If neither one above is any good, is there some way to auto-generate a
LICENSES file to put in the distribution?
4) Some other solution that requires more thought than I've spared here?
Thanks,
-john