调用GPL/GPL v2协议的代码并不是都需要开源

起因

在我们项目安装过程中使用到了XDialog,用来显示的内容信息以及安装的百分比信息,甚至需要在页面上进行选择,最后会获取执行的结果,并根据获得的结果指导后面的流程;这些代码都是在shell脚本里面执行。
之前的小伙伴在调研的时候,已经调研清楚这个软件遵守的是GPLv2开源许可,将对于XDialog的调用当成是类似于动态链接库类型的调用。小伙伴咨询了公司知识产权部门的人,他们在接受到的信息中,认为就是当成动态链接库的调用,最后忍痛决定将对于XDialog的调用代码开源。
虽然,我也对这个具体的GPL v2协议不清楚,但是在我的记忆中,当成链接库使用,或者在原始代码上进行二次开发等才需要,但是具体我也记不清。但是总觉得获得上面的结论有点问题。

问题分析

为了真正了解GPL v2协议,我将其打印出来,对着网上的翻译一行行阅读。当我阅读到GPL部分的如下一段的声明时,发现果然可能小伙伴做的分析结果是错误的,下面是对于GPL协议相关部分的摘抄:

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

这部分翻译如下:

除复制、分发和修改外的行为超出了本协议的约束范围。执行程式的行为并不受限,程式的输出一般不在约束之内,除非其内容构成了本程式的派生作品(并非单纯地作为本程式的运行结果),判别取决于此程式的具体用途。

我的使用是将其当成一个独立程序来运行的,执行的这部分是不受这个GPL(GPLv2/GPLv3)协议管制的,也就是不需要将这部分的调用代码同样以对应的GPLv2公开
我的程序仅仅涉及到的是将其安装到我的系统中,属于复制、分发,我仅仅需要做的是将原始GPLv2协议拷贝过来就行。

扩展知识

在Linux系统上,复制文件cp和移动文件mv等命令都是遵守GPL v3协议,也是基于GPL协议的协议,我们经常对其也是作为独立程序运行,因此也不需要将调用他们的地方公开。上面对于XDialog的运用也是类似。

如果这个协议想要生效,需要添加的英文版的原文哈,中文版是没有法律效用的。


补充(2023年10月20日):
我看到有的小伙伴的留言,我先补充一些资料哈。
Linux 内核遵守的协议是:GPL-2.0 WITH Linux-syscall-note, 因为严格按照GPL的协议,你头文件调用了也是会传染要求遵守GPL的,这个明显偏移了内核作者的初始目标,所以加了一个note来提示这个事情:

SPDX-Exception-Identifier: Linux-syscall-note
SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
SPDX-Licenses: GPL-2.0, GPL-2.0+, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, LGPL-2.1+, GPL-2.0-only, GPL-2.0-or-later
Usage-Guide:
  This exception is used together with one of the above SPDX-Licenses
  to mark user space API (uapi) header files so they can be included
  into non GPL compliant user space application code.
  To use this exception add it with the keyword WITH to one of the
  identifiers in the SPDX-Licenses tag:
    SPDX-License-Identifier: <SPDX-License> WITH Linux-syscall-note
License-Text:

   NOTE! This copyright does *not* cover user programs that use kernel
 services by normal system calls - this is merely considered normal use
 of the kernel, and does *not* fall under the heading of "derived work".
 Also note that the GPL below is copyrighted by the Free Software
 Foundation, but the instance of code that it refers to (the Linux
 kernel) is copyrighted by me and others who actually wrote it.

 Also note that the only valid version of the GPL as far as the kernel
 is concerned is _this_ particular version of the license (ie v2, not
 v2.2 or v3.x or whatever), unless explicitly otherwise stated.

			Linus Torvalds

用户空间的头文件中调用是可以的,但是要加上上面提到的那些话。

对于mv、cp等程序,是另外的一种情况,它们属于coreutils包的程序。
查看方法是:

cp --help

看文档最后,写的项目地址,项目代码在Github上,可以看到它是遵守GPL v3协议的。

扩展阅读:

  1. GPLv2 许可证正经人话翻译 – 知乎.
  2. GNU General Public License, version 2 – Open Source Initiative.
  3. GNU General Public License, version 2 – GNU Operating System .
  4. GNU通用公共许可协议 第二版(官网推荐的中文翻译).
  5. Xdialog home page
  6. Xdialog documentation - License
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值