[BACK]Return to license.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Annotation of pkgsrc/mk/license.mk, Revision 1.64

1.64    ! joerg       1: # $NetBSD: license.mk,v 1.63 2014/05/15 09:59:09 wiz Exp $
1.1       rillig      2: #
                      3: # This file handles everything about the LICENSE variable. It is
                      4: # included automatically by bsd.pkg.mk.
                      5: #
1.17      gdt         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#
                      9: #
1.2       gdt        10: # XXX: Some of this content arguably belongs in the pkgsrc guide
                     11: # instead.
                     12: #
1.1       rillig     13: # === User-settable variables ===
                     14: #
                     15: # ACCEPTABLE_LICENSES
1.17      gdt        16: #
1.2       gdt        17: #      If a package declares a license and that license is not a
1.17      gdt        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.)
1.2       gdt        22: #
                     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.
1.1       rillig     27: #
1.3       rillig     28: #      To include the default licenses, you can use the += operator
                     29: #      in mk.conf. To override it, use the plain = operator.
                     30: #
                     31: #      Default value: ${DEFAULT_ACCEPTABLE_LICENSES}
                     32: #
1.1       rillig     33: # === Package-settable variables ===
                     34: #
                     35: # LICENSE
1.17      gdt        36: #
1.1       rillig     37: #      The license of the package.
                     38: #
1.28      joerg      39: #      Dual licenses can be specified with OR expressions:
                     40: #      LICENSE=        license1 OR license2
                     41: #
                     42: #      If more than one license applies at the same time, AND expressions
                     43: #      can be used:
                     44: #      LICENSE=        license1 AND license2
                     45: #
                     46: #      Expressions can be nested if necessary:
                     47: #      LICENSE=        (license1 AND license2) OR license3
                     48: #      Parenthesis are required when mixing AND and OR.
                     49: #
1.14      gdt        50: #      Every package should specify its license.  (Prior to early 2009,
1.2       gdt        51: #      Open Source and Free software did not have license tags.)
1.1       rillig     52: #
1.4       gdt        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.
1.1       rillig     59: #
1.4       gdt        60: #      http://opensource.org/licenses/category
                     61: #      http://www.fsf.org/licensing/licenses/index_html
1.1       rillig     62: #
                     63: # === Predefined variables ===
                     64: #
                     65: # DEFAULT_ACCEPTABLE_LICENSES
1.8       gdt        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
1.46      gdt        69: #      almost all licenses that are Open Source or Free, so as to provide
1.8       gdt        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.)
1.2       gdt        74: #
1.46      gdt        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.
                     80: #
1.14      gdt        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.
                     85: #
1.17      gdt        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
                     90: #
1.1       rillig     91: # === See also ===
                     92: #
                     93: #      ../doc/TODO, section "Licenses of packages"
                     94: #
1.12      wiz        95: # Keywords: licence license
1.11      rillig     96: #
1.1       rillig     97:
1.4       gdt        98: # This list is not complete.  Free and Open Source licenses should be
                     99: # added to the list as they are added to pkgsrc.
                    100:
1.10      gdt       101: # The convention is that Free or Open Source licenses do not have a
                    102: # -license suffix, and nonfree licenses end in -license.
                    103:
1.4       gdt       104: DEFAULT_ACCEPTABLE_LICENSES= \
1.54      wiz       105:        apache-1.1 apache-2.0 \
1.57      rodent    106:        arphic-public \
1.54      wiz       107:        artistic artistic-2.0 \
                    108:        boost-license \
                    109:        cc-by-sa-v3.0 \
1.59      sno       110:        cc0-1.0-universal \
1.54      wiz       111:        cddl-1.0 \
1.62      wiz       112:        cecill-2.1 \
1.54      wiz       113:        cpl-1.0 \
                    114:        epl-v1.0 \
1.61      wiz       115:        eupl-v1.1 \
1.19      wiz       116:        gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 \
1.40      wiz       117:        gnu-gpl-v1 \
1.21      wiz       118:        gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 \
1.8       gdt       119:        gnu-gpl-v3 gnu-lgpl-v3 \
1.54      wiz       120:        ibm-public-license-1.0 \
1.34      obache    121:        ipafont \
1.38      schnoebe  122:        isc \
1.48      ryoon     123:        lppl-1.3c \
1.51      brook     124:        lucent \
1.54      wiz       125:        miros \
                    126:        mit \
                    127:        mpl-1.0 mpl-1.1 mpl-2.0 \
                    128:        mplusfont \
1.56      rodent    129:        ofl-v1.0 ofl-v1.1 \
1.63      wiz       130:        openssl \
1.54      wiz       131:        original-bsd modified-bsd 2-clause-bsd \
                    132:        php \
                    133:        png-license \
                    134:        postgresql-license \
                    135:        public-domain \
                    136:        python-software-foundation \
1.55      wiz       137:        qpl-v1.0 \
1.58      rodent    138:        sgi-free-software-b-v2.0 \
1.54      wiz       139:        sleepycat-public \
                    140:        unlicense \
                    141:        x11 \
                    142:        zlib \
                    143:        zpl
1.5       rillig    144:
1.32      heinz     145: # not approved by OSI, derived from BSD
                    146: DEFAULT_ACCEPTABLE_LICENSES+=  info-zip
                    147:
1.12      wiz       148: ##### Variant spellings
                    149:
                    150: .if defined(ACCEPTABLE_LICENCES) && !defined(ACCEPTABLE_LICENSES)
                    151: ACCEPTABLE_LICENSES=   ${ACCEPTABLE_LICENCES}
                    152: .endif
                    153:
1.5       rillig    154: .if !defined(LICENSE)
1.64    ! joerg     155: .  if ${PKG_DEVELOPER:Uno} != "no"
1.5       rillig    156: WARNINGS+=             "[license.mk] Every package should define a LICENSE."
                    157: .  endif
                    158:
                    159: .else
                    160:
1.24      joerg     161: .if defined(_ACCEPTABLE)
                    162: WARNINGS+=     "Deprecated variable _ACCEPTABLE found, use SKIP_LICENSE_CHECK=yes"
                    163: SKIP_LICENSE_CHECK=    yes
                    164: .endif
                    165:
                    166: SKIP_LICENSE_CHECK?=   no
                    167:
                    168: .if !empty(SKIP_LICENSE_CHECK:M[Yy][Ee][Ss])
                    169: _ACCEPTABLE_LICENSE=   skipped
                    170: .else
1.25      joerg     171: _ACCEPTABLE_LICENSE!=  \
                    172:     if test `${PKG_ADMIN} -V` -lt 20090528; then \
                    173:        echo outdated; \
                    174:     else \
1.44      abs       175:        ${PKGSRC_SETENV} PKGSRC_ACCEPTABLE_LICENSES=${ACCEPTABLE_LICENSES:Q} \
1.25      joerg     176:        PKGSRC_DEFAULT_ACCEPTABLE_LICENSES=${DEFAULT_ACCEPTABLE_LICENSES:Q} \
                    177:        ${PKG_ADMIN} check-license ${LICENSE:Q} || echo failure; \
                    178:     fi
1.24      joerg     179: .endif
                    180:
                    181: .if ${_ACCEPTABLE_LICENSE} == "no"
                    182: .  if defined(MAKECONF)
                    183: _MAKE_CONF?=   ${MAKECONF}
                    184: .  elif ${OPSYS} == "NetBSD" && ${MAKE} == "/usr/bin/make"
                    185: _MAKE_CONF?=   /etc/mk.conf
                    186: .  else
                    187: _MAKE_CONF?=   ${PREFIX}/etc/mk.conf
                    188: .endif
                    189: .  if ${OPSYS} == "NetBSD" && ${PKG_TOOLS_BIN} == "/usr/sbin"
                    190: _PKG_INSTALL_CONF?=    /etc/pkg_install.conf
                    191: .  else
                    192: _PKG_INSTALL_CONF?=    ${PREFIX}/etc/pkg_install.conf
                    193: .endif
                    194:
1.25      joerg     195: .  if empty(LICENSE:MAND) && empty(LICENSE:MOR) && empty(LICENSE:M*[()]*)
                    196: PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
                    197:     "    "${LICENSE:Q} \
1.37      wiz       198:     "You can mark the license \`\`${LICENSE}'' as acceptable by adding" \
1.25      joerg     199:     "    ACCEPTABLE_LICENSES+= ${LICENSE}" \
                    200:     "to ${_MAKE_CONF} or by adding" \
                    201:     "    ACCEPTABLE_LICENSES= ${LICENSE}" \
                    202:     "to ${_PKG_INSTALL_CONF}."
                    203: PKG_FAIL_REASON+= "The following command will show you the license text:" \
                    204:     "    ${MAKE} show-license"
                    205: .  else
1.24      joerg     206: PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license condition: " \
                    207:     "    "${LICENSE:Q} \
1.37      wiz       208:     "" \
                    209:     "Check that you have accepted all necessary licenses." \
                    210:     "You can mark a particular license \`\`foo'' as acceptable by adding" \
                    211:     "    ACCEPTABLE_LICENSES+= foo" \
1.24      joerg     212:     "to ${_MAKE_CONF} or by adding" \
1.37      wiz       213:     "    ACCEPTABLE_LICENSES= foo" \
1.24      joerg     214:     "to ${_PKG_INSTALL_CONF}."
1.5       rillig    215: .  endif
                    216:
1.24      joerg     217: .elif ${_ACCEPTABLE_LICENSE} == "failure"
                    218: PKG_FAIL_REASON+= "License conditions for ${PKGNAME} could not be evaluated"
1.25      joerg     219: .elif ${_ACCEPTABLE_LICENSE} == "outdated"
                    220: PKG_FAIL_REASON+= \
                    221:     "Your pkg_install is too old to evaluate license conditions" \
                    222:     "You can bypass this check by setting SKIP_LICENSE_CHECK=yes"
1.24      joerg     223: .endif
                    224:
1.5       rillig    225: .endif

CVSweb <webmaster@jp.NetBSD.org>