[licensecheck] 10/26: Improve license patterns cube eurosym libpng zlib zlib_acknowledgement. Reorganize Regexp::Pattern::License::Pattern.

Jonas Smedegaard dr at jones.dk
Sun Feb 5 10:12:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository licensecheck.

commit 5144bc16239a7e6646c7a5ede3747248aa69a606
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Tue Nov 29 04:22:13 2016 +0100

    Improve license patterns cube eurosym libpng zlib zlib_acknowledgement. Reorganize Regexp::Pattern::License::Pattern.
---
 lib/App/Licensecheck.pm             |  32 +--
 lib/Regexp/Pattern/License.pm       |  67 +++---
 lib/Regexp/Pattern/License/Parts.pm | 398 +++++++++++++-----------------------
 t/SPDX.t                            |   1 +
 4 files changed, 185 insertions(+), 313 deletions(-)

diff --git a/lib/App/Licensecheck.pm b/lib/App/Licensecheck.pm
index b31b2b5..f7afbfb 100755
--- a/lib/App/Licensecheck.pm
+++ b/lib/App/Licensecheck.pm
@@ -785,28 +785,6 @@ sub parse_license
 			$gen_license->( 'BSL', $1, $2 );
 		}
 	}
-
-	# Zlib/Libpng
-	given ($licensetext) {
-		when ( /$L{re}{'zlib_acknowledgement'}/ ) {
-			$gen_license->('zlib_acknowledgement');
-		}
-		when ( /$L{re}{cube}/ ) {
-			$gen_license->('cube');
-		}
-		when ( /$L{re}{eurosym}/ ) {
-			$gen_license->('eurosym');
-		}
-		when ( /$L{re}{zlib}/ ) {
-			$gen_license->('zlib');
-		}
-		when ( /see copyright notice in zlib\.h/ ) {
-			$gen_license->('zlib');
-		}
-		when ( /This code is released under $L{re}{libpng}/ ) {
-			$gen_license->('libpng');
-		}
-	}
 	#>>>
 
 	given ($licensetext) {
@@ -829,13 +807,19 @@ sub parse_license
 		foreach my $id (
 			qw(
 			adobe_2006 adobe_glyph aladdin apafml
-			beerware curl fsfap ftl icu isc llgpl
+			beerware cube curl eurosym fsfap ftl icu isc libpng llgpl
 			mit_advertising mit_enna mit_feh mit_new mit_old
 			mit_oldstyle mit_oldstyle_disclaimer mit_oldstyle_permission
-			ms_pl ms_rl postgresql unicode_strict unicode_tou)
+			ms_pl ms_rl postgresql unicode_strict unicode_tou
+			zlib zlib_acknowledgement)
 			)
 		{
 			when (/$L{re}{$id}/) {
+
+				# skip embedded license
+				if ( 'zlib' eq $id and $licensetext =~ /$L{re}{cube}/ ) {
+					continue;
+				}
 				$gen_license->($id);
 				continue;
 			}
diff --git a/lib/Regexp/Pattern/License.pm b/lib/Regexp/Pattern/License.pm
index bb5ee21..6c4f1ef 100644
--- a/lib/Regexp/Pattern/License.pm
+++ b/lib/Regexp/Pattern/License.pm
@@ -248,7 +248,7 @@ our %RE = (
 		caption               => 'BSD (2 clause)',
 		tags                  => ['bsd'],
 		pat =>
-			qr/$P{note_repro_notice_cond_discl}\b[^a-zA-Z]+$P{asis_sw_by_name}/,
+			qr/$P{repro_copr_cond_discl}\W+$P{asis_sw_by_name}/,
 	},
 	bsd_3_clause => {
 		name                  => 'BSD-3-Clause',
@@ -256,14 +256,14 @@ our %RE = (
 		caption               => 'BSD (3 clause)',
 		tags                  => ['bsd'],
 		pat =>
-			qr/$P{note_repro_notice_cond_discl}\b[^a-zA-Z]+$P{nopromo_neither}/,
+			qr/$P{repro_copr_cond_discl}\W+$P{nopromo_neither}/,
 	},
 	bsd_4_clause => {
 		name                  => 'BSD-4-Clause',
 		'name.alt.org.debian' => 'BSD-4-clause',
 		caption               => 'BSD (4 clause)',
 		tags                  => ['bsd'],
-		pat                   => qr/$P{ad_verbatim}/,
+		pat                   => qr/$P{ad_mat_ack_this}/,
 	},
 	cc_by => {
 		name    => 'CC-BY',
@@ -383,11 +383,11 @@ our %RE = (
 		name => 'Cube',
 		tags => ['zlib'],
 		pat =>
-			qr/$P{origin_no_misrepresent}.*?$P{derive_altermark}.*?$P{note_invar}.*?$P{derive_no_relicense}/,
+			qr/$P{origin_sw_no_misrepresent}; $P{you_not_claim_wrote}\. $P{use_ack_nonreq}\. $P{altered_srcver_mark}\. $P{notice_no_alter_any}\. additional clause specific to Cube:? $P{src_no_relicense}/,
 	},
 	curl => {
 		tags => ['mit'],
-		pat  => qr/$P{note_cpyr_perm}\.\s+$P{asis_sw_warranty}/,
+		pat  => qr/$P{note_copr_perm}\.\s+$P{asis_sw_warranty}/,
 	},
 	dsdp => {
 		name                     => 'DSDP',
@@ -404,7 +404,7 @@ our %RE = (
 		name => 'Eurosym',
 		tags => ['zlib'],
 		pat =>
-			qr/$P{origin_no_misrepresent}.*?$P{derive_altermark}.*?$P{derive_share}.*?$P{note_invar}/,
+			qr/$P{origin_sw_no_misrepresent}.*?$P{altered_srcver_mark}.*?$P{change_redist_share}.*?$P{notice_no_alter}/,
 	},
 	fsfap => {
 		name    => 'FSFAP',
@@ -450,13 +450,13 @@ our %RE = (
 	isc => {
 		name => 'ISC',
 		tags => ['mit'],
-		pat  => qr/$P{note_cpyr_perm}\.\s+$P{asis_sw_name_discl}/,
+		pat  => qr/$P{note_copr_perm}\.\s+$P{asis_sw_name_discl}/,
 	},
 	icu => {
 		name => 'ICU',
 		tags => ['mit'],
 		pat =>
-			qr/$P{note_cpyr_perm} of the Software and that $P{note_cpyr_perm_doc}\.\s+$P{asis_sw_warranty}(?:[^.]+\.\s+){2}$P{nopromo_except}/,
+			qr/$P{note_copr_perm} of the Software and that $P{note_copr_perm_doc}\.\s+$P{asis_sw_warranty}(?:[^.]+\.\s+){2}$P{nopromo_except}/,
 	},
 	lgpl => {
 		name    => 'LGPL',
@@ -471,25 +471,26 @@ our %RE = (
 	},
 	libpng => {
 		name => 'Libpng',
-		pat  => qr/$the?libpng license/,
+		pat =>
+			qr/$P{origin_src_no_misrepresent}\. $P{altered_ver_mark}\. $P{copr_no_alter}/,
 	},
 	mit_advertising => {
 		name    => 'MIT-advertising',
 		caption => 'MIT (advertising)',
 		tags    => ['mit'],
-		pat     => qr/$P{note_marketing}\b[^.,]+, and $P{ad_ack_doc_sw}/,
+		pat => qr/$P{note_marketing}\b[^.,]+, and $P{ack_doc_mat_pkg_use}/,
 	},
 	mit_enna => {
 		name    => 'MIT-enna',
 		caption => 'MIT (enna)',
 		tags    => ['mit'],
-		pat     => qr/$P{ad_pub_ack_nosrc}/,
+		pat     => qr/$P{ack_pub_use_nosrc}/,
 	},
 	mit_feh => {
 		name    => 'MIT-feh',
 		caption => 'MIT (feh)',
 		tags    => ['mit'],
-		pat     => qr/$P{ad_ack_doc_pkg}/,
+		pat     => qr/$P{ack_doc_pkg_use}/,
 	},
 	mit_new => {
 		'name.alt.org.spdx'      => 'MIT',
@@ -498,21 +499,22 @@ our %RE = (
 		'caption.alt.org.debian' => 'MIT/X11 (BSD like)',
 		'caption.alt.org.fedora' => 'MIT (Modern Style with sublicense)',
 		tags                     => ['mit'],
-		pat => qr/$P{right_mod_sublic}\b[^.]+\s+$P{note_cpyr_perm_subst}/,
+		pat =>
+			qr/$P{to_mod_sublic} $P{sw}\b[^.]+\s+$P{retain_copr_perm_subst}/,
 	},
 	mit_new_materials => {
 		'name.alt.org.debian' => 'MIT~Khronos',
 		caption               => 'MIT (Khronos)',
 		tags                  => ['mit'],
 		pat =>
-			qr/$P{permission_person_materials}, $P{permission_use_deal_materials}/,
+			qr/$P{perm_granted}, $P{free_charge}, $P{to_pers} $P{the_material}, $P{to_deal_mat}/,
 	},
 	mit_old => {
 		'name.alt.org.debian' => 'MIT~old',
 		'name.alt.org.gentoo' => 'Old-MIT',
 		caption               => 'MIT (old)',
 		tags                  => ['mit'],
-		pat                   => qr/$P{permission_granted_agree_fee}/,
+		pat                   => qr/$P{perm_granted}, $P{free_agree_fee}/,
 	},
 	mit_oldstyle => {
 		'name.alt.org.debian' => 'MIT~oldstyle',
@@ -532,7 +534,7 @@ END
 	mit_oldstyle_permission => {
 		'name.alt.org.debian' => 'MIT~oldstyle~permission',
 		tags                  => ['mit'],
-		pat => qr/$P{nopromo_written_prior}\.\s+$P{asis_name_sw}/,
+		pat => qr/$P{without_written_prior}\.\s+$P{asis_name_sw}/,
 	},
 	mpl => {
 		name    => 'MPL',
@@ -566,7 +568,7 @@ END
 	openssl => {
 		name    => 'OpenSSL',
 		summary => 'OpenSSL License',
-		pat     => qr/$P{ad_always}/,
+		pat     => qr/$P{redist_ack_this}/,
 	},
 	postgresql => {
 		name => 'PostgreSQL',
@@ -630,13 +632,14 @@ END
 		caption => 'zlib/libpng',
 		tags    => ['zlib'],
 		pat =>
-			qr/$P{origin_no_misrepresent}.*?$P{derive_altermark}.*?$P{note_invar}/,
+			qr/$P{origin_sw_no_misrepresent}; $P{you_not_claim_wrote}\. $P{use_ack_nonreq}\. $P{altered_srcver_mark}\. $P{notice_no_alter}/,
 	},
 	zlib_acknowledgement => {
-		name    => 'zlib-acknowledgement',
-		caption => 'zlib/libpng with Acknowledgement',
-		tags    => ['zlib'],
-		pat     => qr/$P{origin_no_misrepresent_ack}/,
+		name                => 'NUnit',
+		'name.alt.org.SPDF' => 'zlib-acknowledgement',
+		tags                => ['zlib'],
+		pat =>
+			qr/$P{origin_sw_no_misrepresent}; $P{you_not_claim_wrote}\. $P{use_ack_req}\. Portions Copyright \S+ [\d-]+ Charlie Poole or Copyright \S+ [\d-]+ James W\. Newkirk, Michael C\. Two, Alexei A\. Vorontsov or Copyright \S+ [\d-]+ Philip A\. Craig $P{altered_srcver_mark}\. $P{notice_no_alter}/,
 	},
 );
 
@@ -677,25 +680,25 @@ Patterns each covering a single trait occuring in licenses.
 $RE{'clause_retention'} = {
 	caption => 'retention clause',
 	tags    => ['trait'],
-	pat     => qr/$P{note_retain_notice_cond_discl}/,
+	pat     => qr/$P{retain_notice_cond_discl}/,
 };
 
 $RE{'clause_reproduction'} = {
 	caption => 'reproduction clause',
 	tags    => ['trait'],
-	pat     => qr/$P{note_repro_notice_cond_discl}/,
+	pat     => qr/$P{repro_copr_cond_discl}/,
 };
 
 $RE{'clause_advertising'} = {
 	caption => 'advertising clause',
 	tags    => ['trait'],
-	pat     => qr/$P{ad_verbatim}/,
+	pat     => qr/$P{ad_mat_ack_this}/,
 };
 
 $RE{'clause_advertising_always'} = {
 	caption => 'advertising clause (always)',
 	tags    => ['trait'],
-	pat     => qr/$P{ad_always}/,
+	pat     => qr/$P{redist_ack_this}/,
 };
 
 $RE{'clause_non_endorsement'} = {
@@ -717,31 +720,31 @@ $RE{'fsf_unlimited_retention'} = {
 $RE{'version_later'} = {
 	caption => 'version "or later"',
 	tags    => ['trait'],
-	pat     => qr/,? $P{version_later_postfix}|\. $P{version_later_para}/,
+	pat     => qr/,? $P{ver_later_postfix}|\. $P{ver_later_para}/,
 };
 
 $RE{'version_later_paragraph'} = {
 	caption => 'version "or later" postfix (paragraphs)',
 	tags    => ['trait'],
-	pat     => qr/$P{version_later_para}/,
+	pat     => qr/$P{ver_later_para}/,
 };
 
 $RE{'version_later_postfix'} = {
 	caption => 'version "or later" (postfix)',
 	tags    => ['trait'],
-	pat     => qr/$P{version_later_postfix}/,
+	pat     => qr/$P{ver_later_postfix}/,
 };
 
 $RE{'version_number'} = {
 	caption => 'version number',
 	tags    => ['trait'],
-	pat     => qr/$P{version_number}/,
+	pat     => qr/$P{ver_number}/,
 };
 
 $RE{'version_prefix'} = {
 	caption => 'version prefix',
 	tags    => ['trait'],
-	pat     => qr/$P{version_prefix}/,
+	pat     => qr/$P{ver_prefix}/,
 };
 
 =head2 License combinations
@@ -785,7 +788,7 @@ $RE{'bsd'} = {
 	caption => 'BSD (unspecified)',
 	tags    => ['group'],
 	pat =>
-		qr/$P{note_repro_notice_cond_discl}(?:(?:[^a-zA-Z]+$P{ad_verbatim}.*)?[^a-zA-Z]+$P{nopromo_neither})?/,
+		qr/$P{repro_copr_cond_discl}(?:(?:[\d\W]+$P{ad_mat_ack_this}.*)?[\d\W]+$P{nopromo_neither})?/,
 };
 
 $RE{'gnu'} = {
diff --git a/lib/Regexp/Pattern/License/Parts.pm b/lib/Regexp/Pattern/License/Parts.pm
index 41cff54..65f104c 100644
--- a/lib/Regexp/Pattern/License/Parts.pm
+++ b/lib/Regexp/Pattern/License/Parts.pm
@@ -30,311 +30,195 @@ It is a class of internally used patterns.
 my $D  = qr/[-–]/;     # dash
 my $SD = qr/[ -–]/;    # space or dash
 
-# permission clause
-my $granted = qr/Permission is hereby granted/;
-
-# purpose
-my $to_use      = qr/to use, copy, modify, and distribute/;
-my $to_deal_sw  = qr/to deal in the Software without restriction/;
-my $to_deal_mat = qr/to deal in the Materials without restriction/;
-my $any_purpose = qr/for any purpose/;
-my $redist_src  = qr/Redistributions of source code/;
-my $redist_bin  = qr/Redistributions in binary form/;
-my $redist_any  = qr/Redistributions of any form whatsoever/;
-my $promote     = qr/endorse or promote products derived from this software/;
-
-# text
-my $notice       = qr/the above copyright notice/;
-my $cond         = qr/this list of conditions/;
-my $discl        = qr/the following disclaimer/;
-my $no_agreement = qr/without written agreement/;
-my $no_permit    = qr/without specific prior written permission/;
-my $ack          = qr/the following acknowledge?ment/;
-my $product_by   = qr/This product includes software developed by/;
-
-# money
-my $no_charge = qr/free of charge/;
-my $no_fee    = qr/without fee/;
-my $no_fees   = qr/without license or royalty fees/;
-
-# asset
-my $sw_doc      = qr/this software and its documentation/;
-my $sw_docfiles = qr/this software and associated documentation files/;
-my $doc         = qr/the documentation/;
-my $other_mat   = qr/other materials provided with the distribution/;
-my $ad_mat
-	= qr/All advertising materials mentioning features or use of this software/;
-
-# agent
-my $to_person = qr/to any person obtaining a copy/;
-my $no_authors
-	= qr/Neither the (?:names? .*|authors?) nor the names of(?: (?:its|their|other|any))? contributors/;
-
-# origin
-my $origin_no_misrepresent = qr/must not be misrepresented/;
-my $origin_ack             = qr/an acknowledgment \(see the following\)/;
-
-# forking
-my $derive_altermark
-	= qr/Altered source versions must be plainly marked as such/;
-
-# invariant parts
-my $invariant_notice = qr/This notice may not be removed or altered/;
+#my $I  = qr/[iI\d\W]+/; # bullet or count
+my $I = qr/\W*\S\W*/;    # bullet or count
 
 our %RE = (
-	ad_ack_doc_pkg => {
-		caption => 'advertisement (aknowledge, documentation, packages)',
-		tags    => ['clause'],
+
+	# assets (original or derived)
+	doc_mat_dist => {
 		pat =>
-			qr/acknowledgment shall be given in the documentation and software packages that this Software was used/,
+			qr/the documentation and\/or other materials provided with the distribution/
 	},
-	ad_ack_doc_sw => {
-		caption => 'advertisement (documentation + source)',
-		tags    => ['clause'],
+	sw           => { pat => qr/the Software/ },
+	the_material => {
 		pat =>
-			qr/acknowledgment shall be given in the documentation, materials and software packages that this Software was used/,
-	},
-	ad_always => {
-		caption => 'advertisement',
-		tags    => ['clause'],
-		pat     => qr/$redist_any must retain $ack[^a-zA-Z]+$product_by/,
+			qr/this software and associated documentation files \(the "?Material"?\)/
 	},
-	ad_pub_ack_nosrc => {
-		caption => 'advertisement (public, aknowledge, no source)',
-		tags    => ['clause'],
+
+	# rights
+	perm_granted => { pat => qr/Permission is hereby granted/ },
+	to_deal_mat =>
+		{ pat => qr/to deal in the Materials without restriction/ },
+	to_mod_sublic => {
 		pat =>
-			qr/publicly documented acknowledgment must be given that this software has been used if no source/,
-	},
-	ad_verbatim => {
-		caption => 'advertisement (verbatim)',
-		tags    => ['clause'],
-		pat     => qr/$ad_mat must display $ack[^a-zA-Z]+$product_by/,
-	},
-	asis_expr_warranty => {
-		caption => 'as-is (express warranty)',
-		tags    => ['clause'],
-		pat     => qr/without express or implied warranty/,
-	},
-	asis_name_sw => {
-		caption => 'as-is (name, software)',
-		tags    => ['clause'],
-		pat     => qr/(?:\S+ ){1,15}PROVIDES? THIS SOFTWARE/,
+			qr/to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of/
 	},
-	asis_sw_by_name => {
-		caption => 'as-is (software, by name)',
-		tags    => ['clause'],
-		pat     => qr/THIS SOFTWARE IS PROVIDED BY/,
-	},
-	asis_sw_name_discl => {
-		caption => 'as-is (software, name disclaims)',
-		tags    => ['clause'],
+
+	# agents
+	to_pers => { pat => qr/to any person obtaining a copy of/ },
+
+	# charges
+	free_charge    => { pat => qr/free of charge/ },
+	free_agree_fee => {
 		pat =>
-			qr/THE SOFTWARE IS PROVIDED \W*AS\W+IS\W*(?:,?|AND) (?:\S+ ){1,15}DISCLAIMS/,
-	},
-	asis_sw_warranty => {
-		caption => 'as-is (software, warranty)',
-		tags    => ['clause'],
-		pat => qr/THE SOFTWARE IS PROVIDED \W*AS\W+IS\W* WITHOUT WARRANTY/,
+			qr/without written agreement and without license or royalty fees/
 	},
-	cc => {
-		caption => 'Creative Commons qualifier',
-		tags    => ['qualifier'],
-		pat     => qr/(?:Creative Commons|CC)/,
-	},
-	cc_by => {
-		caption => 'Creative Commons Attribution component',
-		tags    => ['component'],
-		pat     => qr/(?:Attribution)/,
-	},
-	cc_cc0 => {
-		caption => 'Creative Commons CC0 component',
-		tags    => ['component'],
-		pat     => qr/(?:CC0|Zero|0)/,
-	},
-	cc_nc => {
-		caption => 'Creative Commons NonCommercial component',
-		tags    => ['component'],
-		pat     => qr/(?:Non$SD?Commercial)/,
-	},
-	cc_nd => {
-		caption => 'Creative Commons NoDerivatives component',
-		tags    => ['component'],
-		pat     => qr/(?:No$SD?Deriv(?:ative)?s)/,
-	},
-	cc_sa => {
-		caption => 'Creative Commons ShareAlike component',
-		tags    => ['component'],
-		pat     => qr/(?:Share$SD?Alike)/,
-	},
-	cc_sp => {
-		caption => 'Creative Commons Sampling Plus component',
-		tags    => ['component'],
-		pat     => qr/(?:Sampling$SD?Plus)/,
-	},
-	cc_url => {
-		caption => 'Creative Commons URL',
-		tags    => ['url'],
-		pat     => qr"(?:(?:https?:?)?(?://)?creativecommons.org/licenses/)",
-	},
-	cc_url_pd => {
-		caption => 'Creative Commons stem (public domain)',
-		tags    => ['url'],
-		pat => qr"(?:(?:https?:?)?(?://)?creativecommons.org/publicdomain/)",
-	},
-	derive_altermark => {
-		caption => 'deriving (must plainly mark)',
-		tags    => ['clause'],
-		pat     => qr/$derive_altermark/,
+
+	# conditions
+	ack_doc_mat_pkg_use => {
+		pat =>
+			qr/acknowledgment shall be given in the documentation, materials and software packages that this Software was used/
 	},
-	derive_no_relicense => {
-		caption => 'deriving (no relicense)',
-		tags    => ['clause'],
-		pat     => qr/may not be "?relicensed"?/,
+	ack_doc_pkg_use => {
+		pat =>
+			qr/acknowledgment shall be given in the documentation and software packages that this Software was used/
 	},
-	derive_share => {
-		caption => 'deriving (must share source)',
-		tags    => ['clause'],
+	ack_pub_use_nosrc => {
 		pat =>
-			qr/source code of the altered version of this software available/,
+			qr/publicly documented acknowledgment must be given that this software has been used if no source/
 	},
-	discl_name_warranties => {
-		caption => 'disclaim (name, warranties)',
-		tags    => ['clause'],
-		pat     => qr/(?:\S+ ){1,15}DISCLAIMS? ALL WARRANTIES/,
+	altered_srcver_mark => {
+		pat =>
+			qr/$I?Altered source versions must be plainly marked as such,? and must not be misrepresented as being the original software/
 	},
-	nopromo_except => {
-		caption => 'no promotion (except)',
-		tags    => ['clause'],
+	altered_ver_mark => {
 		pat =>
-			qr/Except as contained in this notice, the names? (?:\S+ ){1,15}shall not be used in advertising/,
+			qr/$I?Altered versions must be plainly marked as such,? and must not be misrepresented as being the original source/
 	},
-	nopromo_neither => {
-		caption => 'no promotion (neither)',
-		tags    => ['clause'],
+	change_redist_share => {
 		pat =>
-			qr/(?:$no_authors may|The name.*? (?:may|must) not) be used to $promote $no_permit/,
+			qr/If you change this software and redistribute parts or all of it in any form, you must make the source code of the altered version of this software available/
 	},
-	nopromo_written_prior => {
-		caption => 'no promo (advertising)',
-		tags    => ['clause'],
-		pat     => qr/without specific, written prior permission/,
+	namenot =>
+		{ pat => qr/[Tt]he names?(?: \S+){1,15} (?:may|must|shall) not/ },
+	neithername => {
+		pat =>
+			qr/Neither the (?:names?(?: \S+){1,15}|authors?) nor the names of(?: (?:its|their|other|any))? contributors may/
 	},
-	note_cpyr_perm => {
-		caption => 'notice (copyright + permission)',
-		tags    => ['clause'],
+	notice_no_alter =>
+		{ pat => qr/$I?This notice may not be removed or altered/ },
+	notice_no_alter_any => {
 		pat =>
-			qr/provided that(?:\W*\S\W*)? the above copyright notice(?:\(?s\)?)? and this permission notice appear in all copies/,
+			qr/$I?This notice may not be removed or altered from any source distribution/
 	},
-	note_cpyr_perm_doc => {
-		caption => 'notice (copyright + permission, documentation)',
-		tags    => ['clause'],
+	copr_no_alter => {
 		pat =>
-			qr/both the above copyright notice\(s\) and this permission notice appear in supporting documentation/,
+			qr/$I?This Copyright notice may not be removed or altered from any source or altered source distribution/
 	},
-	note_marketing => {
-		caption => 'notice (copyright + permission, marketing material)',
-		tags    => ['clause'],
+	redist_bin_repro =>
+		{ pat => qr/Redistributions in binary form must reproduce/ },
+	src_no_relicense => {
 		pat =>
-			qr/shall be included in all copies of the Software, its documentation and marketing/,
+			qr/$I?Source versions may not be "?relicensed"? under a different license without my explicitly written permission/
 	},
-	note_cpyr_perm_subst => {
-		caption => 'notices (copyright, permission, substantial portions)',
-		tags    => ['clause'],
+	used_endorse_deriv => {
 		pat =>
-			qr/The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software/,
+			qr/be used to endorse or promote products derived from this software/
 	},
-	note_invar => {
-		caption => 'notice (invariable)',
-		tags    => ['clause'],
-		pat     => qr/This notice may not be removed or altered/,
+	used_ad => { pat => qr/be used in advertising/ },
+	without_prior_written =>
+		{ pat => qr/without specific prior written permission/ },
+	without_written_prior =>
+		{ pat => qr/without specific, written prior permission/ },
+	origin_sw_no_misrepresent => {
+		pat => qr/$I?The origin of this software must not be misrepresented/
 	},
-	note_repro_notice_cond_discl => {
-		caption => 'notice (reproduce, notice + conditions + disclaimer)',
-		tags    => ['clause'],
+	origin_src_no_misrepresent => {
 		pat =>
-			qr/$redist_bin must reproduce $notice, $cond and $discl in $doc and\/or $other_mat/,
+			qr/$I?The origin of this source code must not be misrepresented/
 	},
-	note_retain_notice_cond_discl => {
-		caption => 'notice (retain, notice + conditions + disclaimer)',
-		tags    => ['clause'],
-		pat     => qr/$redist_src must retain $notice,? $cond and $discl/,
+	you_not_claim_wrote => {
+		pat => qr/you must not claim that you wrote the original software/
 	},
-	origin_no_misrepresent => {
-		caption => 'origin (no misrepresentation)',
-		tags    => ['clause'],
-		pat     => qr/$origin_no_misrepresent/,
+	use_ack_nonreq => {
+		pat =>
+			qr/If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required/
 	},
-	origin_no_misrepresent_ack => {
-		caption => 'origin (no misrepresentation, acknowledgement)',
-		tags    => ['clause'],
-		pat     => qr/$origin_no_misrepresent.*, $origin_ack/,
+	use_ack_req => {
+		pat =>
+			qr/If you use this software in a product, an acknowledgment \(see the following\) in the product documentation is required/
 	},
-	permission_granted_agree_fee => {
-		caption => 'permission (granted, no agreement or fee)',
-		tags    => ['clause'],
-		pat     => qr/$granted, $no_agreement and $no_fees/,
+
+	# disclaimers
+	asis_expr_warranty => { pat => qr/without express or implied warranty/ },
+	asis_name_sw    => { pat => qr/(?:\S+ ){1,15}PROVIDES? THIS SOFTWARE/ },
+	asis_sw_by_name => { pat => qr/THIS SOFTWARE IS PROVIDED BY/ },
+	asis_sw_name_discl => {
+		pat =>
+			qr/THE SOFTWARE IS PROVIDED \W*AS\W+IS\W*(?:,?|AND) (?:\S+ ){1,15}DISCLAIMS/
 	},
-	permission_use_deal_sw => {
-		caption => 'usage (deal, software, any purpose)',
-		tags    => ['clause'],
-		pat     => qr/$to_deal_sw/,
+	asis_sw_warranty => {
+		pat => qr/THE SOFTWARE IS PROVIDED \W*AS\W+IS\W* WITHOUT WARRANTY/
 	},
-	permission_use_deal_materials => {
-		caption => 'usage (deal, materials, any purpose)',
-		tags    => ['clause'],
-		pat     => qr/$to_deal_mat/,
+
+	# versioning
+	ver_later_para    => { pat => qr/Later versions are permitted/ },
+	ver_later_postfix => {
+		pat =>
+			qr/(?:and|or)(?: ?\(?at your option\)?)?(?: any)? (?:later|newer)(?: version)?/
 	},
-	permission_use_fee_agree => {
-		caption => 'permission (use, no fee or agreement)',
-		tags    => ['clause'],
-		pat     => qr/and without a written agreement/,
+	ver_number => { pat => qr/\d(?:\.\d+)*/ },
+	ver_prefix => { pat => qr/[Vv](?:ersion |ERSION |\.? ?)/ },
+
+	# Creative Commons
+	cc     => { pat => qr/(?:Creative Commons|CC)/ },
+	cc_by  => { pat => qr/(?:Attribution)/ },
+	cc_cc0 => { pat => qr/(?:CC0|Zero|0)/ },
+	cc_nc  => { pat => qr/(?:Non$SD?Commercial)/ },
+	cc_nd  => { pat => qr/(?:No$SD?Deriv(?:ative)?s)/ },
+	cc_sa  => { pat => qr/(?:Share$SD?Alike)/ },
+	cc_sp  => { pat => qr/(?:Sampling$SD?Plus)/ },
+	cc_url =>
+		{ pat => qr"(?:(?:https?:?)?(?://)?creativecommons.org/licenses/)" },
+	cc_url_pd => {
+		pat => qr"(?:(?:https?:?)?(?://)?creativecommons.org/publicdomain/)"
 	},
-	permission_person_materials => {
-		caption => 'permission (granted, no charge, person, materials)',
-		tags    => ['clause'],
+
+	# texts
+	ack_name => {
 		pat =>
-			qr/$granted, $no_charge, $to_person of $sw_docfiles \(the "?Materials"?\)/,
+			qr/the following acknowledge?ment\W+This product includes software developed by/
 	},
-	permission_person_sw_doc => {
-		caption => 'permission (granted, no charge, person, software)',
-		tags    => ['clause'],
+	copr_perm => {
 		pat =>
-			qr/$granted, $no_charge, $to_person of $sw_docfiles \(the "?Software"?\)/,
+			qr/[Tt]he above copyright notice(?:\(?s\)?)? and this permission notice/
 	},
-	right_mod_sublic => {
-		caption => 'rights (modify, sublicense)',
-		tags    => ['clause'],
+	copr_cond_discl => {
 		pat =>
-			qr/to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software/,
-	},
-	use_sw_doc_any => {
-		caption => 'usage (software and documentation, any purpose)',
-		tags    => ['clause'],
-		pat     => qr/$to_use $sw_doc $any_purpose/,
-	},
-	version_later_para => {
-		caption => 'version "or later" (paragraph)',
-		tags    => ['trait'],
-		pat     => qr/Later versions are permitted/,
+			qr/the above copyright notice, this list of conditions and the following disclaimer/
 	},
-	version_later_postfix => {
-		caption => 'version "or later" (postfix)',
-		tags    => ['trait'],
+
+	# combinations
+	discl_name_warranties =>
+		{ pat => qr/(?:\S+ ){1,15}DISCLAIMS? ALL WARRANTIES/ },
+	note_marketing => {
 		pat =>
-			qr/(?:and|or)(?: ?\(?at your option\)?)?(?: any)? (?:later|newer)(?: version)?/,
-	},
-	version_number => {
-		caption => 'version number',
-		tags    => ['component'],
-		pat     => qr/\d(?:\.\d+)*/,
-	},
-	version_prefix => {
-		caption => 'version prefix',
-		tags    => ['component'],
-		pat     => qr/[Vv](?:ersion |ERSION |\.? ?)/,
+			qr/shall be included in all copies of the Software, its documentation and marketing/
 	},
+	permission_use_fee_agree =>
+		{ pat => qr/and without a written agreement/ },
 );
 
+$RE{ad_mat_ack_this}{pat}
+	= qr/All advertising materials mentioning features or use of this software must display $RE{ack_name}{pat}/;
+$RE{note_copr_perm}{pat}
+	= qr/provided that$I? $RE{copr_perm}{pat} appear in all copies/;
+$RE{note_copr_perm_doc}{pat}
+	= qr/both $RE{copr_perm}{pat} appear in supporting documentation/;
+$RE{retain_copr_perm_subst}{pat}
+	= qr/$RE{copr_perm}{pat} shall be included in all copies or substantial portions of the Software/;
+$RE{retain_notice_cond_discl}{pat}
+	= qr/Redistributions of source code must retain $RE{copr_cond_discl}{pat}/;
+$RE{nopromo_except}{pat}
+	= qr/Except as contained in this notice, $RE{namenot}{pat} $RE{used_ad}{pat}/;
+$RE{repro_copr_cond_discl}{pat}
+	= qr/$RE{redist_bin_repro}{pat} $RE{copr_cond_discl}{pat} in $RE{doc_mat_dist}{pat}/;
+$RE{nopromo_neither}{pat}
+	= qr/(?:$RE{neithername}{pat}|$RE{namenot}{pat}) $RE{used_endorse_deriv}{pat} $RE{without_prior_written}{pat}/;
+$RE{redist_ack_this}{pat}
+	= qr/Redistributions of any form whatsoever must retain $RE{ack_name}{pat}/;
+
 =encoding UTF-8
 
 =head1 AUTHOR
diff --git a/t/SPDX.t b/t/SPDX.t
index 39bf954..da5d32f 100644
--- a/t/SPDX.t
+++ b/t/SPDX.t
@@ -24,6 +24,7 @@ my %Debian2SPDX = (
 	'LGPL-2.1+'    => 'LGPL-2.1',
 	'Python-2'     => 'Python-2.0',
 	'WTFPL-2'      => 'WTFPL',
+	'NUnit'        => 'zlib-acknowledgement',
 );
 
 path("t/SPDX")->visit(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/licensecheck.git



More information about the Pkg-perl-cvs-commits mailing list