Index: head/Mk/bsd.licenses.db.mk =================================================================== --- head/Mk/bsd.licenses.db.mk (revision 435393) +++ head/Mk/bsd.licenses.db.mk (revision 435394) @@ -1,406 +1,404 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # $FreeBSD$ # ** Please run changes to this file by eadler@ first ** Licenses_db_Include_MAINTAINER= portmgr@FreeBSD.org # # bsd.licenses.db.mk - License database for bsd.licenses.mk # # Created by: Alejandro Pulver # # Please view me with 4 column tabs! # # The canonical source of license names and short-name identifiers: # - SPDX License List # https://spdx.org/licenses/ # # See also: # - Wikipedia (article "Comparison of Free Software Licenses") # http://en.wikipedia.org/wiki/Comparison_of_free_software_licences # # Probably will be automatically incorporated from FOSSology's software. # # IMPORTANT: as this file is going to be included by most ports, we may # consider having licenses here only as "tags" as most of them will be free, # to remove some loops and additional variables here. This will not affect the # rest of bsd.licenses.mk, and anyways restricted licenses that aren't used by # many ports should be defined in each one's Makefile. # XXX Start of editable section # License definitions # # _LICENSE_LIST - List of defined licenses # _LICENSE_LIST_GROUPS - List of defined license groups # _LICENSE_LIST= BSL CDDL CPAL-1.0 ClArtistic EPL GFDL GMGPL \ ISCL MIT MPL NCSA OFL10 OFL11 OWL OpenSSL PD PSFL PostgreSQL \ RUBY ZLIB ZPL21 # GNU family _LICENSE_LIST+= AGPLv3 GPLv1 GPLv2 GPLv3 GPLv3RLE LGPL20 LGPL21 LGPL3 _LICENSE_LIST+= AGPLv3+ GPLv1+ GPLv2+ GPLv3+ GPLv3RLE+ LGPL20+ LGPL21+ \ LGPL3+ # BSD family _LICENSE_LIST+= BSD BSD2CLAUSE BSD3CLAUSE BSD4CLAUSE # LaTeX family _LICENSE_LIST+= LPPL10 LPPL11 LPPL12 LPPL13 LPPL13a LPPL13b LPPL13c # Apache family _LICENSE_LIST+= APACHE10 APACHE11 APACHE20 # Artistic family _LICENSE_LIST+= ART10 ARTPERL10 ART20 # PHP family _LICENSE_LIST+= PHP202 PHP30 PHP301 # Creative Commons family _LICENSE_LIST+= CC0-1.0 \ CC-BY-1.0 CC-BY-2.0 CC-BY-2.5 CC-BY-3.0 CC-BY-4.0 \ CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0 CC-BY-ND-4.0 \ CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5 CC-BY-NC-3.0 CC-BY-NC-4.0 \ CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0 CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-ND-4.0 \ CC-BY-NC-SA-1.0 CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0 CC-BY-NC-SA-4.0 \ CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.5 CC-BY-SA-3.0 CC-BY-SA-4.0 # Others _LICENSE_LIST+= NONE # List of groups (only names must be present) _LICENSE_NAME_FSF= Free Software Foundation Approved _LICENSE_NAME_GPL= GPL Compatible _LICENSE_NAME_OSI= OSI Approved _LICENSE_NAME_COPYFREE= Complies with Copyfree Standard Definition _LICENSE_NAME_FONTS= Font licenses # Default permissions for licenses here, if not defined _LICENSE_PERMS_DEFAULT= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept # Properties of license "xxx" (similar to port variables, but single) # # _LICENSE_NAME_xxx - Full name/description of license/group # _LICENSE_PERMS_xxx - Permissions (if not defined defaults to # ${_LICENSE_PERMS_DEFAULT}. # _LICENSE_GROUPS_xxx - Groups (optional) # # Notes: # - General permissions from groups are added to each license, if not defined. # _LICENSE_NAME_AGPLv3= GNU Affero General Public License version 3 _LICENSE_GROUPS_AGPLv3= FSF GPL OSI # Note that though plus is allowed in a variable (and this license) name it # needs an extra space before following equals sign for them not to be parsed # as a single += operator _LICENSE_NAME_AGPLv3+ = ${_LICENSE_NAME_AGPLv3} (or later) _LICENSE_GROUPS_AGPLv3+ = ${_LICENSE_GROUPS_AGPLv3} _LICENSE_NAME_APACHE10= Apache License 1.0 _LICENSE_GROUPS_APACHE10= FSF _LICENSE_NAME_APACHE11= Apache License 1.1 _LICENSE_GROUPS_APACHE11= FSF OSI _LICENSE_NAME_APACHE20= Apache License 2.0 _LICENSE_GROUPS_APACHE20= FSF OSI _LICENSE_NAME_ART10= Artistic License version 1.0 _LICENSE_GROUPS_ART10= OSI _LICENSE_NAME_ARTPERL10=Artistic License (perl) version 1.0 _LICENSE_GROUPS_ARTPERL10= OSI _LICENSE_NAME_ART20= Artistic License version 2.0 _LICENSE_GROUPS_ART20= FSF GPL OSI _LICENSE_NAME_BSD= BSD license Generic Version (deprecated) _LICENSE_GROUPS_BSD= FSF OSI COPYFREE _LICENSE_NAME_BSD2CLAUSE= BSD 2-clause "Simplified" License _LICENSE_GROUPS_BSD2CLAUSE= FSF OSI COPYFREE _LICENSE_NAME_BSD3CLAUSE= BSD 3-clause "New" or "Revised" License _LICENSE_GROUPS_BSD3CLAUSE= FSF OSI COPYFREE _LICENSE_NAME_BSD4CLAUSE= BSD 4-clause "Original" or "Old" License _LICENSE_GROUPS_BSD4CLAUSE= FSF _LICENSE_NAME_BSL= Boost Software License _LICENSE_GROUPS_BSL= FSF OSI COPYFREE _LICENSE_NAME_CC0-1.0= Creative Commons Zero v1.0 Universal _LICENSE_GROUPS_CC0-1.0= FSF GPL COPYFREE _LICENSE_NAME_CC-BY-1.0= Creative Commons Attribution 1.0 _LICENSE_GROUPS_CC-BY-1.0= # empty _LICENSE_NAME_CC-BY-2.0= Creative Commons Attribution 2.0 _LICENSE_GROUPS_CC-BY-2.0= # empty _LICENSE_NAME_CC-BY-2.5= Creative Commons Attribution 2.5 _LICENSE_GROUPS_CC-BY-2.5= # empty _LICENSE_NAME_CC-BY-3.0= Creative Commons Attribution 3.0 _LICENSE_GROUPS_CC-BY-3.0= # empty _LICENSE_NAME_CC-BY-4.0= Creative Commons Attribution 4.0 _LICENSE_GROUPS_CC-BY-4.0= # empty _LICENSE_NAME_CC-BY-ND-1.0= Creative Commons Attribution No Derivatives 1.0 _LICENSE_GROUPS_CC-BY-ND-1.0= # empty _LICENSE_NAME_CC-BY-ND-2.0= Creative Commons Attribution No Derivatives 2.0 _LICENSE_GROUPS_CC-BY-ND-2.0= # empty _LICENSE_NAME_CC-BY-ND-2.5= Creative Commons Attribution No Derivatives 2.5 _LICENSE_GROUPS_CC-BY-ND-2.5= # empty _LICENSE_NAME_CC-BY-ND-3.0= Creative Commons Attribution No Derivatives 3.0 _LICENSE_GROUPS_CC-BY-ND-3.0= # empty _LICENSE_NAME_CC-BY-ND-4.0= Creative Commons Attribution No Derivatives 4.0 _LICENSE_GROUPS_CC-BY-ND-4.0= # empty _LICENSE_NAME_CC-BY-NC-1.0= Creative Commons Attribution Non Commercial 1.0 _LICENSE_GROUPS_CC-BY-NC-1.0= # empty _LICENSE_PERMS_CC-BY-NC-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-2.0= Creative Commons Attribution Non Commercial 2.0 _LICENSE_GROUPS_CC-BY-NC-2.0= # empty _LICENSE_PERMS_CC-BY-NC-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-2.5= Creative Commons Attribution Non Commercial 2.5 _LICENSE_GROUPS_CC-BY-NC-2.5= # empty _LICENSE_PERMS_CC-BY-NC-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-3.0= Creative Commons Attribution Non Commercial 3.0 _LICENSE_GROUPS_CC-BY-NC-3.0= # empty _LICENSE_PERMS_CC-BY-NC-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-4.0= Creative Commons Attribution Non Commercial 4.0 _LICENSE_GROUPS_CC-BY-NC-4.0= # empty _LICENSE_PERMS_CC-BY-NC-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-1.0= Creative Commons Attribution Non Commercial No Derivatives 1.0 _LICENSE_GROUPS_CC-BY-NC-ND-1.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-2.0= Creative Commons Attribution Non Commercial No Derivatives 2.0 _LICENSE_GROUPS_CC-BY-NC-ND-2.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-2.5= Creative Commons Attribution Non Commercial No Derivatives 2.5 _LICENSE_GROUPS_CC-BY-NC-ND-2.5= # empty _LICENSE_PERMS_CC-BY-NC-ND-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-3.0= Creative Commons Attribution Non Commercial No Derivatives 3.0 _LICENSE_GROUPS_CC-BY-NC-ND-3.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-ND-4.0= Creative Commons Attribution Non Commercial No Derivatives 4.0 _LICENSE_GROUPS_CC-BY-NC-ND-4.0= # empty _LICENSE_PERMS_CC-BY-NC-ND-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-1.0= Creative Commons Attribution Non Commercial Share Alike 1.0 _LICENSE_GROUPS_CC-BY-NC-SA-1.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-1.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-2.0= Creative Commons Attribution Non Commercial Share Alike 2.0 _LICENSE_GROUPS_CC-BY-NC-SA-2.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-2.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-2.5= Creative Commons Attribution Non Commercial Share Alike 2.5 _LICENSE_GROUPS_CC-BY-NC-SA-2.5= # empty _LICENSE_PERMS_CC-BY-NC-SA-2.5= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-3.0= Creative Commons Attribution Non Commercial Share Alike 3.0 _LICENSE_GROUPS_CC-BY-NC-SA-3.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-3.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-NC-SA-4.0= Creative Commons Attribution Non Commercial Share Alike 4.0 _LICENSE_GROUPS_CC-BY-NC-SA-4.0= # empty _LICENSE_PERMS_CC-BY-NC-SA-4.0= dist-mirror pkg-mirror auto-accept _LICENSE_NAME_CC-BY-SA-1.0= Creative Commons Attribution Share Alike 1.0 _LICENSE_GROUPS_CC-BY-SA-1.0= # empty _LICENSE_NAME_CC-BY-SA-2.0= Creative Commons Attribution Share Alike 2.0 _LICENSE_GROUPS_CC-BY-SA-2.0= # empty _LICENSE_NAME_CC-BY-SA-2.5= Creative Commons Attribution Share Alike 2.5 _LICENSE_GROUPS_CC-BY-SA-2.5= # empty _LICENSE_NAME_CC-BY-SA-3.0= Creative Commons Attribution Share Alike 3.0 _LICENSE_GROUPS_CC-BY-SA-3.0= # empty _LICENSE_NAME_CC-BY-SA-4.0= Creative Commons Attribution Share Alike 4.0 _LICENSE_GROUPS_CC-BY-SA-4.0= # empty _LICENSE_NAME_CDDL= Common Development and Distribution License _LICENSE_GROUPS_CDDL= FSF OSI _LICENSE_NAME_ClArtistic= Clarified Artistic License _LICENSE_GROUPS_ClArtistic= FSF GPL OSI _LICENSE_NAME_CPAL-1.0= Common Public Attribution License _LICENSE_GROUPS_CPAL-1.0= FSF OSI _LICENSE_NAME_EPL= Eclipse Public License _LICENSE_GROUPS_EPL= FSF OSI _LICENSE_NAME_GFDL= GNU Free Documentation License _LICENSE_GROUPS_GFDL= FSF _LICENSE_NAME_GMGPL= GNAT Modified General Public License _LICENSE_GROUPS_GMGPL= FSF GPL OSI _LICENSE_NAME_GPLv1= GNU General Public License version 1 _LICENSE_GROUPS_GPLv1= FSF GPL OSI _LICENSE_NAME_GPLv1+ = ${_LICENSE_NAME_GPLv1} (or later) _LICENSE_GROUPS_GPLv1+ = ${_LICENSE_GROUPS_GPLv1} _LICENSE_NAME_GPLv2= GNU General Public License version 2 _LICENSE_GROUPS_GPLv2= FSF GPL OSI _LICENSE_NAME_GPLv2+ = ${_LICENSE_NAME_GPLv2} (or later) _LICENSE_GROUPS_GPLv2+ = ${_LICENSE_GROUPS_GPLv2} _LICENSE_NAME_GPLv3= GNU General Public License version 3 _LICENSE_GROUPS_GPLv3= FSF GPL OSI _LICENSE_NAME_GPLv3+ = ${_LICENSE_NAME_GPLv3} (or later) _LICENSE_GROUPS_GPLv3+ = ${_LICENSE_GROUPS_GPLv3} _LICENSE_NAME_GPLv3RLE= GNU GPL version 3 Runtime Library Exception _LICENSE_GROUPS_GPLv3RLE= FSF GPL OSI _LICENSE_NAME_GPLv3RLE+ = ${_LICENSE_NAME_GPLv3RLE} (or later) _LICENSE_GROUPS_GPLv3RLE+ = ${_LICENSE_GROUPS_GPLv3RLE} _LICENSE_NAME_ISCL= Internet Systems Consortium License _LICENSE_GROUPS_ISCL= FSF GPL OSI COPYFREE _LICENSE_NAME_LGPL20= GNU Library General Public License version 2.0 _LICENSE_GROUPS_LGPL20= FSF GPL OSI _LICENSE_NAME_LGPL20+ = ${_LICENSE_NAME_LGPL20} (or later) _LICENSE_GROUPS_LGPL20+ = ${_LICENSE_GROUPS_LGPL20} _LICENSE_NAME_LGPL21= GNU Lesser General Public License version 2.1 _LICENSE_GROUPS_LGPL21= FSF GPL OSI _LICENSE_NAME_LGPL21+ = ${_LICENSE_NAME_LGPL21} (or later) _LICENSE_GROUPS_LGPL21+ = ${_LICENSE_GROUPS_LGPL21} _LICENSE_NAME_LGPL3= GNU Lesser General Public License version 3 _LICENSE_GROUPS_LGPL3= FSF GPL OSI _LICENSE_NAME_LGPL3+ = ${_LICENSE_NAME_LGPL3} (or later) _LICENSE_GROUPS_LGPL3+ = ${_LICENSE_GROUPS_LGPL3} _LICENSE_NAME_LPPL10= LaTeX Project Public License version 1.0 _LICENSE_GROUPS_LPPL10= FSF OSI _LICENSE_PERMS_LPPL10= dist-mirror dist-sell _LICENSE_NAME_LPPL11= LaTeX Project Public License version 1.1 _LICENSE_GROUPS_LPPL11= FSF OSI _LICENSE_PERMS_LPPL11= dist-mirror dist-sell _LICENSE_NAME_LPPL12= LaTeX Project Public License version 1.2 _LICENSE_GROUPS_LPPL12= FSF OSI _LICENSE_PERMS_LPPL12= dist-mirror dist-sell _LICENSE_NAME_LPPL13= LaTeX Project Public License version 1.3 _LICENSE_GROUPS_LPPL13= FSF OSI _LICENSE_PERMS_LPPL13= dist-mirror dist-sell _LICENSE_NAME_LPPL13a= LaTeX Project Public License version 1.3a _LICENSE_GROUPS_LPPL13a= FSF OSI _LICENSE_PERMS_LPPL13a= dist-mirror dist-sell _LICENSE_NAME_LPPL13b= LaTeX Project Public License version 1.3b _LICENSE_GROUPS_LPPL13b= FSF OSI _LICENSE_PERMS_LPPL13b= dist-mirror dist-sell _LICENSE_NAME_LPPL13c= LaTeX Project Public License version 1.3c _LICENSE_GROUPS_LPPL13c= FSF OSI _LICENSE_PERMS_LPPL13c= dist-mirror dist-sell _LICENSE_NAME_MIT= MIT license / X11 license _LICENSE_GROUPS_MIT= COPYFREE FSF GPL OSI _LICENSE_NAME_MPL= Mozilla Public License _LICENSE_GROUPS_MPL= FSF OSI _LICENSE_NAME_NCSA= University of Illinois/NCSA Open Source License _LICENSE_GROUPS_NCSA= COPYFREE FSF GPL OSI _LICENSE_NAME_OFL10= SIL Open Font License version 1.0 (http://scripts.sil.org/OFL) _LICENSE_GROUPS_OFL10= FONTS _LICENSE_NAME_OFL11= SIL Open Font License version 1.1 (http://scripts.sil.org/OFL) _LICENSE_GROUPS_OFL11= FONTS _LICENSE_NAME_OpenSSL= OpenSSL License _LICENSE_GROUPS_OpenSSL= FSF _LICENSE_NAME_OWL= Open Works License (owl.apotheon.org) _LICENSE_GROUPS_OWL= COPYFREE _LICENSE_NAME_PostgreSQL= PostgreSQL Licence _LICENSE_GROUPS_PostgreSQL= FSF GPL OSI COPYFREE _LICENSE_NAME_PD= Public Domain _LICENSE_GROUPS_PD= GPL COPYFREE _LICENSE_NAME_PHP202= PHP License version 2.02 _LICENSE_GROUPS_PHP202= FSF OSI _LICENSE_NAME_PHP30= PHP License version 3.0 _LICENSE_GROUPS_PHP30= FSF OSI _LICENSE_NAME_PHP301= PHP License version 3.01 _LICENSE_GROUPS_PHP301= FSF OSI _LICENSE_NAME_PSFL= Python Software Foundation License _LICENSE_GROUPS_PSFL= FSF GPL OSI _LICENSE_NAME_RUBY= Ruby License _LICENSE_GROUPS_RUBY= FSF _LICENSE_NAME_NONE= No license specified _LICENSE_GROUPS_NONE= # empty _LICENSE_PERMS_NONE= # empty _LICENSE_NAME_ZLIB= zlib License _LICENSE_GROUPS_ZLIB= GPL FSF OSI _LICENSE_NAME_ZPL21= Zope Public License version 2.1 _LICENSE_GROUPS_ZPL21= GPL OSI # Set default permissions if not defined .for lic in ${_LICENSE_LIST} . if !defined(_LICENSE_PERMS_${lic}) -# note that space before = is needed to correctly handle licenses -# ending with a plus sign -_LICENSE_PERMS_${lic} = ${_LICENSE_PERMS_DEFAULT} +_LICENSE_PERMS_${lic}= ${_LICENSE_PERMS_DEFAULT} . endif .endfor Index: head/Mk/bsd.licenses.mk =================================================================== --- head/Mk/bsd.licenses.mk (revision 435393) +++ head/Mk/bsd.licenses.mk (revision 435394) @@ -1,775 +1,775 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # $FreeBSD$ # ** Please run changes to this file by eadler@ first ** Licenses_Include_MAINTAINER= portmgr@FreeBSD.org # # bsd.licenses.mk - License auditing framework. # # Created by: Alejandro Pulver # # Please view me with 4 column tabs! # # TODO: # - Bring back save and checksum with new dialog interface (only offers to do # so if ran by root, otherwise silently remove the options). Also only allow # saving per-port options (known or unknown), and only when accepted. # - Add custom restriction targets for better integration (now some files are # removed from FTP if restricted for CDROM for example, as the old # behavior). # The following cases are not considered: # # - Redistribution of modified distfiles, because is never done. # - Creating binaries from modified sources, because packages almost always # contain modifications to the source, can not be autodetected (i.e. # patch-* in ${FILESDIR}, post-* targets, etc), and these licenses tend to # have more restrictions anyways. # # Integration with target sequences # # _SANITY_SEQ+= check-license (after check-vulnerable) # _PATCH_SEQ+= ask-license (before any other targets) # _INSTALL_SUSEQ+= install-license (after install-desktop-entries) # # The 'check-license' target will determine if the license was accepted, # rejected or has to be asked later to the user in 'ask-license' (by then # licenses should be extracted). The 'install-license' target installs the # applications' licenses, a general package license mentioning them, and a # restriction report (to be used by ports, scripts and similar tools). # Variables provided to the ports system and users in general, to modify the # behavior of the framework # # DISABLE_LICENSES - Disable license auditing framework completely. # NO_LICENSES_INSTALL - Do not install catalog, report and licenses. # NO_LICENSES_DIALOGS - Disable interactive menus for asking licenses. #NO_LICENSES_INSTALL= yes #NO_LICENSES_DIALOGS= yes # Variables provided to users (can be passed to make or set in /etc/make.conf) # # LICENSES_ACCEPTED - Accepted licenses. # LICENSES_REJECTED - Rejected licenses. # LICENSES_GROUPS_ACCEPTED - Accepted license groups. # LICENSES_GROUPS_REJECTED - Rejected license groups. # LICENSES_ASK - Require explicit user approval for all licenses not # present in previous variables (for example, stock # accepted licenses will ask confirmation). # # Variables provided to ports # # LICENSE - Code of license (short name). # LICENSE_PERMS - Permissions; use "none" if empty. # LICENSE_GROUPS - Groups the license belongs. # LICENSE_NAME - Full license name (for the reports). # LICENSE_FILE - Full path to license (or use LICENSE_TEXT). # LICENSE_TEXT - Text to use as a license, useful when referencing to # another place if it's not in the distfile. # LICENSE_DISTFILES - Name of licensed files (defaults to ${_DISTFILES}). # LICENSE_COMB - Set to "dual" or "multi", for OR/AND behavior # (defaults to "single" if undefined, the common case) # # The following cases are supported after defining LICENSE: # # Case 1: license defined in the framework (aka "known"). # # In this case the only allowed variables to set are LICENSE_FILE and # LICENSE_DISTFILES. The rest are managed by the framework and are not allowed # to change. # # Case 2: license only known by the port (aka "unknown"). # # In this case LICENSE_{PERMS,NAME} are mandatory, in addition to # either LICENSE_FILE or LICENSE_TEXT. Optional variable is # LICENSE_GROUPS. # # Available components for LICENSE_PERMS: # dist-mirror - Redistribution of distfile is permitted # (like FTP mirroring; port is not RESTRICTED). # dist-sell - Selling of distfile, e.g. on CD-ROM is permitted # (port does not need to set NO_CDROM). # pkg-mirror - Free redistribution of package is permitted # (like FTP upload; port does not set NO_PACKAGE). # pkg-sell - Selling of package is permitted, e.g. on CD-ROM. # auto-accept - License is accepted by default, without presented # agreement, unless the user defines LICENSES_ASK. # # Notes about permissions: # - Permissions use a default-deny policy (e.g. not setting "dist-mirror" # means it is automatically excluded). # - Components can be negated by prefixing them with "no-" (like # "no-pkg-sell"). # - In case a component is present and also excluded (i.e. no-dist-sell and # dist-sell together in LICENSE_PERMS), it will be excluded. # - XXX Currently there is no point in "no-" prefixes, as permissions are not # inherited from groups. Maybe it looks more clear that way than leaving the # variable empty? # # Dual/multiple licenses: # # If LICENSE_COMB is set to "dual", then LICENSE can (must, actually) have # more than one component. After that each license "lic" in LICENSE falls in # previous cases (known or unknown), but their variables are prefixed by # _LICENSE_ and suffixed by _lic. The main license name, perms and groups will # be set automatically (following appropiate logic). The idea is that any # license from LICENSE can be chosen to use the package. # # The case when LICENSE_COMB is set to "multi" is similar. But the idea is # that all of the licenses in LICENSE must be agreed to use the package. # .if defined(_POSTMKINCLUDED) && !defined(BEFOREPORTMK) .if defined(LICENSE) # Include known licenses from database .include "${PORTSDIR}/Mk/bsd.licenses.db.mk" # Lists of variables and valid components # # _LICENSE_LIST_PERMS - Valid permission components # _LICENSE_LIST_PORT_VARS - License variables defined by the port _LICENSE_LIST_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept none _LICENSE_LIST_PORT_VARS= PERMS NAME GROUPS # Path variables # # _LICENSE_DIR - Directory to install licenses # _LICENSE_STORE - Store for known license files # _LICENSE_CATALOG - License catalog (make include file) to be created (dst) # _LICENSE_CATALOG_TMP - Same as above, but in WRKDIR (src) # _LICENSE_REPORT - License summary, shows licenses and how they are combined (dst) # _LICENSE_REPORT_TMP - Same as above, but in WRKDIR (src) # _LICENSE_COOKIE - Set when license is accepted, it is not present in # bsd.port.mk to avoid creating LICENSE_{REQ,SEQ} for a # few more targets only. _LICENSE_DIR?= ${PREFIX}/share/licenses/${PKGNAME} _LICENSE_STORE?= ${PORTSDIR}/Templates/Licenses _LICENSE_CATALOG?= ${_LICENSE_DIR}/catalog.mk _LICENSE_CATALOG_TMP?= ${WRKDIR}/.license-catalog.mk _LICENSE_REPORT?= ${_LICENSE_DIR}/LICENSE _LICENSE_REPORT_TMP?= ${WRKDIR}/.license-report _LICENSE_COOKIE?= ${WRKDIR}/.license_done.${PORTNAME}.${PREFIX:S/\//_/g} # Defaults (never overriden for now) # # _LICENSE - Copy of LICENSE (for now) # _LICENSE_COMB - Copy of LICENSE_COMB (but "single" instead of empty) _LICENSE?= ${LICENSE} .if !defined(LICENSE_COMB) _LICENSE_COMB= single .else _LICENSE_COMB= ${LICENSE_COMB} .endif # Check if single or dual/multiple license # # Make sure LICENSE_COMB is only used with more than one license. .if ${_LICENSE_COMB} != "single" && ${_LICENSE_COMB} != "dual" && ${_LICENSE_COMB} != "multi" _LICENSE_ERROR?= invalid value for LICENSE_COMB: "${_LICENSE_COMB}" (should be "single", "dual" or "multi") .endif .for lic in ${_LICENSE} . if defined(_LICENSE_DEFINED) . if ${_LICENSE_COMB} == "single" _LICENSE_ERROR?= multiple licenses in LICENSE, but LICENSE_COMB is set to "single" (or undefined) . else _LICENSE_MULTI= yes . endif . else _LICENSE_DEFINED= yes . endif .endfor .if ${_LICENSE_COMB} != "single" && !defined(_LICENSE_MULTI) _LICENSE_ERROR?= single license in LICENSE, but LICENSE_COMB is set to "${_LICENSE_COMB}" (requires more than one) .endif .if !defined(_LICENSE_DEFINED) _LICENSE_ERROR?= no licenses present in LICENSE (empty string) .endif .undef _LICENSE_DEFINED .undef _LICENSE_MULTI # Evaluate port license groups and permissions # # Available values for _LICENSE_TYPE: # # Case 1: "known" (license info taken from internal database) # Case 2: "unknown" (LICENSE is not known, and info taken from port) # # Make sure required variables are defined, and remove conflicting (positive # and negative) duplicated components. .if ${_LICENSE_COMB} == "single" # Defaults to empty _LICENSE_GROUPS?= # # Start . for lic in ${_LICENSE} . if ${_LICENSE_LIST:M${lic}} != "" # Case 1: license defined in the framework. _LICENSE_TYPE= known . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}) _LICENSE_ERROR?= redefining LICENSE_${var} is not allowed for known licenses, to define a custom license try another LICENSE name like ${_LICENSE}-variant . endif . if !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= ERROR: missing _LICENSE_${var}_${lic} in bsd.licenses.db.mk . else _LICENSE_${var}= ${_LICENSE_${var}_${lic}} . endif . endfor # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE) . if !defined(LICENSE_TEXT) . if exists(${_LICENSE_STORE}/${lic}) _LICENSE_FILE= ${_LICENSE_STORE}/${lic} . else # No license file in /usr/ports/Templates/Licenses _LICENSE_TEXT= The license: ${_LICENSE} (${_LICENSE_NAME}) is standard, please read from the web. _LICENSE_FILE= ${WRKDIR}/${lic} . endif . else _LICENSE_ERROR?= defining LICENSE_TEXT is not allowed for known licenses . endif . else _LICENSE_FILE= ${LICENSE_FILE} . endif . else # Case 2: license only known by the port. _LICENSE_TYPE= unknown . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}) _LICENSE_${var}= ${LICENSE_${var}} . elif !defined(_LICENSE_${var}) _LICENSE_ERROR?= for unknown licenses, defining LICENSE_${var} is mandatory (otherwise use a known LICENSE) . endif . endfor # Check LICENSE_PERMS for invalid, ambiguous and duplicate components __LICENSE_PERMS:= # . for comp in ${_LICENSE_PERMS} . if ${_LICENSE_LIST_PERMS:M${comp:C/^no-//}} == "" _LICENSE_ERROR?= invalid LICENSE_PERMS component "${comp}" . elif ${__LICENSE_PERMS:M${comp}} == "" && \ ${_LICENSE_PERMS:Mno-${comp:C/^no-//}} == "" __LICENSE_PERMS+= ${comp} . endif . endfor _LICENSE_PERMS:= ${__LICENSE_PERMS} . undef __LICENSE_PERMS # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE) . if !defined(LICENSE_TEXT) _LICENSE_ERROR?= either LICENSE_FILE or LICENSE_TEXT must be defined . else _LICENSE_TEXT= ${LICENSE_TEXT} _LICENSE_FILE= ${WRKDIR}/${lic} . endif . else _LICENSE_FILE= ${LICENSE_FILE} . endif . endif # Only one is allowed . if defined(LICENSE_FILE) && defined(LICENSE_TEXT) _LICENSE_ERROR?= defining both LICENSE_FILE and LICENSE_TEXT is not allowed . endif # Distfiles . if !defined(LICENSE_DISTFILES) _LICENSE_DISTFILES= ${_DISTFILES} . else _LICENSE_DISTFILES= ${LICENSE_DISTFILES} . endif . endfor .else . for lic in ${_LICENSE} # Defaults to empty _LICENSE_GROUPS_${lic}?=# . if ${_LICENSE_LIST:M${lic}} != "" # Case 1: license defined in the framework. -_LICENSE_TYPE_${lic} = known +_LICENSE_TYPE_${lic}= known . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}_${lic}) _LICENSE_ERROR?= redefining LICENSE_${var}_${lic} is not allowed for known licenses, to define a custom license try another LICENSE name for ${lic} like ${lic}-variant . endif . if !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= ERROR: missing _LICENSE_${var}_${lic} in bsd.licenses.db.mk . endif . endfor # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE_${lic}) . if !defined(LICENSE_TEXT_${lic}) . if exists(${_LICENSE_STORE}/${lic}) -_LICENSE_FILE_${lic} = ${_LICENSE_STORE}/${lic} +_LICENSE_FILE_${lic}= ${_LICENSE_STORE}/${lic} . else # No license file in /usr/ports/Templates/Licenses -_LICENSE_TEXT_${lic} = The license: ${lic} (${_LICENSE_NAME_${lic}}) is standard, please read from the web. -_LICENSE_FILE_${lic} = ${WRKDIR}/${lic} +_LICENSE_TEXT_${lic}= The license: ${lic} (${_LICENSE_NAME_${lic}}) is standard, please read from the web. +_LICENSE_FILE_${lic}= ${WRKDIR}/${lic} . endif . else _LICENSE_ERROR?= defining LICENSE_TEXT_${lic} is not allowed for known licenses . endif . else -_LICENSE_FILE_${lic} = ${LICENSE_FILE_${lic}} +_LICENSE_FILE_${lic}= ${LICENSE_FILE_${lic}} . endif . else # Case 2: license only known by the port. -_LICENSE_TYPE_${lic} = unknown +_LICENSE_TYPE_${lic}= unknown . for var in ${_LICENSE_LIST_PORT_VARS} . if defined(LICENSE_${var}_${lic}) -_LICENSE_${var}_${lic} = ${LICENSE_${var}_${lic}} +_LICENSE_${var}_${lic}= ${LICENSE_${var}_${lic}} . elif !defined(_LICENSE_${var}_${lic}) _LICENSE_ERROR?= for unknown licenses, defining LICENSE_${var}_${lic} is mandatory (otherwise use a known LICENSE) . endif . endfor # Check LICENSE_PERMS for invalid, ambiguous and duplicate components __LICENSE_PERMS:= # . for comp in ${_LICENSE_PERMS_${lic}} . if ${_LICENSE_LIST_PERMS:M${comp:C/^no-//}} == "" _LICENSE_ERROR?= invalid LICENSE_PERMS_${var} component "${comp}" . elif ${__LICENSE_PERMS:M${comp}} == "" && \ ${_LICENSE_PERMS_${lic}:Mno-${comp:C/^no-//}} == "" __LICENSE_PERMS+= ${comp} . endif . endfor _LICENSE_PERMS_${lic}:= ${__LICENSE_PERMS} . undef __LICENSE_PERMS # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it) . if !defined(LICENSE_FILE_${lic}) . if !defined(LICENSE_TEXT_${lic}) _LICENSE_ERROR?= either LICENSE_FILE_${lic} or LICENSE_TEXT_${lic} must be defined . else -_LICENSE_TEXT_${lic} = ${LICENSE_TEXT_${lic}} -_LICENSE_FILE_${lic} = ${WRKDIR}/${lic} +_LICENSE_TEXT_${lic}= ${LICENSE_TEXT_${lic}} +_LICENSE_FILE_${lic}= ${WRKDIR}/${lic} . endif . else -_LICENSE_FILE_${lic} = ${LICENSE_FILE_${lic}} +_LICENSE_FILE_${lic}= ${LICENSE_FILE_${lic}} . endif . endif # Only one is allowed . if defined(LICENSE_FILE_${lic}) && defined(LICENSE_TEXT_${lic}) _LICENSE_ERROR?= defining both LICENSE_FILE_${lic} and LICENSE_TEXT_${lic}is not allowed . endif # Distfiles . if !defined(LICENSE_DISTFILES_${lic}) -_LICENSE_DISTFILES_${lic} = ${_DISTFILES} +_LICENSE_DISTFILES_${lic}= ${_DISTFILES} . else -_LICENSE_DISTFILES_${lic} = ${LICENSE_DISTFILES_${lic}} +_LICENSE_DISTFILES_${lic}= ${LICENSE_DISTFILES_${lic}} . endif . endfor .endif # Check if the user agrees with the license # Make sure these are defined LICENSES_ACCEPTED?= # LICENSES_REJECTED?= # LICENSES_GROUPS_ACCEPTED?= # LICENSES_GROUPS_REJECTED?= # # Evaluate per-license status .if ${_LICENSE_COMB} == "single" . for lic in ${_LICENSE} . if ${LICENSES_REJECTED:M${lic}} != "" _LICENSE_STATUS?= rejected . endif . for group in ${_LICENSE_GROUPS} . if ${LICENSES_GROUPS_REJECTED:M${group}} != "" _LICENSE_STATUS?= rejected . endif . if ${LICENSES_GROUPS_ACCEPTED:M${group}} != "" _LICENSE_STATUS?= accepted . endif . endfor . if ${LICENSES_ACCEPTED:M${lic}} != "" _LICENSE_STATUS?= accepted . endif . if ${_LICENSE_PERMS:Mauto-accept} != "" && !defined(LICENSES_ASK) _LICENSE_STATUS?= accepted . endif _LICENSE_STATUS?= ask . endfor .else . for lic in ${_LICENSE} . if ${LICENSES_REJECTED:M${lic}} != "" _LICENSE_STATUS_${lic}?= rejected . endif . for group in ${_LICENSE_GROUPS_${lic}} . if ${LICENSES_GROUPS_REJECTED:M${group}} != "" _LICENSE_STATUS_${lic}?= rejected . endif . if ${LICENSES_GROUPS_ACCEPTED:M${group}} != "" _LICENSE_STATUS_${lic}?= accepted . endif . endfor . if ${LICENSES_ACCEPTED:M${lic}} != "" _LICENSE_STATUS_${lic}?= accepted . endif . if ${_LICENSE_PERMS_${lic}:Mauto-accept} != "" && !defined(LICENSES_ASK) _LICENSE_STATUS_${lic}?= accepted . endif _LICENSE_STATUS_${lic}?= ask . endfor .endif # Evaluate general status .if ${_LICENSE_COMB} == "dual" . for lic in ${_LICENSE} . if ${_LICENSE_STATUS_${lic}} == "accepted" _LICENSE_STATUS= accepted . elif ${_LICENSE_STATUS_${lic}} == "ask" _LICENSE_STATUS?= ask _LICENSE_TO_ASK+= ${lic} . endif _LICENSE_STATUS?= rejected . endfor .elif ${_LICENSE_COMB} == "multi" . for lic in ${_LICENSE} . if ${_LICENSE_STATUS_${lic}} == "rejected" _LICENSE_STATUS= rejected . elif ${_LICENSE_STATUS_${lic}} == "ask" _LICENSE_STATUS?= ask _LICENSE_TO_ASK+= ${lic} . endif . endfor _LICENSE_STATUS?= accepted .endif # For dual/multi licenses, after processing all sub-licenses, the following # must be determined: _LICENSE_NAME, _LICENSE_PERMS and _LICENSE_GROUPS. .if ${_LICENSE_COMB} == "dual" _LICENSE_NAME= Dual (any of): ${_LICENSE} # Calculate least restrictive permissions (union) _LICENSE_PERMS:= # . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_PERMS} . if ${_LICENSE_PERMS_${lic}:M${comp}} != "" && \ ${_LICENSE_PERMS:M${comp}} == "" _LICENSE_PERMS+= ${comp} . endif . endfor . endfor # Calculate least restrictive groups (union) _LICENSE_GROUPS:= # . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_GROUPS} . if ${_LICENSE_GROUPS_${lic}:M${comp}} != "" && \ ${_LICENSE_GROUPS:M${comp}} == "" _LICENSE_GROUPS+= ${comp} . endif . endfor . endfor .elif ${_LICENSE_COMB} == "multi" _LICENSE_NAME= Multiple (all of): ${_LICENSE} # Calculate most restrictive permissions (intersection) _LICENSE_PERMS:= ${_LICENSE_LIST_PERMS} . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_PERMS} . if ${_LICENSE_PERMS_${lic}:M${comp}} == "" _LICENSE_PERMS:= ${_LICENSE_PERMS:N${comp}} . endif . endfor . endfor # Calculate most restrictive groups (intersection) _LICENSE_GROUPS:= ${_LICENSE_LIST_GROUPS} . for lic in ${_LICENSE} . for comp in ${_LICENSE_LIST_GROUPS} . if ${_LICENSE_GROUPS_${lic}:M${comp}} == "" _LICENSE_GROUPS:= ${_LICENSE_GROUPS:N${comp}} . endif . endfor . endfor .endif # Prepare information for asking license to the user .if ${_LICENSE_STATUS} == "ask" && ${_LICENSE_COMB} != "single" _LICENSE_ASK_DATA!= mktemp -ut portslicense .endif # Calculate restrictions and set RESTRICTED_FILES when # appropiate, together with cleaning targets. # # XXX For multiple licenses restricted distfiles are always removed from both # CDROM and FTP, but the current framework supports separating them (would # require better/new delete-package and delete-distfiles targets) .if ${_LICENSE_PERMS:Mpkg-mirror} == "" _LICENSE_RESTRICTED+= delete-package .elif ${_LICENSE_PERMS:Mpkg-sell} == "" _LICENSE_CDROM+= delete-package .endif .if ${_LICENSE_COMB} == "multi" . for lic in ${_LICENSE} . if ${_LICENSE_PERMS_${lic}:Mdist-mirror} == "" || ${_LICENSE_PERMS_${lic}:Mdist-sell} == "" RESTRICTED_FILES+= ${_LICENSE_DISTFILES_${lic}} . endif . endfor . if defined(RESTRICTED_FILES) RESTRICTED_FILES+= ${_PATCHFILES} _LICENSE_RESTRICTED+= delete-distfiles _LICENSE_CDROM+= delete-distfiles . endif .else . if ${_LICENSE_PERMS:Mdist-mirror} == "" _LICENSE_RESTRICTED+= delete-distfiles RESTRICTED_FILES= ${_PATCHFILES} ${_DISTFILES} . elif ${_LICENSE_PERMS:Mdist-sell} == "" _LICENSE_CDROM+= delete-distfiles RESTRICTED_FILES= ${_PATCHFILES} ${_DISTFILES} . endif .endif .if defined(_LICENSE_RESTRICTED) # _LICENSE_RESTRICTED contains 'delete-distfiles' and 'delete-package' if # needed with RESTRICTED_FILES filled from above. clean-restricted: ${_LICENSE_RESTRICTED} clean-restricted-list: ${_LICENSE_RESTRICTED:C/$/-list/} .else clean-restricted: clean-restricted-list: .endif .if defined(_LICENSE_CDROM) clean-for-cdrom: ${_LICENSE_CDROM} clean-for-cdrom-list: ${_LICENSE_CDROM:C/$/-list/} .else clean-for-cdrom: clean-for-cdrom-list: .endif # Check variables are correctly defined and print status up to here .if ${_LICENSE_STATUS} == "ask" && defined(BATCH) IGNORE= License ${_LICENSE} needs confirmation, but BATCH is defined .endif check-license: .if defined(_LICENSE_ERROR) @${ECHO_MSG} "===> License not correctly defined: ${_LICENSE_ERROR}" @exit 1 .endif .if ${_LICENSE_STATUS} == "rejected" @${ECHO_MSG} "===> License ${_LICENSE} rejected by the user" @${ECHO_MSG} @${ECHO_MSG} "If you want to install this port make sure the following license(s) are not present in LICENSES_REJECTED, either in make arguments or /etc/make.conf: ${_LICENSE}. Also check LICENSES_GROUPS_REJECTED in case they contain a group this license(s) belong to." | ${FMT} @${ECHO_MSG} @exit 1 .elif ${_LICENSE_STATUS} == "accepted" @${ECHO_MSG} "===> License ${_LICENSE} accepted by the user" .elif ${_LICENSE_STATUS} == "ask" @${ECHO_MSG} "===> License ${_LICENSE} needs confirmation, will ask later" .endif # Display, ask and save preference if requested ask-license: ${_LICENSE_COOKIE} ${_LICENSE_COOKIE}: # Make sure all required license files exist .if ${_LICENSE_COMB} == "single" . if !defined(LICENSE_FILE) && defined(_LICENSE_TEXT) @test -f ${_LICENSE_FILE} || ${ECHO_CMD} "${_LICENSE_TEXT}" | ${FMT} > ${_LICENSE_FILE} . endif @test -f ${_LICENSE_FILE} || \ (${ECHO_MSG} "===> Missing license file for ${_LICENSE} in ${_LICENSE_FILE}"; exit 1) .else . for lic in ${_LICENSE} . if !defined(LICENSE_FILE_${lic}) && defined(_LICENSE_TEXT_${lic}) @test -f ${_LICENSE_FILE_${lic}} || ${ECHO_CMD} "${_LICENSE_TEXT_${lic}}" | ${FMT} > ${_LICENSE_FILE_${lic}} . endif @test -f ${_LICENSE_FILE_${lic}} || \ (${ECHO_MSG} "===> Missing license file for ${lic} in ${_LICENSE_FILE_${lic}}"; exit 1) . endfor .endif .if ${_LICENSE_STATUS} == "ask" . if !defined(NO_LICENSES_DIALOGS) # Dialog interface . if ${_LICENSE_COMB} == "single" @${DIALOG} --title "License for ${PKGNAME} (${_LICENSE})" \ --yes-label Accept --no-label Reject --yesno \ "$$(${CAT} ${_LICENSE_FILE})" 21 76 . elif ${_LICENSE_COMB} == "dual" @${RM} ${_LICENSE_ASK_DATA} . for lic in ${_LICENSE_TO_ASK} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} . endfor @menu_cmd="${DIALOG} --hline \"This port requires you to accept at least one license\" --menu \"License for ${PKGNAME} (dual)\" 21 70 15"; \ trap '${RM} $$tmpfile' EXIT INT TERM; \ tmpfile=$$(mktemp -t portlicenses); \ for lic in ${_LICENSE_TO_ASK}; do \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\" USE_$${lic} \"Accept the license $${lic}\""; \ done; \ menu_cmd="$${menu_cmd} REJECT \"Reject the licenses (all)\""; \ while true; do \ ${SH} -c "$${menu_cmd} 2>\"$${tmpfile}\""; \ result=$$(${CAT} "$${tmpfile}"); \ case $${result} in \ REJECT) exit 1;; \ VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \ file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \ ${DIALOG} --textbox "$${file}" 21 75 ;; \ USE_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^USE_//'); \ ${ECHO_CMD} $${name} > ${_LICENSE_COOKIE}; \ break ;; \ esac; \ done . elif ${_LICENSE_COMB} == "multi" @${RM} ${_LICENSE_ASK_DATA} . for lic in ${_LICENSE_TO_ASK} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} . endfor @menu_cmd="${DIALOG} --hline \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \ trap '${RM} $$tmpfile' EXIT INT TERM; \ tmpfile=$$(mktemp -t portlicenses); \ for lic in ${_LICENSE_TO_ASK}; do \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\""; \ done; \ menu_cmd="$${menu_cmd} ACCEPT \"Accept the licenses (all)\" REJECT \"Reject the licenses (all)\""; \ while true; do \ ${SH} -c "$${menu_cmd} 2>\"$${tmpfile}\""; \ result=$$(${CAT} "$${tmpfile}"); \ case $${result} in \ ACCEPT) break ;; \ REJECT) exit 1 ;; \ VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \ file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \ ${DIALOG} --textbox "$${file}" 21 75 ;; \ esac; \ done . endif . else # Text interface @${ECHO_MSG} . if ${_LICENSE_COMB} == "single" @${ECHO_MSG} "To install the port you must agree to the license: ${_LICENSE} (${_LICENSE_NAME})." | ${FMT} @${ECHO_MSG} @${ECHO_MSG} "You can view the license at ${_LICENSE_FILE:S/${WRKDIR}\//${WRKDIR:T}\//}." . elif ${_LICENSE_COMB} == "dual" @${ECHO_MSG} "To install the port you must agree to any of the following licenses:" . elif ${_LICENSE_COMB} == "multi" @${ECHO_MSG} "To install the port you must agree to all of the following licenses:" . endif @${ECHO_MSG} . if ${_LICENSE_COMB} != "single" . for lic in ${_LICENSE_TO_ASK} . if defined(WRKDIRPREFIX) @${ECHO_MSG} "- ${lic} (${_LICENSE_NAME_${lic}}), available at ${_LICENSE_FILE_${lic}}" . else @${ECHO_MSG} "- ${lic} (${_LICENSE_NAME_${lic}}), available at ${_LICENSE_FILE_${lic}:S/${WRKDIR}\//${WRKDIR:T}\//}" . endif . endfor @${ECHO_MSG} . endif @${ECHO_MSG} "If you agree with the corresponding license(s), add them to LICENSES_ACCEPTED either in make arguments or /etc/make.conf." | ${FMT} @${ECHO_MSG} @exit 1 . endif @${RM} ${_LICENSE_ASK_DATA} .endif # Create report and catalog .if !defined(NO_LICENSES_INSTALL) @${RM} ${_LICENSE_CATALOG_TMP} ${_LICENSE_REPORT_TMP} . if ${_LICENSE_COMB} == "single" # Catalog . for var in _LICENSE _LICENSE_NAME _LICENSE_PERMS _LICENSE_GROUPS _LICENSE_DISTFILES @${ECHO_CMD} "${var}=${${var}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor # Report @${ECHO_CMD} "This package has a single license: ${_LICENSE} (${_LICENSE_NAME})." > ${_LICENSE_REPORT_TMP} . else # Catalog . for var in _LICENSE _LICENSE_COMB _LICENSE_NAME _LICENSE_PERMS _LICENSE_GROUPS @${ECHO_CMD} "${var}=${${var}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor . if ${_LICENSE_COMB} == "dual" && ${_LICENSE_STATUS} == "ask" @${SED} -e 's/^/_LICENSE_SELECTED=/' ${_LICENSE_COOKIE} >> ${_LICENSE_CATALOG_TMP} . endif . for lic in ${_LICENSE} . for var in NAME PERMS GROUPS DISTFILES @${ECHO_CMD} "_LICENSE_${var}_${lic} =${_LICENSE_${var}_${lic}:C/^[[:blank:]]*//}" >> ${_LICENSE_CATALOG_TMP} . endfor . endfor # Report . if ${_LICENSE_COMB} == "dual" @${ECHO_CMD} "This package has dual licenses (any of):" >> ${_LICENSE_REPORT_TMP} . elif ${_LICENSE_COMB} == "multi" @${ECHO_CMD} "This package has multiple licenses (all of):" >> ${_LICENSE_REPORT_TMP} . endif . for lic in ${_LICENSE} @${ECHO_CMD} "- ${lic} (${_LICENSE_NAME_${lic}})" >> ${_LICENSE_REPORT_TMP} . endfor . endif .endif # Cookie (done here) @${TOUCH} ${_LICENSE_COOKIE} # Package list entries, and installation .if !defined(NO_LICENSES_INSTALL) PLIST_FILES+= ${_LICENSE_CATALOG} \ ${_LICENSE_REPORT} .if ${_LICENSE_COMB} == "single" PLIST_FILES+= ${_LICENSE_DIR}/${_LICENSE} .else . for lic in ${_LICENSE} . if defined(_LICENSE_FILE_${lic}) PLIST_FILES+= ${_LICENSE_DIR}/${lic} . endif . endfor .endif install-license: @${MKDIR} ${STAGEDIR}${_LICENSE_DIR} @${INSTALL_DATA} ${_LICENSE_CATALOG_TMP} ${STAGEDIR}${_LICENSE_CATALOG} @${INSTALL_DATA} ${_LICENSE_REPORT_TMP} ${STAGEDIR}${_LICENSE_REPORT} .if ${_LICENSE_COMB} == "single" @${INSTALL_DATA} ${_LICENSE_FILE} ${STAGEDIR}${_LICENSE_DIR}/${_LICENSE} .else . for lic in ${_LICENSE} @${INSTALL_DATA} ${_LICENSE_FILE_${lic}} ${STAGEDIR}${_LICENSE_DIR}/${lic} . endfor .endif .endif .else # !LICENSE check-license: . if defined(LICENSE_VERBOSE) @${ECHO_MSG} "===> License check disabled, port has not defined LICENSE" . endif .endif # LICENSE .endif