1 # $NetBSD: license.mk,v 1.33 2010/04/26 11:03:10 obache 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
10 # XXX: Some of this content arguably belongs in the pkgsrc guide
13 # === User-settable variables ===
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
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 ===
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
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 # 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 # Licenses not formally approved as Free or Open Source may be
76 # added if they have terms that would obviously be approved if
77 # the effort were made. Such license names will have a comment
78 # near them in the assignment to DEFAULT_ACCEPTABLE_LICENSES.
80 # The pkg_install sources also have a
81 # DEFAULT_ACCEPTABLE_LICENSES list, and that should be updated
82 # to match the list here. See
83 # pkgsrc/pkgtools/pkg_install/files/lib/license.c
87 # ../doc/TODO, section "Licenses of packages"
89 # Keywords: licence license
92 # This list is not complete. Free and Open Source licenses should be
93 # added to the list as they are added to pkgsrc.
95 # The convention is that Free or Open Source licenses do not have a
96 # -license suffix, and nonfree licenses end in -license.
98 # XXX open-font-license should perhaps be changed to open-font
100 DEFAULT_ACCEPTABLE_LICENSES= \
102 gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 \
103 gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 \
104 gnu-gpl-v3 gnu-lgpl-v3 \
105 original-bsd modified-bsd 2-clause-bsd \
107 apache-1.1 apache-2.0 \
108 artistic artistic-2.0 \
114 python-software-foundation \
118 # not approved by OSI, derived from BSD
119 DEFAULT_ACCEPTABLE_LICENSES+= info-zip
121 ##### Variant spellings
123 .if defined(ACCEPTABLE_LICENCES) && !defined(ACCEPTABLE_LICENSES)
124 ACCEPTABLE_LICENSES= ${ACCEPTABLE_LICENCES}
127 .if !defined(LICENSE)
128 . if defined(PKG_DEVELOPER)
129 WARNINGS+= "[license.mk] Every package should define a LICENSE."
134 .if defined(_ACCEPTABLE)
135 WARNINGS+= "Deprecated variable _ACCEPTABLE found, use SKIP_LICENSE_CHECK=yes"
136 SKIP_LICENSE_CHECK= yes
139 SKIP_LICENSE_CHECK?= no
141 .if !empty(SKIP_LICENSE_CHECK:M[Yy][Ee][Ss])
142 _ACCEPTABLE_LICENSE= skipped
144 _ACCEPTABLE_LICENSE!= \
145 if test `${PKG_ADMIN} -V` -lt 20090528; then \
148 ${SETENV} PKGSRC_ACCEPTABLE_LICENSES=${ACCEPTABLE_LICENSES:Q} \
149 PKGSRC_DEFAULT_ACCEPTABLE_LICENSES=${DEFAULT_ACCEPTABLE_LICENSES:Q} \
150 ${PKG_ADMIN} check-license ${LICENSE:Q} || echo failure; \
154 .if ${_ACCEPTABLE_LICENSE} == "no"
155 . if defined(MAKECONF)
156 _MAKE_CONF?= ${MAKECONF}
157 . elif ${OPSYS} == "NetBSD" && ${MAKE} == "/usr/bin/make"
158 _MAKE_CONF?= /etc/mk.conf
160 _MAKE_CONF?= ${PREFIX}/etc/mk.conf
162 . if ${OPSYS} == "NetBSD" && ${PKG_TOOLS_BIN} == "/usr/sbin"
163 _PKG_INSTALL_CONF?= /etc/pkg_install.conf
165 _PKG_INSTALL_CONF?= ${PREFIX}/etc/pkg_install.conf
168 . if empty(LICENSE:MAND) && empty(LICENSE:MOR) && empty(LICENSE:M*[()]*)
169 PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
171 "You can mark the license \`\`license'' as acceptable by adding" \
172 " ACCEPTABLE_LICENSES+= ${LICENSE}" \
173 "to ${_MAKE_CONF} or by adding" \
174 " ACCEPTABLE_LICENSES= ${LICENSE}" \
175 "to ${_PKG_INSTALL_CONF}."
176 PKG_FAIL_REASON+= "The following command will show you the license text:" \
177 " ${MAKE} show-license"
179 PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
181 "You can mark the license \`\`license'' as acceptable by adding" \
182 " ACCEPTABLE_LICENSES+= license" \
183 "to ${_MAKE_CONF} or by adding" \
184 " ACCEPTABLE_LICENSES= license" \
185 "to ${_PKG_INSTALL_CONF}."
188 .elif ${_ACCEPTABLE_LICENSE} == "failure"
189 PKG_FAIL_REASON+= "License conditions for ${PKGNAME} could not be evaluated"
190 .elif ${_ACCEPTABLE_LICENSE} == "outdated"
192 "Your pkg_install is too old to evaluate license conditions" \
193 "You can bypass this check by setting SKIP_LICENSE_CHECK=yes"