summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/license.bbclass219
-rw-r--r--meta/conf/licenses.conf54
-rw-r--r--meta/files/common-licenses/AFL-192
-rw-r--r--meta/files/common-licenses/AFL-2155
-rw-r--r--meta/files/common-licenses/AGPL-3213
-rw-r--r--meta/files/common-licenses/APL-1327
-rw-r--r--meta/files/common-licenses/APSL-1334
-rw-r--r--meta/files/common-licenses/APSL-2337
-rw-r--r--meta/files/common-licenses/Adobe14
-rw-r--r--meta/files/common-licenses/Apache-159
-rw-r--r--meta/files/common-licenses/Apache-2203
-rw-r--r--meta/files/common-licenses/Artistic131
-rw-r--r--meta/files/common-licenses/Artistic-197
-rw-r--r--meta/files/common-licenses/Artistic-2202
-rw-r--r--meta/files/common-licenses/BSL-125
-rw-r--r--meta/files/common-licenses/BitstreamVera160
-rw-r--r--meta/files/common-licenses/CATOSL-1335
-rw-r--r--meta/files/common-licenses/CC-BY-1185
-rw-r--r--meta/files/common-licenses/CC-BY-2205
-rw-r--r--meta/files/common-licenses/CC-BY-3283
-rw-r--r--meta/files/common-licenses/CC-BY-NC-1194
-rw-r--r--meta/files/common-licenses/CC-BY-NC-2220
-rw-r--r--meta/files/common-licenses/CC-BY-NC-3297
-rw-r--r--meta/files/common-licenses/CC-BY-NC-ND-1146
-rw-r--r--meta/files/common-licenses/CC-BY-NC-ND-2209
-rw-r--r--meta/files/common-licenses/CC-BY-NC-ND-3272
-rw-r--r--meta/files/common-licenses/CC-BY-NC-SA-1209
-rw-r--r--meta/files/common-licenses/CC-BY-NC-SA-2242
-rw-r--r--meta/files/common-licenses/CC-BY-NC-SA-3320
-rw-r--r--meta/files/common-licenses/CC-BY-ND-10
-rw-r--r--meta/files/common-licenses/CC-BY-ND-2194
-rw-r--r--meta/files/common-licenses/CC-BY-ND-3259
-rw-r--r--meta/files/common-licenses/CC-BY-SA-1201
-rw-r--r--meta/files/common-licenses/CC-BY-SA-2227
-rw-r--r--meta/files/common-licenses/CC-BY-SA-3319
-rw-r--r--meta/files/common-licenses/CDDL-1313
-rw-r--r--meta/files/common-licenses/CECILL-1462
-rw-r--r--meta/files/common-licenses/CECILL-2451
-rw-r--r--meta/files/common-licenses/CPAL-1435
-rw-r--r--meta/files/common-licenses/CPL-1250
-rw-r--r--meta/files/common-licenses/CUA-OPL-1482
-rw-r--r--meta/files/common-licenses/DSSSL49
-rw-r--r--meta/files/common-licenses/ECL-161
-rw-r--r--meta/files/common-licenses/ECL-2218
-rw-r--r--meta/files/common-licenses/EDL-1.013
-rw-r--r--meta/files/common-licenses/EFL-130
-rw-r--r--meta/files/common-licenses/EFL-227
-rw-r--r--meta/files/common-licenses/EPL-1204
-rw-r--r--meta/files/common-licenses/EUPL-1302
-rw-r--r--meta/files/common-licenses/Elfutils-Exception12
-rw-r--r--meta/files/common-licenses/ErlPL-1293
-rw-r--r--meta/files/common-licenses/FSF-Unlimited4
-rw-r--r--meta/files/common-licenses/Frameworx-1181
-rw-r--r--meta/files/common-licenses/FreeType170
-rw-r--r--meta/files/common-licenses/GPL-1259
-rw-r--r--meta/files/common-licenses/GPL-1.0+252
-rw-r--r--meta/files/common-licenses/GPL-223
-rw-r--r--meta/files/common-licenses/GPL-2,0-with-GCC-exception17
-rw-r--r--meta/files/common-licenses/GPL-2,0-with-font-exception18
-rw-r--r--meta/files/common-licenses/GPL-2.0+132
-rw-r--r--meta/files/common-licenses/GPL-2.0-with-GCC-exception13
-rw-r--r--meta/files/common-licenses/GPL-2.0-with-font-exception14
-rw-r--r--meta/files/common-licenses/GPL-370
-rw-r--r--meta/files/common-licenses/GPL-3.0224
-rw-r--r--meta/files/common-licenses/GPL-3.0+3
-rw-r--r--meta/files/common-licenses/IPL-1222
-rw-r--r--meta/files/common-licenses/LGPL-2461
-rw-r--r--meta/files/common-licenses/LGPL-2.0189
-rw-r--r--meta/files/common-licenses/LGPL-2.0+173
-rw-r--r--meta/files/common-licenses/LGPL-2.1+176
-rw-r--r--meta/files/common-licenses/LGPL-3147
-rw-r--r--meta/files/common-licenses/LGPL-3.053
-rw-r--r--meta/files/common-licenses/LGPL-3.0+66
-rw-r--r--meta/files/common-licenses/LPL-1213
-rw-r--r--meta/files/common-licenses/LPPL-1422
l---------meta/files/common-licenses/MIT-style1
-rw-r--r--meta/files/common-licenses/MPL-1433
-rw-r--r--meta/files/common-licenses/NASA-1246
-rw-r--r--meta/files/common-licenses/NPOSL-3206
-rw-r--r--meta/files/common-licenses/OASIS13
-rw-r--r--meta/files/common-licenses/OCLC-2207
-rw-r--r--meta/files/common-licenses/OFL-196
-rw-r--r--meta/files/common-licenses/OLDAP-254
-rw-r--r--meta/files/common-licenses/OSL-1172
-rw-r--r--meta/files/common-licenses/OSL-1.02
-rw-r--r--meta/files/common-licenses/OSL-2171
-rw-r--r--meta/files/common-licenses/OSL-3157
-rw-r--r--meta/files/common-licenses/PHP-370
-rw-r--r--meta/files/common-licenses/Proprietary1
-rw-r--r--meta/files/common-licenses/Python-2192
-rw-r--r--meta/files/common-licenses/QPL-196
-rw-r--r--meta/files/common-licenses/RPL-1582
-rw-r--r--meta/files/common-licenses/RPSL-1535
-rw-r--r--meta/files/common-licenses/SPL519
-rw-r--r--meta/files/common-licenses/Simple-253
-rw-r--r--meta/files/common-licenses/UCB26
-rw-r--r--meta/files/common-licenses/VSL-154
-rw-r--r--meta/files/common-licenses/Watcom-1389
-rw-r--r--meta/files/common-licenses/XFree86-150
-rw-r--r--meta/files/common-licenses/YPL-1140
-rw-r--r--meta/files/common-licenses/ZPL-160
-rw-r--r--meta/files/common-licenses/ZPL-244
-rw-r--r--meta/files/common-licenses/Zimbra-1140
-rw-r--r--meta/files/common-licenses/eCos-238
104 files changed, 1119 insertions, 17671 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 8c6e2d2c9b..8c64e4cd8a 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -1,17 +1,12 @@
# Populates LICENSE_DIRECTORY as set in distro config with the license files as set by
# LIC_FILES_CHKSUM.
# TODO:
-# - We should also enable the ability to put the generated license directory onto the
-# rootfs
-# - Gather up more generic licenses
-# - There is a real issue revolving around license naming standards. See license names
-# licenses.conf and compare them to the license names in the recipes. You'll see some
-# differences and that should be corrected.
+# - There is a real issue revolving around license naming standards.
LICENSE_DIRECTORY ??= "${DEPLOY_DIR}/licenses"
LICSSTATEDIR = "${WORKDIR}/license-destdir/"
-addtask populate_lic after do_patch before do_package
+addtask populate_lic after do_patch before do_compile
do_populate_lic[dirs] = "${LICSSTATEDIR}/${PN}"
do_populate_lic[cleandirs] = "${LICSSTATEDIR}"
@@ -22,33 +17,122 @@ do_populate_lic[cleandirs] = "${LICSSTATEDIR}"
#
# We should really discuss standardizing this field, but that's a longer term goal.
# For now, we can do this and it should grab the most common LICENSE naming variations.
-
-#GPL variations
-SPDXLICENSEMAP[GPL] = "GPL-1"
-SPDXLICENSEMAP[GPLv2] = "GPL-2"
-SPDXLICENSEMAP[GPLv3] = "GPL-3"
+#
+# Changing GPL mapping to GPL-2 as it's not very likely to be GPL-1
+# We should NEVER have a GPL/LGPL without a version!!!!
+# Any mapping to MPL/LGPL/GPL should be fixed
+# see: https://wiki.yoctoproject.org/wiki/License_Audit
+
+# GPL variations
+SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
+SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"
#LGPL variations
-SPDXLICENSEMAP[LGPL] = "LGPL-2"
-SPDXLICENSEMAP[LGPLv2] = "LGPL-2"
+SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
-SPDXLICENSEMAP[LGPLv3] = "LGPL-3"
+SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"
#MPL variations
-SPDXLICENSEMAP[MPL] = "MPL-1"
-SPDXLICENSEMAP[MPLv1] = "MPL-1"
-SPDXLICENSEMAP[MPLv1.1] = "MPL-1"
+SPDXLICENSEMAP[MPL-1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1.1] = "MPL-1.1"
#MIT variations
SPDXLICENSEMAP[MIT-X] = "MIT"
+SPDXLICENSEMAP[MIT-style] = "MIT"
#Openssl variations
SPDXLICENSEMAP[openssl] = "OpenSSL"
+#Python variations
+SPDXLICENSEMAP[PSF] = "Python-2.0"
+SPDXLICENSEMAP[PSFv2] = "Python-2.0"
+SPDXLICENSEMAP[Python-2] = "Python-2.0"
+
+#Apache variations
+SPDXLICENSEMAP[Apachev2] = "Apache-2.0"
+SPDXLICENSEMAP[Apache-2] = "Apache-2.0"
+
+#Artistic variations
+SPDXLICENSEMAP[Artisticv1] = "Artistic-1.0"
+SPDXLICENSEMAP[Artistic-1] = "Artistic-1.0"
+
+#Academic variations
+SPDXLICENSEMAP[AFL-2] = "AFL-2.0"
+SPDXLICENSEMAP[AFL-1] = "AFL-1.2"
+SPDXLICENSEMAP[AFLv2] = "AFL-2.0"
+SPDXLICENSEMAP[AFLv1] = "AFL-1.2"
+
#Other variations
-SPDXLICENSEMAP[AFL2.1] = "AFL-2"
-SPDXLICENSEMAP[EPLv1.0] = "EPL-1"
+SPDXLICENSEMAP[EPLv1.0] = "EPL-1.0"
+
+license_create_manifest() {
+ mkdir -p ${LICENSE_DIRECTORY}/${IMAGE_NAME}
+ # Get list of installed packages
+ list_installed_packages | grep -v "locale" |sort > ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest
+ INSTALLED_PKGS=`cat ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest`
+ # list of installed packages is broken for deb
+ if [ ${IMAGE_PKGTYPE} != "deb" ]; then
+
+ for pkg in ${INSTALLED_PKGS}; do
+ # not the best way to do this but licenses are not arch dependant iirc
+ files=`find ${TMPDIR}/pkgdata/*/runtime -name ${pkg}| head -1`
+ for filename in $files; do
+ pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
+ pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})"
+ # check to see if the package name exists in the manifest. if so, bail.
+ if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then
+ # exclude local recipes
+ if [ ! ${pkged_pn} == "*locale*" ]; then
+ echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ for lic in ${pkged_lic}; do
+ if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then
+ echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ else
+ echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ fi
+ done
+ echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ fi
+ fi
+ done
+ done
+ fi
+
+ # Two options here:
+ # - Just copy the manifest
+ # - Copy the manifest and the license directories
+ # This will make your image a bit larger, however
+ # if you are concerned about license compliance
+ # and delivery this should cover all your bases
+
+ if [ -n ${COPY_LIC_MANIFEST} ]; then
+ mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/
+ cp ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest
+ if [ -n ${COPY_LIC_DIRS} ]; then
+ for pkg in ${INSTALLED_PKGS}; do
+ mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
+ for lic in `ls ${LICENSE_DIRECTORY}/${pkged_pn}`; do
+ # Really don't need to copy the generics as they're
+ # represented in the manifest and in the actual pkg licenses
+ # Doing so would make your image quite a bit larger
+ if [ ! ${lic} == "generic_*" ]; then
+ cp ${LICENSE_DIRECTORY}/${pkged_pn}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
+ fi
+ done
+ done
+ fi
+ fi
+
+}
+
python do_populate_lic() {
"""
@@ -59,6 +143,26 @@ python do_populate_lic() {
import shutil
import oe.license
+ # All the license types for the package
+ license_types = d.getVar('LICENSE', True)
+ # All the license files for the package
+ lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+ pn = d.getVar('PN', True)
+ # The base directory we wrangle licenses to
+ destdir = os.path.join(d.getVar('LICSSTATEDIR', True), pn)
+ # The license files are located in S/LIC_FILE_CHECKSUM.
+ srcdir = d.getVar('S', True)
+ # Directory we store the generic licenses as set in the distro configuration
+ generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+ license_source_dirs = []
+ license_source_dirs.append(generic_directory)
+ try:
+ additional_lic_dirs = d.getVar('LICENSE_DIR', True).split()
+ for lic_dir in additional_lic_dirs:
+ license_source_dirs.append(lic_dir)
+ except:
+ pass
+
class FindVisitor(oe.license.LicenseVisitor):
def visit_Str(self, node):
#
@@ -70,54 +174,38 @@ python do_populate_lic() {
find_license(node.s.replace("+", "").replace("*", ""))
self.generic_visit(node)
- def copy_license(source, destination, file_name):
- try:
- bb.copyfile(os.path.join(source, file_name), os.path.join(destination, file_name))
- except:
- bb.warn("%s: No generic license file exists for: %s at %s" % (pn, file_name, source))
- pass
-
- def link_license(source, destination, file_name):
- try:
- os.symlink(os.path.join(source, file_name), os.path.join(destination, "generic_" + file_name))
- except:
- bb.warn("%s: Could not symlink: %s at %s to %s at %s" % (pn, file_name, source, file_name, destination))
- pass
-
def find_license(license_type):
try:
bb.mkdirhier(gen_lic_dest)
except:
pass
-
+ spdx_generic = None
+ license_source = None