Skip to content

Commit 96aaa77

Browse files
committed
LICENSES: add 'license-rules.txt'
Add a file to the LICENSES directory to describe how file licenses should be described in all the OpenOCD files, using the SPDX identifier, as well as where all licenses should be in the source tree for people to refer to (LICENSES/). This file is mainly copied from the Linux kernel file in Documentation/process/license-rules.rst originally written by Thomas Gleixner <[email protected]>, with specific adaptations for OpenOCD. Change-Id: I7a98fc756df90dc86dbc6e0c47c009a610a0318d Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: http://openocd.zylin.com/5973 Tested-by: jenkins Reviewed-by: Tim Newsome <[email protected]>
1 parent 5bf4640 commit 96aaa77

File tree

3 files changed

+225
-0
lines changed

3 files changed

+225
-0
lines changed

COPYING

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ later, according with:
77

88
LICENSES/preferred/GPL-2.0
99

10+
In addition, other licenses may also apply. Please see:
11+
12+
LICENSES/license-rules.txt
13+
14+
for more details.
15+
1016
All contributions to OpenOCD are subject to this COPYING file.

LICENSES/license-rules.txt

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later
2+
3+
OpenOCD licensing rules
4+
=======================
5+
6+
The OpenOCD source code is provided under the terms of the GNU General
7+
Public License version 2 or later (GPL-2.0-or-later), as provided in
8+
LICENSES/preferred/GPL-2.0.
9+
10+
The OpenOCD documentation is provided under the terms of the GNU Free
11+
Documentation License version 1.2 or later without Invariant Sections
12+
(GFDL-1.2-no-invariants-or-later).
13+
14+
Few stand-alone applications coexist in the same code tree of OpenOCD
15+
and are provided under the terms of the GNU General Public License
16+
version 3 (GPL-3.0), as provided in LICENSES/stand-alone/GPL-3.0.
17+
18+
This documentation file provides a description of how each source file
19+
should be annotated to make its license clear and unambiguous.
20+
It doesn't replace the OpenOCD's license.
21+
22+
The license described in the COPYING file applies to the OpenOCD source
23+
as a whole, though individual source files can have a different license
24+
which is required to be compatible with the GPL-2.0:
25+
26+
GPL-1.0-or-later : GNU General Public License v1.0 or later
27+
GPL-2.0-or-later : GNU General Public License v2.0 or later
28+
LGPL-2.0 : GNU Library General Public License v2 only
29+
LGPL-2.0-or-later : GNU Library General Public License v2 or later
30+
LGPL-2.1 : GNU Lesser General Public License v2.1 only
31+
LGPL-2.1-or-later : GNU Lesser General Public License v2.1 or later
32+
33+
Aside from that, individual files can be provided under a dual license,
34+
e.g. one of the compatible GPL variants and alternatively under a
35+
permissive license like BSD, MIT etc.
36+
37+
The common way of expressing the license of a source file is to add the
38+
matching boilerplate text into the top comment of the file. Due to
39+
formatting, typos etc. these "boilerplates" are hard to validate for
40+
tools which are used in the context of license compliance.
41+
42+
An alternative to boilerplate text is the use of Software Package Data
43+
Exchange (SPDX) license identifiers in each source file. SPDX license
44+
identifiers are machine parsable and precise shorthands for the license
45+
under which the content of the file is contributed. SPDX license
46+
identifiers are managed by the SPDX Workgroup at the Linux Foundation and
47+
have been agreed on by partners throughout the industry, tool vendors, and
48+
legal teams. For further information see https://spdx.org/
49+
50+
OpenOCD requires the precise SPDX identifier in all source files.
51+
The valid identifiers used in OpenOCD are explained in the section
52+
`License identifiers` and have been retrieved from the official SPDX
53+
license list at https://spdx.org/licenses/ along with the license texts.
54+
55+
License identifier syntax
56+
-------------------------
57+
58+
1. Placement:
59+
60+
The SPDX license identifier in OpenOCD files shall be added at the
61+
first possible line in a file which can contain a comment. For the
62+
majority of files this is the first line, except for scripts which
63+
require the '#!PATH_TO_INTERPRETER' in the first line. For those
64+
scripts the SPDX identifier goes into the second line.
65+
66+
2. Style:
67+
68+
The SPDX license identifier is added in form of a comment. The comment
69+
style depends on the file type::
70+
71+
C source: // SPDX-License-Identifier: <SPDX License Expression>
72+
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
73+
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
74+
makefiles: # SPDX-License-Identifier: <SPDX License Expression>
75+
scripts: # SPDX-License-Identifier: <SPDX License Expression>
76+
texinfo: @c SPDX-License-Identifier: <SPDX License Expression>
77+
text: # SPDX-License-Identifier: <SPDX License Expression>
78+
79+
If a specific tool cannot handle the standard comment style, then the
80+
appropriate comment mechanism which the tool accepts shall be used. This
81+
is the reason for having the "/\* \*/" style comment in C header
82+
files. There was build breakage observed with generated .lds files where
83+
'ld' failed to parse the C++ comment. This has been fixed by now, but
84+
there are still older assembler tools which cannot handle C++ style
85+
comments.
86+
87+
3. Syntax:
88+
89+
A <SPDX License Expression> is either an SPDX short form license
90+
identifier found on the SPDX License List, or the combination of two
91+
SPDX short form license identifiers separated by "WITH" when a license
92+
exception applies. When multiple licenses apply, an expression consists
93+
of keywords "AND", "OR" separating sub-expressions and surrounded by
94+
"(", ")" .
95+
96+
License identifiers for licenses like [L]GPL with the 'or later' option
97+
are constructed by using a "-or-later":
98+
99+
// SPDX-License-Identifier: GPL-2.0-or-later
100+
// SPDX-License-Identifier: LGPL-2.1-or-later
101+
102+
WITH should be used when there is a modifier to a license needed.
103+
Exceptions can only be used with particular License identifiers. The
104+
valid License identifiers are listed in the tags of the exception text
105+
file.
106+
107+
OR should be used if the file is dual licensed and only one license is
108+
to be selected. For example, some source files are available under dual
109+
licenses:
110+
111+
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-1-Clause
112+
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
113+
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
114+
115+
AND should be used if the file has multiple licenses whose terms all
116+
apply to use the file. For example, if code is inherited from another
117+
project and permission has been given to put it in OpenOCD, but the
118+
original license terms need to remain in effect::
119+
120+
// SPDX-License-Identifier: GPL-2.0-or-later AND MIT
121+
122+
License identifiers
123+
-------------------
124+
125+
The licenses currently used, as well as the licenses for code added to
126+
OpenOCD, can be broken down into:
127+
128+
1. `Preferred licenses`:
129+
130+
Whenever possible these licenses should be used as they are known to be
131+
fully compatible and widely used. These licenses are available from the
132+
directory:
133+
134+
LICENSES/preferred/
135+
136+
in the OpenOCD source tree.
137+
138+
The files in this directory contain the full license text and
139+
`Metatags`. The file names are identical to the SPDX license
140+
identifier which shall be used for the license in source files.
141+
142+
Examples:
143+
144+
LICENSES/preferred/GPL-2.0
145+
146+
Contains the GPL version 2 license text and the required metatags.
147+
148+
`Metatags`:
149+
150+
The following meta tags must be available in a license file:
151+
152+
- Valid-License-Identifier:
153+
154+
One or more lines which declare which License Identifiers are valid
155+
inside the project to reference this particular license text. Usually
156+
this is a single valid identifier, but e.g. for licenses with the 'or
157+
later' options two identifiers are valid.
158+
159+
- SPDX-URL:
160+
161+
The URL of the SPDX page which contains additional information related
162+
to the license.
163+
164+
- Usage-Guidance:
165+
166+
Freeform text for usage advice. The text must include correct examples
167+
for the SPDX license identifiers as they should be put into source
168+
files according to the `License identifier syntax` guidelines.
169+
170+
- License-Text:
171+
172+
All text after this tag is treated as the original license text
173+
174+
File format examples::
175+
176+
Valid-License-Identifier: GPL-2.0
177+
Valid-License-Identifier: GPL-2.0-only
178+
Valid-License-Identifier: GPL-2.0-or-later
179+
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
180+
Usage-Guide:
181+
To use this license in source code, put one of the following SPDX
182+
tag/value pairs into a comment according to the placement
183+
guidelines in the licensing rules documentation.
184+
For 'GNU General Public License (GPL) version 2 only' use:
185+
SPDX-License-Identifier: GPL-2.0
186+
or
187+
SPDX-License-Identifier: GPL-2.0-only
188+
For 'GNU General Public License (GPL) version 2 or any later version' use:
189+
SPDX-License-Identifier: GPL-2.0-or-later
190+
License-Text:
191+
Full license text
192+
193+
2. Stand-alone licenses:
194+
195+
These licenses should only be used for stand-alone applications that are
196+
distributed with OpenOCD but are not included in the OpenOCD binary.
197+
These licenses are available from the directory:
198+
199+
LICENSES/stand-alone/
200+
201+
in the OpenOCD source tree.
202+
203+
Examples:
204+
205+
SPDX-License-Identifier: GPL-3.0
206+
207+
The format and requirements of the license files in the other sub-directories
208+
of directory
209+
210+
LICENSES
211+
212+
have to follow the same format and requirements of the `Preferred licenses`.
213+
214+
All SPDX license identifiers and exceptions must have a corresponding file
215+
in the LICENSES subdirectories. This is required to allow tool
216+
verification (e.g. checkpatch.pl) and to have the licenses ready to read
217+
and extract right from the source, which is recommended by various FOSS
218+
organizations, e.g. the `FSFE REUSE initiative <https://reuse.software/>`.

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ EXTRA_DIST += \
5050
README.macOS \
5151
$(EXTRA_DIST_NEWS) \
5252
Doxyfile.in \
53+
LICENSES/license-rules.txt \
5354
LICENSES/preferred/BSD-1-Clause \
5455
LICENSES/preferred/BSD-2-Clause \
5556
LICENSES/preferred/BSD-3-Clause \

0 commit comments

Comments
 (0)