iperf3: fix install section of Makefile and dependencies
[feed/packages.git] / net / iperf3 / Makefile
1 #
2 # Copyright (C) 2007-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iperf
11 PKG_VERSION:=3.11
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf
16 PKG_HASH:=de8cb409fad61a0574f4cb07eb19ce1159707403ac2dc01b5d175e91240b7e5f
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-3-Clause
20
21 PKG_BUILD_PARALLEL:=1
22 PKG_INSTALL:=1
23
24 PKG_FIXUP:=autoreconf
25
26 include $(INCLUDE_DIR)/package.mk
27
28 DISABLE_NLS:=
29
30 define Package/iperf3/default
31 SECTION:=net
32 CATEGORY:=Network
33 TITLE:=Internet Protocol bandwidth measuring tool
34 URL:=https://github.com/esnet/iperf
35 endef
36
37 define Package/iperf3
38 $(call Package/iperf3/default)
39 VARIANT:=nossl
40 DEPENDS:=+libiperf3
41 endef
42
43 define Package/iperf3-ssl
44 $(call Package/iperf3/default)
45 TITLE+= with iperf_auth support
46 VARIANT:=ssl
47 DEPENDS:=+libopenssl
48 endef
49
50 define Package/libiperf3
51 SECTION:=libs
52 CATEGORY:=Libraries
53 TITLE:=Internet Protocol bandwidth measuring library
54 URL:=https://github.com/esnet/iperf
55 endef
56
57 TARGET_CFLAGS += -D_GNU_SOURCE
58
59 ifeq ($(BUILD_VARIANT),ssl)
60 CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --disable-shared
61 else
62 CONFIGURE_ARGS += --without-openssl
63 endif
64
65 MAKE_FLAGS += noinst_PROGRAMS=
66
67 define Package/iperf3/description
68 Iperf is a modern alternative for measuring TCP and UDP bandwidth
69 performance, allowing the tuning of various parameters and
70 characteristics.
71 endef
72
73 define Package/libiperf3/description
74 Libiperf is a library providing an API for iperf3 functionality.
75 endef
76
77 define Build/InstallDev
78 $(INSTALL_DIR) $(1)/usr/lib
79 $(INSTALL_DIR) $(1)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.* $(1)/usr/lib/
81 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
82 endef
83
84 # autoreconf fails if the README file isn't present
85 define Build/Prepare
86 $(call Build/Prepare/Default)
87 touch $(PKG_BUILD_DIR)/README
88 endef
89
90 define Package/iperf3/install
91 $(INSTALL_DIR) $(1)/usr/bin
92 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/
93 endef
94
95 define Package/iperf3-ssl/install
96 $(INSTALL_DIR) $(1)/usr/bin
97 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/
98 endef
99
100 define Package/libiperf3/install
101 $(INSTALL_DIR) $(1)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.so.* $(1)/usr/lib
103 endef
104
105 $(eval $(call BuildPackage,iperf3))
106 $(eval $(call BuildPackage,iperf3-ssl))
107 $(eval $(call BuildPackage,libiperf3))