build: allow defining license information per binary package
authorMichael Heimpold <mhei@heimpold.de>
Tue, 31 Oct 2017 20:29:50 +0000 (21:29 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 25 Nov 2017 19:02:04 +0000 (20:02 +0100)
At the moment, license information can only be specified on a
"per source package" level while other metadata fields (e.g. maintainer)
can be given for each binary package. Apply the same logic for license
fields as well. This can be used e.g. in cases where a library is
distributed under some license while related tools are distributed
under a different one.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
include/package-defaults.mk
include/package-dumpinfo.mk
include/package-ipkg.mk

index 0eecd6c4f81ec121452c69833f8051f21387c75e..0bca076e72d190682b87dfd65bddfa7c06f98277 100644 (file)
@@ -57,6 +57,8 @@ define Package/Default
   DEFAULT_VARIANT:=
   USERID:=
   ALTERNATIVES:=
+  LICENSE:=$(PKG_LICENSE)
+  LICENSE_FILES:=$(PKG_LICENSE_FILES)
 endef
 
 Build/Patch:=$(Build/Patch/Default)
index b717c1b472df6aa59c3f7300c2e6d678f25bb434..1be7d958d424616ab13e23dfbaa8058cb20e682b 100644 (file)
@@ -46,8 +46,8 @@ $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
 Maintainer: $(MAINTAINER)
 $(if $(USERID),Require-User: $(USERID)
 )Source: $(PKG_SOURCE)
-$(if $(PKG_LICENSE),License: $(PKG_LICENSE)
-)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES)
+$(if $(LICENSE),License: $(LICENSE)
+)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES)
 )Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
 $(if $(KCONFIG),Kernel-Config: $(KCONFIG)
 )$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
index bf508fb4934ad6df4893e18745ab47fd93de6ed8..9e2717e788cc21457df15162a0926aa6ad7db6ec 100644 (file)
@@ -161,8 +161,8 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
 )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
 )$$(call addfield,Source,$(SOURCE)
-)$$(call addfield,License,$$(PKG_LICENSE)
-)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES)
+)$$(call addfield,License,$(LICENSE)
+)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
 )$$(call addfield,Section,$(SECTION)
 )$$(call addfield,Require-User,$(USERID)
 )$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed