欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

如何在开源程序中添加开源许可证GPLv3.0

程序员文章站 2022-05-29 23:46:47
...

为自己的开源程序添加GPLv3.0,按照下面步骤只需要5分钟即可完成。

官网条款全文

条款全文网址:https://www.gnu.org/licenses/gpl-3.0.html

如何应用到开源程序中

  • 将下文拷贝保存到LICENSE文件中(或NOTICE,建议两个都有)。

下文为官网拷贝下来的内容,建议从官网拷贝。

 <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
  • 写入版权信息及开源程序作品简介

    第一段为程序的简介及程序版权信息,删除第一个“<>”及其中内容,写上自己的程序简介,替换copyright(c)后面“<>”中的内容,写上程序版权时间及作者(版权方),建议加上联系方式。

  • 加入源文件开头。

为了让第三方显而易见的了解该程序的License,建议在源文件的开头包含这段声明。 

<program>  Copyright (C) <year>  <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
  • 将LICENSE文件放入源代码库与源程序一起发布。

声明:本文仅代表个人观点,请自行斟酌使用。

相关标签: 开源