Commit 7c992ac3 authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Peter Korsgaard
Browse files

legal-info: split _LICENSE and _REDISTRIBUTE constants



Currently packages can be described in two ways: proprietary (tarball not
saved, license not described in further detail), and others (tarball
saved, license described).

Split the logic to allow the license to be always described whether or not
the source code can be redistributed.

Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
Acked-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent c6917357
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -276,6 +276,15 @@ ifndef $(2)_LICENSE_FILES
 endif
endif

ifndef $(2)_REDISTRIBUTE
 ifdef $(3)_REDISTRIBUTE
  $(2)_REDISTRIBUTE = $($(3)_REDISTRIBUTE)
 endif
endif

$(2)_REDISTRIBUTE		?= YES


$(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))

$(2)_INSTALL_STAGING		?= NO
@@ -445,29 +454,27 @@ $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
endif

# legal-info: declare dependencies and set values used later for the manifest
ifneq ($$($(2)_LICENSE),PROPRIETARY)
ifneq ($$($(2)_LICENSE_FILES),)
$(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES)
endif
$(2)_MANIFEST_LICENSE_FILES ?= not saved

ifeq ($$($(2)_REDISTRIBUTE),YES)
ifneq ($$($(2)_SITE_METHOD),local)
ifneq ($$($(2)_SITE_METHOD),override)
# Packages that have a tarball need it downloaded and extracted beforehand
$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR)
$(2)_MANIFEST_TARBALL = $$($(2)_SOURCE)
ifneq ($$($(2)_LICENSE_FILES),)
$(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES)
endif
endif
endif
endif
# defaults for packages without tarball or license files
$(2)_MANIFEST_TARBALL ?= not saved
$(2)_MANIFEST_LICENSE_FILES ?= not saved

# legal-info: produce legally relevant info.
$(1)-legal-info:
# Packages without a source are assumed to be part of Buildroot, skip them.
ifneq ($(call qstrip,$$($(2)_SOURCE)),)
ifeq ($$($(2)_LICENSE),PROPRIETARY)
# Proprietary packages: nothing to save
else ifeq ($$($(2)_SITE_METHOD),local)
ifeq ($$($(2)_SITE_METHOD),local)
# Packages without a tarball: don't save and warn
	@$(call legal-warning-pkg-savednothing,$$($(2)_RAWNAME),local)
else ifeq ($$($(2)_SITE_METHOD),override)
@@ -483,9 +490,11 @@ else
		$(call legal-license-file,$$($(2)_RAWNAME),$$$${F},$$($(2)_DIR)/$$$${F}); \
		done
endif
ifeq ($$($(2)_REDISTRIBUTE),YES)
# Copy the source tarball (just hardlink if possible)
	@cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) 2>/dev/null || \
	   cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR)
endif
endif
	@$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL))
endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),)