From aec70d53102fcd5f468dc8439a25010254166c22 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 28 Jun 2018 16:13:52 +0800 Subject: Collect licenses for the distribution --- scripts/functions | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index ab235d89..81406c39 100644 --- a/scripts/functions +++ b/scripts/functions @@ -2396,3 +2396,34 @@ else CT_Error "Not found: paths.sh" fi . "${paths_sh_location}" + +CT_InstallCopyingInformation() +{ + local pkgname + local pkgdir + local licfile + local dstdir + + CT_DoLog EXTRA "Collect license information from: ${CT_SRC_DIR}" + CT_DoLog EXTRA "Put the license information to: ${CT_PREFIX_DIR}/share/licenses" + + shopt -s nullglob + + for pkgdir in ${CT_SRC_DIR}/*; do + pkgname=$(basename "${pkgdir}") + for licfile in ${pkgdir}/{COPYING*,LICENSE*}; do + dstdir="${CT_PREFIX_DIR}/share/licenses/${pkgname}" + mkdir -p "${dstdir}" + CT_DoExecLog ALL cp -av "${licfile}" "${dstdir}/" + done + done + + # Also add crosstool's information + for licfile in ${CT_TOP_DIR}/{COPYING*,LICENSE*,licenses.d}; do + dstdir="${CT_PREFIX_DIR}/share/licenses/crosstool-ng" + mkdir -p "${dstdir}" + CT_DoExecLog ALL cp -av "${licfile}" "${dstdir}/" + done + + shopt -u nullglob +} -- cgit v1.2.3