[Buildroot] [PATCH] snmppp: extract license text from source files

Luca Ceresoli luca at lucaceresoli.net
Tue Jul 21 16:29:44 UTC 2015


There is no proper license file in the SNMP++ tarballs, so let's
extract it from a source file instead of copying it entirely.

Signed-off-by: Luca Ceresoli <luca at lucaceresoli.net>
---
 package/snmppp/snmppp.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/snmppp/snmppp.mk b/package/snmppp/snmppp.mk
index 026fe6e..1b73eba 100644
--- a/package/snmppp/snmppp.mk
+++ b/package/snmppp/snmppp.mk
@@ -11,7 +11,7 @@ SNMPPP_DEPENDENCIES = host-pkgconf
 SNMPPP_INSTALL_STAGING = YES
 SNMPPP_CONF_OPTS = $(if $(BR2_PACKAGE_SNMPPP_LOGGING),--enable-logging,--disable-logging)
 SNMPPP_LICENSE = SNMP++
-SNMPPP_LICENSE_FILES = src/v3.cpp
+SNMPPP_LICENSE_FILES = license.txt
 
 ifeq ($(BR2_PACKAGE_SNMPPP_SNMPV3),y)
 SNMPPP_CONF_OPTS += --enable-snmpv3
@@ -20,4 +20,10 @@ else
 SNMPPP_CONF_OPTS += --disable-snmpv3
 endif
 
+define SNMPPP_EXTRACT_LICENSE
+	grep '_##' $(@D)/src/v3.cpp >$(@D)/license.txt
+endef
+
+SNMPPP_POST_EXTRACT_HOOKS += SNMPPP_EXTRACT_LICENSE
+
 $(eval $(autotools-package))
-- 
1.9.1




More information about the buildroot mailing list