Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / license.mk
blob0e1293e45b8207130bb22540fd4e285186bd757d
1 # $NetBSD: license.mk,v 1.57 2013/04/19 11:25:26 rodent Exp $
3 # This file handles everything about the LICENSE variable. It is
4 # included automatically by bsd.pkg.mk.
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
8 # binary installs#
10 # XXX: Some of this content arguably belongs in the pkgsrc guide
11 # instead.
13 # === User-settable variables ===
15 # ACCEPTABLE_LICENSES
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
19 # build the package and instead print an error message.
20 # (pkg_install has code to behave the same way, but it is not
21 # yet turned on.)
23 # XXX: Perhaps there should be some mechanism to prevent running
24 # programs that are part of packages that declare LICENSEs that
25 # are not in ACCEPTABLE_LICENSES or some per-user variable.
26 # This is surely controversial and requires discussion.
28 # To include the default licenses, you can use the += operator
29 # in mk.conf. To override it, use the plain = operator.
31 # Default value: ${DEFAULT_ACCEPTABLE_LICENSES}
33 # === Package-settable variables ===
35 # LICENSE
37 # The license of the package.
39 # Dual licenses can be specified with OR expressions:
40 # LICENSE= license1 OR license2
42 # If more than one license applies at the same time, AND expressions
43 # can be used:
44 # LICENSE= license1 AND license2
46 # Expressions can be nested if necessary:
47 # LICENSE= (license1 AND license2) OR license3
48 # Parenthesis are required when mixing AND and OR.
50 # Every package should specify its license. (Prior to early 2009,
51 # Open Source and Free software did not have license tags.)
53 # Licenses are collected in the licenses/ subdirectory of
54 # pkgsrc. For open source license, we generally use the same
55 # names as either the Open Source Initiative or the Free
56 # Software Foundation, choosing a name to reduce confusion.
57 # Open source and free licenses do not have a -license suffix,
58 # and non-free licenses do.
60 # http://opensource.org/licenses/category
61 # http://www.fsf.org/licensing/licenses/index_html
63 # === Predefined variables ===
65 # DEFAULT_ACCEPTABLE_LICENSES
66 # The list of licenses that will be the default value of
67 # ACCEPTABLE_LICENSES. Adapting the longstanding policy of Open
68 # Source or Free licenses not requiring tags, it should contain
69 # almost all licenses that are Open Source or Free, so as to provide
70 # the most expansive default that almost all people find
71 # acceptable. (Many people will want to add more licenses to
72 # ACCEPTABLE_LICENSES; the point is to have a default that very
73 # few people want to shrink.)
75 # As an exception to the Open Source or Free policy, the board
76 # of The NetBSD Foundation has decided that licenses that
77 # trigger obligations from use (rather than redistribution),
78 # such as the Affero GPL, should not be in
79 # DEFAULT_ACCEPTABLE_LICENSES.
81 # Licenses not formally approved as Free or Open Source may be
82 # added if they have terms that would obviously be approved if
83 # the effort were made. Such license names will have a comment
84 # near them in the assignment to DEFAULT_ACCEPTABLE_LICENSES.
86 # The pkg_install sources also have a
87 # DEFAULT_ACCEPTABLE_LICENSES list, and that should be updated
88 # to match the list here. See
89 # pkgsrc/pkgtools/pkg_install/files/lib/license.c
91 # === See also ===
93 # ../doc/TODO, section "Licenses of packages"
95 # Keywords: licence license
98 # This list is not complete. Free and Open Source licenses should be
99 # added to the list as they are added to pkgsrc.
101 # The convention is that Free or Open Source licenses do not have a
102 # -license suffix, and nonfree licenses end in -license.
104 DEFAULT_ACCEPTABLE_LICENSES= \
105 apache-1.1 apache-2.0 \
106 arphic-public \
107 artistic artistic-2.0 \
108 boost-license \
109 cc-by-sa-v3.0 \
110 cddl-1.0 \
111 cpl-1.0 \
112 epl-v1.0 \
113 gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 \
114 gnu-gpl-v1 \
115 gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 \
116 gnu-gpl-v3 gnu-lgpl-v3 \
117 ibm-public-license-1.0 \
118 ipafont \
119 isc \
120 lppl-1.3c \
121 lucent \
122 miros \
123 mit \
124 mpl-1.0 mpl-1.1 mpl-2.0 \
125 mplusfont \
126 ofl-v1.0 ofl-v1.1 \
127 original-bsd modified-bsd 2-clause-bsd \
128 php \
129 png-license \
130 postgresql-license \
131 public-domain \
132 python-software-foundation \
133 qpl-v1.0 \
134 sgi-free-software-b-v2.0 \
135 sleepycat-public \
136 unlicense \
137 x11 \
138 zlib \
141 # not approved by OSI, derived from BSD
142 DEFAULT_ACCEPTABLE_LICENSES+= info-zip
144 ##### Variant spellings
146 .if defined(ACCEPTABLE_LICENCES) && !defined(ACCEPTABLE_LICENSES)
147 ACCEPTABLE_LICENSES= ${ACCEPTABLE_LICENCES}
148 .endif
150 .if !defined(LICENSE)
151 . if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no"
152 WARNINGS+= "[license.mk] Every package should define a LICENSE."
153 . endif
155 .else
157 .if defined(_ACCEPTABLE)
158 WARNINGS+= "Deprecated variable _ACCEPTABLE found, use SKIP_LICENSE_CHECK=yes"
159 SKIP_LICENSE_CHECK= yes
160 .endif
162 SKIP_LICENSE_CHECK?= no
164 .if !empty(SKIP_LICENSE_CHECK:M[Yy][Ee][Ss])
165 _ACCEPTABLE_LICENSE= skipped
166 .else
167 _ACCEPTABLE_LICENSE!= \
168 if test `${PKG_ADMIN} -V` -lt 20090528; then \
169 echo outdated; \
170 else \
171 ${PKGSRC_SETENV} PKGSRC_ACCEPTABLE_LICENSES=${ACCEPTABLE_LICENSES:Q} \
172 PKGSRC_DEFAULT_ACCEPTABLE_LICENSES=${DEFAULT_ACCEPTABLE_LICENSES:Q} \
173 ${PKG_ADMIN} check-license ${LICENSE:Q} || echo failure; \
175 .endif
177 .if ${_ACCEPTABLE_LICENSE} == "no"
178 . if defined(MAKECONF)
179 _MAKE_CONF?= ${MAKECONF}
180 . elif ${OPSYS} == "NetBSD" && ${MAKE} == "/usr/bin/make"
181 _MAKE_CONF?= /etc/mk.conf
182 . else
183 _MAKE_CONF?= ${PREFIX}/etc/mk.conf
184 .endif
185 . if ${OPSYS} == "NetBSD" && ${PKG_TOOLS_BIN} == "/usr/sbin"
186 _PKG_INSTALL_CONF?= /etc/pkg_install.conf
187 . else
188 _PKG_INSTALL_CONF?= ${PREFIX}/etc/pkg_install.conf
189 .endif
191 . if empty(LICENSE:MAND) && empty(LICENSE:MOR) && empty(LICENSE:M*[()]*)
192 PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
193 " "${LICENSE:Q} \
194 "You can mark the license \`\`${LICENSE}'' as acceptable by adding" \
195 " ACCEPTABLE_LICENSES+= ${LICENSE}" \
196 "to ${_MAKE_CONF} or by adding" \
197 " ACCEPTABLE_LICENSES= ${LICENSE}" \
198 "to ${_PKG_INSTALL_CONF}."
199 PKG_FAIL_REASON+= "The following command will show you the license text:" \
200 " ${MAKE} show-license"
201 . else
202 PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
203 " "${LICENSE:Q} \
204 "" \
205 "Check that you have accepted all necessary licenses." \
206 "You can mark a particular license \`\`foo'' as acceptable by adding" \
207 " ACCEPTABLE_LICENSES+= foo" \
208 "to ${_MAKE_CONF} or by adding" \
209 " ACCEPTABLE_LICENSES= foo" \
210 "to ${_PKG_INSTALL_CONF}."
211 . endif
213 .elif ${_ACCEPTABLE_LICENSE} == "failure"
214 PKG_FAIL_REASON+= "License conditions for ${PKGNAME} could not be evaluated"
215 .elif ${_ACCEPTABLE_LICENSE} == "outdated"
216 PKG_FAIL_REASON+= \
217 "Your pkg_install is too old to evaluate license conditions" \
218 "You can bypass this check by setting SKIP_LICENSE_CHECK=yes"
219 .endif
221 .endif