Skip to content
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

Add a lint check for SPDX licenses #3976

Merged
merged 1 commit into from Sep 3, 2019
Merged

Add a lint check for SPDX licenses #3976

merged 1 commit into from Sep 3, 2019

Conversation

AltGr
Copy link
Member

@AltGr AltGr commented Sep 2, 2019

and update the documentation.
Supersedes and closes #2224

AltGr added a commit to AltGr/opam-repository that referenced this pull request Sep 2, 2019
Ref. ocaml/opam#3976
This was done semi-manually. I didn't fix invalid licenses, just
normalised the ones that fit.
There are still some pearls like 'GPL-2.1', 'GPL-3 with OCaml linking exception',
or even 'BSD-3-clause with OCaml linking exception' !

Very crude list of sed expressions:

```
s/"GNU Lesser General Public License version 3"/"LGPL-3.0-only"/
s/"BSD3"/"BSD-3-Clause"/
s/"BSD-3"/"BSD-3-Clause"/
s/"BSD-2"/"BSD-2-Clause"/
s/"Apache 2.0"/"Apache-2.0"/
s/"BSD2"/"BSD-2-Clause"/
s/"GNU Lesser General Public License version 2.1"/"LGPL-2.1-only"/
s/"BSD-3-clause"/"BSD-3-Clause"/
s/"LGPL-2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"Apache License 2.0"/"Apache-2.0"/
s/"Apache v2"/"Apache-2.0"/
s/"LGPL-3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-3.0 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 3"/"GPL-3.0-only"/
s/"LGPL3"/"LGPL-3.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"BSD-2-clauses"/"BSD-2-Clause"/
s/"GPL-3"/"GPL-3.0-only"/
s/"LGPL-2.0 with OCaml linking exception"/"LGPL-2.0-only with OCaml-LGPL-linking-exception"/
s/"CC0"/"CC0-1.0+"/
s/"LGPL"/"LGPL-2.0-or-later"/
s/"FreeBSD"/"BSD-2-Clause-FreeBSD"/
s/"GPL 2"/"GPL-2.0-only"/
s/"LGPL3+"/"LGPL-3.0-or-later"/
s/"LGPL + linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3.0"/"GPL-3.0-only"/
s/"part BSD3, part LGPL 2.1"/"BSD-3-Clause" "LGPL-2.1-only"/
s/"LGPLv2.1-WITH-linking-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPLv3"/"GPL-3.0-only"/
s/"LGPL-3.0-only with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"Apache"/"Apache-1.0+"/
s/"BSD"/"BSD-3-Clause"/
s/"CeCILL"/"CeCILL-1.0+"/
s/"GPL"/"GPL-1.0-or-later"/
s/"MIT License"/"MIT"/
s/"Creative Commons Zero"/"CC0-1.0+"/
s/"LGPL-2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s%"MIT/X11"%"MIT" "X11"%
s/"GPL-2"/"GPL-2.0-only"/
s/"LGPL-2.1 with static linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License"/"GPL-1.0-or-later"/
s/"LGPL version 2.1"/"LGPL-2.1-only"/
s/"GPL2"/"GPL-2.0-only"/
s/"GPL 3"/"GPL-3.0-only"/
s/"LGPLv3 w/ linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s%"LGPLv3 w/ linking exception"%"LGPL-3.0-only with OCaml-LGPL-linking-exception"%
s%"gpl-v3"%"GPL-3.0-only"%
s/"BSD 2-Clause"/"BSD-2-Clause"/
s/"Apache2"/"Apache-2.0"/
s/"GNU Public License version 3"/"GPL-3.0-only"/
s/"Boost License Version 1.0"/"BSL-1.0"/
s/"GPLv2"/"GPL-2.0-only"/
s/"LGPL-2.1 with OCaml linking exception, BSD-3-clause, GPL-3.0"/"LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause" "GPL-3.0"/
s/"LGPLv2.1"/"LGPL-2.1-only"/
s/"LGPL with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL 2.1+"/"LGPL-2.1-or-later"/
s/"AGPL"/"AGPL-3.0-only" "MIT"/
s/"LGPL 2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 2"/"GPL-2.0-only"/
s/"GNU Library General Public License version 2.1"/"LGPL-2.1-only"/
s/"ISC license"/"ISC"/
s/"GPL3"/"GPL-3.0-only"/
s/"LGPL-2"/"LGPL-2.1-only"/
s/"BSD 3-Clause License"/"BSD-3-Clause"/
s/"LGPL + static linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"part ISC, part LGPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL 2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3"/"GPL-3.0-only"/
s/"LGPL v3"/"LGPL-3.0-only"/
s/"GPL  v3"/"GPL-3.0-only"/
s/"LGPL *v2"/"LGPL-2.1-only"/
s/"MPL2"/"MPL-2.0"/
s/"Artistic 2.0"/"Artistic-2.0"/
s/"BSD 3"/"BSD-3-Clause"/
s/"GNU Library General Public License version 2"/"LGPL-2.1-only"/
s/"gpl-3"/"GPL-3.0-only"/
s/"Apache Version 2.0"/"Apache-2.0"/
s/"part ISC, part LBPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL with linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/\(license:.*\) and /\1" "/
s/\(license:.*\) + /\1" "/
s/\(license: *\)"\(.*".*".*\)/\1["\2]/
s/"LGPLv2+"/"LGPL-2.0-or-later"/
s/"GPLv2+"/"GPL-2.0-or-later"/
s/"BSD 3-Clause"/"BSD-3-Clause"/
s/"GPLv2 or later"/"GPL-2.0-or-later"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"LGPL v2.1, or MPL v1.1"/["LGPL-2.1-only" "MPL-1.1"]/
s/"GPL-3 | BSD"/["GPL-3.0-only" "BSD-3-Clause"]/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-or-later"/
s/"GPL-v3"/"GPL-3.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-only"/
s/"gnuplot license"/"gnuplot"/
s/"Eclipse Public License v1.0"/"EPL-1.0"/
s/"GPL 2.0"/GPL-2.0-only/
s/"GPLv2 & BSD-2-clause"/["GPL-2.0-only" "BSD-2-Clause"]/
s/"Artistic License 2.0"/"Artistic-2.0"/
s/"BSD-3-Clause, or LGPLv2.1+"/["BSD-3-Clause" "LGPL-2.1-or-later"]/
s/"GPL-1+"/"GPL-1.0-or-later"/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2 or later"/"LGPL-2.0-or-later"/
s/"LGPL 2"/"LGPL-2.0-only"/
s/"Apache Software License version 2.0"/"Apache-2.0"/
s/"LGPL-v2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3+ with OCaml linking exception"/"LGPL-3.0-or-later with OCaml-LGPL-linking-exception"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"CeCILL-B v1"/"CeCILL-B"/
s/"CeCILL-B_V1"/"CeCILL-B"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"LGPL-3"/"LGPL-3.0-only"/
s/"GPL v2"/"GPL-2.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"GNU GPL v2"/"LGPL-2.0-only"/
s/"BSD 3-clause"/"BSD-3-Clause"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"GNU Library General Public License"/"LGPL-2.0-or-later"/
s/"GNU Lesser General Public License version 2 or later"/"LGPL-2.0-or-later"/
s/"part ISC, part L.PL-2.1 with OCaml linking ecxeption, part 3-clause BSD"/["ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"]/
s/"LGPL-2.1-with-OCaml-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"BSD (3-clause)"/"BSD-3-Clause"/
s/"ISC license"/"ISC"/
s/"Apache"/"Apache-1.0+"/
s/"LGPLv2+ with exceptions and GPLv2+"/["LGPL-2.0-or-later with exceptions" "GPL-2.0-or-later"]/
s/\(license:.*\)"LGPLv2+ /\1"LGPL-2.0-only /
s/"CeCILL-B v2"/"CeCILL-B-2.0"/
s/"LGPL-2.0 &\\n   LGPL-2.1 with OCaml linking exception &\\n   ISC"/["LGPL-2.0-only" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "ISC"]/
```
@rjbou rjbou added the PR: LGTM label Sep 2, 2019
and update the documentation.
Supersedes and closes ocaml#2224
AltGr added a commit to AltGr/opam-repository that referenced this pull request Sep 3, 2019
Ref. ocaml/opam#3976
This was done semi-manually. I didn't fix invalid licenses, just
normalised the ones that fit.
There are still some pearls like 'GPL-2.1', 'GPL-3 with OCaml linking exception',
or even 'BSD-3-clause with OCaml linking exception' !

Very crude list of sed expressions:

```
s/"GNU Lesser General Public License version 3"/"LGPL-3.0-only"/
s/"BSD3"/"BSD-3-Clause"/
s/"BSD-3"/"BSD-3-Clause"/
s/"BSD-2"/"BSD-2-Clause"/
s/"Apache 2.0"/"Apache-2.0"/
s/"BSD2"/"BSD-2-Clause"/
s/"GNU Lesser General Public License version 2.1"/"LGPL-2.1-only"/
s/"BSD-3-clause"/"BSD-3-Clause"/
s/"LGPL-2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"Apache License 2.0"/"Apache-2.0"/
s/"Apache v2"/"Apache-2.0"/
s/"LGPL-3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-3.0 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 3"/"GPL-3.0-only"/
s/"LGPL3"/"LGPL-3.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"BSD-2-clauses"/"BSD-2-Clause"/
s/"GPL-3"/"GPL-3.0-only"/
s/"LGPL-2.0 with OCaml linking exception"/"LGPL-2.0-only with OCaml-LGPL-linking-exception"/
s/"CC0"/"CC0-1.0+"/
s/"LGPL"/"LGPL-2.0-or-later"/
s/"FreeBSD"/"BSD-2-Clause-FreeBSD"/
s/"GPL 2"/"GPL-2.0-only"/
s/"LGPL3+"/"LGPL-3.0-or-later"/
s/"LGPL + linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3.0"/"GPL-3.0-only"/
s/"part BSD3, part LGPL 2.1"/"BSD-3-Clause" "LGPL-2.1-only"/
s/"LGPLv2.1-WITH-linking-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPLv3"/"GPL-3.0-only"/
s/"LGPL-3.0-only with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"Apache"/"Apache-1.0+"/
s/"BSD"/"BSD-3-Clause"/
s/"CeCILL"/"CeCILL-1.0+"/
s/"GPL"/"GPL-1.0-or-later"/
s/"MIT License"/"MIT"/
s/"Creative Commons Zero"/"CC0-1.0+"/
s/"LGPL-2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s%"MIT/X11"%"MIT" "X11"%
s/"GPL-2"/"GPL-2.0-only"/
s/"LGPL-2.1 with static linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License"/"GPL-1.0-or-later"/
s/"LGPL version 2.1"/"LGPL-2.1-only"/
s/"GPL2"/"GPL-2.0-only"/
s/"GPL 3"/"GPL-3.0-only"/
s/"LGPLv3 w/ linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s%"LGPLv3 w/ linking exception"%"LGPL-3.0-only with OCaml-LGPL-linking-exception"%
s%"gpl-v3"%"GPL-3.0-only"%
s/"BSD 2-Clause"/"BSD-2-Clause"/
s/"Apache2"/"Apache-2.0"/
s/"GNU Public License version 3"/"GPL-3.0-only"/
s/"Boost License Version 1.0"/"BSL-1.0"/
s/"GPLv2"/"GPL-2.0-only"/
s/"LGPL-2.1 with OCaml linking exception, BSD-3-clause, GPL-3.0"/"LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause" "GPL-3.0"/
s/"LGPLv2.1"/"LGPL-2.1-only"/
s/"LGPL with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL 2.1+"/"LGPL-2.1-or-later"/
s/"AGPL"/"AGPL-3.0-only" "MIT"/
s/"LGPL 2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 2"/"GPL-2.0-only"/
s/"GNU Library General Public License version 2.1"/"LGPL-2.1-only"/
s/"ISC license"/"ISC"/
s/"GPL3"/"GPL-3.0-only"/
s/"LGPL-2"/"LGPL-2.1-only"/
s/"BSD 3-Clause License"/"BSD-3-Clause"/
s/"LGPL + static linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"part ISC, part LGPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL 2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3"/"GPL-3.0-only"/
s/"LGPL v3"/"LGPL-3.0-only"/
s/"GPL  v3"/"GPL-3.0-only"/
s/"LGPL *v2"/"LGPL-2.1-only"/
s/"MPL2"/"MPL-2.0"/
s/"Artistic 2.0"/"Artistic-2.0"/
s/"BSD 3"/"BSD-3-Clause"/
s/"GNU Library General Public License version 2"/"LGPL-2.1-only"/
s/"gpl-3"/"GPL-3.0-only"/
s/"Apache Version 2.0"/"Apache-2.0"/
s/"part ISC, part LBPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL with linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/\(license:.*\) and /\1" "/
s/\(license:.*\) + /\1" "/
s/\(license: *\)"\(.*".*".*\)/\1["\2]/
s/"LGPLv2+"/"LGPL-2.0-or-later"/
s/"GPLv2+"/"GPL-2.0-or-later"/
s/"BSD 3-Clause"/"BSD-3-Clause"/
s/"GPLv2 or later"/"GPL-2.0-or-later"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"LGPL v2.1, or MPL v1.1"/["LGPL-2.1-only" "MPL-1.1"]/
s/"GPL-3 | BSD"/["GPL-3.0-only" "BSD-3-Clause"]/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-or-later"/
s/"GPL-v3"/"GPL-3.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-only"/
s/"gnuplot license"/"gnuplot"/
s/"Eclipse Public License v1.0"/"EPL-1.0"/
s/"GPL 2.0"/GPL-2.0-only/
s/"GPLv2 & BSD-2-clause"/["GPL-2.0-only" "BSD-2-Clause"]/
s/"Artistic License 2.0"/"Artistic-2.0"/
s/"BSD-3-Clause, or LGPLv2.1+"/["BSD-3-Clause" "LGPL-2.1-or-later"]/
s/"GPL-1+"/"GPL-1.0-or-later"/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2 or later"/"LGPL-2.0-or-later"/
s/"LGPL 2"/"LGPL-2.0-only"/
s/"Apache Software License version 2.0"/"Apache-2.0"/
s/"LGPL-v2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3+ with OCaml linking exception"/"LGPL-3.0-or-later with OCaml-LGPL-linking-exception"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"CeCILL-B v1"/"CeCILL-B"/
s/"CeCILL-B_V1"/"CeCILL-B"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"LGPL-3"/"LGPL-3.0-only"/
s/"GPL v2"/"GPL-2.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"GNU GPL v2"/"LGPL-2.0-only"/
s/"BSD 3-clause"/"BSD-3-Clause"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"GNU Library General Public License"/"LGPL-2.0-or-later"/
s/"GNU Lesser General Public License version 2 or later"/"LGPL-2.0-or-later"/
s/"part ISC, part L.PL-2.1 with OCaml linking ecxeption, part 3-clause BSD"/["ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"]/
s/"LGPL-2.1-with-OCaml-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"BSD (3-clause)"/"BSD-3-Clause"/
s/"ISC license"/"ISC"/
s/"Apache"/"Apache-1.0+"/
s/"LGPLv2+ with exceptions and GPLv2+"/["LGPL-2.0-or-later with exceptions" "GPL-2.0-or-later"]/
s/\(license:.*\)"LGPLv2+ /\1"LGPL-2.0-only /
s/"CeCILL-B v2"/"CeCILL-B-2.0"/
s/"LGPL-2.0 &\\n   LGPL-2.1 with OCaml linking exception &\\n   ISC"/["LGPL-2.0-only" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "ISC"]/
```
@dbuenzli
Copy link
Contributor

dbuenzli commented Sep 3, 2019

Is there a syntax that allows to silence the warning ?

@AltGr
Copy link
Member Author

AltGr commented Sep 3, 2019

Unfortunately no, I am not sure if we should add something for custom licenses ?
Lintian has a generic way of declaring "I know I have this warning and am OK about it", but well...

@AltGr AltGr merged commit 2d8746a into ocaml:master Sep 3, 2019
@AltGr
Copy link
Member Author

AltGr commented Sep 3, 2019

(merging now, but this can ofc still be amended)

@dbuenzli
Copy link
Contributor

dbuenzli commented Sep 3, 2019

Unfortunately no, I am not sure if we should add something for custom licenses ?

I mean those do exist in practice so it would be nice to be able to specify them without having opam constantly warn about them.

For example in odig I have a few fonts license that I'm not sure I'm able to recast as spdx licenses (have to check again) so at the moment this is what I have so that people are made aware and need to pay attention to the fact there's a bit more than just ISC in there.

andersfugmann pushed a commit to andersfugmann/opam-repository that referenced this pull request Sep 25, 2019
Ref. ocaml/opam#3976
This was done semi-manually. I didn't fix invalid licenses, just
normalised the ones that fit.
There are still some pearls like 'GPL-2.1', 'GPL-3 with OCaml linking exception',
or even 'BSD-3-clause with OCaml linking exception' !

Very crude list of sed expressions:

```
s/"GNU Lesser General Public License version 3"/"LGPL-3.0-only"/
s/"BSD3"/"BSD-3-Clause"/
s/"BSD-3"/"BSD-3-Clause"/
s/"BSD-2"/"BSD-2-Clause"/
s/"Apache 2.0"/"Apache-2.0"/
s/"BSD2"/"BSD-2-Clause"/
s/"GNU Lesser General Public License version 2.1"/"LGPL-2.1-only"/
s/"BSD-3-clause"/"BSD-3-Clause"/
s/"LGPL-2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"Apache License 2.0"/"Apache-2.0"/
s/"Apache v2"/"Apache-2.0"/
s/"LGPL-3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-3.0 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 3"/"GPL-3.0-only"/
s/"LGPL3"/"LGPL-3.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"BSD-2-clauses"/"BSD-2-Clause"/
s/"GPL-3"/"GPL-3.0-only"/
s/"LGPL-2.0 with OCaml linking exception"/"LGPL-2.0-only with OCaml-LGPL-linking-exception"/
s/"CC0"/"CC0-1.0+"/
s/"LGPL"/"LGPL-2.0-or-later"/
s/"FreeBSD"/"BSD-2-Clause-FreeBSD"/
s/"GPL 2"/"GPL-2.0-only"/
s/"LGPL3+"/"LGPL-3.0-or-later"/
s/"LGPL + linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3.0"/"GPL-3.0-only"/
s/"part BSD3, part LGPL 2.1"/"BSD-3-Clause" "LGPL-2.1-only"/
s/"LGPLv2.1-WITH-linking-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPLv3"/"GPL-3.0-only"/
s/"LGPL-3.0-only with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"Apache"/"Apache-1.0+"/
s/"BSD"/"BSD-3-Clause"/
s/"CeCILL"/"CeCILL-1.0+"/
s/"GPL"/"GPL-1.0-or-later"/
s/"MIT License"/"MIT"/
s/"Creative Commons Zero"/"CC0-1.0+"/
s/"LGPL-2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s%"MIT/X11"%"MIT" "X11"%
s/"GPL-2"/"GPL-2.0-only"/
s/"LGPL-2.1 with static linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License"/"GPL-1.0-or-later"/
s/"LGPL version 2.1"/"LGPL-2.1-only"/
s/"GPL2"/"GPL-2.0-only"/
s/"GPL 3"/"GPL-3.0-only"/
s/"LGPLv3 w/ linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s%"LGPLv3 w/ linking exception"%"LGPL-3.0-only with OCaml-LGPL-linking-exception"%
s%"gpl-v3"%"GPL-3.0-only"%
s/"BSD 2-Clause"/"BSD-2-Clause"/
s/"Apache2"/"Apache-2.0"/
s/"GNU Public License version 3"/"GPL-3.0-only"/
s/"Boost License Version 1.0"/"BSL-1.0"/
s/"GPLv2"/"GPL-2.0-only"/
s/"LGPL-2.1 with OCaml linking exception, BSD-3-clause, GPL-3.0"/"LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause" "GPL-3.0"/
s/"LGPLv2.1"/"LGPL-2.1-only"/
s/"LGPL with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL 2.1+"/"LGPL-2.1-or-later"/
s/"AGPL"/"AGPL-3.0-only" "MIT"/
s/"LGPL 2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 2"/"GPL-2.0-only"/
s/"GNU Library General Public License version 2.1"/"LGPL-2.1-only"/
s/"ISC license"/"ISC"/
s/"GPL3"/"GPL-3.0-only"/
s/"LGPL-2"/"LGPL-2.1-only"/
s/"BSD 3-Clause License"/"BSD-3-Clause"/
s/"LGPL + static linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"part ISC, part LGPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL 2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3"/"GPL-3.0-only"/
s/"LGPL v3"/"LGPL-3.0-only"/
s/"GPL  v3"/"GPL-3.0-only"/
s/"LGPL *v2"/"LGPL-2.1-only"/
s/"MPL2"/"MPL-2.0"/
s/"Artistic 2.0"/"Artistic-2.0"/
s/"BSD 3"/"BSD-3-Clause"/
s/"GNU Library General Public License version 2"/"LGPL-2.1-only"/
s/"gpl-3"/"GPL-3.0-only"/
s/"Apache Version 2.0"/"Apache-2.0"/
s/"part ISC, part LBPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL with linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/\(license:.*\) and /\1" "/
s/\(license:.*\) + /\1" "/
s/\(license: *\)"\(.*".*".*\)/\1["\2]/
s/"LGPLv2+"/"LGPL-2.0-or-later"/
s/"GPLv2+"/"GPL-2.0-or-later"/
s/"BSD 3-Clause"/"BSD-3-Clause"/
s/"GPLv2 or later"/"GPL-2.0-or-later"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"LGPL v2.1, or MPL v1.1"/["LGPL-2.1-only" "MPL-1.1"]/
s/"GPL-3 | BSD"/["GPL-3.0-only" "BSD-3-Clause"]/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-or-later"/
s/"GPL-v3"/"GPL-3.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-only"/
s/"gnuplot license"/"gnuplot"/
s/"Eclipse Public License v1.0"/"EPL-1.0"/
s/"GPL 2.0"/GPL-2.0-only/
s/"GPLv2 & BSD-2-clause"/["GPL-2.0-only" "BSD-2-Clause"]/
s/"Artistic License 2.0"/"Artistic-2.0"/
s/"BSD-3-Clause, or LGPLv2.1+"/["BSD-3-Clause" "LGPL-2.1-or-later"]/
s/"GPL-1+"/"GPL-1.0-or-later"/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2 or later"/"LGPL-2.0-or-later"/
s/"LGPL 2"/"LGPL-2.0-only"/
s/"Apache Software License version 2.0"/"Apache-2.0"/
s/"LGPL-v2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3+ with OCaml linking exception"/"LGPL-3.0-or-later with OCaml-LGPL-linking-exception"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"CeCILL-B v1"/"CeCILL-B"/
s/"CeCILL-B_V1"/"CeCILL-B"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"LGPL-3"/"LGPL-3.0-only"/
s/"GPL v2"/"GPL-2.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"GNU GPL v2"/"LGPL-2.0-only"/
s/"BSD 3-clause"/"BSD-3-Clause"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"GNU Library General Public License"/"LGPL-2.0-or-later"/
s/"GNU Lesser General Public License version 2 or later"/"LGPL-2.0-or-later"/
s/"part ISC, part L.PL-2.1 with OCaml linking ecxeption, part 3-clause BSD"/["ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"]/
s/"LGPL-2.1-with-OCaml-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"BSD (3-clause)"/"BSD-3-Clause"/
s/"ISC license"/"ISC"/
s/"Apache"/"Apache-1.0+"/
s/"LGPLv2+ with exceptions and GPLv2+"/["LGPL-2.0-or-later with exceptions" "GPL-2.0-or-later"]/
s/\(license:.*\)"LGPLv2+ /\1"LGPL-2.0-only /
s/"CeCILL-B v2"/"CeCILL-B-2.0"/
s/"LGPL-2.0 &\\n   LGPL-2.1 with OCaml linking exception &\\n   ISC"/["LGPL-2.0-only" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "ISC"]/
```
@rjbou rjbou removed the PR: LGTM label Oct 29, 2019
@rjbou rjbou added this to the 2.1.0 milestone Oct 29, 2019
andersfugmann pushed a commit to andersfugmann/opam-repository that referenced this pull request Oct 31, 2019
Ref. ocaml/opam#3976
This was done semi-manually. I didn't fix invalid licenses, just
normalised the ones that fit.
There are still some pearls like 'GPL-2.1', 'GPL-3 with OCaml linking exception',
or even 'BSD-3-clause with OCaml linking exception' !

Very crude list of sed expressions:

```
s/"GNU Lesser General Public License version 3"/"LGPL-3.0-only"/
s/"BSD3"/"BSD-3-Clause"/
s/"BSD-3"/"BSD-3-Clause"/
s/"BSD-2"/"BSD-2-Clause"/
s/"Apache 2.0"/"Apache-2.0"/
s/"BSD2"/"BSD-2-Clause"/
s/"GNU Lesser General Public License version 2.1"/"LGPL-2.1-only"/
s/"BSD-3-clause"/"BSD-3-Clause"/
s/"LGPL-2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"Apache License 2.0"/"Apache-2.0"/
s/"Apache v2"/"Apache-2.0"/
s/"LGPL-3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-3.0 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 3"/"GPL-3.0-only"/
s/"LGPL3"/"LGPL-3.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"BSD-2-clauses"/"BSD-2-Clause"/
s/"GPL-3"/"GPL-3.0-only"/
s/"LGPL-2.0 with OCaml linking exception"/"LGPL-2.0-only with OCaml-LGPL-linking-exception"/
s/"CC0"/"CC0-1.0+"/
s/"LGPL"/"LGPL-2.0-or-later"/
s/"FreeBSD"/"BSD-2-Clause-FreeBSD"/
s/"GPL 2"/"GPL-2.0-only"/
s/"LGPL3+"/"LGPL-3.0-or-later"/
s/"LGPL + linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3.0"/"GPL-3.0-only"/
s/"part BSD3, part LGPL 2.1"/"BSD-3-Clause" "LGPL-2.1-only"/
s/"LGPLv2.1-WITH-linking-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPLv3"/"GPL-3.0-only"/
s/"LGPL-3.0-only with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"Apache"/"Apache-1.0+"/
s/"BSD"/"BSD-3-Clause"/
s/"CeCILL"/"CeCILL-1.0+"/
s/"GPL"/"GPL-1.0-or-later"/
s/"MIT License"/"MIT"/
s/"Creative Commons Zero"/"CC0-1.0+"/
s/"LGPL-2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s%"MIT/X11"%"MIT" "X11"%
s/"GPL-2"/"GPL-2.0-only"/
s/"LGPL-2.1 with static linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License"/"GPL-1.0-or-later"/
s/"LGPL version 2.1"/"LGPL-2.1-only"/
s/"GPL2"/"GPL-2.0-only"/
s/"GPL 3"/"GPL-3.0-only"/
s/"LGPLv3 w/ linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s%"LGPLv3 w/ linking exception"%"LGPL-3.0-only with OCaml-LGPL-linking-exception"%
s%"gpl-v3"%"GPL-3.0-only"%
s/"BSD 2-Clause"/"BSD-2-Clause"/
s/"Apache2"/"Apache-2.0"/
s/"GNU Public License version 3"/"GPL-3.0-only"/
s/"Boost License Version 1.0"/"BSL-1.0"/
s/"GPLv2"/"GPL-2.0-only"/
s/"LGPL-2.1 with OCaml linking exception, BSD-3-clause, GPL-3.0"/"LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause" "GPL-3.0"/
s/"LGPLv2.1"/"LGPL-2.1-only"/
s/"LGPL with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL 2.1+"/"LGPL-2.1-or-later"/
s/"AGPL"/"AGPL-3.0-only" "MIT"/
s/"LGPL 2.1 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GNU General Public License version 2"/"GPL-2.0-only"/
s/"GNU Library General Public License version 2.1"/"LGPL-2.1-only"/
s/"ISC license"/"ISC"/
s/"GPL3"/"GPL-3.0-only"/
s/"LGPL-2"/"LGPL-2.1-only"/
s/"BSD 3-Clause License"/"BSD-3-Clause"/
s/"LGPL + static linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"LGPL-2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-2+ with OCaml linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/"part ISC, part LGPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL 2.1 with linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"GPL v3"/"GPL-3.0-only"/
s/"LGPL v3"/"LGPL-3.0-only"/
s/"GPL  v3"/"GPL-3.0-only"/
s/"LGPL *v2"/"LGPL-2.1-only"/
s/"MPL2"/"MPL-2.0"/
s/"Artistic 2.0"/"Artistic-2.0"/
s/"BSD 3"/"BSD-3-Clause"/
s/"GNU Library General Public License version 2"/"LGPL-2.1-only"/
s/"gpl-3"/"GPL-3.0-only"/
s/"Apache Version 2.0"/"Apache-2.0"/
s/"part ISC, part LBPL-2.1 with OCaml linking exception, part 3-clause BSD"/"ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"/
s/"LGPL with linking exception"/"LGPL-2.1-or-later with OCaml-LGPL-linking-exception"/
s/\(license:.*\) and /\1" "/
s/\(license:.*\) + /\1" "/
s/\(license: *\)"\(.*".*".*\)/\1["\2]/
s/"LGPLv2+"/"LGPL-2.0-or-later"/
s/"GPLv2+"/"GPL-2.0-or-later"/
s/"BSD 3-Clause"/"BSD-3-Clause"/
s/"GPLv2 or later"/"GPL-2.0-or-later"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"LGPL v2.1, or MPL v1.1"/["LGPL-2.1-only" "MPL-1.1"]/
s/"GPL-3 | BSD"/["GPL-3.0-only" "BSD-3-Clause"]/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-or-later"/
s/"GPL-v3"/"GPL-3.0-or-later"/
s/"LGPL 2.1"/"LGPL-2.1-only"/
s/"gnuplot license"/"gnuplot"/
s/"Eclipse Public License v1.0"/"EPL-1.0"/
s/"GPL 2.0"/GPL-2.0-only/
s/"GPLv2 & BSD-2-clause"/["GPL-2.0-only" "BSD-2-Clause"]/
s/"Artistic License 2.0"/"Artistic-2.0"/
s/"BSD-3-Clause, or LGPLv2.1+"/["BSD-3-Clause" "LGPL-2.1-or-later"]/
s/"GPL-1+"/"GPL-1.0-or-later"/
s/"GPL-2+"/"GPL-2.0-or-later"/
s/"LGPL 2 or later"/"LGPL-2.0-or-later"/
s/"LGPL 2"/"LGPL-2.0-only"/
s/"Apache Software License version 2.0"/"Apache-2.0"/
s/"LGPL-v2 with OCaml linking exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3 with OCaml linking exception"/"LGPL-3.0-only with OCaml-LGPL-linking-exception"/
s/"LGPL-\?v\?3+ with OCaml linking exception"/"LGPL-3.0-or-later with OCaml-LGPL-linking-exception"/
s/"GPL v2+"/"GPL-2.0-or-later"/
s/"CeCILL-B v1"/"CeCILL-B"/
s/"CeCILL-B_V1"/"CeCILL-B"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"LGPL-3"/"LGPL-3.0-only"/
s/"GPL v2"/"GPL-2.0-only"/
s/"GNU LGPL v3"/"LGPL-3.0-only"/
s/"GNU GPL v2"/"LGPL-2.0-only"/
s/"BSD 3-clause"/"BSD-3-Clause"/
s/"GPL-3+"/"GPL-3.0-or-later"/
s/"GNU Library General Public License"/"LGPL-2.0-or-later"/
s/"GNU Lesser General Public License version 2 or later"/"LGPL-2.0-or-later"/
s/"part ISC, part L.PL-2.1 with OCaml linking ecxeption, part 3-clause BSD"/["ISC" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "BSD-3-Clause"]/
s/"LGPL-2.1-with-OCaml-exception"/"LGPL-2.1-only with OCaml-LGPL-linking-exception"/
s/"BSD (3-clause)"/"BSD-3-Clause"/
s/"ISC license"/"ISC"/
s/"Apache"/"Apache-1.0+"/
s/"LGPLv2+ with exceptions and GPLv2+"/["LGPL-2.0-or-later with exceptions" "GPL-2.0-or-later"]/
s/\(license:.*\)"LGPLv2+ /\1"LGPL-2.0-only /
s/"CeCILL-B v2"/"CeCILL-B-2.0"/
s/"LGPL-2.0 &\\n   LGPL-2.1 with OCaml linking exception &\\n   ISC"/["LGPL-2.0-only" "LGPL-2.1-only with OCaml-LGPL-linking-exception" "ISC"]/
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants