From patchwork Wed Oct 14 19:06:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Pallas X-Patchwork-Id: 1382315 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=meter.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=meter-com.20150623.gappssmtp.com header.i=@meter-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=xYbHmPhY; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBN0l1Qvxz9sRK for ; Thu, 15 Oct 2020 06:35:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9555487C49; Wed, 14 Oct 2020 19:35:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id imEN4OL0j1Of; Wed, 14 Oct 2020 19:35:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B651187C2C; Wed, 14 Oct 2020 19:35:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 83DB61BF4D6 for ; Wed, 14 Oct 2020 19:34:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7F10C87C2C for ; Wed, 14 Oct 2020 19:34:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1m5jqcorEyDv for ; Wed, 14 Oct 2020 19:34:58 +0000 (UTC) X-Greylist: delayed 01:04:10 by SQLgrey-1.7.6 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 9905987C2B for ; Wed, 14 Oct 2020 19:34:58 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id gv6so338008pjb.4 for ; Wed, 14 Oct 2020 12:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meter-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aVA86++9Oom38ezAJzu9+IN2EOwpAasG7Ey73shKVFQ=; b=xYbHmPhYccl0qPZYIkPe14YQSKMMSAAOpLThZ4NSLL/1v6tTNxmAT+q9mtJqwiLoEc FhJW+82WMv6x1TBrLJtnzudxE+nNmIwPO3ZrbzZ2yv57KLAZ8dVxI3zZeu3KNZWmRXQm CO3+XTrO2A1jbAnTzqyeyTJekjXvxFRs+TQYM55eadAEU3Xobe1Ovcvoe6FHEilYJ0Fh 8FC5OVVm9emfJAmbFYxFCDrGrokxiq8YYPApQtd11OY24SeFfQh4UKdC0vQ8lNk8Ny8c QH+90QB/KDuzgLMshaqDF32ndl7LWAwNAv2Tc0VMMnrE0KB57UUTHR0hw0d9S+mP9wIQ INvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aVA86++9Oom38ezAJzu9+IN2EOwpAasG7Ey73shKVFQ=; b=SvDcPgd88bfTGlewry6yDEcAG+oh13umFjOy4R7a09R9fzV+8g70iZa6/NI4lck8DO spO5PEUTdCwrPLkXqVFnbF4zJuxIZodyI+EohuCj2ETEmq7wyQWD9o8d4kHg+xaCp2h/ iK5cI00BgC4GXxOAxIA+KupBEeRIoQVfko9R8dlqdJzL57hmADsQRzVAqTsrRiD1tfed WLsEGVCng2NQdxzmwwqOBmGN5DtQYtMNeuadqfz07VsvgMFYrKK1S25oj82skz/4jEeX eXzcOe6pa7tFzroRSkhmE7yOEjfFQUp8q2Ek37FM5RfjoAuMOUu9I53ZZnzal8cpQeC8 H7nw== X-Gm-Message-State: AOAM533dTzlhsDMgKSJx8LLn+8Qhq12Rm8v2HHMmeOwYokEyjvGCJjtm SWRBCQZNq+2kCzbAvC5FTB334+OKDyHwZn87 X-Google-Smtp-Source: ABdhPJy5cnmexCM57/azlhEnRNdd/2A4jYOYBJ5inu9wo3sDhZ+vBCbQWeZfBCfW5UuMrwvSMR08vg== X-Received: by 2002:a62:7b11:0:b029:156:3610:7e25 with SMTP id w17-20020a627b110000b029015636107e25mr682783pfc.53.1602702388356; Wed, 14 Oct 2020 12:06:28 -0700 (PDT) Received: from frank-chu.members.linode.com ([2600:3c01::f03c:92ff:fe24:9a57]) by smtp.gmail.com with ESMTPSA id y22sm368780pfr.62.2020.10.14.12.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 12:06:27 -0700 (PDT) From: Derrick Lyndon Pallas To: buildroot@buildroot.org Date: Wed, 14 Oct 2020 19:06:14 +0000 Message-Id: <20201014190614.30321-1-derrick@meter.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/ipcalc: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derrick Lyndon Pallas Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" ipcalc is an ancient and venerable tool for manipulating IP addresses, networks, & interfaces from shell scripts. There is a subtool in busybox, but it does not support everything the upstream tool [1] supports. [1] https://gitlab.com/ipcalc/ipcalc Signed-off-by: Derrick Lyndon Pallas --- DEVELOPERS | 3 ++ package/Config.in | 1 + package/busybox/busybox.mk | 1 + ...not-fail-to-build-if-ronn-is-missing.patch | 49 +++++++++++++++++++ .../0002-Include-stdarg-for-va_list.patch | 29 +++++++++++ package/ipcalc/Config.in | 9 ++++ package/ipcalc/ipcalc.hash | 3 ++ package/ipcalc/ipcalc.mk | 17 +++++++ 8 files changed, 112 insertions(+) create mode 100644 package/ipcalc/0001-Do-not-fail-to-build-if-ronn-is-missing.patch create mode 100644 package/ipcalc/0002-Include-stdarg-for-va_list.patch create mode 100644 package/ipcalc/Config.in create mode 100644 package/ipcalc/ipcalc.hash create mode 100644 package/ipcalc/ipcalc.mk diff --git a/DEVELOPERS b/DEVELOPERS index 79a9eaa563..ab69e2b630 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -731,6 +731,9 @@ F: package/tcllib/ N: Denis Bodor F: package/libstrophe/ +N: Derrick Lyndon Pallas +F: package/ipcalc/ + N: Dimitrios Siganos F: package/wireless-regdb/ diff --git a/package/Config.in b/package/Config.in index 09a332e3b9..8cfe3a7f74 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2108,6 +2108,7 @@ menu "Networking applications" source "package/igmpproxy/Config.in" source "package/inadyn/Config.in" source "package/iodine/Config.in" + source "package/ipcalc/Config.in" source "package/iperf/Config.in" source "package/iperf3/Config.in" source "package/iproute2/Config.in" diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index 7862beb790..01f7331221 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -42,6 +42,7 @@ BUSYBOX_DEPENDENCIES = \ $(if $(BR2_PACKAGE_IFENSLAVE),ifenslave) \ $(if $(BR2_PACKAGE_IFPLUGD),ifplugd) \ $(if $(BR2_PACKAGE_IFUPDOWN),ifupdown) \ + $(if $(BR2_PACKAGE_IPCALC),ipcalc) \ $(if $(BR2_PACKAGE_IPROUTE2),iproute2) \ $(if $(BR2_PACKAGE_IPUTILS),iputils) \ $(if $(BR2_PACKAGE_KMOD),kmod) \ diff --git a/package/ipcalc/0001-Do-not-fail-to-build-if-ronn-is-missing.patch b/package/ipcalc/0001-Do-not-fail-to-build-if-ronn-is-missing.patch new file mode 100644 index 0000000000..419f4bba44 --- /dev/null +++ b/package/ipcalc/0001-Do-not-fail-to-build-if-ronn-is-missing.patch @@ -0,0 +1,49 @@ +From 322294d7bf61f9fdf0e45e9b6c6013a7c6a35bfd Mon Sep 17 00:00:00 2001 +From: Derrick Lyndon Pallas +Date: Wed, 14 Oct 2020 18:25:54 +0000 +Subject: [PATCH] Do not fail to build if ronn is missing + +If ruby-ronn is missing, we can not compile the man page from markdown but +that should not prevent the application from building. + +Signed-off-by: Derrick Lyndon Pallas +--- + meson.build | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/meson.build b/meson.build +index a2169fc..981d4a4 100644 +--- a/meson.build ++++ b/meson.build +@@ -72,16 +72,17 @@ ipcalc = executable('ipcalc', + install : true + ) + +-ronn = find_program('ronn', required: true) +- +-ipcalc_1 = custom_target( +- 'ipcalc.1', +- output : 'ipcalc.1', +- input : 'ipcalc.1.md', +- command : [ronn, '--pipe', '-r', '@INPUT@'], +- capture: true, +- install_dir: join_paths(get_option('mandir'), 'man1'), +- install: true +-) ++ronn = find_program('ronn', required: false) ++if ronn.found() ++ ipcalc_1 = custom_target( ++ 'ipcalc.1', ++ output : 'ipcalc.1', ++ input : 'ipcalc.1.md', ++ command : [ronn, '--pipe', '-r', '@INPUT@'], ++ capture: true, ++ install_dir: join_paths(get_option('mandir'), 'man1'), ++ install: true ++ ) ++endif + + subdir('tests') +-- +2.28.0 + diff --git a/package/ipcalc/0002-Include-stdarg-for-va_list.patch b/package/ipcalc/0002-Include-stdarg-for-va_list.patch new file mode 100644 index 0000000000..de23a56303 --- /dev/null +++ b/package/ipcalc/0002-Include-stdarg-for-va_list.patch @@ -0,0 +1,29 @@ +From 7795c02fb1e0f5fdbdf949007e52684c590235d4 Mon Sep 17 00:00:00 2001 +From: Derrick Lyndon Pallas +Date: Wed, 14 Oct 2020 18:40:38 +0000 +Subject: [PATCH 2/2] Include stdarg for va_list + +While several function signatures use va_list, stdarg was never included. +This fixes that. + +Signed-off-by: Derrick Lyndon Pallas +--- + ipcalc.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ipcalc.h b/ipcalc.h +index 0e81320..a220dc5 100644 +--- a/ipcalc.h ++++ b/ipcalc.h +@@ -20,6 +20,8 @@ + #ifndef _IPCALC_H + #define _IPCALC_H + ++#include /* for va_list */ ++ + #if defined(USE_GEOIP) + void geo_ip_lookup(const char *ip, char **country, char **ccode, char **city, char **coord); + int geo_setup(void); +-- +2.28.0 + diff --git a/package/ipcalc/Config.in b/package/ipcalc/Config.in new file mode 100644 index 0000000000..7cbb09253f --- /dev/null +++ b/package/ipcalc/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_IPCALC + bool "ipcalc" + help + A modern IPv4/IPv6 ipcalc tool, assisting in network calculations + in command line and as a tool for scripts. + + https://gitlab.com/ipcalc/ipcalc + + depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS diff --git a/package/ipcalc/ipcalc.hash b/package/ipcalc/ipcalc.hash new file mode 100644 index 0000000000..df610eb693 --- /dev/null +++ b/package/ipcalc/ipcalc.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 d7aca371335ab3e35364bcfe34cd0229db005be8bebb9236608ec318cb3f7748 ipcalc-1.0.0.tar.bz2 +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/package/ipcalc/ipcalc.mk b/package/ipcalc/ipcalc.mk new file mode 100644 index 0000000000..c4ce8b9ceb --- /dev/null +++ b/package/ipcalc/ipcalc.mk @@ -0,0 +1,17 @@ +################################################################################ +# +# ipcalc +# +################################################################################ + +IPCALC_VERSION = 1.0.0 +IPCALC_SITE = https://gitlab.com/ipcalc/ipcalc/-/archive/$(IPCALC_VERSION) +IPCALC_SOURCE = ipcalc-$(IPCALC_VERSION).tar.bz2 +IPCALC_LICENSE = GPL-2.0+ +IPCALC_LICENSE_FILES = COPYING + +IPCALC_CONF_OPTS = \ + -Duse_maxminddb=disabled \ + -Duse_geoip=disabled + +$(eval $(meson-package))