File Coverage

blib/lib/Regexp/Pattern/License/Parts.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Regexp::Pattern::License::Parts;
2              
3 28     28   1135 use utf8;
  28         80  
  28         184  
4 28     28   932 use strict;
  28         84  
  28         549  
5 28     28   134 use warnings;
  28         61  
  28         45584  
6              
7             =head1 NAME
8              
9             Regexp::Pattern::License::Parts - Regular expressions for licensing sub-parts
10              
11             =head1 VERSION
12              
13             Version v3.11.1
14              
15             =cut
16              
17             our $VERSION = version->declare("v3.11.1");
18              
19             =head STATUS
20              
21             This module is considered part of Regexp-Pattern-License's internals.
22              
23             =head DESCRIPTION
24              
25             This is not considered part of Regexp-Pattern-License's public API.
26              
27             It is a class of internally used patterns.
28              
29             =cut
30              
31             # internal patterns compiled into patterns
32             # * must be unique, to not collide at their final use in gen_pat sub
33             # * must be a unit, so that e.g. suffix "?" applies to whole chunk
34              
35             # [ ] end-of-sentence space
36             # [.] full stop
37             # [:] colon
38             # [;] semicolon or colon or comma
39             # ["] quote
40             # ["*] quote or bullet
41             # [*)] start-of-sentence bullet or count
42             # [/] slash or space or none
43             # [-] dash maybe space after, or none
44             # [- ] dash or space
45             # [ - ] dash with space around
46             # [(] parens-open
47             # [)] parens-close
48             # [http://] http or https protocol
49             # [ word] space and word
50             # [as is] as is, maybe quote around
51              
52             our %RE = (
53              
54             # assets (original or derived)
55             doc_mat_dist => {
56             pat =>
57             'the documentation and[/]or other materials provided with the distribution'
58             },
59             the_material => {
60             pat =>
61             'this software and(?:[/]or)? associated documentation files [(]?the ["]Materials?["][)]?, '
62             },
63             cp_sw => { pat => 'all copies of the Software' },
64             cp_sw_copr =>
65             { pat => 'all copies of the Software and its Copyright notices' },
66             cp_sw_doc =>
67             { pat => 'all copies of the Software and its documentation' },
68             sw_doc_nofee => {
69             pat =>
70             'this software and its documentation for any purpose and without fee '
71             },
72             the_sw => {
73             pat =>
74             'this software and associated documentation files [(]the ["]Software["][)], '
75             },
76              
77             # rights
78             perm_dist_mod => {
79             pat =>
80             'Permission to modify the code and to distribute modified code '
81             },
82             any_purpose => { pat => 'for any purpose, ' },
83             to_deal_mat => { pat => 'to deal in the Materials without restriction' },
84             granted => { pat => 'is(?: hereby)? granted' },
85             to_deal_the_sw_rights => {
86             pat =>
87             'to deal in the Software without restriction, including without limitation the rights '
88             },
89             to_copy_prg => { pat => 'to use or copy this program ' },
90             to_dist => { pat => 'to use, copy, modify,? and distribute ' },
91             to_reproduce => {
92             pat =>
93             'to use, reproduce, prepare derivative works, and to redistribute to others'
94             },
95             to_mod_sublic_sw => {
96             pat =>
97             'to use, copy, modify, merge, publish, distribute, sublicense, and[/]or sell copies of the Software, '
98             },
99             and_to_perm_pers => {
100             caption => 'to permit person',
101             pat =>
102             'and to permit persons to whom the Software is furnished to do so, '
103             },
104              
105             # agents
106             to_pers => { pat => 'to any person obtaining a copy of ' },
107              
108             # charges
109             free_charge => { pat => 'free of charge, ' },
110             free_agree_fee => {
111             pat =>
112             'without written agreement and without license or royalty fees'
113             },
114              
115             # conditions
116             subj_cond => { pat => 'subject to the following conditions' },
117             ack_doc_mat_pkg_use => {
118             pat =>
119             'acknowledgment shall be given in the documentation, materials and software packages that this Software was used'
120             },
121             ack_doc_pkg_use => {
122             pat =>
123             'acknowledgment shall be given in the documentation and software packages that this Software was used'
124             },
125             ack_pub_use_nosrc => {
126             pat =>
127             'In addition publicly documented acknowledgment must be given that this software has been used if no source code of this software is made available publicly'
128             },
129             altered_srcver_mark => {
130             pat =>
131             '[*)]?Altered source versions must be plainly marked as such,? and must not be misrepresented as being the original software'
132             },
133             altered_ver_mark => {
134             pat =>
135             '[*)]?Altered versions must be plainly marked as such,? and must not be misrepresented as being the original source'
136             },
137             change_redist_share => {
138             pat =>
139             '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'
140             },
141             incl => { pat => 'shall be included in ' },
142             name => { pat => '[Tt]he names?[ word]{1,15}' },
143             namenot =>
144             { pat => '(?:[Tt]he n|N)ames?[ word]{1,15} (?:may|must|shall) not ' },
145             neithername => {
146             pat =>
147             'Neither the (?:names?[ word]{1,15}|authors?) n?or the names of(?: (?:its|their|other|any))? contributors\W? may '
148             },
149             notice_no_alter =>
150             { pat => '[*)]?This notice may not be removed or altered' },
151             notice_no_alter_any => {
152             pat =>
153             '[*)]?This notice may not be removed or altered from any source distribution'
154             },
155             copr_no_alter => {
156             pat =>
157             '[*)]?This Copyright notice may not be removed or altered from any source or altered source distribution'
158             },
159             license_not_lib => {
160             pat =>
161             'This License does not apply to any software that links to the libraries provided by this software [(]statically or dynamically[)], but only to the software provided'
162             },
163             redist_bin_repro =>
164             { pat => 'Redistributions in binary form must reproduce ' },
165             src_no_relicense => {
166             pat =>
167             '[*)]?Source versions may not be ["]relicensed["] under a different license without my explicitly written permission'
168             },
169             used_endorse_deriv => {
170             pat =>
171             'be used to endorse or promote products derived from this software '
172             },
173             used_ad => { pat => 'be used in advertising' },
174             used_ad_dist => {
175             pat =>
176             'be used in (?:any )?advertising or publicity pertaining to distribution of the software '
177             },
178             you_not_use_ad_dist => {
179             pat =>
180             'You must not use any of the names of the authors or copyright holders of the original software for advertising or publicity pertaining to distribution '
181             },
182             without_prior_written =>
183             { pat => 'without(?: specific)? prior written permission' },
184             without_written => { pat => 'without specific written permission' },
185             without_written_prior =>
186             { pat => 'without specific, written prior permission' },
187             origin_sw_no_misrepresent => {
188             pat =>
189             '[*)]?The origin of this software must not be misrepresented[;] '
190             },
191             origin_src_no_misrepresent => {
192             pat =>
193             '[*)]?The origin of this source code must not be misrepresented'
194             },
195             you_not_claim_wrote =>
196             { pat => 'you must not claim that you wrote the original software' },
197             use_ack_apprec => {
198             pat =>
199             'If you use this software in a product, an acknowledgment in the product documentation would be appreciated'
200             },
201             use_ack_apprec_not_req => {
202             pat =>
203             'If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required'
204             },
205             use_ack_req => {
206             pat =>
207             'If you use this software in a product, an acknowledgment [(]see the following[)] in the product documentation is required'
208             },
209              
210             # disclaimers
211             asis_expr_warranty =>
212             { pat => 'provided [as is] without express or implied warranty' },
213             asis_mat => { pat => 'This material is supplied [as is]' },
214             asis_name_sw => { pat => '[word][ word]{0,14} PROVIDES? THIS SOFTWARE' },
215             asis_sw_by => { pat => 'THIS SOFTWARE IS PROVIDED BY' },
216             asis_sw_expr_warranty => {
217             pat =>
218             'This software is supplied [as is] without express or implied warranty'
219             },
220             asis_sw_name_discl => {
221             pat =>
222             'THE SOFTWARE IS PROVIDED [as is](?:,?| AND)[ word]{1,15} DISCLAIMS'
223             },
224             asis_sw_warranty =>
225             { pat => 'THE SOFTWARE IS PROVIDED [as is],? WITHOUT WARRANTY' },
226              
227             # Creative Commons
228             cc => { pat => '(?:Creative Commons|CC)' },
229             cc_by => { pat => '(?:Attribution)' },
230             cc_cc0 => { pat => '(?:CC0|Zero|0)' },
231             cc_nc => { pat => '(?:Non[- ]?Commercial)' },
232             cc_nd => { pat => '(?:No[- ]?Deriv(?:ative)?s)' },
233             cc_sa => { pat => '(?:Share[- ]?Alike)' },
234             cc_sp => { pat => '(?:Sampling[- ]?Plus)' },
235             cc_url => { pat => '(?:[http://]creativecommons.org[/]licenses[/])' },
236             cc_url_pd =>
237             { pat => '(?:[http://]creativecommons.org[/]publicdomain[/])' },
238              
239             # FSF
240             fsf_url => { pat => '(?:[http://](?:www\.)?fsf\.org[/]?)' },
241              
242             # texts
243             ack_dev_by => {
244             pat => 'the following acknowledge?ments?[:]?[ ]'
245             . '["]?This product includes software developed by '
246             },
247             ack_written_by => {
248             pat => 'the following acknowledge?ment[:]?[ ]'
249             . '["]?This product includes(?: cryptographic)? software written by'
250             },
251             authors_copr => { pat => 'the Authors, the Copyright' },
252             above_copr => { pat => 'the above copyright notice' },
253             copr_avail_orig => {
254             pat =>
255             'the Copyright, this License, and the Availability of the original version'
256             },
257             copr_avail_note => {
258             pat => 'the Copyright, this License, (?:and )?the Availability note'
259             },
260             copr_perm => {
261             pat =>
262             '(?:both t|t|T)(?:hat|he|he above) copyright notice(?:s|[(]s[)])? and this permission notice '
263             },
264             copr_perm_warr => {
265             pat =>
266             '(?:both t|t|T)(?:hat|he|he above) copyright notice(?:s|[(]s[)])? and this permission notice and warranty disclaimer'
267             },
268             copr_perms => { pat => 'this copyright and permissions notice' },
269             copr_cond_discl => {
270             pat =>
271             'the above copyright notice, this list of conditions,? and the following disclaimer'
272             },
273             copr_cond_discl_warr => {
274             pat =>
275             'the above copyright notice, this list of conditions,? and the Disclaimer of Warranty'
276             },
277             copr_cond_discl_anywhere => {
278             pat =>
279             'the copyright notice, this list of conditions,? and the following disclaimer'
280             },
281             notices => { pat => '[Tt]he above notices' },
282             and_used_by_perm => { pat => 'and ["]Used by permission[." ]' },
283              
284             # combinations
285             discl_name_warranties =>
286             { pat => '[word][ word]{0,14} DISCLAIMS? ALL WARRANTIES' },
287             permission_use_fee_agree => { pat => 'and without a written agreement' },
288              
289             # versioning
290             at_option =>
291             { pat => '(?:[(] ?)?(?:at )?your (?:option|choice)(?: ?[)])?' },
292             version_number_prefix =>
293             { pat => '(?:[Vv]ersion [Vv]?|VERSION |rev(?:ision)? |[Vv]\.? ?)?' },
294             version_number => { pat => '\d(?:\.\d+){0,2}[a-f]?\b' },
295             version_number_suffix => { pat => ' ?(?:(?:of the )?Licen[cs]e)?' },
296             );
297              
298             $RE{perm_granted}{pat} = 'Permission ' . $RE{granted}{pat} . ',? ';
299             $RE{to_copy_sublicence_conditions}{pat}
300             = $RE{to_mod_sublic_sw}{pat}
301             . $RE{and_to_perm_pers}{pat}
302             . $RE{subj_cond}{pat};
303             $RE{ad_mat_ack_this}{pat}
304             = 'All advertising materials mentioning features or use of this software must display '
305             . $RE{ack_dev_by}{pat};
306             $RE{ad_mat_ack_ssleay}{pat}
307             = 'All advertising materials mentioning features or use of this software must display '
308             . $RE{ack_written_by}{pat};
309             $RE{note_copr_perm}{pat}
310             = 'provided that[*)]?' . $RE{copr_perm}{pat} . 'appear in all copies';
311             $RE{note_copr_perms_deriv}{pat}
312             = 'provided that[*)]?'
313             . $RE{copr_perms}{pat}
314             . ' appear in all copies and derivatives';
315             $RE{repro_code_cite_authors_copr}{pat}
316             = 'User documentation of any code that uses this code must cite '
317             . $RE{authors_copr}{pat} . ', ';
318             $RE{repro_code_modcode_cite_copr_avail_note}{pat}
319             = 'User documentation of any code that uses this code or any modified version of this code must cite '
320             . $RE{copr_avail_note}{pat} . ', ';
321             $RE{repro_copr_perm_warr_appear_doc}{pat}
322             = $RE{copr_perm_warr}{pat} . ' appear in supporting documentation';
323             $RE{repro_matlab_cite_authors}{pat}
324             = 'If this code is accessible from within Matlab, then typing[ word]{2,5} [(]with no arguments[)] must cite the Authors';
325             $RE{note_marketing}{pat}
326             = $RE{incl}{pat} . $RE{cp_sw}{pat} . ', its documentation and marketing';
327             $RE{note_mod_inc}{pat}
328             = 'and a notice that the code was modified is included';
329             $RE{note_mod_inc_with_copr}{pat}
330             = 'and a notice that the code was modified is included with '
331             . $RE{above_copr}{pat};
332             $RE{retain_copr_appear}{pat}
333             = ',? provided that ' . $RE{above_copr}{pat} . ' appears? in all copies';
334             $RE{retain_copr_avail_note}{pat}
335             = ',? provided ' . $RE{copr_avail_note}{pat} . ' are retained, ';
336             $RE{retain_copr_avail_orig}{pat}
337             = 'provided that '
338             . $RE{copr_avail_orig}{pat}
339             . ' is retained on all copies';
340             $RE{retain_copr_perm_subst}{pat}
341             = $RE{copr_perm}{pat}
342             . $RE{incl}{pat}
343             . 'all copies or substantial portions of the Software';
344             $RE{retain_copr_perm_sw_copr}{pat}
345             = $RE{copr_perm}{pat} . $RE{incl}{pat} . $RE{cp_sw_copr}{pat};
346             $RE{retain_copr_perm_sw_doc}{pat}
347             = $RE{copr_perm}{pat} . $RE{incl}{pat} . $RE{cp_sw_doc}{pat};
348             $RE{retain_notice_cond_discl}{pat}
349             = 'Redistributions of source code must retain '
350             . $RE{copr_cond_discl}{pat};
351             $RE{retain_notice_cond_discl_warr}{pat}
352             = 'Redistributions of source code must retain '
353             . $RE{copr_cond_discl_warr}{pat};
354             $RE{retain_notice_cond_discl_anywhere}{pat}
355             = 'Redistributions of source code must retain '
356             . $RE{copr_cond_discl_anywhere}{pat};
357             $RE{retain_notices}{pat}
358             = ',? provided ' . $RE{notices}{pat} . ' are retained, ';
359             $RE{retain_notices_all}{pat}
360             = 'provided ' . $RE{notices}{pat} . ' are retained on all copies';
361             $RE{retain_you_avail_orig}{pat}
362             = 'You must also retain the Availability information below, of the original version';
363             $RE{nopromo_except}{pat}
364             = 'Except as contained in this notice, '
365             . $RE{namenot}{pat}
366             . $RE{used_ad}{pat};
367             $RE{nopromo_name_written}{pat}
368             = $RE{name}{pat} . ' not '
369             . $RE{used_ad_dist}{pat}
370             . $RE{without_written}{pat};
371             $RE{nopromo_name_written_prior}{pat}
372             = $RE{name}{pat} . ' not '
373             . $RE{used_ad_dist}{pat}
374             . $RE{without_written_prior}{pat};
375             $RE{repro_copr_cond_discl}{pat}
376             = '[*)]?'
377             . $RE{redist_bin_repro}{pat}
378             . $RE{copr_cond_discl}{pat} . ' in '
379             . $RE{doc_mat_dist}{pat};
380             $RE{repro_copr_cond_discl_warr}{pat}
381             = '[*)]?'
382             . $RE{redist_bin_repro}{pat}
383             . $RE{copr_cond_discl_warr}{pat} . ' in '
384             . $RE{doc_mat_dist}{pat};
385             $RE{repro_copr_perm_appear_doc}{pat}
386             = $RE{copr_perm}{pat} . 'appear in supporting documentation';
387             $RE{nopromo_neither}{pat}
388             = '(?:'
389             . $RE{neithername}{pat} . '|'
390             . $RE{namenot}{pat} . ')'
391             . $RE{used_endorse_deriv}{pat}
392             . $RE{without_prior_written}{pat};
393             $RE{nopromo_university}{pat}
394             = 'Neither the name of the University nor the names of its contributors may '
395             . $RE{used_endorse_deriv}{pat}
396             . $RE{without_prior_written}{pat};
397             $RE{nopromo_nothing_deemed}{pat}
398             = '[*)]?Nothing in this license shall be deemed to grant';
399             $RE{redist_ack_this}{pat}
400             = 'Redistributions of any form whatsoever must retain '
401             . $RE{ack_dev_by}{pat};
402             $RE{discl_warranties}{pat}
403             = $RE{asis_sw_by}{pat}
404             . '[ word]{1,15} [as is] '
405             . 'AND ANY EXPRESS(?:ED)? OR IMPLIED WARRANTIES, '
406             . 'INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE '
407             . 'ARE DISCLAIMED';
408             $RE{discl_warranties_any_kind}{pat}
409             = 'This software is provided [as is] without a warranty of any kind';
410             $RE{discl_warranties_any_kind_noninfringement}{pat}
411             = 'THE SOFTWARE IS PROVIDED [as is]'
412             . ', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED'
413             . ', INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT';
414             $RE{discl_warranties_excluded}{pat}
415             = 'ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES'
416             . ', INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY'
417             . ', FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT'
418             . ', ARE HEREBY EXCLUDED';
419             $RE{discl_liability}{pat}
420             = 'IN NO EVENT SHALL[ word]{1,15} BE LIABLE'
421             . ' FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES'
422             . ' [(]INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES[;] '
423             . 'LOSS OF USE, DATA, OR PROFITS[;] OR BUSINESS INTERRUPTION[)]'
424             . ' HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY'
425             . ', WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT'
426             . ' [(]INCLUDING NEGLIGENCE OR OTHERWISE[)]'
427             . ' ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE'
428             . ', EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE';
429             $RE{discl_liability_suffered}{pat}
430             = '[word][ word]{0,14} SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE'
431             . ' AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES';
432             $RE{discl_liability_revenue}{pat}
433             = 'IN NO EVENT WILL[ word]{1,15} BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA'
434             . ', OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES'
435             . ', HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY'
436             . ', ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE'
437             . ', EVEN IF[ word]{1,15} HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES';
438             $RE{discl_liability_claim}{pat}
439             = 'IN NO EVENT SHALL[ word]{1,15} BE LIABLE'
440             . ' FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY'
441             . ', WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE'
442             . ', ARISING FROM, OUT OF OR IN CONNEC[-]TION WITH THE SOFTWARE'
443             . ' OR THE USE OR OTHER DEALINGS IN THE SOFTWARE';
444             $RE{version_plural_infix}{pat}
445             = '(?:,(?: or)?|or)(?:,? ' . $RE{at_option}{pat} . ',?)? ?';
446             $RE{version_plural_suffix}{pat}
447             = '(?: ?' . $RE{at_option}{pat} . ')?';
448              
449             =encoding UTF-8
450              
451             =head1 AUTHOR
452              
453             Jonas Smedegaard C<< >>
454              
455             =head1 COPYRIGHT AND LICENSE
456              
457             Copyright © 2016-2021 Jonas Smedegaard
458              
459             Copyright © 2017-2021 Purism SPC
460              
461             This program is free software; you can redistribute it and/or modify it
462             under the terms of the GNU General Public License as published by the
463             Free Software Foundation; either version 3, or (at your option) any
464             later version.
465              
466             This program is distributed in the hope that it will be useful, but
467             WITHOUT ANY WARRANTY; without even the implied warranty of
468             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
469             General Public License for more details.
470              
471             You should have received a copy of the GNU General Public License along
472             with this program. If not, see .
473              
474             =cut
475              
476             1;