Skip to content

✨ Add SPDX field to the license.db #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions share/licenses/license.db
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#GPLv2)
File: share/licenses/GPL-2
URL: https://www.r-project.org/Licenses/GPL-2
FOSS: yes
SPDX: GPL-2.0-only

Name: GNU General Public License
Abbrev: GPL
Expand All @@ -18,16 +19,18 @@ File: share/licenses/GPL-3
URL: https://www.r-project.org/Licenses/GPL-3
FOSS: yes
Extensible: yes
SPDX: GPL-3.0-only

Name: GNU Library General Public License
Abbrev: LGPL
Version: 2
SSS: LGPL-2
OSI: open
OSI: open (https://opensource.org/license/lgpl-2-0)
FSF: free
File: share/licenses/LGPL-2
URL: https://www.r-project.org/Licenses/LGPL-2
FOSS: yes
SPDX: LGPL-2.0-only

Name: GNU Lesser General Public License
Abbrev: LGPL
Expand All @@ -38,6 +41,7 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#LGPLv2.1)
File: share/licenses/LGPL-2.1
URL: https://www.r-project.org/Licenses/LGPL-2.1
FOSS: yes
SPDX: LGPL-2.1-only

Name: GNU Lesser General Public License
Abbrev: LGPL
Expand All @@ -49,6 +53,7 @@ File: share/licenses/LGPL-3
URL: https://www.r-project.org/Licenses/LGPL-3
FOSS: yes
Extensible: yes
SPDX: LGPL-3.0-only

Name: GNU Affero General Public License
Abbrev: AGPL
Expand All @@ -60,20 +65,23 @@ File: share/licenses/AGPL-3
URL: https://www.r-project.org/Licenses/AGPL-3
FOSS: yes
Extensible: yes
SPDX: AGPL-3.0-only

Name: Apache License
Version: 1.1
OSI: open but superseded (https://opensource.org/licenses/apachepl-1.1)
FSF: free (https://www.gnu.org/licenses/license-list.html#apache1.1)
URL: https://www.apache.org/LICENSE-1.1
FOSS: yes
SPDX: Apache-1.1

Name: Apache License
Version: 2.0
OSI: open (https://opensource.org/licenses/Apache-2.0)
FSF: free (https://www.gnu.org/licenses/license-list.html#apache2)
URL: https://www.apache.org/licenses/LICENSE-2.0
FOSS: yes
SPDX: Apache-2.0

Name: Artistic License
Version: 1.0
Expand All @@ -83,6 +91,7 @@ FSF: non_free (https://www.gnu.org/licenses/license-list.html#ArtisticLicense)
URL: https://www.r-project.org/Licenses/Artistic-1.0
FOSS: no
Restricts_use: no
SPDX: Artistic-1.0

Name: Artistic License
Version: 2.0
Expand All @@ -92,13 +101,15 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#ArtisticLicense2)
File: share/licenses/Artistic-2.0
URL: https://www.r-project.org/Licenses/Artistic-2.0
FOSS: yes
SPDX: Artistic-2.0

Name: CeCILL
Abbrev: CeCILL
Version: 2
FSF: free (https://www.gnu.org/licenses/license-list.html#CeCILL)
URL: https://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
FOSS: yes
SPDX: CECILL-2.0

Name: CeCILL
Abbrev: CeCILL
Expand All @@ -107,13 +118,15 @@ SSS: CECILL-2.1
OSI: open (https://opensource.org/license/cecill-2-1/)
URL: https://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
FOSS: yes
SPDX: CECILL-2.1

Name: FreeBSD License
Abbrev: FreeBSD
OSI: open (https://opensource.org/licenses/BSD-2-Clause)
FSF: free (https://www.gnu.org/licenses/license-list.html#FreeBSD)
URL: https://www.freebsd.org/copyright/freebsd-license.html
FOSS: yes
SPDX: BSD-2-Clause-FreeBSD

Name: MIT License
Abbrev: MIT
Expand All @@ -123,14 +136,16 @@ URL: https://opensource.org/licenses/mit-license.php
FOSS: yes
Extensible: yes
Note: this is a template, needs + file LICENSE
SPDX: MIT

Name: Modified BSD License
Abbrev: BSD
OSI: open (https://opensource.org/licenses/BSD-3-Clause)
FSF: free (https://www.gnu.org/licenses/license-list.html#ModifiedBSD)
URL: https://opensource.org/licenses/BSD-3-Clause
FOSS: yes
Note: do not use: use BSD_2_clause or BSD_3_clause instead
Note: do not use: use BSD_2_clause or BSD_3_clause instead
SPDX: BSD-3-Clause

Name: BSD 2-clause License
Abbrev: BSD_2_clause
Expand All @@ -141,6 +156,7 @@ URL: https://opensource.org/licenses/BSD-2-Clause
FOSS: yes
Extensible: yes
Note: this is a template, needs + file LICENSE
SPDX: BSD-2-Clause

Name: BSD 3-clause License
Abbrev: BSD_3_clause
Expand All @@ -151,6 +167,7 @@ URL: https://opensource.org/licenses/BSD-3-Clause
FOSS: yes
Extensible: yes
Note: this is a template, needs + file LICENSE
SPDX: BSD-3-Clause

Name: Mozilla Public License
Abbrev: MPL
Expand All @@ -159,6 +176,7 @@ OSI: open but superseded (https://opensource.org/licenses/mozilla1.0)
FSF: free
URL: http://website-archive.mozilla.org/www.mozilla.org/mpl/MPL/1.0/
FOSS: yes
SPDX: MPL-1.0

Name: Mozilla Public License
Abbrev: MPL
Expand All @@ -167,6 +185,7 @@ OSI: open but superseded (https://opensource.org/licenses/MPL-1.1)
FSF: free (https://www.gnu.org/licenses/license-list.html#MPL)
URL: https://www.mozilla.org/en-US/MPL/1.1/
FOSS: yes
SPDX: MPL-1.1

Name: Mozilla Public License
Abbrev: MPL
Expand All @@ -175,6 +194,7 @@ OSI: open (https://opensource.org/licenses/MPL-2.0)
FSF: free (https://www.gnu.org/licenses/license-list.html#MPL-2.0)
URL: https://www.mozilla.org/en-US/MPL/2.0/
FOSS: yes
SPDX: MPL-2.0

Name: Common Public License
Abbrev: CPL
Expand All @@ -183,6 +203,7 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#CommonPublicLicense10)
OSI: open but superseded (https://opensource.org/licenses/cpl1.0)
URL: https://www.eclipse.org/legal/cpl-v10.html
FOSS: yes
SPDX: CPL-1.0

Name: Eclipse Public License
Version: 1.0
Expand All @@ -191,13 +212,15 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#EPL)
OSI: open (https://opensource.org/licenses/EPL-1.0)
URL: https://www.eclipse.org/legal/epl-v10.html
FOSS: yes
SPDX: EPL-1.0

Name: Lucent Public License
Version: 1.02
FSF: free (https://www.gnu.org/licenses/license-list.html#lucent102)
OSI: open (https://opensource.org/licenses/LPL-1.02)
URL: https://opensource.org/licenses/lucent1.02.php
FOSS: yes
SPDX: LPL-1.02

Name: European Union Public License
Version: 1.1
Expand All @@ -206,6 +229,7 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#EUPL)
OSI: open but superseded (https://opensource.org/licenses/EUPL-1.1)
URL: https://joinup.ec.europa.eu/software/page/eupl
FOSS: yes
SPDX: EUPL-1.1

Name: European Union Public License
Version: 1.2
Expand All @@ -214,20 +238,23 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#EUPL)
OSI: open (https://opensource.org/licenses/EUPL-1.2)
URL: https://joinup.ec.europa.eu/software/page/eupl
FOSS: yes
SPDX: EUPL-1.2

Name: Creative Commons Attribution 4.0 International License
Abbrev: CC BY 4.0
FSF: free (https://www.gnu.org/licenses/license-list.html#ccby)
URL: https://creativecommons.org/licenses/by/4.0
FOSS: yes
Extensible: yes
SPDX: CC-BY-4.0

Name: Creative Commons Attribution-ShareAlike 4.0 International License
Abbrev: CC BY-SA 4.0
FSF: free (https://www.gnu.org/licenses/license-list.html#ccbysa)
URL: https://creativecommons.org/licenses/by-sa/4.0
FOSS: yes
Extensible: yes
SPDX: CC-BY-SA-4.0

Name: Creative Commons Attribution-NonCommercial 4.0 International License
Abbrev: CC BY-NC 4.0
Expand All @@ -236,6 +263,7 @@ URL: https://creativecommons.org/licenses/by-nc/4.0
FOSS: no
Extensible: yes
Restricts_use: yes
SPDX: CC-BY-NC-4.0

Name: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Abbrev: CC BY-NC-SA 4.0
Expand All @@ -244,6 +272,7 @@ URL: https://creativecommons.org/licenses/by-nc-sa/4.0
FOSS: no
Extensible: yes
Restricts_use: yes
SPDX: CC-BY-NC-SA-4.0

Name: Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International License
Abbrev: CC BY-NC-ND 4.0
Expand All @@ -252,19 +281,22 @@ URL: https://creativecommons.org/licenses/by-nc-nd/4.0
FOSS: no
Extensible: yes
Restricts_use: yes
SPDX: CC-BY-NC-ND-4.0

Name: CC0
FSF: free (https://www.gnu.org/licenses/license-list.html#CC0)
OSI: NA (https://opensource.org/faq#cc-zero)
URL: https://creativecommons.org/publicdomain/zero/1.0/legalcode
FOSS: yes
SPDX: CC0-1.0

Name: zlib License
Abbrev: Zlib
FSF: free (https://www.gnu.org/licenses/license-list.html#ZLib)
OSI: open (https://opensource.org/licenses/Zlib)
URL: http://www.gzip.org/zlib/zlib_license.html
FOSS: yes
SPDX: Zlib

Name: Boost Software License
Version: 1.0
Expand All @@ -273,6 +305,7 @@ FSF: free (https://www.gnu.org/licenses/license-list.html#boost)
OSI: open (https://opensource.org/licenses/BSL-1.0)
URL: http://www.boost.org/LICENSE_1_0.txt
FOSS: yes
SPDX: BSL-1.0

Name: ACM Software License Agreement
Version: 1998
Expand Down
17 changes: 14 additions & 3 deletions src/library/tools/R/license.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ function(x)
extensions = NULL,
pointers = NULL,
is_FOSS = NA,
restricts_use = NA)
restricts_use = NA,
spdx = "")
list(is_empty = is_empty,
is_canonical = is_canonical,
bad_components = bad_components,
Expand All @@ -478,7 +479,8 @@ function(x)
extensions = extensions,
pointers = pointers,
is_FOSS = is_FOSS,
restricts_use = restricts_use)
restricts_use = restricts_use,
spdx = spdx)


x <- trimws(x)
Expand All @@ -495,6 +497,7 @@ function(x)
is_verified <- FALSE
is_FOSS <- NA
restricts_use <- NA
spdx <- ""

## Try splitting into the individual components.
components <-
Expand Down Expand Up @@ -611,6 +614,13 @@ function(x)
stringsAsFactors = FALSE)
}

vapply(
expansions, FUN.VALUE = character(1),
FUN = function(z) {
paste(z[["SPDX"]], collapse = " OR ")
}
) |>
paste(collapse = " OR ") -> spdx
## Replace expansions by their labels from the license db.
## (As these are unique, we can always easily get the full
## expansions back.)
Expand Down Expand Up @@ -642,7 +652,8 @@ function(x)
extensions = extensions,
pointers = pointers,
is_FOSS = is_FOSS,
restricts_use = restricts_use)
restricts_use = restricts_use,
spdx = spdx)
}

.standardize_license_components <-
Expand Down