legal info: split license texts for host and target

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Thomas De Schampheleire 2013-11-12 09:47:58 +01:00 committed by Peter Korsgaard
parent cc4f34ddd4
commit 366f17f747
3 changed files with 15 additions and 13 deletions

View File

@ -109,10 +109,12 @@ HOST_DIR:=$(BASE_DIR)/host
LEGAL_INFO_DIR=$(BASE_DIR)/legal-info LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses
LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses
LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv
LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt LEGAL_LICENSES_TXT_TARGET=$(LEGAL_INFO_DIR)/licenses.txt
LEGAL_LICENSES_TXT_HOST=$(LEGAL_INFO_DIR)/host-licenses.txt
LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT=$(LEGAL_INFO_DIR)/README LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
@ -575,7 +577,7 @@ legal-info-clean:
legal-info-prepare: $(LEGAL_INFO_DIR) legal-info-prepare: $(LEGAL_INFO_DIR)
@$(call MESSAGE,"Collecting legal info") @$(call MESSAGE,"Collecting legal info")
@$(call legal-license-file,buildroot,COPYING,COPYING) @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET) @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET)
@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST) @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST)
@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST) @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST)

View File

@ -575,13 +575,13 @@ else
# Save license files if defined # Save license files if defined
ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),) ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
@$(call legal-license-nofiles,$$($(2)_RAWNAME)) @$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(5)))
@$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined)) @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
else else
# Double dollar signs are really needed here, to catch host packages # Double dollar signs are really needed here, to catch host packages
# without explicit HOST_FOO_LICENSE_FILES assignment, also in case they # without explicit HOST_FOO_LICENSE_FILES assignment, also in case they
# have multiple license files. # have multiple license files.
@$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F))$$(sep)) @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F),$(call UPPERCASE,$(5)))$$(sep))
endif # license files endif # license files
ifeq ($$($(2)_REDISTRIBUTE),YES) ifeq ($$($(2)_REDISTRIBUTE),YES)

View File

@ -107,15 +107,15 @@ endef
legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6)) legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
define legal-license-header define legal-license-header
echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \ echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT) "$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
endef endef
define legal-license-nofiles define legal-license-nofiles
$(call legal-license-header,$(1),unknown license file(s)) $(call legal-license-header,$(1),unknown license file(s),$(2))
endef endef
define legal-license-file # pkg, filename, file-fullpath define legal-license-file # pkg, filename, file-fullpath, type
$(call legal-license-header,$(1),$(2) file) && \ $(call legal-license-header,$(1),$(2) file,$(4)) && \
cat $(3) >>$(LEGAL_LICENSES_TXT) && \ cat $(3) >>$(LEGAL_LICENSES_TXT_$(4)) && \
echo >>$(LEGAL_LICENSES_TXT) && \ echo >>$(LEGAL_LICENSES_TXT_$(4)) && \
mkdir -p $(LICENSE_FILES_DIR)/$(1)/$(dir $(2)) && \ mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \
cp $(3) $(LICENSE_FILES_DIR)/$(1)/$(2) cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2)
endef endef