diff --git a/lib/Software/License/Unlicense.pm b/lib/Software/License/Unlicense.pm new file mode 100644 index 0000000..a5334ab --- /dev/null +++ b/lib/Software/License/Unlicense.pm @@ -0,0 +1,40 @@ +use strict; +use warnings; +package Software::License::Unlicense; + +use parent 'Software::License'; +# ABSTRACT: Unlicense + +sub name { q(Unlicense) } +sub url { q(http://unlicense.org/) } +sub meta_name { 'unrestricted' } +sub spdx_expression { 'Unlicense' } + +1; +__DATA__ +__NOTICE__ +__LICENSE__ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/lib/Software/LicenseUtils.pm b/lib/Software/LicenseUtils.pm index 8744180..ef7d0fb 100644 --- a/lib/Software/LicenseUtils.pm +++ b/lib/Software/LicenseUtils.pm @@ -57,6 +57,7 @@ my @phrases = ( 'apache(?: |-)2.0' => "Apache_2_0", "Apache License(\\s)+Version 2.0" => "Apache_2_0", 'No license is granted to other entities' => 'None', + 'free and unencumbered software' => 'Unlicense', ); my %meta_keys = (); diff --git a/t/guess_license_from_pod.t b/t/guess_license_from_pod.t index ef403fc..407901e 100644 --- a/t/guess_license_from_pod.t +++ b/t/guess_license_from_pod.t @@ -95,6 +95,42 @@ LICENSE } }; +subtest 'Unlicense' => sub { + my $license = << 'LICENSE'; +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +LICENSE + + is_deeply( + [ Software::LicenseUtils->guess_license_from_pod( build_pod($license) ) ], + [ 'Software::License::Unlicense' ], + $license + ); +}; + + done_testing; sub build_pod { "=head1 LICENSE\n\n" . shift . "\n=cut\n" }