Skip to contentSkip to conversation

ifstat: new package

PATCH New Francois Perrad 2 participants 2 messages Sep 5, 2019 – Sep 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ifstat: new package

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 .../0001-install-without-strip-flag.patch     | 26 +++++++++++++++++++
 package/ifstat/Config.in                      |  9 +++++++
 package/ifstat/ifstat.hash                    |  3 +++
 package/ifstat/ifstat.mk                      | 21 +++++++++++++++
 6 files changed, 61 insertions(+)
 create mode 100644 package/ifstat/0001-install-without-strip-flag.patch
 create mode 100644 package/ifstat/Config.in
 create mode 100644 package/ifstat/ifstat.hash
 create mode 100644 package/ifstat/ifstat.mk
DEVELOPERS +1 -0
index 3df21a78e..e452a1cbb 100644
@@ -881,6 +881,7 @@ F:	package/copas/
 F:	package/coxpcall/
 F:	package/dado/
 F:	package/ficl/
+F:	package/ifstat/
 F:	package/libtomcrypt/
 F:	package/libtommath/
 F:	package/libwpe/
package/Config.in +1 -0
index 710ed12be..42dccf068 100644
@@ -1927,6 +1927,7 @@ menu "Networking applications"
 	source "package/ifenslave/Config.in"
 	source "package/ifmetric/Config.in"
 	source "package/ifplugd/Config.in"
+	source "package/ifstat/Config.in"
 	source "package/iftop/Config.in"
 	source "package/ifupdown/Config.in"
 	source "package/ifupdown-scripts/Config.in"
package/ifstat/0001-install-without-strip-flag.patch new file +26 -0
new file mode 100644
index 000000000..217681f0a
@@ -0,0 +1,26 @@
+From 63533db706244d8b43e242349fcf32866ea10ab6 Mon Sep 17 00:00:00 2001
+From: Francois Perrad <[email protected]>
+Date: Thu, 5 Sep 2019 17:11:53 +0200
+Subject: [PATCH] install without strip flag
+
+Signed-off-by: Francois Perrad <[email protected]>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 486fe3e..5d17383 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -66,7 +66,7 @@ install: install-$(TARGET) install- at LIBTARGET@
+ 
+ install-$(TARGET): $(TARGET)
+ 	$(INSTALL) -d -m 755 $(bindir)
+-	$(INSTALL) -s -m 755 $(TARGET) $(bindir)/$(TARGET)
++	$(INSTALL) -m 755 $(TARGET) $(bindir)/$(TARGET)
+ 	$(INSTALL) -d -m 755 $(mandir)/man1
+ 	$(INSTALL) -m 644 ifstat.1 $(mandir)/man1/ifstat.1
+ 
+-- 
+2.20.1
+
package/ifstat/Config.in new file +9 -0
new file mode 100644
index 000000000..1e9671901
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_IFSTAT
+	bool "ifstat"
+	help
+	  ifstat is a tool to report network interfaces bandwidth just
+	  like vmstat/iostat do for other system counters.
+	  It can monitor local interfaces by polling the kernel
+	  counters, or remote hosts interfaces using SNMP.
+
+	  http://gael.roualland.free.fr/ifstat/
package/ifstat/ifstat.hash new file +3 -0
new file mode 100644
index 000000000..dcc2ced31
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 8599063b7c398f9cfef7a9ec699659b25b1c14d2bc0f535aed05ce32b7d9f507  ifstat-1.1.tar.gz
+sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad  COPYING
package/ifstat/ifstat.mk new file +21 -0
new file mode 100644
index 000000000..9a911739c
@@ -0,0 +1,21 @@
+################################################################################
+#
+# ifstat
+#
+################################################################################
+
+IFSTAT_VERSION = 1.1
+IFSTAT_SITE = http://gael.roualland.free.fr/ifstat
+IFSTAT_LICENSE = GPL
+IFSTAT_LICENSE_FILES = COPYING
+
+IFSTAT_CONF_OPTS = --prefix=$(TARGET_DIR)/usr --exec_prefix=$(TARGET_DIR)/usr
+
+ifeq ($(BR2_PACKAGE_NETSNMP),y)
+IFSTAT_DEPENDENCIES += netsnmp
+IFSTAT_CONF_OPTS += --with-snmp
+else
+IFSTAT_CONF_OPTS += --without-snmp
+endif
+
+$(eval $(autotools-package))
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 ifstat: new package

Hello Fran?ois,

Quoted 1 line · On Thu, 5 Sep 2019 18:02:29 +0200 Francois Perrad <[email protected]> wrote:

The last release of this tool is from 2004. Do we really want yet another network statistics tool that is unmaintained ?

Have you tried using "iftop" (already in Buildroot), or "netstat -i", or iptraf-ng (already in Buildroot), or bmon (already in Buildroot), or... see https://www.binarytides.com/linux-commands-monitor-network/.

Quoted 18 lines
package/ifstat/0001-install-without-strip-flag.patch new file +12 -0
new file mode 100644
index 000000000..217681f0a
@@ -0,0 +1,26 @@
+From 63533db706244d8b43e242349fcf32866ea10ab6 Mon Sep 17 00:00:00 2001
+From: Francois Perrad <[email protected]>
+Date: Thu, 5 Sep 2019 17:11:53 +0200
+Subject: [PATCH] install without strip flag
+
+Signed-off-by: Francois Perrad <[email protected]>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 486fe3e..5d17383 100644

package/ifstat/0001-install-without-strip-flag.patch line 22

Quoted 10 lines
package/ifstat/0001-install-without-strip-flag.patch new file +10 -0
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -66,7 +66,7 @@ install: install-$(TARGET) install- at LIBTARGET@
+ 
+ install-$(TARGET): $(TARGET)
+ 	$(INSTALL) -d -m 755 $(bindir)
+-	$(INSTALL) -s -m 755 $(TARGET) $(bindir)/$(TARGET)
++	$(INSTALL) -m 755 $(TARGET) $(bindir)/$(TARGET)
+ 	$(INSTALL) -d -m 755 $(mandir)/man1
+ 	$(INSTALL) -m 644 ifstat.1 $(mandir)/man1/ifstat.1

Actually, this should be fixed to also use $(DESTDIR)$(bindir) instead of $(bindir). Ditto for the man page.

Quoted 6 lines
package/ifstat/ifstat.mk new file +0 -0
new file mode 100644
index 000000000..9a911739c

package/ifstat/ifstat.mk line 9

Quoted 9 lines
package/ifstat/ifstat.mk new file +9 -0
@@ -0,0 +1,21 @@
+################################################################################
+#
+# ifstat
+#
+################################################################################
+
+IFSTAT_VERSION = 1.1
+IFSTAT_SITE = http://gael.roualland.free.fr/ifstat
+IFSTAT_LICENSE = GPL

The license is GPL-2.0+

package/ifstat/ifstat.mk line 12

Quoted 3 lines
package/ifstat/ifstat.mk new file +3 -0
+IFSTAT_LICENSE_FILES = COPYING
+
+IFSTAT_CONF_OPTS = --prefix=$(TARGET_DIR)/usr --exec_prefix=$(TARGET_DIR)/usr

If you fix the Makefile.in to use $(DESTDIR), then the default autotools infra will work. Also, the option is normally --exec-prefix, not --exec_prefix.

But again, I'm wondering about the usefulness of packaging a tool that hasn't been maintained since 2004, while there are plenty of other tools doing the same job.

Best regards,

Thomas Petazzoni

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com