Fork me on GitHub

开源协议概谈[转载]

      最近博客园上对开源的讨论比较多,开源作为一种文化,和传统的专利一样,需要了解各种开源协议,正好看到一篇介绍开源协议的blog,转载如下:
原文地址  http://blog.gxsti.net/cs/blogs/hxtan/archive/2005/08/05/154.aspx     
      之前对开源协议没有什么清晰的概念,总以为开源就是免费甚至为所欲为。前些天花了一天时间,看了些关于开源协议的资料。

常用开源协议解析

看‘谈谈open source '有感!

常用开源协议讨论

sun 炮轰GPL开源协议

开源协议List

也详细查阅了一些关于 CPL1.0 的资料:
 Common Public License (CPL) Frequently asked quest
 Common Public License (CPL) Frequently asked questions
 Common Public License Version 1.0
  What open source license is OpenLaszlo available under?

算是对开源协议有了大概的了解。下面谈谈我对开源协议的一些粗浅的认识,如有不当之处,请大家指教。

      首先,要对几个概念有所了解:
(1)Contributors 和 Recipients
      Contributors 指的是对某个开源软件或项目提供了代码(包括最初的或者修改过的)发布的人或者实体(团队、公司、组织等),Contributors 按照参与某个软件开源的时间先后,可以分为 an initial Contributor 和 subsequent Contributors 。
      Recipients指的是开源软件或项目的获取者,显然,subsequent Contributors 也属于 Recipients之列。

(2)Source Code 和 Object Code

        Source Code 指的是各种语言写成的源代码,通过Source Code,结合文档, 可以了解到整个软件的体系结构及具体到某个功能函数的实现方法等。

        Object Code 指的是Source Code 经过编译之后,生成的类似于“类库”一样的,提供各种接口供他人使用的目标码,按我的理解,它就是像常见的DLL、AtiveX、OCX控件性质的东西。(不知道这样理解对不对

分清楚这两个概念的目的在于,有些开源,只发布Object Code ,当然,大多数发布的是Source Code。很多协议也对 “你发布的是哪种Code的时候应该怎样”,有着明确的约束。

(3)Derivative Module 和 Separate Module

       Derivative Module 指的是,依托或包含“最初的”或者“从别人处获取的”开源代码而产生的代码,是原“源代码”的增强(不等于增加)、改善和延续的模块,意为“衍生模块”。

         Separate Module 指的是,参考或借助原“源代码”,开发出的独立的,不包含、不依赖于原“源代码模块”,意为“独立的模块”。

理解这两个概念的目的在于,很多协议对涉及到商业发布的时候,会有哪些是衍生的,哪些是独立的,有着明确的商业发布规定。

      接下来,说说常见的几种协议吧。其实上面我给出的几篇文章的链接里面对一些常见的开源协议已经有比较清晰的描述了,我这里也只是加人了个人的一些理解,希望对接触得少的人有一定的帮助吧。

GPL(Gun General Public License) vesion 2.0  1991

      最常见的开源协议,使用它作为授权协议的有大名鼎鼎的 Linux 。GPL最显著的两个特点就是网上称为的“病毒性传播”和“不允许闭源的商业发布”。

      所谓的“病毒性传播”,指的是,GPL规定,所有从GPL协议授权的源码衍生出来的(即上面提到的Derivative Module),或者要跟GPL授权的源码混着用的Project,都要遵循GPL协议,就像病毒一样,粘上了关系,就“中毒”了。GPL这样规定的目的是,保证 在GPL协议保护下的产品,不会再受到其他协议或者授权的约束。即让跟GPL有关系的源码都能免费获取。举个例子,如果你的改进的Linux中使用了GPL授权下的开源模块(也必须使用,你不可能自己重新去做个内核吧,如果做出来了,你也没必要叫Linux了。),那么你整个Linux产品也必须遵循GPL协议去开源,不能以其他方式去开源发布,更不允许闭源发布。这样一来,就不会出现这样一个Linux--这个功能是GPL协议授权的,可以免费获取源码,而另外一个功能是其他协议下的,拿不到源码。这点规定对使用或者研究该产品的人来说,是一个极大的便利。

      而“不允许闭源商业发布”指的是,在GPL授权下,你的软件产品可以商业发布,拿去卖钱,但是在这同时,你也必须将该产品的源码以GPL协议方式开源发布出去,供他人免费获取。也许有人会迷惑,拿去卖,又同时开源,那谁来买阿?这个产品怎么赚钱呢??这就涉及到开源产品的商业模式的问题了,想了解相关一些信息的话,可以看看以上我给出链接的一些文章。至于后面,可能会写一篇关于开源项目的商业模式的随笔。

     GPL协议下的商业发布的一个关键点就像 Java 视线论坛的 Robbin所说的,GPL是针对软件源代码的版权,而不是针对软件编译后二进制版本的版权。你有权免费获得软件的源代码,但是你没有权力免费获得软件的二进制发行版本。GPL对软件发行版本唯一的限制就是:你的发行版本必须把完整的源代码一同提供

BSDBerkeley Software Distribution

     跟GPL有很大的不同,BSD协议是给予人很大的自由的一种开源协议。其最大的特点是,Recipients 几乎可以对源码“为所欲为”,可以自由地修改,自由地使用,修改后再以其他方式再发布(商业或者开源)。但,你做这些事情的时候,还是得遵循以下规则:

    1. 如果再发布的产品中包含原“源代码”,则在原“源代码”中必须带有原来代码中的BSD协议。 
    2. 如果再发布的只是二进制类库/软件(Object Code / Product),则需要在类库/软件的文档和版权声明中包含原来代码中的BSD协议。
    3. 不可以用开源代码的作者/机构名字和原来产品的名字做市场推广。

      其实这几个规则约定的目的也只是达到一个目的:是他人的东西,别人以BSD开源了,你就不能不做任何声明而占为己有,更不能用他人的名义来做商业推广。你只对你自己的东西拥有绝对控制权。

      举个例子,你用开源代码(A)修改或做其他增添之后,产生了产品B,这时候,你对B的控制由你自己决定,你可以用任何协议再开源,也可以闭源商业发布。但,因为如果B中包含了A或A的一部分(一点都不包含就不叫修改了),那你在B产品的版权声明中,必须有提到你有使用到 A ,并且附带上 A 的开源协议。而且不能做商业推广的时候 将 B 冠以 原开源作者的名义以促进商业推广。

      BSD代码鼓励代码共享,但需要尊重代码作者的著作权。BSD由于允许使用者修改和重新发布代码,也允许使用或在BSD代码上开发商业软件发布和销售,因此是对商业集成很友好的协议。而很多的公司企业在选用开源产品的时候都首选BSD协议,因为可以完全控制这些第三方的代码,在必要的时候可以修改或者二次开发。

Apache Licence  vesion 2.0

Apache Licence 是著名的非盈利开源组织 Apache 采用的协议。该协议和BSD类似,同样鼓励代码共享和尊重原作者的著作权,同样允许代码修改,再发布(作为开源或商业软件)。需要满足的条件也和BSD类似:(配备英文原文,方便更准确理解)
1. 需要给 Recipients 一份Apache Licence

      (You must give any other recipients of the Work or Derivative Works a copy of this License)
2. 如果你修改了代码,需要在被修改的文件中进行说明。

      (You must cause any modified files to carry prominent notices stating that You changed the files)
3. 在Derivative Module中(修改和包含源代码而衍生的代码)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。

       (You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works)
4. 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。

       (If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.)

Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。

LGPL
      LGPL是GPL的一个为主要为类库使用设计的开源协议。和GPL要求任何使用/修改/衍生之GPL类库的的软件必须采用GPL协议不同。LGPL允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。 

      但是如果修改LGPL协议的代码或者衍生,则所有修改的代码,涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议。因此LGPL协议的开源代码很适合作为第三方类库被商业软件引用,但不适合希望以LGPL协议代码为基础,通过修改和衍生的方式做二次开发的商业软件采用。

CPL(Common Public Liecense) vesion 1.0

      CPL 是 IBM 提出的并通过了OSI(Open Source Initiative)批准的开源协议。主要用于一些 IBM 或跟 IBM 相关的开源软件/项目中。如 很著名的Java开发环境 Eclipse 、RIA开发平台Open Laszlo等。

       CPL也是一项对商业应用友好的协议。它允许 Recipients 对源码进行任意的使用、复制、分发、传播、展示、修改以及改后做闭源的二次商业发布,这点跟 BSD 很类似,也属于自由度比较高的开源协议。但是,需要遵循:

       1.当一个Contributors  将源码的整体或部分再次开源发布的时候,必须继续遵循 CPL 开源协议来发布,而不能改用其他协议发布。除非你得到了原“源码”Owner  的 授权。

          (Does the CPL allow me to take the Source Code for a Program licensed under it and include all or part of it in another program licensed under the GNU General Public License (GPL), Berkeley Software Distribution (BSD) license or other Open Source license?
No. Only the owner of software can decide whether and how to license it to others. Contributors to a Program licensed under the CPL understand that source code for the Program will be made available under the terms of the CPL. Unless you are the owner of the software or have received permission from the owner, you are not authorized to apply the terms of another license to the Program by including it in a program licensed under another Open Source license. By the way, the same answer applies if you want to include source code licensed under another Open Source license in a program licensed under the CPL )

       2.CPL协议下,你可以将源码不做任何修改来商业发布。但如果你要将修改后的源码其开源,而且当你再发布的是Object Code 的时候,你必须声明 它的Source Code 是可以获取的,而且要告知获取方法

       ( Can I take a Program licensed under the CPL, compile it without modification, and commercially license the result?
Yes. You may compile a Program licensed under the CPL without modification and commercially license the result in accordance with the terms of the CPL. 

   Do I need to include the source code for such Program with the object code distribution?
No. But you do need to include a statement that the source code is available from you and information on how to obtain it.
 
What happens if I make a modification to the platform under the CPL but choose not to distribute it to anyone else?
Under the CPL, in this circumstance you do not need to make the source code available to others.
 
If I modify a Program licensed under the CPL and distribute the object code of the modified Program for free, must I make the source code available?
Yes. By distributing the modified Program, even if it is only a free version of the object code, you are obligated to make the source code to the modified Program available to others. )   
 
        3.当你需要将 CPL 下的源码作为一部分跟其他私有的源码混和着成为一个 Project 发布的时候,你可以将整个Project/Product 以私人的协议发布,但要声明哪一部分代码是CPL下的,而且声明那部分代码继续遵循CPL。
 
When I incorporate a portion of a Program licensed under the CPL into my own proprietary product distributed in object code form, can I use a single license for the full product, in other words, covering the portion of the Program plus my own code?
Yes. The object code for the product may be distributed under a single license as long as it references the CPL portion and complies, for that portion, with the terms of the CPL.
       4.独立的模块(Separate Module),不需要开源

If I write a module to add to a Program licensed under the CPL and distribute the object code of the module along with the rest of the Program, must I make the source code to my module available in accordance with the terms of the CPL?
No, as long as the module is not a derivative work of the Program.)

      综上所述,看见我对开源的协议的了解也只是达到一个初步的认识。特别是对 CPL 还有着一些困惑。另外我自己一直也觉得 Derivative Module 和 Separate Module 很难有个清晰的界限,在某种程度上总感觉他们有个模棱两可地段。但既然是有所心得,就先写下来吧。衷心欢迎大家指正、讨论。

posted @ 2005-09-30 20:31  张善友  阅读(2384)  评论(4编辑  收藏  举报