From 2680f57d96705afc794b6435a8a2afe682892ef9 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 11 Sep 2022 14:31:33 +0200 Subject: [PATCH 1/3] iperf3: add shared libiperf library and link iperf3 dynamically Add library for creating own functions with iperf3 functionality. Example: https://github.com/esnet/iperf/blob/master/examples/mis.c This library is needed by python3-iperf3. Build iperf3 binary with dynamically linked libiperf3. However, still build iperf3-ssl as static binary due to a lack of shipping two libiperf versions. Signed-off-by: Nick Hainke --- net/iperf3/Makefile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/net/iperf3/Makefile b/net/iperf3/Makefile index de17f81c..db3b6e43 100644 --- a/net/iperf3/Makefile +++ b/net/iperf3/Makefile @@ -32,6 +32,7 @@ define Package/iperf3/default CATEGORY:=Network TITLE:=Internet Protocol bandwidth measuring tool URL:=https://github.com/esnet/iperf + DEPENDS:=+libiperf3 endef define Package/iperf3 @@ -43,14 +44,20 @@ define Package/iperf3-ssl $(call Package/iperf3/default) TITLE+= with iperf_auth support VARIANT:=ssl - DEPENDS:= +libopenssl + DEPENDS+=+libopenssl +endef + +define Package/libiperf3 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Internet Protocol bandwidth measuring library + URL:=https://github.com/esnet/iperf endef TARGET_CFLAGS += -D_GNU_SOURCE -CONFIGURE_ARGS += --disable-shared ifeq ($(BUILD_VARIANT),ssl) - CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" + CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --disable-shared else CONFIGURE_ARGS += --without-openssl endif @@ -63,6 +70,17 @@ define Package/iperf3/description characteristics. endef +define Package/libiperf3/description + Libiperf is a library providing an API for iperf3 functionality. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ +endef + # autoreconf fails if the README file isn't present define Build/Prepare $(call Build/Prepare/Default) @@ -79,5 +97,11 @@ define Package/iperf3-ssl/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ endef +define Package/iperf3/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.so.* $(1)/usr/lib +endef + $(eval $(call BuildPackage,iperf3)) $(eval $(call BuildPackage,iperf3-ssl)) +$(eval $(call BuildPackage,libiperf3)) From a02ff1ce0c469c8c1c55e244a61886f22e030c1d Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 14 Sep 2022 22:46:09 +0200 Subject: [PATCH 2/3] iperf3: fix install section of Makefile and dependencies In the Makefile the library installation was accidentally called "Package/iperf3/install" and not "Package/libiperf3/install". Fix this typo. Thanks to Hartmut spotting this. Also the iperf3-ssl does not need to depend on libiperf3. Fixes ae48be8e2157 ("iperf3: add shared libiperf library and link iperf3 dynamically") Signed-off-by: Nick Hainke --- net/iperf3/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/iperf3/Makefile b/net/iperf3/Makefile index db3b6e43..abc691e4 100644 --- a/net/iperf3/Makefile +++ b/net/iperf3/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf PKG_VERSION:=3.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf @@ -32,19 +32,19 @@ define Package/iperf3/default CATEGORY:=Network TITLE:=Internet Protocol bandwidth measuring tool URL:=https://github.com/esnet/iperf - DEPENDS:=+libiperf3 endef define Package/iperf3 $(call Package/iperf3/default) VARIANT:=nossl + DEPENDS:=+libiperf3 endef define Package/iperf3-ssl $(call Package/iperf3/default) TITLE+= with iperf_auth support VARIANT:=ssl - DEPENDS+=+libopenssl + DEPENDS:=+libopenssl endef define Package/libiperf3 @@ -97,7 +97,7 @@ define Package/iperf3-ssl/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ endef -define Package/iperf3/install +define Package/libiperf3/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.so.* $(1)/usr/lib endef From c8d0b57ce744cd619a2df9f49a94e4b17a7846c6 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 7 Oct 2022 10:25:06 +0200 Subject: [PATCH 3/3] iperf3: update to 3.12 Release Notes: https://groups.google.com/g/iperf-dev/c/_DgSWrpl9Gk?pli=1 Signed-off-by: Nick Hainke --- net/iperf3/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/iperf3/Makefile b/net/iperf3/Makefile index abc691e4..5f9e96cd 100644 --- a/net/iperf3/Makefile +++ b/net/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.11 -PKG_RELEASE:=2 +PKG_VERSION:=3.12 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf -PKG_HASH:=de8cb409fad61a0574f4cb07eb19ce1159707403ac2dc01b5d175e91240b7e5f +PKG_HASH:=72034ecfb6a7d6d67e384e19fb6efff3236ca4f7ed4c518d7db649c447e1ffd6 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause