licenserec 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,352 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "licenserec/version"
4
+ require 'set'
5
+ require 'open3'
6
+ require 'csv'
7
+
8
+ module Licenserec
9
+ class TermsChoice
10
+ def initialize()
11
+ end
12
+
13
+ # 开源许可证条款要素名称、含义及要素值
14
+ def self.terms_meaning()
15
+ terms_meaning_hash = Hash.new
16
+ terms_meaning_hash.store("info","是指许可证名称及版本号、发布日期、许可证版权声明及许可证原文链接地址等信息。‘1’表示明确包含该条款,‘0’表示未提及。")
17
+ terms_meaning_hash.store("preamble","对许可证的适用场景或适用条件、条款接受说明、以及目的宗旨等进行说明,如GPL序言部分。‘1’表示明确包含该条款,‘0’表示未提及。")
18
+ terms_meaning_hash.store("define","对许可证条款中的特定术语进行说明,便于用户理解许可证内容。‘1’表示明确包含该条款,‘0’表示未提及。")
19
+ terms_meaning_hash.store("copyright","对许可证授予的版权范围进行说明。‘-1’表示放弃版权投入公共领域,‘1’表示明确授予版权,‘0’表示模糊授予版权。")
20
+ terms_meaning_hash.store("patent","对许可证授予的专利权范围进行说明。‘-1’表示不授予专利权,‘1’表示明确授予专利权,‘0’表示未提及。")
21
+ terms_meaning_hash.store("trademark","对许可证不授予商标权进行说明。‘1’表示明确不授予商标权,‘0’表示未提及。")
22
+ terms_meaning_hash.store("copyleft","一种授权条件,即衍生作品分发的再授权方式,其中“无限制”表示衍生作品可以使用其他许可证授权分发;“文件级弱限制”表示衍生作品可以使用其他许可证授权分发,只要确保衍生作品中该文件级弱限制许可证授权的文件及其修改仍然遵循该许可证,如MPL-2.0;“库级弱限制”表示衍生作品可以使用其他许可证授权分发,只要确保衍生作品中该库级弱限制许可证授权的库及其修改仍然遵循该许可证,如LGPL-2.1;“强限制”表示衍生作品的整体及其部分都必须按照该许可证授权分发。‘0’表示无限制,‘1’表示文件级弱限制,‘2’表示库级弱限制,‘3’表示强限制。")
23
+ terms_meaning_hash.store("interaction","一种授权条件,是指使用原创作品或衍生作品,通过网络向用户提供服务等行为,须按照该许可证公开源码的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
24
+ terms_meaning_hash.store("modification","一种授权条件,是指分发衍生作品,须添加修改声明(如修改者、修改时间、修改内容等)的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
25
+ terms_meaning_hash.store("retain_attr","一种授权条件,是指原创作品或衍生作品的分发,须保留原归属信息(如版权声明等)的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
26
+ terms_meaning_hash.store("enhance_attr","一种授权条件,是指原创作品或衍生作品的分发,除了要求保留归属外,还须以某种特定的形式声明软件的版权信息和作者的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
27
+ terms_meaning_hash.store("acceptance","一种授权条件,是指原创作品或衍生作品的分发,必须做出合理的努力,以获得接收人对该许可证条款的明确同意的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
28
+ terms_meaning_hash.store("patent_term","是指禁止任何人对该许可证授权的作品发起专利诉讼(否则终止其在该作品或该许可证下的专利授权)的要求。‘1’表示明确包含该条款,‘0’表示未提及。")
29
+ terms_meaning_hash.store("vio_term","是指许可证中可能包含的因违约而终止授权的条件或补救条件。‘1’表示明确包含该条款,‘0’表示未提及。")
30
+ terms_meaning_hash.store("disclaimer","对不提供担保进行澄清声明。‘1’表示明确包含该条款,‘0’表示未提及。")
31
+ terms_meaning_hash.store("law","对许可证对应的准据法进行说明,用于处理许可证的解释和争议问题。‘1’表示明确包含该条款,‘0’表示未提及。")
32
+ terms_meaning_hash.store("instruction","提供许可证应用模板及明确模板放置位置。‘1’表示包含使用说明,‘0’表示未提及。")
33
+ terms_meaning_hash.store("compatible_version","是对于后续可能发布的更多版本的兼容性进行说明,以便用户可以在后续版本下分发许可作品和衍生作品。逗号分隔的许可证SPDX字符串。")
34
+ terms_meaning_hash.store("secondary_license","是对于现有的其他开源许可证的兼容性进行说明,以便用户可以在次级许可证下分发许可作品和衍生作品。逗号分隔的许可证SPDX字符串。")
35
+ terms_meaning_hash.store("gpl_combine","GPL类许可证中关于能否与其他GPL许可证组合的说明。逗号分隔的许可证SPDX字符串。")
36
+ return terms_meaning_hash
37
+ end
38
+
39
+ # 开源许可证关键条款及说明
40
+ def self.important_terms_instruction()
41
+ important_terms_instruction_hash = Hash.new
42
+ important_terms_instruction_hash.store("开源许可证类型","宽松型开源许可证授权的作品允许其衍生作品,在满足原开源许可证
43
+ 要求的前提下,可以使用与原开源许可证不同的其他许可证(甚至商业许可
44
+ 证)进行再授权,如 MIT、Apache-2.0、MulanPSL-2.0 等;限制型开源许可
45
+ 证授权的作品要求其衍生作品须在其相同或兼容许可证下进行再授权,如
46
+ MPL-2.0、GPL-2.0、OSL-3.0。")
47
+ important_terms_instruction_hash.store("衍生作品分发限制性强弱","弱限制型许可证要求对作品修改后的重新分发必须按照获得该作品的
48
+ 许可证进行授权,但允许将代码与其他作品组合,组合作品整体可采用其他
49
+ 许可证授权,只要确保该弱限制型许可证授权的部分及其修改仍然遵循该许
50
+ 可证的约束,按照其约束范围可分为“文件级_弱限制型开源许可证”(如
51
+ MPL-2.0)和“库级_弱限制型开源许可证”(如 LGPL-2.1);“强限制型”
52
+ 许可证要求对作品的修改或组合后的分发都必须按照获得该作品的许可证进
53
+ 行开源,如 GPL-2.0、OSL-3.0 等。")
54
+ important_terms_instruction_hash.store("专利授权","开源软件中可能包含软件专利,软件的可专利性是开源软件正在面临
55
+ 的威胁之一。开源许可证可以通过专利授权条款明确提供免费的专利许可,
56
+ 也可能不提及专利许可(该场景主要出现在早期的开源许可证中,如 MIT、
57
+ GPL-2.0),或者明确排除免费专利许可(该场景较为少见,如 BSD-3-
58
+ Clause-clear)。明确的专利授权有利于保护开源软件的用户免受专利诉讼,
59
+ 尤其是面向一些拥有大量专利组合和其他专利组合风险的企业用户,他们普
60
+ 遍很重视专利权的授予。")
61
+ important_terms_instruction_hash.store("专利诉讼终止","“专利诉讼终止”是指禁止任何人就许可作品发起专利诉讼,否则将
62
+ 终止其获得的相关权利,例如 Apache-2.0 要求任何人不得对其授权的用户
63
+ 发起专利诉讼,否则其在该作品下通过 Apache-2.0 获得的专利授权将被终
64
+ 止。“反专利诉讼”的目的是阻止人们提起关于许可作品的专利诉讼,为用
65
+ 户提供保障。")
66
+ important_terms_instruction_hash.store("商标权限制","开源软件中可能包含商标,开源许可证可以明确对商标权的限制(即
67
+ 不授予商标权),或禁止借商标权人的名义进行广告或宣传(如 BSD-3-
68
+ Clause);开源许可证也可能不提及商标权(如 MIT、BSD-2-Clause),但原
69
+ 则上不涉及商标权许可,如需使用开源软件中出现的商标,应额外获得商标
70
+ 权人的许可。明确“不授予商标权”有利于保护许可方的合法权益,建议在
71
+ 开源许可证或其他声明通知中明确对商标权的限制,避免用户误用。")
72
+ important_terms_instruction_hash.store("网络部署","“网络部署公开源码”是使用这类许可作品进行网络部署(如通过网络
73
+ 与用户交互的方式提供在线服务等),即使许可作品的物理副本并未被分
74
+ 发,也须按照获得该作品的许可证授权其源代码,例如在云中使用
75
+ AGPL3.0 许可的衍生软件提供在线服务也须要发布其源代码。该条款主要
76
+ 用于避免云厂商使用开源代码盈利而不向开源社区提供贡献的场景。")
77
+ important_terms_instruction_hash.store("修改声明","“修改声明”是指要求用户分发衍生作品时伴随的声明通知,用以标
78
+ 记修改内容、日期、修改作者等信息。“修改说明”有利于增强开源软件贡
79
+ 献者的可见性和软件的可维护性,然而也可能导致被许可人无意违规。")
80
+ return important_terms_instruction_hash
81
+ end
82
+
83
+ # 查询某个开源许可证的某个条款要素的值。输入1为许可证的SPDX,输入2为条款要素名称。输出为要素值,其中--。
84
+ def self.license_term_lookup(one_license,one_term)
85
+ term_feature = -1
86
+ c_table = CSV.read("lib\\licenses_terms_63.csv",headers:true)
87
+ CSV.foreach("lib\\licenses_terms_63.csv") do |row|
88
+ if row[0] == one_license
89
+ no_row = $.
90
+ term_feature = c_table[no_row-2][one_term]
91
+ end
92
+ end
93
+ return term_feature
94
+ end
95
+
96
+ # 根据条款要素值,从推荐许可证列表中,筛选符合要求的许可证,输出更新的推荐许可证列表。输入1为条款要素名称,输入2为推荐许可证列表,输入3为条款要素值(String)。
97
+ def self.license_term_choice(one_term,recommended_licenses,term_option)
98
+ remove_licenses = []
99
+ recommended_licenses.each do |one_license|
100
+ term_feature = TermsChoice.license_term_lookup(one_license,one_term)
101
+ if term_feature != String(term_option)
102
+ remove_licenses.push(one_license)
103
+ end
104
+ end
105
+ recommended_licenses = recommended_licenses - remove_licenses
106
+ return recommended_licenses
107
+ end
108
+
109
+
110
+ # def self.license_terms_choice(questions_val,init_licenselist)
111
+ # c_table = CSV.table("lib\\licenses_terms_63.csv")
112
+ # licenses_spdx = c_table[:license]
113
+ # licenses_copyleft = c_table[:copyleft]
114
+ # licenses_copyright = c_table[:copyright]
115
+ # licenses_patent = c_table[:patent]
116
+ # licenses_patent_term = c_table[:patent_term]
117
+ # licenses_trademark = c_table[:trademark]
118
+ # licenses_interaction = c_table[:interaction]
119
+ # licenses_modification = c_table[:modification]
120
+ #
121
+ #
122
+ # # licenses_copyleft.each do |x|
123
+ # # puts "#{x}"
124
+ # # end
125
+ # # 初始化推荐列表
126
+ # licenselist_recommended = init_licenselist
127
+ # # 满足各个条款的列表的列表
128
+ # rr_license = []
129
+ # # 已选择的条款选项
130
+ # rr_question_var = []
131
+ #
132
+ # q2_show=1
133
+ # #Q1
134
+ # if questions_val[0] != ""
135
+ # # 满足该条款的许可证列表
136
+ # license_ok = []
137
+ # if questions_val[0] == '宽松型开源许可证'
138
+ # q2_show = 0
139
+ # licenses_copyleft.each_with_index do |x,i|
140
+ #
141
+ #
142
+ # if x.to_i == 0 && licenses_copyright[i].to_i != -1
143
+ # license_ok.push(licenses_spdx[i])
144
+ #
145
+ # end
146
+ # end
147
+ # elsif questions_val[0] == '限制型开源许可证'
148
+ # licenses_copyleft.each_with_index do |x,i|
149
+ # if x.to_i > 0
150
+ # license_ok.push(licenses_spdx[i])
151
+ # end
152
+ # end
153
+ # elsif questions_val[0] == '公共领域许可证'
154
+ # q2_show = 0
155
+ # licenses_copyright.each_with_index do |x,i|
156
+ # if x.to_i == -1
157
+ # license_ok.push(licenses_spdx[i])
158
+ # end
159
+ # end
160
+ # end
161
+ #
162
+ # rr_license.push(license_ok)
163
+ # rr_question_var.push(questions_val[0])
164
+ # else
165
+ # rr_license.push(init_licenselist)
166
+ # rr_question_var.push(questions_val[0])
167
+ # end
168
+ #
169
+ # #Q2
170
+ # if q2_show == 1 && questions_val[1] != ""
171
+ # # 满足该条款的许可证列表
172
+ # license_ok = []
173
+ # if questions_val[1] == '文件级__弱限制型开源许可证'
174
+ # licenses_copyleft.each_with_index do |x,i|
175
+ # if x.to_i == 1
176
+ # license_ok.push(licenses_spdx[i])
177
+ # end
178
+ # end
179
+ # elsif questions_val[1] == '库级__弱限制型开源许可证'
180
+ # licenses_copyleft.each_with_index do |x,i|
181
+ # if x.to_i == 2
182
+ # license_ok.push(licenses_spdx[i])
183
+ # end
184
+ # end
185
+ # else
186
+ # licenses_copyleft.each_with_index do |x,i|
187
+ # if x.to_i == 3
188
+ # license_ok.push(licenses_spdx[i])
189
+ # end
190
+ # end
191
+ # end
192
+ # rr_license.push(license_ok)
193
+ # rr_question_var.push(questions_val[1])
194
+ # else
195
+ # rr_license.push(init_licenselist)
196
+ # rr_question_var.push(questions_val[1])
197
+ #
198
+ # end
199
+ #
200
+ # #Q3
201
+ # if questions_val[2] != ""
202
+ # # 满足该条款的许可证列表
203
+ # license_ok = []
204
+ # if questions_val[2] == '不提及专利权'
205
+ # licenses_patent.each_with_index do |x,i|
206
+ # if x.to_i == 0
207
+ # license_ok.push(licenses_spdx[i])
208
+ # end
209
+ # end
210
+ # elsif questions_val[2] == '明确授予专利权'
211
+ # licenses_patent.each_with_index do |x,i|
212
+ # if x.to_i == 1
213
+ # license_ok.push(licenses_spdx[i])
214
+ # end
215
+ # end
216
+ # else
217
+ # licenses_patent.each_with_index do |x,i|
218
+ # if x.to_i == -1
219
+ # license_ok.push(licenses_spdx[i])
220
+ # end
221
+ # end
222
+ # end
223
+ # rr_license.push(license_ok)
224
+ # rr_question_var.push(questions_val[2])
225
+ # else
226
+ # rr_license.push(init_licenselist)
227
+ # rr_question_var.push(questions_val[2])
228
+ # end
229
+ #
230
+ # #Q4
231
+ # if questions_val[3] != ""
232
+ # # 满足该条款的许可证列表
233
+ # license_ok = []
234
+ # if questions_val[3] == '包含反专利诉讼条款'
235
+ # licenses_patent_term.each_with_index do |x,i|
236
+ # if x.to_i == 1
237
+ # license_ok.push(licenses_spdx[i])
238
+ # end
239
+ # end
240
+ # else
241
+ # licenses_patent_term.each_with_index do |x,i|
242
+ # if x.to_i == 0
243
+ # license_ok.push(licenses_spdx[i])
244
+ # end
245
+ # end
246
+ # end
247
+ # rr_license.push(license_ok)
248
+ # rr_question_var.push(questions_val[3])
249
+ # else
250
+ # rr_license.push(init_licenselist)
251
+ # rr_question_var.push(questions_val[3])
252
+ # end
253
+ #
254
+ # #Q5
255
+ # if questions_val[4] != ""
256
+ # # 满足该条款的许可证列表
257
+ # license_ok = []
258
+ # if questions_val[4] == '不提及商标权'
259
+ # licenses_trademark.each_with_index do |x,i|
260
+ #
261
+ # if x.to_i == 0
262
+ #
263
+ # license_ok.push(licenses_spdx[i])
264
+ # end
265
+ # end
266
+ # else
267
+ # licenses_trademark.each_with_index do |x,i|
268
+ # if x.to_i == 1
269
+ # license_ok.push(licenses_spdx[i])
270
+ # end
271
+ # end
272
+ # end
273
+ # rr_license.push(license_ok)
274
+ # rr_question_var.push(questions_val[4])
275
+ # else
276
+ # rr_license.push(init_licenselist)
277
+ # rr_question_var.push(questions_val[4])
278
+ #
279
+ # end
280
+ #
281
+ # #Q6
282
+ # if questions_val[5] != ""
283
+ # # 满足该条款的许可证列表
284
+ # license_ok = []
285
+ # if questions_val[5] == '网络部署公开源码'
286
+ # licenses_interaction.each_with_index do |x,i|
287
+ # if x.to_i == 1
288
+ # license_ok.push(licenses_spdx[i])
289
+ # end
290
+ # end
291
+ # else
292
+ # licenses_interaction.each_with_index do |x,i|
293
+ # if x.to_i == 0
294
+ # license_ok.push(licenses_spdx[i])
295
+ # end
296
+ # end
297
+ # end
298
+ #
299
+ # rr_license.push(license_ok)
300
+ # rr_question_var.push(questions_val[5])
301
+ # else
302
+ # rr_license.push(init_licenselist)
303
+ # rr_question_var.push(questions_val[5])
304
+ #
305
+ # end
306
+ #
307
+ # #Q7
308
+ # if questions_val[6] != ""
309
+ # # 满足该条款的许可证列表
310
+ # license_ok = []
311
+ # if questions_val[6] == '包含修改说明条款'
312
+ # licenses_modification.each_with_index do |x,i|
313
+ # if x.to_i == 1
314
+ # license_ok.push(licenses_spdx[i])
315
+ # end
316
+ # end
317
+ # else
318
+ # licenses_modification.each_with_index do |x,i|
319
+ # if x.to_i == 0
320
+ # license_ok.push(licenses_spdx[i])
321
+ # end
322
+ # end
323
+ # end
324
+ # rr_license.push(license_ok)
325
+ # rr_question_var.push(questions_val[6])
326
+ # else
327
+ # rr_license.push(init_licenselist)
328
+ # rr_question_var.push(questions_val[6])
329
+ # end
330
+ #
331
+ # terms_choice = []
332
+ #
333
+ # for i in 0..6
334
+ # licenselist_recommended=licenselist_recommended & rr_license[i]
335
+ # licenselist_recommended=licenselist_recommended.sort
336
+ # if rr_question_var[i] != ""
337
+ # terms_choice.push(rr_question_var[i])
338
+ # end
339
+ # end
340
+ #
341
+ #
342
+ # puts licenselist_recommended
343
+ # puts terms_choice
344
+ #
345
+ # return licenselist_recommended, terms_choice
346
+ # end
347
+ end
348
+ end
349
+
350
+ # Test
351
+ # Licenserec::TermsChoice.license_terms_choice(['宽松型开源许可证','','不提及专利权','不包含反专利诉讼条款','不提及商标权','不网络部署公开源码','不包含修改说明条款'],["NTP","CC0-1.0","Unlicense","WTFPL","0BSD","MIT-0","Fair","MIT","ISC","FSFAP","Imlib2"])
352
+ # puts Licenserec::TermsChoice.license_term_lookup("OSL-3.0","patent")
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "licenserec/version"
4
+
5
+
6
+ module Licenserec
7
+ class LicensetypeGuide
8
+ def initialize()
9
+ end
10
+
11
+ # 个人开源风格方面,选择开源许可证类型的观点
12
+ def self.os_style_guide()
13
+ os_style_hash = Hash.new
14
+ os_style_hash.store("支持持续共享","也称 copyleft的“自由”哲学理念,支持该理念的开发者不但
15
+ 开放源码,而且鼓励用户自由使用、自由复制、自由修改和自由分发,且在传播过程
16
+ 中一直要保持自由,要求用户对该软件进行修改、改进和再分发时,要严格接受自由
17
+ 的运行规则。限制型开源许可证允许用户自由地使用、复制、修改和分发软件,重新
18
+ 分发修改后的衍生软件通常须要在相同的开源许可证(或其兼容的开源许可证)下授权,
19
+ 可以确保软件的持续开源。")
20
+ os_style_hash.store("支持用户权利","支持该理念的开发者对于开放源码的传播具有更多的包容性,
21
+ 他们允许用户自由使用、自由复制、自由修改和自由分发,同时不限制他们分发的方
22
+ 式,用户拥有更多的自主权。宽松型开源许可证允许用户自由地使用、复制、修改和
23
+ 分发软件,且重新分发修改后的软件允许用户重新选择许可方式,甚至闭源。")
24
+ os_style_hash.store("投入公共领域","支持该理念的开发者不在乎他人如何使用其软件。将软件放
25
+ 置公共领域,意味着开发者放弃对软件的版权保护,公共领域许可证(如 Unlicense)可
26
+ 以用于声明放弃版权保护。")
27
+ return os_style_hash
28
+ end
29
+
30
+ # 开源商业模式方面,选择开源许可证类型的观点
31
+ def self.os_business_guide()
32
+ os_business_hash = Hash.new
33
+ os_business_hash.store("扩大用户基础","支持服务、开放核心等商业模式依赖于广泛
34
+ 的用户基础,宽松型开源许可证和限制型开源许可证的主要区别在于,宽松型开源许
35
+ 可证允许用户在自己的产品中集成开源代码,不必将代码开源,因此宽松型开源许可
36
+ 证对于商业用户比较友好。")
37
+ os_business_hash.store("减少同行竞争","软件的源代码始终是软件厂商的核心价值之
38
+ 一,分叉(Fork)虽然可以鼓励创新,但也会带来开发者的分裂出走以及潜在竞争,限
39
+ 制型开源许可证对于衍生软件的发布要求不同程度的开放自己的源代码,一定程度较
40
+ 少了竞争对手利用开源软件制作私有产品的机会,从而减少同行竞争。")
41
+ os_business_hash.store("控制产品发展","如何有效控制软件发展方向,对于开源厂商
42
+ 具有战略意义,限制型开源许可证可以减少代码分叉,且所有开发的内容都可以保留
43
+ 下来,有助于掌握软件开发的动向;开源厂商还可以通过参与开源软件的决策(如成
44
+ 为 PMC)或者签订额外协议(如 CLA)来获得对软件的足够控制。")
45
+ return os_business_hash
46
+ end
47
+
48
+ # 项目社区发展方面,选择开源许可证类型的观点
49
+ def self.os_community_guide()
50
+ os_community_hash = Hash.new
51
+ os_community_hash.store("用户","宽松型开源许可证
52
+ 对任何用户来说都没有压力,而开源许可证的互惠性越强,从衍生产品中生产专有产
53
+ 品就越困难,降低了对那些想要制作专有衍生软件的商业用户的吸引力。")
54
+ os_community_hash.store("贡献者","。限制型开源许可证使软件保持开放的特性,往往能产生更强的社会认同感,且对
55
+ 那些寻求如工作挑战、同行认可等高度内在动机的贡献者具有一定吸引力;宽松型开
56
+ 源许可证项目主要吸引的贡献者,不仅出于内在动机,还具有希望获得商业化潜在机
57
+ 会、声誉和地位等外在动机,较高的用户数量能使他们的技能得到更好的展示。")
58
+ os_community_hash.store("合作伙伴或竞争对手","。限制型开源许可证一定程度上为合作伙伴或竞争对手提供信
59
+ 用,即保证他们的努力不会被第三方直接闭源并商业化。")
60
+ return os_community_hash
61
+ end
62
+
63
+ # 常见的开源商业模式及特点
64
+ def self.business_model_feature()
65
+ business_model_hash = Hash.new()
66
+ business_model_hash.store("支持服务","通过围绕开源产品的培训、咨询或扩展开发等形式来提供辅助产品和增值服
67
+ 务。互补产品或服务的需求随着开源软件被更广泛地采用而增加。")
68
+ business_model_hash.store("双重授权","软件在两个独立的许可证下提供,通常一个版本在开源许可证下授权,开源
69
+ 版本通常具有 Copyleft 条款(GPL 风格)的,可以避免竞争对手从访问源码中
70
+ 获得搭便车的好处,另一个版本在商业许可证下授权,商业许可证允许软
71
+ 件与其他专有软件组合,因此那些不希望受 copyleft 条款约束的商业集成用户
72
+ 可以购买商业许可。该模式主要面向商业“嵌入式”客户。")
73
+ business_model_hash.store("业务源","软件使用两个具有时间延迟的不同许可证,源代码通常在设定的时间内(如 3
74
+ 年)必须付费才能使用,在这个时间段后,许可证自动更改为开源许可证。
75
+ 这种模式可以同时满足开源社区和开源商业用户的需求,然而开源许可证过
76
+ 于严格会损害社区的发展,过于宽松则会损害业务的发展,例如 MariaDB 在
77
+ BSL-1.1(with GPL-2.0+)要求衍生软件也遵循相同的条款(即首次公开发布
78
+ 特定版本的许可作品的四年后,使用 GPL-2.0+进行开源)。")
79
+ business_model_hash.store("开放核心","在开源许可下提供核心基础代码,在商业许可下提供专有代码,专有部分可
80
+ 能打包为与开源基础部分连接的单独模块或服务,也可能与开源基础部分一
81
+ 起作为付费版本分发。核心产品越有用,社区的潜在兴趣就越大;从终端用
82
+ 户的角度来看,开放核心会导致厂商锁定,在吸引和维护开发人员方面可能
83
+ 存在潜在消极影响;容易出现了一个相互竞争的分叉产品。")
84
+ business_model_hash.store("开放核心+混合许可","在开放核心模式基础上进行了改进,同一个代码库中包含了开源代码和专有
85
+ 代码,用户可以选择只使用开源代码,或者同时使用开源代码和专有代码。
86
+ 代码在同一个代码库,方便管理和开发,且方便用户升级到付费模式,不需
87
+ 要额外部署;且允许外部社区对专有代码进行改进,但需要遵循许可证约
88
+ 定,例如,CockroachDB 采用 CCL(free)+CCL(paid),允许用户查看和修改源
89
+ 码,但未经 Cockroach Labs 同意不能重用代码。")
90
+ business_model_hash.store("附加限制条件","软件在开源许可证的基础上附加其他限制条款,例如 Apache-2.0 with
91
+ Common Clause1.0,其中 Common Clause 主要禁止他人直接利用开源软件牟
92
+ 利,以促进自身业务需求。开源厂商依然需要选择一个基本的主许可证,附
93
+ 加的条款可能定义模糊,通常须要法院认定,例如 Common Clause 没有经过
94
+ OSI 认证,因此添加了 Common Clause 的软件不再是传统意义上的开源软
95
+ 件,只能说源码可用(source available)。")
96
+ business_model_hash.store("软件即服务","利用开源软件通过互联网提供服务,但是软件并没有分发给他们的用户。
97
+ SaaS 与开源没有直接关系,但它可以合并开源组件或直接使用开源软件。")
98
+ business_model_hash.store("广告或版税","企业可以通过广告合作、品牌授权、销售商业软件等方式创造利益,例如
99
+ Mozilla 公司通过与雅虎(Yahoo)合作,在 Firefox 火狐浏览器中使用雅虎成为
100
+ 默认搜索引擎获得收入等。")
101
+ return business_model_hash
102
+ end
103
+
104
+ end
105
+
106
+ end
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ module Licenserec
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: licenserec
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - osslab-pku
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Licenserec是一个用于开源许可证选择的ruby库,提供许可证兼容性查询、许可证兼容性检查、项目兼容许可证筛选、许可证条款特征查询、许可证条款特征对比、许可证类型选择观点、许可证关键条款解读等功能。
14
+ email:
15
+ - blesswoo@pku.edu.cn
16
+ executables:
17
+ - licenserec.rb
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".idea/.gitignore"
22
+ - ".idea/licenserec.iml"
23
+ - ".idea/misc.xml"
24
+ - ".idea/modules.xml"
25
+ - ".idea/vcs.xml"
26
+ - Gemfile
27
+ - Gemfile.lock
28
+ - README.md
29
+ - Rakefile
30
+ - bin/licenserec.rb
31
+ - exe/licenserec.rb
32
+ - lib/compatibility_63.csv
33
+ - lib/github_license_usage.csv
34
+ - lib/license_readability.csv
35
+ - lib/licensecompare.rb
36
+ - lib/licensecompatibility.rb
37
+ - lib/licenserec.rb
38
+ - lib/licenserec/version.rb
39
+ - lib/licenses_terms_63.csv
40
+ - lib/licensesort.rb
41
+ - lib/licensetermchoice.rb
42
+ - lib/licensetypeguide.rb
43
+ - licenserec-1.0.0.gem
44
+ - licenserec-1.0.1.gem
45
+ - sig/licenserec.rbs
46
+ homepage: https://rubygems.org/gems/licenserec
47
+ licenses: []
48
+ metadata:
49
+ homepage_uri: https://rubygems.org/gems/licenserec
50
+ source_code_uri: https://github.com/osslab-pku/licenserec
51
+ changelog_uri: https://github.com/osslab-pku/licenserec
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2.4.0
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubygems_version: 3.3.7
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: Licenserec是一个用于开源许可证选择的ruby库
71
+ test_files: []