• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# License and Copyright Specifications
2
3## Purpose
4This document describes how code contributors, committers, and PMC members in the OpenHarmony community handle the license and copyright statements of repositories and source code files. It covers the following parts:
51. License file
62. NOTICE file
73. Copyright and license header
8
9## Scope
10This document applies only to the OpenHarmony community. It is not applicable to the scenario where the OpenHarmony project is used by individuals or enterprises to develop their products or the scenario where third-party open-source software is introduced. For details, see [Introducing Third-Party Open-Source Software](introducing-third-party-open-source-software.md).
11
12## Improvements and Revisions
131. This document is drafted and maintained by the OpenHarmony PMC. What you are reading now is the latest version of this document.
142. Any addition, modification, or deletion of the principles mentioned in this document are traced in the tracing system.
153. The PMC finalizes the principles after thorough discussion in the community.
16
17## License File
181. Each open-source repository must have a license file that is clearly documented and comply with the overall license principles in the OpenHarmony community. For example, a user-mode open-source repository uses Apache License 2.0, and a LiteOS kernel-mode open-source repository uses BSD 3-clause.
192. The license file of each open-source repository must be in plain text format and stored in the root directory of the code repository. The file must contain the full text of the license and be named **LICENSE**, without the file name extension .txt or .md.
203. If the source code of an open-source repository uses multiple licenses, describe the main license in the file named **LICENSE**. For other licenses, name them in the format of **LICENSE-*LicenseType*-*Remarks*** and place them in the root directory of the code repository or the root directory of the source code corresponding to the license. Describe the location and application scenarios of each license file in the main license.
214. The license file of each open-source software repository must cover all files in the repository. Ensure that the description of each license is accurate and concise, and do not contain unnecessary information such as licenses of source code that is not released in the repository. For example, the license of the dependent software to be downloaded separately should not be included in the repository and license.
225. If the open-source repository is released in binary mode, ensure that the license file is stored in a common location of the release format, for example, the top directory of the release folder or compressed package. For a .jar file, the license file can be stored in the **META-INF** directory.
23
24## NOTICE File
251. If the distributed binary files contain third-party open-source software, provide a file named **NOTICE**. Include the following information in plain text in this file: name, version, rights holder statements, and license information of every third-party open-source software.
262. The **NOTICE** file is usually stored in the top directory of the release folder or compressed package. For a .jar file, the license file can be stored in the **META-INF** directory.
27
28
29## Copyright and License Header
301. In principle, all files in the open-source repository must contain appropriate copyright and license header statements, except in the following scenarios:
31* Adding the copyright and license header statement affects the functions of the file. For example, JSON files do not support comments, and therefore you should not add the copyright and license header to a JSON file.
32* A file that is generated by the tool and contains the description indicating the automatic generation.
33* A brief description file for users to read. Adding the copyright and license header affects the readability of the file, for example, **README**.
34
352. The format of the copyright and license header is as follows:
36```
37Copyright (C) [Year of the first release]-[Year of the current release] [Copyright holder]
38
39The license header is subject to the specific license content. Example:
40
41Apache License Version 2.0 license header:
42Licensed under the Apache License, Version 2.0 (the "License");
43you may not use this file except in compliance with the License.
44You may obtain a copy of the License at
45
46   http://www.apache.org/licenses/LICENSE-2.0
47
48Unless required by applicable law or agreed to in writing, software
49distributed under the License is distributed on an "AS IS" BASIS,
50WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51See the License for the specific language governing permissions and
52limitations under the License.
53
54BSD 3-Clause license header:
55Redistribution and use in source and binary forms, with or without modification,
56are permitted provided that the following conditions are met:
57
581. Redistributions of source code must retain the above copyright notice, this list of
59   conditions and the following disclaimer.
60
612. Redistributions in binary form must reproduce the above copyright notice, this list
62   of conditions and the following disclaimer in the documentation and/or other materials
63   provided with the distribution.
64
653. Neither the name of the copyright holder nor the names of its contributors may be used
66   to endorse or promote products derived from this software without specific prior written
67   permission.
68
69THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
70"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
71THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
72PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
73CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
74EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
75PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
76OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
77WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
78OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
79ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
80```
813. The year in the copyright header indicates the year when the work is released. If this is the first release, enter [Year of the first release]. If this is not the first release, enter [Year of the first release]-[Year of the current release].
824. The copyright holder is a legal entity, which can be an individual or a company. If the copyright holder contributes code on behalf of a company, enter the legal entity of the company.
835. The license header information must be consistent with the license information of the open-source repository. If a file is a dual license, the license header must clearly describe the application conditions of each license and include the license header description defined by each license.
84