Softwa...erPack(3pm)

okay bestie, pull up a chair 🫢 you just opened Softwa...erPack(3pm) β€” the User Contributed Perl Documentation page for Software::License::OrLaterPack β€” and honestly? it's a banger. no cap. let's get into it πŸ’…


✨ NAME ✨

Software::License::OrLaterPack β€” Use GNU license with "or later" clause πŸŽ€


🌸 VERSION 🌸

Version v0.10.2, released on 2016-10-10 22:17 UTC. that's the whole vibe check. ✨


πŸ’– WHAT? πŸ’–

so. Software-License-OrLaterPack (or just OrLaterPack when we're being casual, which is always) is an add-on for Software-License β€” a set of licenses with an "or later" clause, like GPL_3::or_later. it lets Perl developers (the ones who use Dist-Zilla, anyway) release their work under the terms of a License version N or β€” at user option β€” any later version. iconic behavior, truly.

this right here is the OrLaterPack user manual. read it if you wanna use a GNU license with the "or later" clause. that's literally the entire point bestie 🌸

but listen β€” if you're planning to hack or extend OrLaterPack, go read the module documentation instead, e. g. Software::License::GPL_3::or_later. and general topics like getting source, building, installing, bug reporting and some others? those live in the README file. iykyk πŸ’œ


🌈 SYNOPSIS 🌈

okay so this section is literally empty in the original πŸ’€ no synopsis, nothing, just void. the real examples are hanging out down in DESCRIPTION. we move on.


πŸ’… DESCRIPTION πŸ’…

every "or later" license is just a subclass of the corresponding base license class. 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. like, in your dist.ini file:

license = GPL_3::or_later

but ✨ plot twist ✨ β€” the licenses in the pack introduce a few features you won't find in the base classes. slay.

πŸ¦‹ Program Name πŸ¦‹

the Software::License constructor accepts a hashref as the only argument:

$lic = Software::License::GPL_3::or_later->new( {
    holder  => 'John Doe',
    year    => '2010',
} );

Software::License documents two keys β€” holder and year β€” shown in that example. BUT. here's the tea: the Software::License constructor just (re)blesses the passed hashref to the package, keeping all the hash keys and values intact, so you can pass more arguments to the constructor. 😌

OrLaterPack licenses use two more keys, program and Program:

$lic = Software::License::GPL_3::or_later->new( {
    holder  => 'John Doe',
    year    => '2010',
    program => 'assa',
    Program => 'Assa',
} );

these values get used as the program name instead of the generic "this program" in the license notice. for example:

Assa is free software: you can redistribute it and/or modify itX

the program key is used in the middle of a sentence, Program is used if the program name starts a sentence. you may specify either one or both keys. if only one key is specified, it's used in all the occurrences regardless of its position within a sentence. flexible, we love that 🫢

Note: at the time of writing, these keys are used only by licenses from OrLaterPack. you can safely pass them to the constructor of any license β€” it does not hurt β€” but the keys will not be used. πŸ’€

when you're using Dist::Zilla you just specify a few options, and Dist::Zilla does all the work on behalf of you:

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 the license object constructor. a patch for Dist::Zilla was submitted but not yet applied. meanwhile, you can hack it with a little help from the Hook plugin:

name                = Assa
license             = GPL_3::or_later
copyright_holder    = John Doe
copyright_year      = 2010
[Hook::Init]
    . = $dist->license->{ program } = $dist->name;
        ; Voila: license has `program` key now.
...

for accessing these keys, OrLaterPack introduced two methods: program and Program. they're convenient because you should not worry if the key was specified or not β€” a method returns the best available variant of the program name. for example, if the program key was not passed to the constructor, $self->{ program } will return undef, while $self->program will return the value of the Program key (if it was specified), or this program as the last resort. however!! these methods are not defined in the base class and can be invoked only on a license from OrLaterPack. noted. πŸ’…

πŸ“ Short License Notice πŸ“

the standard GNU license notice consists of 3 paragraphs (more than 100 words and 600 characters). that's fine for program documentation, but it's far too long to be printed in the beginning of an interactive session. for the latter purpose, FSF recommends using a 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 the short license notice, pass the 'short' argument to the notice method:

$lic->notice( 'short' );

at the time of writing, the 'short' argument is respected only by licenses in orLaterPack. other licenses ignore the arguments and return the ordinary license note.

Note: this feature is considered experimental now. πŸ§ͺ

πŸ”₯ WHY? πŸ”₯

Dist-Zilla is a popular tool for building CPAN distributions. the build process is controlled by dist.ini, the Dist-Zilla configuration file. a distribution author can specify the license covering his work by using the license option in the dist.ini file:

license = NAME

where NAME is a name of module from the 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.

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, the Free Software Foundation recommends using the clause "license version N or (at your option) any later version" β€” https://www.gnu.org/licenses/gpl-faq.html#VersionThreeOrLater. unfortunately, the Software-License distribution does not supply (out of the box) a way to express such a clause. 😭

OrLaterPack fulfills the lack. if OrLaterPack is installed, a developer can specify in his dist.ini:

license = GPL_3::or_later

in 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
X

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
X

πŸ‘‘ LIST OF PROVIDED LICENSES πŸ‘‘

  • Software::License::AGPL_3::or_later
  • Software::License::GPL_1::or_later
  • Software::License::GPL_2::or_later
  • Software::License::GPL_3::or_later
  • Software::License::LGPL_2_1::or_later
  • Software::License::LGPL_3_0::or_later

πŸ’€ CAVEATS πŸ’€

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. yeah. that's just how it is. πŸ™ˆ


🫢 SEE ALSO 🫢


πŸ’œ AUTHOR πŸ’œ

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.


and that's a wrap, bestie πŸ’… this whole page was rendered by perl v5.32.0 back on 2021-01-18, and it still goes by Softwa...erPack(3pm) β€” go forth and license responsibly, you gorgeous nerd πŸŽ€πŸ¦‹βœ¨