1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-23 05:10:11 +01:00

Merge branch 'spdx-license-texts-from-text' into spdx-license-templates

This commit is contained in:
Mike Linksvayer 2017-11-20 11:19:47 -08:00
commit e0834369ca
17 changed files with 256 additions and 200 deletions

View File

@ -42,9 +42,11 @@ the following:
a) to reproduce the Original Work in copies, either alone or as part of a
collective work;
b) to translate, adapt, alter, transform, modify, or arrange the Original
Work, thereby creating derivative works ("Derivative Works") based upon
the Original Work;
c) to distribute or communicate copies of the Original Work and
Derivative Works to the public, under any license of your choice that
does not contradict the terms and conditions, including Licensors

View File

@ -77,6 +77,7 @@ code to the public.
The GNU Affero General Public License is designed specifically to ensure that,
in such cases, the modified source code becomes available to the community.
It requires the operator of a network server to provide the source code of the
modified version running there to the users of that server. Therefore, public
use of a modified version, on a publicly accessible server, gives the public
@ -100,6 +101,7 @@ follow.
such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License.
Each licensee is addressed as "you". "Licensees" and "recipients" may be
individuals or organizations.
@ -152,6 +154,7 @@ used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source
code needed to generate, install, and (for an executable work) run the object
code and to modify the work, including scripts to control those activities.
However, it does not include the work's System Libraries, or general-purpose
tools or generally available free programs which are used unmodified in
performing those activities but which are not part of the work. For example,
@ -296,6 +299,7 @@ the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible
personal property which is normally used for personal, family, or household
purposes, or (2) anything designed or sold for incorporation into a dwelling.
In determining whether a product is a consumer product, doubtful cases shall
be resolved in favor of coverage. For a particular product received by a
particular user, "normally used" refers to a typical or common use of that
@ -574,6 +578,7 @@ of acceptance of a version permanently authorizes you to choose that version
for the Program.
Later license versions may give you additional or different permissions.
However, no additional obligations are imposed on any author or copyright
holder as a result of your choosing to follow a later version.
@ -640,6 +645,7 @@ Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network,
you should also make sure that it provides a way for users to get its source.
For example, if your program is a web application, its interface could display
a "Source" link that leads users to an archive of the code. There are many
ways you could offer source, and different solutions will be better for

View File

@ -26,8 +26,7 @@ limitations:
---
Copyright (c) <<var;name=copyright;original= <year> <owner>;match=.+>> All
rights reserved.
Copyright (c) [year] [fullname] All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -39,15 +38,13 @@ list of conditions and the following disclaimer.
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY <<var;name=copyrightHolderAsIs;original=THE
COPYRIGHT HOLDERS AND CONTRIBUTORS;match=.+>> "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL <<var;name=copyrightHolderLiability;original=THE COPYRIGHT HOLDER
OR CONTRIBUTORS;match=.+>> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -27,8 +27,7 @@ limitations:
The Clear BSD License
Copyright (c) <<var;name=copyright;original=[xxxx]-[xxxx] [Owner
Organization];match=.+>>
Copyright (c) [year] [fullname]
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -42,20 +41,17 @@ below) provided that the following conditions are met:
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of <<var;name=organizationClause3;original=[Owner
Organization];match=.+>> nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
* Neither the name of [fullname] nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY
<<var;name=copyrightHolderAsIs;original=THE COPYRIGHT HOLDERS AND
CONTRIBUTORS;match=.+>> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
<<var;name=copyrightHolderLiability;original=THE COPYRIGHT HOLDER OR
CONTRIBUTORS;match=.+>> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

View File

@ -25,8 +25,7 @@ limitations:
---
Copyright (c) <<var;name=copyright;original= <year> <owner>;match=.+>>. All
rights reserved.
Copyright (c) [year] [fullname]. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -38,20 +37,17 @@ list of conditions and the following disclaimer.
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of <<var;name=organizationClause3;original=the copyright
holder;match=.+>> nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
permission.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <<var;name=copyrightHolderAsIs;original=THE
COPYRIGHT HOLDERS AND CONTRIBUTORS;match=.+>> "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL <<var;name=copyrightHolderLiability;original=THE COPYRIGHT HOLDER
OR CONTRIBUTORS;match=.+>> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -29,14 +29,14 @@ limitations:
Creative Commons Attribution 4.0 International
<<beginOptional;name=ccOptionalIntro>> Creative Commons Corporation (“Creative
Commons”) is not a law firm and does not provide legal services or legal
advice. Distribution of Creative Commons public licenses does not create a
lawyer-client or other relationship. Creative Commons makes its licenses and
related information available on an “as-is” basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their terms and
conditions, or any related information. Creative Commons disclaims all
liability for damages resulting from their use to the fullest extent possible.
Creative Commons Corporation (“Creative Commons”) is not a law firm and does
not provide legal services or legal advice. Distribution of Creative Commons
public licenses does not create a lawyer-client or other relationship.
Creative Commons makes its licenses and related information available on an
“as-is” basis. Creative Commons gives no warranties regarding its licenses,
any material licensed under their terms and conditions, or any related
information. Creative Commons disclaims all liability for damages resulting
from their use to the fullest extent possible.
Using Creative Commons Public Licenses
@ -69,7 +69,7 @@ other reasons, including because others have copyright or other rights in the
material. A licensor may make special requests, such as asking that all
changes be marked or described. Although not required by our licenses, you are
encouraged to respect those requests where reasonable. More considerations for
the public. <<endOptional>>
the public.
Creative Commons Attribution 4.0 International Public License

View File

@ -30,14 +30,14 @@ limitations:
Creative Commons Attribution-ShareAlike 4.0 International
<<beginOptional;name=ccOptionalIntro>> Creative Commons Corporation (“Creative
Commons”) is not a law firm and does not provide legal services or legal
advice. Distribution of Creative Commons public licenses does not create a
lawyer-client or other relationship. Creative Commons makes its licenses and
related information available on an “as-is” basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their terms and
conditions, or any related information. Creative Commons disclaims all
liability for damages resulting from their use to the fullest extent possible.
Creative Commons Corporation (“Creative Commons”) is not a law firm and does
not provide legal services or legal advice. Distribution of Creative Commons
public licenses does not create a lawyer-client or other relationship.
Creative Commons makes its licenses and related information available on an
“as-is” basis. Creative Commons gives no warranties regarding its licenses,
any material licensed under their terms and conditions, or any related
information. Creative Commons disclaims all liability for damages resulting
from their use to the fullest extent possible.
Using Creative Commons Public Licenses
@ -71,7 +71,7 @@ material. A licensor may make special requests, such as asking that all
changes be marked or described.
Although not required by our licenses, you are encouraged to respect those
requests where reasonable. More considerations for the public. <<endOptional>>
requests where reasonable. More considerations for the public.
Creative Commons Attribution-ShareAlike 4.0 International Public License

View File

@ -30,13 +30,13 @@ limitations:
Creative Commons CC0 1.0 Universal
<<beginOptional;name=ccOptionalIntro>> CREATIVE COMMONS CORPORATION IS NOT A
LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT
DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES
THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS
DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. <<endOptional>>
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT
RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR
THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER.
Statement of Purpose

View File

@ -310,14 +310,16 @@ This licence shall be governed by the Belgian law if:
- the Licensor, other than the European Commission, has no residence or
registered office inside a European Union country.
Appendix
"Compatible Licences" according to article 5 EUPL are:
- GNU General Public License (GNU GPL) v. 2
- Open Software License (OSL) v. 2.1, v. 3.0
- Common Public License v. 1.0
- Eclipse Public License v. 1.0
- Cecill v. 2.0

View File

@ -38,6 +38,7 @@ GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license

View File

@ -29,8 +29,7 @@ limitations:
ISC License:
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
Copyright (c) 1995-2003 by Internet Software Consortium
Copyright (c) [year], [fullname]
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above

View File

@ -29,6 +29,7 @@ limitations:
---
The LaTeX Project Public License
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
LPPL Version 1.3c 2008-05-04
@ -39,6 +40,7 @@ Everyone is allowed to distribute verbatim copies of this license document,
but modification of it is not allowed.
PREAMBLE
========
The LaTeX Project Public License (LPPL) is the primary license under which the
@ -65,6 +67,7 @@ goal while meeting these conditions, then read the document `cfgguide.tex' and
`modguide.tex' in the base LaTeX distribution for suggestions.
DEFINITIONS
===========
In this license document the following terms are used:
@ -106,6 +109,7 @@ Interpreter is a `LaTeX-Format' or in the case of files belonging to the
`LaTeX-format' a program implementing the `TeX language'.
CONDITIONS ON DISTRIBUTION AND MODIFICATION
===========================================
1. Activities other than distribution and/or modification of the Work are not
@ -188,6 +192,7 @@ applying some process to that format, does not relax or nullify any sections
of this license as they pertain to the results of applying that process.
10.
a. A Derived Work may be distributed under a different license provided
that license itself honors the conditions listed in Clause 6 above, in
regard to the Work, though it does not have to honor the rest of the
@ -206,6 +211,7 @@ with the Work by any means.
complete compliance by all parties with all applicable laws.
NO WARRANTY
===========
There is no warranty for the Work. Except when otherwise stated in writing,
@ -228,6 +234,7 @@ or said author or said other party has been advised of the possibility of such
damages.
MAINTENANCE OF THE WORK
=======================
The Work has the status `author-maintained' if the Copyright Holder explicitly
@ -293,6 +300,7 @@ as Current Maintainer. You should also announce your new status to the same
pertinent community as in 2b) above.
WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
======================================================
This section contains important instructions, examples, and recommendations
@ -300,6 +308,7 @@ for authors who are considering distributing their works under this license.
These authors are addressed as `you' in this section.
Choosing This License or Another License
----------------------------------------
If for any part of your work you want or need to use *distribution* conditions
@ -317,6 +326,7 @@ discussion in `modguide.tex' may still be relevant, and authors intending to
distribute their works under any license are encouraged to read it.
A Recommendation on Modification Without Distribution
-----------------------------------------------------
It is wise never to modify a component of the Work, even for your own personal
@ -332,6 +342,7 @@ works provide ways to control the behavior of that work without altering any
of its licensed components.
How to Use This License
-----------------------
To use this license, place in each of the components of your work both an
@ -343,21 +354,37 @@ conditions in this license.
Here is an example of such a notice and statement:
%% pig.dtx
%% Copyright 2005 M. Y. Name
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is M. Y. Name.
%
% This work consists of the files pig.dtx and pig.ins
% and the derived file pig.sty.
Given such a notice and statement in a file, the conditions given in this
@ -374,6 +401,7 @@ that your Work remains useful to the community even when you can no longer
maintain and support it yourself.
Derived Works That Are Not Replacements
---------------------------------------
Several clauses of the LPPL specify means to provide reliability and stability
@ -384,6 +412,7 @@ lines of code are reused for a completely different task), then clauses 6b and
6d shall not apply.
Important Recommendations
-------------------------
Defining What Constitutes the Work

View File

@ -31,7 +31,7 @@ limitations:
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -226,6 +226,7 @@ Mozilla Public License Version 2.0
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
If it is impossible for You to comply with any of the terms of this License
with respect to some or all of the Covered Software due to statute, judicial
order, or regulation then You must: (a) comply with the terms of this License
@ -264,6 +265,7 @@ detailed for a recipient of ordinary skill to be able to understand it.
to termination shall survive termination.
6. Disclaimer of Warranty
Covered Software is provided under this License on an "as is" basis, without
warranty of any kind, either expressed, implied, or statutory, including,
without limitation, warranties that the Covered Software is free of defects,
@ -276,6 +278,7 @@ of any Covered Software is authorized under this License except under this
disclaimer.
7. Limitation of Liability
Under no circumstances and under no legal theory, whether tort (including
negligence), contract, or otherwise, shall any Contributor, or anyone who
distributes Covered Software as permitted above, be liable to You for any
@ -290,6 +293,7 @@ jurisdictions do not allow the exclusion or limitation of incidental or
consequential damages, so this exclusion and limitation may not apply to You.
8. Litigation
Any litigation relating to this License may be brought only in the courts of a
jurisdiction where the defendant maintains its principal place of business and
such litigation shall be governed by laws of that jurisdiction, without
@ -297,6 +301,7 @@ reference to its conflict-of-law provisions. Nothing in this Section shall
prevent a party's ability to bring cross-claims or counter-claims.
9. Miscellaneous
This License represents the complete agreement concerning the subject matter
hereof. If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it

View File

@ -30,11 +30,9 @@ limitations:
University of Illinois/NCSA Open Source License
Copyright (c) <<var;name=copyright;original= <Year> <Owner Organization
Name>;match=.+>>. All rights reserved.
Copyright (c) [year] [fullname]. All rights reserved.
Developed by: <<var;name=organization;original=<Name of Development Group>
<Name of Institution> <URL for Development Group/Institution>;match=.+>>
Developed by: [fullname] [project] [project_url]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -50,8 +48,7 @@ furnished to do so, subject to the following conditions:
notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of <<var;name=organizationClause3;original=<Name of
Development Group, Name of Institution>;match=.+>>, nor the names of its
* Neither the names of [fullname], [project], nor the names of its
contributors may be used to endorse or promote products derived from this
Software without specific prior written permission.

View File

@ -28,6 +28,7 @@ limitations:
zlib License
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the
use of this software.

View File

@ -2,7 +2,12 @@
# frozen_string_literal: true
require 'jekyll'
require 'open-uri'
require 'tmpdir'
tmp_dir = Dir.mktmpdir
git_cmd = "git clone --depth=1 'https://github.com/spdx/license-list-data.git' #{tmp_dir}"
system(git_cmd)
text_dir = File.join(tmp_dir, 'text')
site_path = File.expand_path('../', File.dirname(__FILE__))
config = Jekyll.configuration('source' => site_path)
@ -10,29 +15,49 @@ site = Jekyll::Site.new(config)
site.read
site.collections['licenses'].docs.each do |license|
puts "Updating the #{license.data['title']}..."
uri = "https://spdx.org/licenses/#{license.data['spdx-id']}.json"
data = JSON.parse open(uri).read
spdx_text = data['standardLicenseTemplate'].gsub(/ +\n/, "\n")
text_file = File.join(text_dir, "#{license.data['spdx-id']}.txt")
spdx_text = File.read(text_file)
license_key = license.data['spdx-id'].downcase
if ['bsd-2-clause', 'bsd-3-clause'].include? license_key
spdx_text = spdx_text.gsub(/<year>/, '[year]')
spdx_text = spdx_text.gsub(/<owner>/, '[fullname]')
elsif license_key == 'bsd-3-clause-clear'
spdx_text = spdx_text.gsub(/\[xxxx\]-\[xxxx\]/, '[year]')
spdx_text = spdx_text.gsub(/\[Owner Organization\]/, '[fullname]')
elsif license_key == 'isc'
spdx_text = spdx_text.gsub(/Copyright.*Consortium/m, 'Copyright (c) [year], [fullname]')
elsif license_key == 'mit'
spdx_text = spdx_text.gsub(/<year>/, '[year]')
spdx_text = spdx_text.gsub(/<copyright holders>/, '[fullname]')
elsif license_key == 'ncsa'
spdx_text = spdx_text.gsub(/<Year>/, '[year]')
spdx_text = spdx_text.gsub(/<Owner Organization Name>/, '[fullname]')
spdx_text = spdx_text.gsub(/<Name of Development Group>/, '[fullname]')
spdx_text = spdx_text.gsub(/<Name of Institution>/, '[project]')
spdx_text = spdx_text.gsub(%r{<URL for Development Group/Institution>}, '[project_url]')
spdx_text = spdx_text.gsub(/<Name of Development Group, Name of Institution>/, '[fullname], [project]')
end
license_text = ''
spdx_text.lines.each do |line|
if line.length <= 78
license_text += line
else
if line.length > 78
indented_line = line.match(/\A(\s*)(.*)/)
line_indent = indented_line[1]
line_text = indented_line[2]
text_width = 78 - line_indent.length
license_text += line_text.gsub(/(.{1,#{text_width}})(\s+|\Z)/, "#{line_indent}\\1\n")
line = line_text.gsub(/(.{1,#{text_width}})(\s+|\Z)/, "#{line_indent}\\1\n")
end
license_text += line
end
raw_content = File.read(license.path)
matches = raw_content.match Jekyll::Document::YAML_FRONT_MATTER_REGEXP
output = matches[1]
output << "---\n\n"
output << license_text
output << license_text.gsub(/\s+$/m, "\n")
File.write(license.path, output)
end