现今存在的开源协议很多,而经过Open Source Initiative组织通过批准的开源协议目前有58种(http://www.opensource.org/licenses/alphabetical)。我们在常见的开源协议如BSD , GPL , LGPL,MIT等都是OSI批准的协议。如果要开源自己的代码,最好也是选择这些被批准的开源协议。
这里我们来看四种最常用的开源协议及它们的适用范围,供那些准备开源或者使用开源产品的开发人员/厂家参考。
BSD 开源协议(original BSD license、FreeBSD license、Original BSD license)
BSD 开源协议是一个给于使用者很大自由的协议。基本上使用者可以"为所欲为",可以自由的使用,修改源代码,也可以将修改后的代码作为开源或者专有软件再发布。
但"为所欲为"的前提当你发布使用了BSD 协议的代码,或则以BSD 协议代码为基础做二次开发自己的产品时,需要满足三个条件:
如果再发布的产品中包含源代码,则在源代码中必须带有原来代码中的BSD 协议。
如果再发布的只是二进制类库/软件,则需要在类库/软件的文档和版权声明中包含原来代码中的BSD 协议。
不可以用开源代码的作者/机构名字和原来产品的名字做市场推广。
BSD 代码鼓励代码共享,但需要尊重代码作者的著作权。BSD 由于允许使用者修改和重新发布代码,也允许使用或在BSD 代码上开发商业软件发布和销售,因此是对商业集成很友好的协议。而很多的公司企业在选用开源产品的时候都首选BSD 协议,因为可以完全控制这些第三方的代码,在必要的时候可以修改或者二次开发。
Apache Licence 2.0(Apache License, Version 2.0、Apache License, Version 1.1、Apache License, Version 1.0)
Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD 类似,同样鼓励代码共享和尊重原作者的著作权,同样允许代码修改,再发布(作为开源或商业软件)。需要满足的条件也和BSD 类似:
需要给代码的用户一份Apache Licence
如果你修改了代码,需要再被修改的文件中说明。
在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。
Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。
GPL (GNU General Public License)
我们很熟悉的Linux就是采用了GPL 。GPL 协议和BSD , Apache Licence等鼓励代码重用的许可很不一样。GPL 的出发点是代码的开源/免费使用和引用/修改/衍生代码的开源/免费使用,但不允许修改后和衍生的代码做为闭源的商业软件发布和销售。这也就是为什么我们能用免费的各种linux,包括商业公司的linux和linux上各种各样的由个人,组织,以及商业软件公司开发的免费软件了。
GPL 协议的主要内容是只要在一个软件中使用("使用"指类库引用,修改后的代码或者衍生代码)GPL 协议的产品,则该软件产品必须也采用GPL 协议,既必须也是开源和免费。这就是所谓的"传染性"。GPL 协议的产品作为一个单独的产品使用没有任何问题,还可以享受免费的优势。
由于GPL 严格要求使用了GPL 类库的软件产品必须使用GPL 协议,对于使用GPL 协议的开源代码,商业软件或者对代码有保密要求的部门就不适合集成/采用作为类库和二次开发的基础。
其它细节如再发布的时候需要伴随GPL 协议等和BSD /Apache等类似。
LGPL(GNU Lesser General Public License)
LGPL是GPL 的一个为主要为类库使用设计的开源协议。和GPL 要求任何使用/修改/衍生之GPL 类库的的软件必须采用GPL 协议不同。LGPL允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。
但是如果修改LGPL协议的代码或者衍生,则所有修改的代码,涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议。因此LGPL协议的开源代码很适合作为第三方类库被商业软件引用,但不适合希望以LGPL协议代码为基础,通过修改和衍生的方式做二次开发的商业软件采用。
GPL /LGPL都保障原作者的知识产权,避免有人利用开源代码复制并开发类似的产品
MIT(MIT)
MIT是和BSD 一样宽范的许可协议,作者只想保留版权,而无任何其他了限制.也就是说,你必须在你的发行版里包含原许可协议的声明,无论你是以二进制发布的还是以源代码发布的.
First some general points. These points either directly relate to the following table or are necessary to understand the whole Open Source philosophy. So, in no particular order:
-
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library.
-
The “Proprietary Software linking” refers to linking or closed sourced applications/libraries with applications/libraries licensed under one of the following Open Source licenses.
-
By “the Work” in the “Distribution of 'the Work''” I mean a combination of a software with the library or application licensed under one of the following licenses
-
“Redistributing of the code with changes” refers to the act of redistributing a modified app /library based on the app/library licensed under the given license
License | Proprietary Software linking | Distribution of “the Work” | Redistributing of the code with changes | Compatible with GNU GPL |
---|---|---|---|---|
Not allowed (since the linked software is considered a whole) | Not allowed with software whose license is not GNU GPL compatible. | Only if the derivative is GNU GPL. | Yes | |
Allowed (since the software that links to the library is not considered a derivative work) | Allowed with some restrictions: You have to provide source code of the distributed LGPL library with (if any) modifications, changes to the LGPL library should be allowed to third parties and if BC your app/lib should still work with the modified LGPL lib/app. | Only if the derivative is GNU LGPL or GNU GPL. | Yes | |
Allowed (the requirements of Apple License apply only to the Covered Code) | Allowed. | Only under Apple Public license. | No | |
Allowed. | Allowed. | Allowed (as long as the name “Apache” isn't used in the name of the derivative work) | No | |
Allowed. | Allowed (as long as C or perl subroutines supplied by you and linked into the Covered Code are not considered a part of the Covered Code) | Allowed if one of the following is true: a) modifications are freely available, b) one uses the modified package only within corporation or organization, c) rename any non-standard executables, d) make other distribution arrangements with the Copyright Holder And the name of the Copyright Holder may not be used to promote derived products without his/hes written permission. | Yes [1] | |
Allowed. | Allowed. | Allowed. | Only the modified BSD license is compatible with GPL. The original BSD license is not compatible because it includes a weird advertising clause. [2] | |
License not clear on that, but do not mix Code Covered by this license with incompatible licenses. | Not clear, but again do not mix it with code licensed under an incompatible license. | Only under CPL or a compatible license. | No | |
Allowed | Allowed. Only the portions of “the Work” licensed under the Jabber license needs to stay licensed as such. | Can be under a different license as long as the source code is provided and a few License specific requirements are fulfilled. | No | |
Allowed. | Allowed. | Allowed. | Yes | |
Allowed. | Allowed. | Only under MPL. | No/Yes [3] | |
Allowed (?) | Allowed. | Allowed, assuming the package includes a list of changes to the original Python and copyright notices on all files. | Yes | |
Not allowed. | Only if it's Open Source. | Only in the form of patches to the original code. | No | |
Allowed | Allowed | Allowed | Yes | |
Allowed. | Allowed. | Only under Sun Public. | No | |
Allowed. | Allowed. | Allowed | Yes |