Softwa...eUtils(3pm)

πŸ“¦
version 1.009 Β· 2 versions
  • 1.009 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.005 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Software::LicenseMoreUtils πŸ’–

okay bestie, gather round, because this is a 3pm page β€” that's User Contributed Perl Documentation β€” and it's about Software::LicenseMoreUtils, the module that's basically the cooler older sibling of Software::License. It's giving extra utilities + a license summary, and honestly? Obsessed.


✨ NAME ✨

Software::LicenseMoreUtils β€” more utilities and a summary for Software::License. Periodt.

πŸŽ€ VERSION πŸŽ€

version 1.009 (yes, the real number, no cap)

🧚 SYNOPSIS 🧚

 use Software::LicenseMoreUtils;

 my $lic = Software::LicenseMoreUtils->new_from_short_name({
    short_name => 'Apache-2.0', # or GPL-2+, Artistic-2 ...
    holder => 'X. Ample' # unlike Software::License, holder is optional
 });

 # On Debian, return a license summary, returns license text elsewhere
 # with ot without copyright notice, depending if holder is set.
 my $text = $lic->summary_or_text;

 # returns license full text
 my $text = $lic->text;

🌸 DESCRIPTION 🌸

So this module hands you more utilities for Software::License. Here's the whole vibe check:

  • The method new_from_short_name returns a Software::LicenseMoreUtils::LicenseWithSummary object β€” and that lil guy gives you all the functionalities</>, of Software::License::* objects plus a summary on some Linux distribution (scroll down for that tea).
  • new_from_short_name accepts more short names than Software::LicenseUtils does. Iconic behavior.
  • new_from_short_name also accepts the "or any later version" variant of GPL licenses. When you use a short name like GPL-3+, the license summary contains the "or (at your option) any later version" statement. Slay.
  • Software::License::LGPL-2 is also provided. Even though the license LGPL-2.1 is preferred over LGPL-2, some software in Debian uses LGPL-2. So we hold space for it. 🫢

πŸ“œ License summary πŸ“œ

In some distributions like Debian, all packages should come with the full text of the licenses of the package software. Yes, all of them. The whole thing. 😭

To avoid many duplications of long license text, the text of the most common licenses is provided in the /usr/share/common-licenses directory. So instead of copy-pasting a whole novel, the license text of a package only needs to provide a summary of the license that refers to the location of the common license. Chef's kiss. πŸ‘‘

All summaries are provided for Debian (so, for Ubuntu too πŸ’œ). Other distributions are welcome to send a pull request for their license summaries β€” the door is open, bestie.

πŸ› οΈ Methods πŸ› οΈ

⭐ new_from_short_name ⭐

 my $license_object = Software::LicenseMoreUtils->new_from_short_name({
      short_name => 'GPL-1', # mandatory
      holder => 'X. Ample' # optional
 }) ;

Unlike Software::License, the Holder parameter is optional. When it's set, summary_or_text in Software::LicenseMoreUtils::LicenseWithSummary returns a copyright notice together with the text of the summary of the license.

Returns a new Software::LicenseMoreUtils::LicenseWithSummary object, which is a Software::License wrapped with a summary. This is a drop-in replacement for the Software::License object, because all methods are delegated to the underlying Software::License object. No drama, no rewrites. πŸ’…

Known short license names are GPL-*, LGPL-*, and their "or later version" variants GPL-*+, LGPL-*+, Artistic and Artistic-*. And unlike vanilla Software::License, this module accepts license names with - (e.g. GPL-2) along with _ (e.g. GPL_2). Both. We contain multitudes. 🌈

SPDX v3 identifiers can also be used as short names. I.e. short names like GPL-2.0-only or LGPL-2.1-or-later are supported. iykyk ✨

If the short name is not known, this method tries to create a license object with Software::License and the specified short name (e.g. Software::License::MIT with short_name => 'MIT', or Software::License::Apache_2_0 with short_name => 'Apache-2.0'). So it'll still try its best for you. πŸ₯Ί

πŸ‘‘ AUTHOR πŸ‘‘

Dominique Dumont (the main character who wrote all this)

This software is copyright (c) 2018, 2022 by Dominique Dumont.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


πŸ’€ heads up bestie: this page is from perl v5.34.0, dated 2022-06-04. So if something's changed since then... that's between you and your CPAN mirror. πŸ™ˆ

okay bye love u, go summarize some licenses responsibly πŸ¦‹πŸ’–

πŸ“¦ where this page comes from