Dist::Zilla Gets More Legal

It is Legal day again here in the Dist-Pen.

So a quick look today at three section plug-ins all dealing with the LEGAL section of you pod. All three offer the same basic output as the [Legal] sections we saw in this post, buit each adds a little.

So to start lets have a look at [Legal::Complicated] the name is a little misleading as the plug-in is easy to use and by complicated it meas that the license holder is more complicated that a single author. This plug-in is best used when code is coming from an organization where ownership is shared between the organization and the writer of the code.

This plug-in works with comment tags your add to any of the PODs you want to have extra content on. There are three you can use '# AUTHOR:', '# OWNER:' and '#LICENSE:'. I don't really have a use for this plug-in in my project but here is an example of how to use it.

Simply put in the desired pod like this

# AUTHOR:  John Doe
# AUTHOR:  Mary Jane
# OWNER:   2001-2005 University of Over Here
# OWNER:   2012 Mary Jane

and in you 'weaver.ini' this

head= 2

and then you should get

=head2 AUTHORS
John Doe
Mary Jane
This software is copyright (c) 2001-2005 by University of Over Here, and 2012 by Mary Jane.
This software is available under The GNU General Public License, Version 3, June 2007.

So with this plug-in you get a little different style than strait [Legal] and you get the 'Authors' section for free as well. It does come with two attributes 'add_dist_license' which will add in the full text of the license into your POD and 'head' that you can use to change the value of the '=Head' tag from '1'

The next one I am looking at [Legal::Supplemented] is very useful for situations where you are bundling 3rd party code with your distribution or are using some sort of name-brand in your code. With this plug-in you use the two attributes 'text_before' or 'text_after' to add in the content you want. A good example is found in the source of 'Mojolicious::Plugin::BootstrapHelper' its 'weaver.ini' file takes this

header = LICENSE
text_after = Bootstrap itself is (c) Twitter. See L<their license information|http://getbootstrap.com/getting-started/#license-faqs> .
text_after =
text_after = L<Mojolicious::Plugin::BootstrapHelpers> is third party software, and is not endorsed by Twitter.
And generates this

This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Bootstrap itself is (c) Twitter. See their license information.
Mojolicious::Plugin::BootstrapHelpers is third party software, and is not endorsed by Twitter.
Just a note here that this plug-in is extends the [Legal] Plug-in so you get all the attribures of that one as well, so that is why you see the 'header' used in the example above though it is not listed in the POD of the Plug-in. As well the synopsis looks like it does not use the correct attributes, I have raised a bug for it, but I could be wrong.

Now this is not a plug-in I will use for my Database::Accessor project but I have a few in the works that might benefit from this one.

The final one tonight is [LegalWithAddendum] which extends [Legal] like the last but adds in one more attribute 'addendum' that allows you to tack on one line of text to the end of your legal section. So this in 'weaver.ini'

addendum= Bootstrap itself is (c) Twitter. See L<their license information| http://getbootstrap.com/getting-started/#license-faqs> .

Would add that extra line at the end of your standard [Legal] section.

So that is the legal sides of things all wrapped up.


Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations