mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Markus Niebel <list-09_ptxdist@tqsc.de>
To: ptxdist@pengutronix.de
Cc: m.olbrich@pengutronix.de, Markus Niebel <Markus.Niebel@tq-group.com>
Subject: [ptxdist] [RFC 1/2] ptxdist: add license text extraction
Date: Wed, 21 Jan 2015 09:12:31 +0100	[thread overview]
Message-ID: <1421827952-15513-2-git-send-email-list-09_ptxdist@tqsc.de> (raw)
In-Reply-To: <1421827952-15513-1-git-send-email-list-09_ptxdist@tqsc.de>

From: Markus Niebel <Markus.Niebel@tq-group.com>

It would be good to have the possibility to extract license texts for
target packages. This would add a benefit to ptxdist since it makes
auditing a BSP easier.

This patch adds

- a new (optional) variable to package rule file to encode the
  license file(s) for this package
- set a pkg var with the value new var from the package rule
  or use default list of filenames
- copy the license text files in the targetinstall.post stage to
  a directory under $PTXDIST_PLATFORMDIR/<pkg>-<pkg_version>

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
---
 rules/post/ptxd_make_world_common.make |  1 +
 scripts/lib/ptxd_make_xpkg_common.sh   |  3 +++
 scripts/lib/ptxd_make_xpkg_finish.sh   | 11 +++++++++++
 3 files changed, 15 insertions(+)

diff --git a/rules/post/ptxd_make_world_common.make b/rules/post/ptxd_make_world_common.make
index 4820d8c..01d2c88 100644
--- a/rules/post/ptxd_make_world_common.make
+++ b/rules/post/ptxd_make_world_common.make
@@ -55,6 +55,7 @@ world/env/impl = \
 	pkg_pkg_dir="$(call ptx/escape,$($(1)_PKGDIR))"				\
 	pkg_pkg_dev="$(call ptx/escape,$($(1)_DEVPKG))"				\
 	pkg_license="$(call ptx/escape,$($(1)_LICENSE))"			\
+	pkg_license_text="$(call ptx/escape,$($(1)_LICENSE_TEXT))"	\
 	pkg_build_deps="$(call ptx/escape,$(PTX_MAP_B_dep_$(1)))"		\
 	pkg_run_deps="$(call ptx/escape,$(PTX_MAP_R_dep_$(1)))"			\
 										\
diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_xpkg_common.sh
index 279348f..90501eb 100644
--- a/scripts/lib/ptxd_make_xpkg_common.sh
+++ b/scripts/lib/ptxd_make_xpkg_common.sh
@@ -87,6 +87,9 @@ ptxd_make_xpkg_init() {
     pkg_license="${pkg_license:-unknown}"
     pkg_xpkg_license="${pkg_xpkg_license:-${pkg_license}}"
     pkg_xpkg_license_file="${ptx_state_dir}/${pkg_xpkg}.license"
+    pkg_license_text="${pkg_license_text:-COPYING COPYING3 COPYING.LIB COPYING3.LIB}"
+    pkg_xpkg_license_text="${pkg_xpkg_license_text:-${pkg_license_text}}"
+    pkg_xpkg_license_dir="${PTXDIST_PLATFORMDIR}/licenses/${pkg_xpkg}-${pkg_xpkg_version}"
 
     # packaging stuff
     pkg_xpkg_install_deps="${ptx_state_dir}/${pkg_xpkg}.deps"
diff --git a/scripts/lib/ptxd_make_xpkg_finish.sh b/scripts/lib/ptxd_make_xpkg_finish.sh
index e56be89..ec28710 100644
--- a/scripts/lib/ptxd_make_xpkg_finish.sh
+++ b/scripts/lib/ptxd_make_xpkg_finish.sh
@@ -63,6 +63,17 @@ EOF
     #
     echo -n "xpkg_finish:	collecting license (${pkg_xpkg_license}) ... "
     echo "${pkg_xpkg_license}" > "${pkg_xpkg_license_file}"
+    #
+    # create a package specific dir to store the license information
+    #
+    mkdir -p "${pkg_xpkg_license_dir}"
+    cp "${pkg_xpkg_license_file}" "${pkg_xpkg_license_dir}/license"
+    for f in ${pkg_xpkg_license_text}
+    do
+        if [ -f "${pkg_dir}/${f}" ]; then
+            cp "${pkg_dir}/${f}" "${pkg_xpkg_license_dir}"
+        fi
+    done
     echo "done."
 
     #
-- 
2.2.1


-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2015-01-21  8:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  8:12 [ptxdist] [RFC 0/2] add a way to extract license text from packages Markus Niebel
2015-01-21  8:12 ` Markus Niebel [this message]
2015-01-21  8:12 ` [ptxdist] [RFC 2/2] icu: add LICENSE_TEXT Markus Niebel
2015-01-29  7:45 ` [ptxdist] [RFC 0/2] add a way to extract license text from packages Markus Niebel
2015-01-29 20:23   ` Guillermo Rodriguez Garcia
2015-01-30  7:48     ` Markus Niebel
2015-02-10 13:14       ` Guillermo Rodriguez Garcia
2015-02-11 10:50       ` Hubert Feurstein
2015-02-11 11:19         ` Juergen Borleis
2015-02-11 13:02           ` Michael Olbrich
2015-02-17  8:10             ` Markus Niebel
2015-02-19 14:12               ` Michael Olbrich
2015-02-12  7:33           ` Markus Niebel
2015-02-12  8:55             ` Robert Schwebel
2016-10-03 22:23           ` [ptxdist] license-report: extend to generate textual list of package + licenses Andreas Pretzsch
2016-10-04 13:02             ` Michael Olbrich
2016-10-04 17:15               ` Andreas Pretzsch
2016-10-05 12:53                 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421827952-15513-2-git-send-email-list-09_ptxdist@tqsc.de \
    --to=list-09_ptxdist@tqsc.de \
    --cc=Markus.Niebel@tq-group.com \
    --cc=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox