Software::License::OrLaterPack - Use GNU license with "or later" clause
Version v0.10.2, released on 2016-10-10 22:17 UTC.
Software-License-OrLaterPack (or just OrLaterPack for brevity) is an add-on for Software-License, a set of licenses with "or later" clause (like GPL_3::or_later). It allows Perl developers (who use Dist-Zilla) to release their work under the terms of a License version N or (at user option) any later version.
Software-License-OrLaterPack
OrLaterPack
Software-License
GPL_3::or_later
Dist-Zilla
This is OrLaterPack user manual. Read this if you want to use GNU license with "or later" clause.
If you are going to hack or extend OrLaterPack read module documentation, e. g. Software::License::GPL_3::or_later. General topics like getting source, building, installing, bug reporting and some others are covered in the README file.
All "or later" are just subclasses of corresponding base license classes. For example, Software::License::GPL_3::or_later is a subclass of Software::License::GPL_3, so any "or later" license can be used like any other license. For example, in your dist.ini file:
Software::License::GPL_3::or_later
Software::License::GPL_3
license = GPL_3::or_later
However, licenses in the pack introduce few features not found in base classes.
Software::License constructor accepts hashref as the only argument:
Software::License
$lic = Software::License::GPL_3::or_later->new( { holder => 'John Doe', year => '2010', } );
Software::License documents two keys holder and year shown in example. However, Software::License constructor just (re)blesses passed hashref to the package, keeping all the hash keys and values intact, so you can pass more arguments to the constructor.
holder
year
OrLaterPack licenses use two more keys program and Program:
program
Program
$lic = Software::License::GPL_3::or_later->new( { holder => 'John Doe', year => '2010', program => 'assa', Program => 'Assa', } );
These values are used as program name instead of generic "this program" in license notice, for example:
Assa is free software: you can redistribute it and/or modify it…
program key is used in the middle of sentence, Program is used if program name starts a sentence. You may specify either one or both keys. If only one key specified, it is used in all the occurrences regardless of its position within a sentence.
Note: At time of writing, these keys are used only by licenses from OrLaterPack. You can safely pass them to constructor of any license, it does not hurt but keys will not be used.
When using Dist::Zilla you just specify few options, and Dist::Zilla does all the work on behalf of you:
Dist::Zilla
name = Assa license = GPL_3::or_later copyright_holder = John Doe copyright_year = 2010
Program name is specified, but Dist::Zilla does not pass it to license object constructor. Patch for Dist::Zilla submitted but not yet applied. Meanwhile, you can hack it with little help from Hook plugin:
Hook
name = Assa license = GPL_3::or_later copyright_holder = John Doe copyright_year = 2010 [Hook::Init] . = $dist->license->{ program } = $dist->name; ; Voilà: license has `program` key now. ...
For accessing these keys, OrLaterPack introduced two methods: program and Program. They are convenient because you should not worry if the key was specified or not: a method returns best available variant of program name. For example, if program key was not passed to the constructor, $self->{ program } will return undef, while $self->program will return value of Program key, if it was specified, or "this program" as the last resort. However, these methods are not defined in base class and can be invoked only on a license from OrLaterPack.
$self->{ program }
undef
$self->program
Standard GNU license notice consists of 3 paragraphs (more than 100 words and 600 characters). It is ok for the program documentation, but it far too long to be printed in the beginning of interactive session. For latter purpose FSF recommends to use short notice like this one:
Copyright (C) 2010 John Doe License GPLv3+: GNU General Public License version 3 or later. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
To get short license notice, pass 'short' argument to the notice method:
'short'
notice
$lic->notice( 'short' );
At time of writing, 'short' argument is respected only by licenses in orLaterPack. Other licenses ignore the arguments and return ordinary license note.
orLaterPack
Note: This feature is considered experimental now.
Dist-Zilla is a popular tool for building CPAN distributions. Build process is controlled by dist.ini, Dist-Zilla configuration file. A distribution author can specify license covering his work by using license option in dist.ini file:
license
license = NAME
where NAME is a name of module from Software::License hierarchy.
Software-License is shipped with a set of popular licenses, from Apache_1_1 to Zlib, including GNU licenses (GPL), including their "Affero" and "Lesser" variants.
Apache_1_1
Zlib
So, if a developer wants to release his work under the terms of the GPL version 3, he should write in his dist.ini:
license = GPL_3
However, Free Software Foundation recommends using clause "license version N or (at your option) any later version". Unfortunately, Software-License distribution does not supply (out of the box) a way to express such clause.
OrLaterPack fulfills the lack. If OrLaterPack is installed, a developer can specify in his dist.ini:
In dist.ini:
dist.ini
name = Foo-Bar version = 0.001 author = John Doe <john.doe@example.com> license = GPL_3::or_later ; or another license, see the list of provided licenses copyright_holder = John Doe copyright_year = 2015 …
Direct usage:
use Software::License::GPL_3::or_later; # or another license, see the list of provided licenses my $lic = Software::License::GPL_3::or_later->new( { holder => 'John Doe', year => '2010', program => 'Assa', } ); $lic->abbr; # returns 'GPLv3+' $lic->notice; # Copyright statement and 3-paragraph GNU license notice …
CPAN::Meta::Spec hardcodes the list of "valid" licenses. In version 2.150001 of the module there are no "upgradable" GNU licenses, so in CPAN the GPLv3+ will look as ordinal GPLv3 (gpl_3), and so on.
gpl_3
Van de Bugger <van.de.bugger@gmail.com>
Copyright (C) 2015 Van de Bugger
License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
To install Software::License::OrLaterPack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Software::License::OrLaterPack
CPAN shell
perl -MCPAN -e shell install Software::License::OrLaterPack
For more information on module installation, please visit the detailed CPAN module installation guide.