| @@ -1,300 +1,300 @@ | | | @@ -1,300 +1,300 @@ |
1 | # $NetBSD: license.mk,v 1.108 2021/03/06 04:36:21 ryoon Exp $ | | 1 | # $NetBSD: license.mk,v 1.109 2021/04/03 15:30:39 gdt Exp $ |
2 | # | | 2 | # |
3 | # This file handles everything about the LICENSE variable. It is | | 3 | # This file handles everything about the LICENSE variable. It is |
4 | # included automatically by bsd.pkg.mk. | | 4 | # included automatically by bsd.pkg.mk. |
5 | # | | 5 | # |
6 | # XXX There should be one place to set the default list and for users | | 6 | # XXX There should be one place to set the default list and for users |
7 | # to set the ACCEPTABLE_LICENSES list, used by both source builds and | | 7 | # to set the ACCEPTABLE_LICENSES list, used by both source builds and |
8 | # binary installs. | | 8 | # binary installs. |
9 | # | | 9 | # |
10 | # XXX: Some of this content arguably belongs in the pkgsrc guide | | 10 | # XXX: Some of this content arguably belongs in the pkgsrc guide |
11 | # instead. | | 11 | # instead. |
12 | # | | 12 | # |
13 | # User-settable variables: | | 13 | # User-settable variables: |
14 | # | | 14 | # |
15 | # ACCEPTABLE_LICENSES | | 15 | # ACCEPTABLE_LICENSES |
16 | # | | 16 | # |
17 | # If a package declares a license and that license is not a | | 17 | # If a package declares a license and that license is not a |
18 | # member of the list defined by this variable, pkgsrc will not | | 18 | # member of the list defined by this variable, pkgsrc will not |
19 | # build the package and instead print an error message. | | 19 | # build the package and instead print an error message. |
20 | # (pkg_install has code to behave the same way, but it is not | | 20 | # (pkg_install has code to behave the same way, but it is not |
21 | # yet turned on.) | | 21 | # yet turned on.) |
22 | # | | 22 | # |
23 | # To include the default licenses, you can use the += operator | | 23 | # To include the default licenses, you can use the += operator |
24 | # in mk.conf. To override it, use the plain = operator. | | 24 | # in mk.conf. To override it, use the plain = operator. |
25 | # | | 25 | # |
26 | # Default value: ${DEFAULT_ACCEPTABLE_LICENSES} | | 26 | # Default value: ${DEFAULT_ACCEPTABLE_LICENSES} |
27 | # | | 27 | # |
28 | # Package-settable variables: | | 28 | # Package-settable variables: |
29 | # | | 29 | # |
30 | # LICENSE | | 30 | # LICENSE |
31 | # | | 31 | # |
32 | # The license of the package. | | 32 | # The license of the package. |
33 | # | | 33 | # |
34 | # Dual licenses can be specified with OR expressions: | | 34 | # Dual licenses can be specified with OR expressions: |
35 | # LICENSE= license1 OR license2 | | 35 | # LICENSE= license1 OR license2 |
36 | # | | 36 | # |
37 | # If more than one license applies at the same time, AND expressions | | 37 | # If more than one license applies at the same time, AND expressions |
38 | # can be used: | | 38 | # can be used: |
39 | # LICENSE= license1 AND license2 | | 39 | # LICENSE= license1 AND license2 |
40 | # | | 40 | # |
41 | # Expressions can be nested if necessary: | | 41 | # Expressions can be nested if necessary: |
42 | # LICENSE= (license1 AND license2) OR license3 | | 42 | # LICENSE= (license1 AND license2) OR license3 |
43 | # Parenthesis are required when mixing AND and OR. | | 43 | # Parenthesis are required when mixing AND and OR. |
44 | # | | 44 | # |
45 | # Every package should specify its license. | | 45 | # Every package should specify its license. |
46 | # | | 46 | # |
47 | # Licenses are collected in the licenses/ subdirectory of | | 47 | # Licenses are collected in the licenses/ subdirectory of |
48 | # pkgsrc. For open source license, we generally use the same | | 48 | # pkgsrc. For open source license, we generally use the same |
49 | # names as either the Open Source Initiative or the Free | | 49 | # names as either the Open Source Initiative or the Free |
50 | # Software Foundation, choosing a name to reduce confusion. | | 50 | # Software Foundation, choosing a name to reduce confusion. |
51 | # Open source and free licenses do not have a -license suffix, | | 51 | # Open Source and Free licenses do not have a -license suffix, |
52 | # and non-free licenses do. | | 52 | # and non-Free licenses do. |
53 | # | | 53 | # |
54 | # http://opensource.org/licenses/category | | 54 | # http://opensource.org/licenses/category |
55 | # http://www.gnu.org/licenses/license-list.html | | 55 | # http://www.gnu.org/licenses/license-list.html |
56 | # | | 56 | # |
57 | # === Predefined variables === | | 57 | # === Predefined variables === |
58 | # | | 58 | # |
59 | # DEFAULT_ACCEPTABLE_LICENSES | | 59 | # DEFAULT_ACCEPTABLE_LICENSES |
60 | # The list of licenses that will be the default value of | | 60 | # The list of licenses that will be the default value of |
61 | # ACCEPTABLE_LICENSES. Adapting the longstanding policy of Open | | 61 | # ACCEPTABLE_LICENSES. Adapting the longstanding policy of Open |
62 | # Source or Free licenses not requiring tags, it should contain | | 62 | # Source or Free licenses not requiring tags, it should contain |
63 | # all licenses that are definitively Free or Open Source -- | | 63 | # all licenses that are definitively Free or Open Source -- |
64 | # except those specifically excluded by the TNF board -- so as | | 64 | # except those specifically excluded by the TNF board -- so as |
65 | # to provide the most expansive default that almost all people | | 65 | # to provide the most expansive default that almost all people |
66 | # find acceptable. (Many people will want to add more licenses | | 66 | # find acceptable. (Many people will want to add more licenses |
67 | # to ACCEPTABLE_LICENSES; the point is to have a default that | | 67 | # to ACCEPTABLE_LICENSES; the point is to have a default that |
68 | # very few people want to shrink.) | | 68 | # very few people want to shrink.) |
69 | # | | 69 | # |
70 | # Licenses approved by FSF as Free and by OSI as Open Source | | 70 | # Licenses approved by FSF as Free and by OSI as Open Source |
71 | # will be added by default, without annotation, as these | | 71 | # will be added by default, without annotation, as these |
72 | # organizations publish lists of approved licenses. | | 72 | # organizations publish lists of approved licenses. |
73 | # | | 73 | # |
74 | # Licenses approved by Debian as meeting the Debian Free | | 74 | # Licenses approved by Debian as meeting the Debian Free |
75 | # Software Guidelines will also be added by default. They | | 75 | # Software Guidelines will also be added by default. They |
76 | # should be in a second section with a comment about each one, | | 76 | # should be in a second section with a comment about each one, |
77 | # because Debian does not publish an accepted license list and | | 77 | # because Debian does not publish an approved license list and |
78 | # acceptability must be inferred from inclusion in main. | | 78 | # approval must be inferred from inclusion in main. |
79 | # | | 79 | # |
80 | # The board of The NetBSD Foundation is the final arbiter of | | 80 | # The board of The NetBSD Foundation is the final arbiter of |
81 | # which licenses may be in DEFAULT_ACCEPTABLE_LICENSES. As an | | 81 | # which licenses may be in DEFAULT_ACCEPTABLE_LICENSES. As an |
82 | # exception to the above policy on treating Free, Open Source, | | 82 | # exception to the above policy on treating Free, Open Source, |
83 | # and DFSG licenses as acceptable, the board has decided that | | 83 | # and DFSG licenses as acceptable, the board has decided that |
84 | # licenses that trigger obligations from use (rather than | | 84 | # licenses that trigger obligations from use (rather than |
85 | # redistribution), such as the Affero GPL, should not be in | | 85 | # redistribution), such as the Affero GPL, should not be in |
86 | # DEFAULT_ACCEPTABLE_LICENSES. | | 86 | # DEFAULT_ACCEPTABLE_LICENSES. |
87 | # | | 87 | # |
88 | # Licenses not formally approved as Free or Open Source may be | | 88 | # Licenses not formally approved as Free or Open Source may be |
89 | # added if they have terms that would 1) obviously be approved | | 89 | # added if they have terms that would 1) obviously be approved |
90 | # by FSF or OSI if the effort were made and 2) obviously not | | 90 | # by FSF or OSI if the effort were made and 2) obviously not |
91 | # trigger the above issue with AGPL-type licenses. Such license | | 91 | # trigger the above issue with AGPL-type licenses. Such license |
92 | # names will be in an additional section and have a comment near | | 92 | # names will be in an additional section and have a comment near |
93 | # them in the assignment to DEFAULT_ACCEPTABLE_LICENSES. | | 93 | # them in the assignment to DEFAULT_ACCEPTABLE_LICENSES. |
94 | # | | 94 | # |
95 | # The pkg_install sources also have a | | 95 | # The pkg_install sources also have a |
96 | # DEFAULT_ACCEPTABLE_LICENSES list, and that should be updated | | 96 | # DEFAULT_ACCEPTABLE_LICENSES list, and that should be updated |
97 | # to match the list here. See | | 97 | # to match the list here. See |
98 | # pkgsrc/pkgtools/pkg_install/files/lib/license.c | | 98 | # pkgsrc/pkgtools/pkg_install/files/lib/license.c |
99 | # | | 99 | # |
100 | # === See also === | | 100 | # === See also === |
101 | # | | 101 | # |
102 | # ../doc/TODO, section "Licenses of packages" | | 102 | # ../doc/TODO, section "Licenses of packages" |
103 | # | | 103 | # |
104 | # Keywords: licence license | | 104 | # Keywords: licence license |
105 | # | | 105 | # |
106 | | | 106 | |
107 | # The convention is that Free and Open Source licenses do not have a | | 107 | # The convention is that Free and Open Source licenses do not have a |
108 | # -license suffix, and non-Free licenses end in -license. Thus, | | 108 | # -license suffix, and non-Free licenses end in -license. Thus, |
109 | # license in DEFAULT_ACCEPTABLE_LICENSES should not end in -license. | | 109 | # license in DEFAULT_ACCEPTABLE_LICENSES should not end in -license. |
110 | # | | 110 | # |
111 | # First, we set DEFAULT_ACCEPTABLE_LICENSES to the set of licenses | | 111 | # First, we set DEFAULT_ACCEPTABLE_LICENSES to the set of licenses |
112 | # formally approved as Free Software by FSF or Open Source by OSI, | | 112 | # formally approved as Free Software by FSF or Open Source by OSI, |
113 | # except that we exclude the AGPL (clearly a Free license), following | | 113 | # except that we exclude the AGPL (clearly a Free license), following |
114 | # the decision of the board of TNF. | | 114 | # the decision of the board of TNF. |
115 | DEFAULT_ACCEPTABLE_LICENSES= \ | | 115 | DEFAULT_ACCEPTABLE_LICENSES= \ |
116 | afl-3.0 \ | | 116 | afl-3.0 \ |
117 | apache-1.1 apache-2.0 \ | | 117 | apache-1.1 apache-2.0 \ |
118 | arphic-public \ | | 118 | arphic-public \ |
119 | artistic artistic-2.0 \ | | 119 | artistic artistic-2.0 \ |
120 | boost-license \ | | 120 | boost-license \ |
121 | cc-by-sa-v3.0 \ | | 121 | cc-by-sa-v3.0 \ |
122 | cc-by-sa-v4.0 \ | | 122 | cc-by-sa-v4.0 \ |
123 | cc-by-v4.0 \ | | 123 | cc-by-v4.0 \ |
124 | cc0-1.0-universal \ | | 124 | cc0-1.0-universal \ |
125 | cddl-1.0 \ | | 125 | cddl-1.0 \ |
126 | cecill-2.1 \ | | 126 | cecill-2.1 \ |
127 | cecill-b-v1 \ | | 127 | cecill-b-v1 \ |
128 | cpl-1.0 \ | | 128 | cpl-1.0 \ |
129 | epl-v1.0 \ | | 129 | epl-v1.0 \ |
130 | eupl-v1.1 \ | | 130 | eupl-v1.1 \ |
131 | gfsl \ | | 131 | gfsl \ |
132 | gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 \ | | 132 | gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 \ |
133 | gnu-gpl-v1 \ | | 133 | gnu-gpl-v1 \ |
134 | gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 \ | | 134 | gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 \ |
135 | gnu-gpl-v3 gnu-lgpl-v3 \ | | 135 | gnu-gpl-v3 gnu-lgpl-v3 \ |
136 | hpnd \ | | 136 | hpnd \ |
137 | ipafont \ | | 137 | ipafont \ |
138 | ipl-1.0 \ | | 138 | ipl-1.0 \ |
139 | isc \ | | 139 | isc \ |
140 | lppl-1.0 lppl-1.2 lppl-1.3c \ | | 140 | lppl-1.0 lppl-1.2 lppl-1.3c \ |
141 | lucent \ | | 141 | lucent \ |
142 | miros \ | | 142 | miros \ |
143 | mit \ | | 143 | mit \ |
144 | mpl-1.0 mpl-1.1 mpl-2.0 \ | | 144 | mpl-1.0 mpl-1.1 mpl-2.0 \ |
145 | mplusfont \ | | 145 | mplusfont \ |
146 | ms-pl \ | | 146 | ms-pl \ |
147 | odbl-v1 \ | | 147 | odbl-v1 \ |
148 | ofl-v1.0 ofl-v1.1 \ | | 148 | ofl-v1.0 ofl-v1.1 \ |
149 | openssl \ | | 149 | openssl \ |
150 | original-bsd modified-bsd 2-clause-bsd 0-clause-bsd \ | | 150 | original-bsd modified-bsd 2-clause-bsd 0-clause-bsd \ |
151 | osl \ | | 151 | osl \ |
152 | paratype \ | | 152 | paratype \ |
153 | php \ | | 153 | php \ |
154 | png-license \ | | 154 | png-license \ |
155 | postgresql-license \ | | 155 | postgresql-license \ |
156 | public-domain \ | | 156 | public-domain \ |
157 | python-software-foundation \ | | 157 | python-software-foundation \ |
158 | qpl-v1.0 \ | | 158 | qpl-v1.0 \ |
159 | sgi-free-software-b-v2.0 \ | | 159 | sgi-free-software-b-v2.0 \ |
160 | sleepycat-public \ | | 160 | sleepycat-public \ |
161 | sissl-1.1 \ | | 161 | sissl-1.1 \ |
162 | unicode \ | | 162 | unicode \ |
163 | unlicense \ | | 163 | unlicense \ |
164 | w3c \ | | 164 | w3c \ |
165 | x11 \ | | 165 | x11 \ |
166 | zlib \ | | 166 | zlib \ |
167 | zpl-2.0 \ | | 167 | zpl-2.0 \ |
168 | zpl-2.1 \ | | 168 | zpl-2.1 \ |
169 | zsh | | 169 | zsh |
170 | | | 170 | |
171 | # The following licenses meet the DFSG (but are not formally approved | | 171 | # The following licenses meet the DFSG (but are not formally approved |
172 | # by FSF/OSI) as evidenced by inclusion in Debian main. | | 172 | # by FSF/OSI) as evidenced by inclusion in Debian main. |
173 | # | | 173 | # |
174 | # used in https://sources.debian.org/copyright/license/python-biopython/ | | 174 | # used in https://sources.debian.org/copyright/license/python-biopython/ |
175 | DEFAULT_ACCEPTABLE_LICENSES+= biopython | | 175 | DEFAULT_ACCEPTABLE_LICENSES+= biopython |
176 | # \todo reference to package | | 176 | # \todo reference to package |
177 | DEFAULT_ACCEPTABLE_LICENSES+= happy | | 177 | DEFAULT_ACCEPTABLE_LICENSES+= happy |
178 | # used in https://sources.debian.org/copyright/license/lsof/ | | 178 | # used in https://sources.debian.org/copyright/license/lsof/ |
179 | DEFAULT_ACCEPTABLE_LICENSES+= purdue | | 179 | DEFAULT_ACCEPTABLE_LICENSES+= purdue |
180 | | | 180 | |
181 | # The following licenses are included based on it being obvious they | | 181 | # The following licenses are included based on it being obvious they |
182 | # would be approved. | | 182 | # would be approved. |
183 | # | | 183 | # |
184 | # derived from BSD | | 184 | # derived from BSD |
185 | DEFAULT_ACCEPTABLE_LICENSES+= info-zip | | 185 | DEFAULT_ACCEPTABLE_LICENSES+= info-zip |
186 | # Derived from MIT, with an advertising clause added (and previously | | 186 | # Derived from MIT, with an advertising clause added (and previously |
187 | # included in Debian main as such). | | 187 | # included in Debian main as such). |
188 | DEFAULT_ACCEPTABLE_LICENSES+= enlightenment16 | | 188 | DEFAULT_ACCEPTABLE_LICENSES+= enlightenment16 |
189 | | | 189 | |
190 | # The following licenses do not currently meet our standards for | | 190 | # The following licenses do not currently meet our standards for |
191 | # inclusion. | | 191 | # inclusion. |
192 | | | 192 | |
193 | # mostly inline with Free Software principles and typefaces can not be | | 193 | # mostly inline with Free Software principles and typefaces can not be |
194 | # sold by itself. | | 194 | # sold by itself. |
195 | DEFAULT_ACCEPTABLE_LICENSES+= vera-ttf-license | | 195 | DEFAULT_ACCEPTABLE_LICENSES+= vera-ttf-license |
196 | | | 196 | |
197 | ##### Variant spellings | | 197 | ##### Variant spellings |
198 | | | 198 | |
199 | .if defined(ACCEPTABLE_LICENCES) && !defined(ACCEPTABLE_LICENSES) | | 199 | .if defined(ACCEPTABLE_LICENCES) && !defined(ACCEPTABLE_LICENSES) |
200 | ACCEPTABLE_LICENSES= ${ACCEPTABLE_LICENCES} | | 200 | ACCEPTABLE_LICENSES= ${ACCEPTABLE_LICENCES} |
201 | .endif | | 201 | .endif |
202 | | | 202 | |
203 | .if !defined(LICENSE) | | 203 | .if !defined(LICENSE) |
204 | . if ${PKG_DEVELOPER:Uno} != "no" | | 204 | . if ${PKG_DEVELOPER:Uno} != "no" |
205 | WARNINGS+= "[license.mk] Every package should define a LICENSE." | | 205 | WARNINGS+= "[license.mk] Every package should define a LICENSE." |
206 | . endif | | 206 | . endif |
207 | | | 207 | |
208 | .else | | 208 | .else |
209 | | | 209 | |
210 | .if defined(_ACCEPTABLE) | | 210 | .if defined(_ACCEPTABLE) |
211 | WARNINGS+= "Deprecated variable _ACCEPTABLE found, use SKIP_LICENSE_CHECK=yes" | | 211 | WARNINGS+= "Deprecated variable _ACCEPTABLE found, use SKIP_LICENSE_CHECK=yes" |
212 | SKIP_LICENSE_CHECK= yes | | 212 | SKIP_LICENSE_CHECK= yes |
213 | .endif | | 213 | .endif |
214 | | | 214 | |
215 | SKIP_LICENSE_CHECK?= no | | 215 | SKIP_LICENSE_CHECK?= no |
216 | | | 216 | |
217 | .if !empty(SKIP_LICENSE_CHECK:M[Yy][Ee][Ss]) | | 217 | .if !empty(SKIP_LICENSE_CHECK:M[Yy][Ee][Ss]) |
218 | _ACCEPTABLE_LICENSE= skipped | | 218 | _ACCEPTABLE_LICENSE= skipped |
219 | .else | | 219 | .else |
220 | _ACCEPTABLE_LICENSE!= \ | | 220 | _ACCEPTABLE_LICENSE!= \ |
221 | ${PKGSRC_SETENV} PKGSRC_ACCEPTABLE_LICENSES=${ACCEPTABLE_LICENSES:Q} \ | | 221 | ${PKGSRC_SETENV} PKGSRC_ACCEPTABLE_LICENSES=${ACCEPTABLE_LICENSES:Q} \ |
222 | PKGSRC_DEFAULT_ACCEPTABLE_LICENSES=${DEFAULT_ACCEPTABLE_LICENSES:Q} \ | | 222 | PKGSRC_DEFAULT_ACCEPTABLE_LICENSES=${DEFAULT_ACCEPTABLE_LICENSES:Q} \ |
223 | ${PKG_ADMIN} check-license ${LICENSE:Q} || echo failure | | 223 | ${PKG_ADMIN} check-license ${LICENSE:Q} || echo failure |
224 | .endif | | 224 | .endif |
225 | | | 225 | |
226 | .if ${_ACCEPTABLE_LICENSE} == "no" | | 226 | .if ${_ACCEPTABLE_LICENSE} == "no" |
227 | . if defined(MAKECONF) | | 227 | . if defined(MAKECONF) |
228 | _MAKE_CONF?= ${MAKECONF} | | 228 | _MAKE_CONF?= ${MAKECONF} |
229 | . elif ${OPSYS} == "NetBSD" && ${MAKE} == "/usr/bin/make" | | 229 | . elif ${OPSYS} == "NetBSD" && ${MAKE} == "/usr/bin/make" |
230 | _MAKE_CONF?= /etc/mk.conf | | 230 | _MAKE_CONF?= /etc/mk.conf |
231 | . else | | 231 | . else |
232 | _MAKE_CONF?= ${PREFIX}/etc/mk.conf | | 232 | _MAKE_CONF?= ${PREFIX}/etc/mk.conf |
233 | .endif | | 233 | .endif |
234 | . if ${OPSYS} == "NetBSD" && ${PKG_TOOLS_BIN} == "/usr/sbin" | | 234 | . if ${OPSYS} == "NetBSD" && ${PKG_TOOLS_BIN} == "/usr/sbin" |
235 | _PKG_INSTALL_CONF?= /etc/pkg_install.conf | | 235 | _PKG_INSTALL_CONF?= /etc/pkg_install.conf |
236 | . else | | 236 | . else |
237 | _PKG_INSTALL_CONF?= ${PREFIX}/etc/pkg_install.conf | | 237 | _PKG_INSTALL_CONF?= ${PREFIX}/etc/pkg_install.conf |
238 | .endif | | 238 | .endif |
239 | | | 239 | |
240 | . if empty(LICENSE:MAND) && empty(LICENSE:MOR) && empty(LICENSE:M*[()]*) | | 240 | . if empty(LICENSE:MAND) && empty(LICENSE:MOR) && empty(LICENSE:M*[()]*) |
241 | PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \ | | 241 | PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \ |
242 | " "${LICENSE:Q} \ | | 242 | " "${LICENSE:Q} \ |
243 | "You can mark the license \`\`${LICENSE}'' as acceptable by adding" \ | | 243 | "You can mark the license \`\`${LICENSE}'' as acceptable by adding" \ |
244 | " ACCEPTABLE_LICENSES+= ${LICENSE}" \ | | 244 | " ACCEPTABLE_LICENSES+= ${LICENSE}" \ |
245 | "to ${_MAKE_CONF} or by adding" \ | | 245 | "to ${_MAKE_CONF} or by adding" \ |
246 | " ACCEPTABLE_LICENSES= ${LICENSE}" \ | | 246 | " ACCEPTABLE_LICENSES= ${LICENSE}" \ |
247 | "to ${_PKG_INSTALL_CONF}." | | 247 | "to ${_PKG_INSTALL_CONF}." |
248 | PKG_FAIL_REASON+= "The following command will show you the license text:" \ | | 248 | PKG_FAIL_REASON+= "The following command will show you the license text:" \ |
249 | " ${MAKE} show-license" | | 249 | " ${MAKE} show-license" |
250 | . else | | 250 | . else |
251 | PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \ | | 251 | PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \ |
252 | " "${LICENSE:Q} \ | | 252 | " "${LICENSE:Q} \ |
253 | "" \ | | 253 | "" \ |
254 | "Check that you have accepted all necessary licenses." \ | | 254 | "Check that you have accepted all necessary licenses." \ |
255 | "You can mark a particular license \`\`foo'' as acceptable by adding" \ | | 255 | "You can mark a particular license \`\`foo'' as acceptable by adding" \ |
256 | " ACCEPTABLE_LICENSES+= foo" \ | | 256 | " ACCEPTABLE_LICENSES+= foo" \ |
257 | "to ${_MAKE_CONF} or by adding" \ | | 257 | "to ${_MAKE_CONF} or by adding" \ |
258 | " ACCEPTABLE_LICENSES= foo" \ | | 258 | " ACCEPTABLE_LICENSES= foo" \ |
259 | "to ${_PKG_INSTALL_CONF}." | | 259 | "to ${_PKG_INSTALL_CONF}." |
260 | . endif | | 260 | . endif |
261 | | | 261 | |
262 | .elif ${_ACCEPTABLE_LICENSE} == "failure" | | 262 | .elif ${_ACCEPTABLE_LICENSE} == "failure" |
263 | PKG_FAIL_REASON+= "License conditions for ${PKGNAME} could not be evaluated" | | 263 | PKG_FAIL_REASON+= "License conditions for ${PKGNAME} could not be evaluated" |
264 | .elif ${_ACCEPTABLE_LICENSE} == "outdated" | | 264 | .elif ${_ACCEPTABLE_LICENSE} == "outdated" |
265 | PKG_FAIL_REASON+= \ | | 265 | PKG_FAIL_REASON+= \ |
266 | "Your pkg_install is too old to evaluate license conditions" \ | | 266 | "Your pkg_install is too old to evaluate license conditions" \ |
267 | "You can bypass this check by setting SKIP_LICENSE_CHECK=yes" | | 267 | "You can bypass this check by setting SKIP_LICENSE_CHECK=yes" |
268 | .endif | | 268 | .endif |
269 | | | 269 | |
270 | .endif | | 270 | .endif |
271 | | | 271 | |
272 | # guess-license: | | 272 | # guess-license: |
273 | # Extracts the current package and tries to guess its license. | | 273 | # Extracts the current package and tries to guess its license. |
274 | # This is useful for package developers. | | 274 | # This is useful for package developers. |
275 | # | | 275 | # |
276 | # Keywords: license | | 276 | # Keywords: license |
277 | guess-license: .PHONY | | 277 | guess-license: .PHONY |
278 | @# Running "make extract" would fetch and build the dependencies | | 278 | @# Running "make extract" would fetch and build the dependencies |
279 | ${RUN} [ -d ${WRKSRC} ] \ | | 279 | ${RUN} [ -d ${WRKSRC} ] \ |
280 | || ALLOW_VULNERABLE_PACKAGES=yes ${MAKE} makedirs fetch pre-extract do-extract | | 280 | || ALLOW_VULNERABLE_PACKAGES=yes ${MAKE} makedirs fetch pre-extract do-extract |
281 | | | 281 | |
282 | ${RUN} \ | | 282 | ${RUN} \ |
283 | \ | | 283 | \ |
284 | type ninka > /dev/null 2>&1 || ${FAIL_MSG} "To guess the license, devel/ninka must be installed."; \ | | 284 | type ninka > /dev/null 2>&1 || ${FAIL_MSG} "To guess the license, devel/ninka must be installed."; \ |
285 | \ | | 285 | \ |
286 | ${PHASE_MSG} "Guessing licenses for ${PKGNAME}"; \ | | 286 | ${PHASE_MSG} "Guessing licenses for ${PKGNAME}"; \ |
287 | \ | | 287 | \ |
288 | : "Note that ninka can only handle one file at a time; therefore the slow loop below."; \ | | 288 | : "Note that ninka can only handle one file at a time; therefore the slow loop below."; \ |
289 | cd ${WRKDIR} \ | | 289 | cd ${WRKDIR} \ |
290 | && ${FIND} ./* -type f -print \ | | 290 | && ${FIND} ./* -type f -print \ |
291 | | while read fname; do ninka "$$fname"; done \ | | 291 | | while read fname; do ninka "$$fname"; done \ |
292 | | ${AWK} -F ';' '{ print $$2 }' \ | | 292 | | ${AWK} -F ';' '{ print $$2 }' \ |
293 | | LC_ALL=C ${SORT} | uniq -c | LC_ALL=C ${SORT} -nr \ | | 293 | | LC_ALL=C ${SORT} | uniq -c | LC_ALL=C ${SORT} -nr \ |
294 | | ${AWK} 'BEGIN { printf("%5s %s\n", "Files", "License") } { printf("%5d %s\n", $$1, $$2); }' | | 294 | | ${AWK} 'BEGIN { printf("%5s %s\n", "Files", "License") } { printf("%5d %s\n", $$1, $$2); }' |
295 | | | 295 | |
296 | _VARGROUPS+= license | | 296 | _VARGROUPS+= license |
297 | _USER_VARS.license= ACCEPTABLE_LICENSES SKIP_LICENSE_CHECK | | 297 | _USER_VARS.license= ACCEPTABLE_LICENSES SKIP_LICENSE_CHECK |
298 | _PKG_VARS.license= LICENSE | | 298 | _PKG_VARS.license= LICENSE |
299 | _SYS_VARS.license= DEFAULT_ACCEPTABLE_LICENSES | | 299 | _SYS_VARS.license= DEFAULT_ACCEPTABLE_LICENSES |
300 | _SORTED_VARS.license= *_LICENSES SKIP_* | | 300 | _SORTED_VARS.license= *_LICENSES SKIP_* |