NAME
Dist::Zilla::Plugin::CustomLicense - setting legal stuff of Dist::Zilla while keeping control
VERSION
version 1.0.2
DESCRIPTION
This plugin allows using Software::License::Custom to get software licensing information from a custom file. In other terms, you can specify Custom
in the license configuration inside dist.ini:
name = Foo-Bar
abstract = basic Bar for Foo
author = A.U. Thor <author@example.com>
license = Custom
copyright_holder = A.U.Thor
By default the custom file is LEGAL in the main directory, but it can be configured with the filename
option in the dist.ini configuration file:
[CustomLicense]
filename = MY-LEGAL-ASPECTS
Unfortunately, as of the handover of Software::License::Custom module it seems that its documentation disappeared; see below for details about how file LEGAL should be written. Most probably you will not want to include this file in the final distro, so you should prune it out like this:
[PruneFiles]
filename = LEGAL
Of course you have to put any name you decided to call your file with!
WRITING THE LICENSE FILE
The default license file is LEGAL in the main directory. Setting it properly, you should be able to customise some aspects of the licensing messages that would otherwise be difficult to tinker, e.g. adding a note in the notice, setting multiple years for the copyright notice or set multiple authors and/or copyright holders. See the "COPYRIGHT AND LICENSE" section below for an example of this.
The license file contains different sections. Each section has the following format:
header line
a line that begins and ends with two underscores
__
. The string between the begin and the end of the line is first depured of any non-word character, then used as the name of the section;body
a Text::Template (possibly a plain text file) where items to be expanded are enclosed between double braces.
Each section is terminated by the header of the following section or by the end of the file. Example:
__[ NAME ]__
The Foo-Bar License
__URL__
http://www.example.com/foo-bar.txt
__[ META_NAME ]__
foo_bar_meta
__{ META2_NAME }__
foo_bar_meta2
__[ NOTICE ]__
Copyright (C) 2000-2002 by P.R. Evious
Copyright (C) {{$self->year}} by {{$self->holder}}.
This is free software, licensed under {{$self->name}}.
__[ LICENSE ]__
The Foo-Bar License
Well... this is only some sample text. I'm true... only sample text!!!
Yes, spanning more lines and more paragraphs.
The different formats for specifying the section name in the example above are only examples, you're invited to use a consistent approach.
The sections that you should include are the following:
- NAME
-
The name of the license, suitable for shoving in the middle of a sentence, generally with a leading capitalized "The".
- URL
-
The URL at which a canonical text of the license can be found, if one is available. If possible, this will point at plain text, but it may point to an HTML resource.
- META_NAME
-
The string that should be used for this license in the CPAN META.yml file, according to the CPAN Meta spec v1. Leave out if there is no known string to use.
- META2_NAME
-
The string that should be used for this license in the CPAN META.json or META.yml file, according to the CPAN Meta spec v2. Leave out if there is no known string to use; in this case, see Software::License to understand what will be used.
- NOTICE
-
A snippet of text, usually a few lines, indicating the copyright holder and year of copyright, as well as an indication of the license under which the software is distributed.
- LICENSE
-
The full text of the license, including customisation of any part of it (e.g. a translation of some sections).
The explanations in the list above has been munged from the documentation of Software::License
.
AUTHOR
Flavio Poletti <polettix@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2010, 2011 by Flavio Poletti <polettix@cpan.org>.
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.