From: Luca Ceresoli <luca@lucaceresoli.net>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC v2 01/31] legal-info: infrastructure to collect legally-relevant material
Date: Fri, 09 Mar 2012 09:51:19 +0100 [thread overview]
Message-ID: <4F59C487.1040401@lucaceresoli.net> (raw)
In-Reply-To: <CAAXf6LU5uXpuYqaFdwek4NrB2J9P4sx3CZwk4Jaq2Q3y8-LWyg@mail.gmail.com>
Thomas De Schampheleire wrote:
> On Wed, Mar 7, 2012 at 9:58 PM, Luca Ceresoli<luca@lucaceresoli.net> wrote:
>> Signed-off-by: Luca Ceresoli<luca@lucaceresoli.net>
>> ---
>> Makefile | 52 ++++++++++++++++++++++++-
>> package/Makefile.package.in | 59 +++++++++++++++++++++++++++++
>> support/legal-info/README.header | 24 ++++++++++++
>> support/legal-info/README.warnings-header | 4 ++
>> 4 files changed, 136 insertions(+), 3 deletions(-)
>> create mode 100644 support/legal-info/README.header
>> create mode 100644 support/legal-info/README.warnings-header
>>
>> diff --git a/Makefile b/Makefile
>> index d508888..b78aaf8 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -284,6 +284,15 @@ TARGET_DIR:=$(BASE_DIR)/target
>> TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
>> TARGET_SKELETON=$(TOPDIR)/fs/skeleton
>>
>> +LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
>> +REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
>> +LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses
>> +LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv
>> +LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
>> +LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
> I'm not sure if this should be a hidden file, as it is quite important
> for a user to really see this.
But at the end it's copied into the final README, where it is visible.
From Makefile:
legal-info: legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \
$(TARGETS_LEGAL_INFO)
@cat support/legal-info/README.header>>$(LEGAL_REPORT)
@if [ -r $(LEGAL_WARNINGS) ]; then \
cat support/legal-info/README.warnings-header \
$(LEGAL_WARNINGS)>>$(LEGAL_REPORT); \
cat $(LEGAL_WARNINGS); fi
@echo "Legal info produced in $(LEGAL_INFO_DIR)"
@rm -f $(LEGAL_WARNINGS)
>> +LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
>> +LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
>> +
>> ifeq ($(BR2_CCACHE),y)
>> CCACHE:=$(HOST_DIR)/usr/bin/ccache
>> CCACHE_CACHE_DIR=$(HOME)/.buildroot-ccache
>> @@ -362,6 +371,10 @@ HOST_DEPS = $(sort $(foreach dep,\
>> $($(dep))))
>> HOST_SOURCE += $(addsuffix -source,$(sort $(TARGETS_HOST_DEPS) $(HOST_DEPS)))
>>
>> +TARGETS_LEGAL_INFO:=$(patsubst %,%-legal-info,\
>> + $(filter-out host-makedevs,\
>> + $(TARGETS) $(BASE_TARGETS) $(TARGETS_HOST_DEPS) $(HOST_DEPS))))
>> +
>> # all targets depend on the crosscompiler and it's prerequisites
>> $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
>>
>> @@ -395,8 +408,9 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
>> "> $@
>>
>> .PHONY: all world dirs clean distclean source outputmakefile \
>> + legal-info legal-info-prepare legal-info-clean \
>> $(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
>> - $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
>> + $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) $(TARGETS_LEGAL_INFO) \
>> $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
>> $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR)
>>
>> @@ -406,7 +420,7 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
>> # dependencies anywhere else
>> #
>> #############################################################
>> -$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR):
>> +$(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR):
>> @mkdir -p $@
>>
>> $(STAGING_DIR):
>> @@ -513,6 +527,37 @@ source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE)
>> external-deps:
>> @$(MAKE) -Bs DL_MODE=SHOW_EXTERNAL_DEPS $(EXTRAMAKEARGS) source | sort -u
>>
>> +legal-info-clean:
>> + @rm -fr $(LEGAL_INFO_DIR)
>> +
>> +legal-info-prepare: $(LEGAL_INFO_DIR)
>> + @echo "package,version,license,license files,source archive" \
>> +>>$(LEGAL_MANIFEST_CSV)
>> + @mkdir -p $(LICENSE_FILES_DIR)/buildroot
>> + @cp COPYING $(LICENSE_FILES_DIR)/buildroot/COPYING
>> + @echo -e "$(LEGAL_INFO_SEPARATOR)\n\t buildroot:" \
>> + "COPYING file\n$(LEGAL_INFO_SEPARATOR)\n\n" \
>> +>>$(LEGAL_LICENSES_TXT)
>> + @cat COPYING>>$(LEGAL_LICENSES_TXT)
>> + @echo>>$(LEGAL_LICENSES_TXT)
>> + @echo "buildroot,$(BR2_VERSION_FULL),GPLv2,COPYING,not saved" \
>> +>>$(LEGAL_MANIFEST_CSV)
>> + @echo "WARNING: The Buildroot source code has not be saved" \
> s/be/been
> This should be fixed in a few places in the patchset.
Fixed, thanks.
>> +>>$(LEGAL_WARNINGS)
>> + @echo "WARNING: The toolchain has not be saved" \
>> +>>$(LEGAL_WARNINGS)
>> + @cp $(CONFIG_DIR)/.config $(LEGAL_INFO_DIR)/buildroot.config
>> +
>> +legal-info: legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \
>> + $(TARGETS_LEGAL_INFO)
>> + @cat support/legal-info/README.header>>$(LEGAL_REPORT)
>> + @if [ -r $(LEGAL_WARNINGS) ]; then \
>> + cat support/legal-info/README.warnings-header \
>> + $(LEGAL_WARNINGS)>>$(LEGAL_REPORT); \
>> + cat $(LEGAL_WARNINGS); fi
>> + @echo "Legal info produced in $(LEGAL_INFO_DIR)"
>> + @rm -f $(LEGAL_WARNINGS)
>> +
> I think the readability of this can be improved by creating a set of
> functions to produce a warning, to add a line to the csv, etc.
> Moreover, the details about the format of these files will be grouped
> in one place.
> For example (untested):
>
> define legal-add-warning # (pkg, warning)
> @echo "WARNING: $(1): $(warning)">>$(LEGAL_WARNINGS)
> endef
> define legal-add-csv-line # (pkg, version, license, license file, source file)
> @echo "$(1),$(2),$(3),$(4),$(5)">>$(LEGAL_MANIFEST_CSV)
> endef
> Example calls would be:
> $(call legal-add-warning,buildroot,source code has not been saved)
> $(call legal-add-csv-line,$$($(3)_NAME),$$($(3)_VERSION),$$($(3)_LICENSE),not
> saved,not saved)
>
> These functions can be used in Makefile, in Makefile.package.in below,
> and even for packages that do not follow gentargets but still want to
> hook into the legal infrastructure.
It would definitely improve things, but I'm not sure about the add-csv-line. In
fact such lines are currently generated in pieces: pkg, version, license in a
common place, license files in another, source files in yet another one. But I
might define constants in these same places, then call the function passing these
constants.
I'll try to code something.
Luca
next prev parent reply other threads:[~2012-03-09 8:51 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 20:58 [Buildroot] [RFC v2 00/31] Automatically produce legal compliance info Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 01/31] legal-info: infrastructure to collect legally-relevant material Luca Ceresoli
2012-03-09 7:45 ` Thomas De Schampheleire
2012-03-09 8:51 ` Luca Ceresoli [this message]
2012-03-07 20:58 ` [Buildroot] [RFC v2 02/31] cups: warn that legal-info is not implemented Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 03/31] fis: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 04/31] doom-wad: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 05/31] gettext: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 06/31] microperl: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 07/31] netkitbase: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 08/31] netkittelnet: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 09/31] newt: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 10/31] tinyhttpd: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 11/31] ttcp: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 12/31] uemacs: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 13/31] vpnc: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 14/31] xfsprogs: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 15/31] mpc: define license Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 16/31] linux: " Luca Ceresoli
2012-03-07 21:49 ` Yann E. MORIN
2012-03-09 16:23 ` Luca Ceresoli
2012-03-09 20:12 ` Thomas De Schampheleire
2012-04-16 21:19 ` Luca Ceresoli
2012-04-16 21:38 ` Yann E. MORIN
2012-04-16 21:40 ` Yann E. MORIN
2012-04-18 14:15 ` Thomas De Schampheleire
2012-04-18 15:39 ` Luca Ceresoli
2012-04-18 15:39 ` Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 17/31] m4: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 18/31] busybox: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 19/31] bzip2: " Luca Ceresoli
2012-03-07 21:52 ` Yann E. MORIN
2012-03-09 16:00 ` Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 20/31] directfb: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 21/31] iostat: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 22/31] lzo: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 23/31] lzop: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 24/31] tslib: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 25/31] libusb: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 26/31] pcre: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 27/31] netsnmp: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 28/31] berkeleydb: " Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 29/31] qt: define license choice Luca Ceresoli
2012-03-10 12:43 ` Arnout Vandecappelle
2012-03-07 20:58 ` [Buildroot] [RFC v2 30/31] foobar: create a fake proprietary package (testing only) Luca Ceresoli
2012-03-07 20:58 ` [Buildroot] [RFC v2 31/31] Create test configs " Luca Ceresoli
2012-03-07 21:30 ` [Buildroot] [RFC v2 00/31] Automatically produce legal compliance info Luca Ceresoli
2012-03-07 21:41 ` Yann E. MORIN
2012-03-08 10:02 ` Luca Ceresoli
2012-03-08 18:46 ` Yann E. MORIN
2012-03-09 8:48 ` Thomas De Schampheleire
2012-03-10 12:46 ` Arnout Vandecappelle
2012-03-07 21:54 ` Yann E. MORIN
2012-03-08 9:14 ` Luca Ceresoli
2012-03-09 8:47 ` Thomas De Schampheleire
2012-03-09 9:12 ` Luca Ceresoli
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=4F59C487.1040401@lucaceresoli.net \
--to=luca@lucaceresoli.net \
--cc=buildroot@busybox.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.