1################################################################################ 2# 3# iputils 4# 5################################################################################ 6 7# The original upstream was forked to the github repository in 2014 to 8# pull fixes from other distribution and centralize the changes after 9# the upstream seemed to have gone dormant. The fork contains the 10# latest changes including musl support, removing a libsysfs dependency 11# and IPv6 updates. 12# http://www.spinics.net/lists/netdev/msg279881.html 13 14IPUTILS_VERSION = 20210722 15IPUTILS_SITE = $(call github,iputils,iputils,$(IPUTILS_VERSION)) 16IPUTILS_LICENSE = GPL-2.0+, BSD-3-Clause 17IPUTILS_LICENSE_FILES = LICENSE Documentation/LICENSE.BSD3 Documentation/LICENSE.GPL2 18IPUTILS_CPE_ID_VENDOR = iputils_project 19IPUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) 20 21# Selectively build binaries 22IPUTILS_CONF_OPTS += \ 23 -DBUILD_CLOCKDIFF=$(if $(BR2_PACKAGE_IPUTILS_CLOCKDIFF),true,false) \ 24 -DBUILD_RARPD=$(if $(BR2_PACKAGE_IPUTILS_RARPD),true,false) \ 25 -DBUILD_RDISC=$(if $(BR2_PACKAGE_IPUTILS_RDISC),true,false) \ 26 -DENABLE_RDISC_SERVER=$(if $(BR2_PACKAGE_IPUTILS_RDISC_SERVER),true,false) \ 27 -DBUILD_TRACEPATH=$(if $(BR2_PACKAGE_IPUTILS_TRACEPATH),true,false) \ 28 -DBUILD_TRACEROUTE6=$(if $(BR2_PACKAGE_IPUTILS_TRACEROUTE6),true,false) \ 29 -DBUILD_NINFOD=$(if $(BR2_PACKAGE_IPUTILS_NINFOD),true,false) \ 30 -DSKIP_TESTS=true 31 32# Selectively select the appropriate SELinux refpolicy modules 33IPUTILS_SELINUX_MODULES = \ 34 $(if $(BR2_PACKAGE_IPUTILS_ARPING),netutils) \ 35 $(if $(BR2_PACKAGE_IPUTILS_PING),netutils) \ 36 $(if $(BR2_PACKAGE_IPUTILS_TRACEPATH),netutils) \ 37 $(if $(BR2_PACKAGE_IPUTILS_TRACEROUTE6),netutils) \ 38 $(if $(BR2_PACKAGE_IPUTILS_RDISC),rdisc) \ 39 $(if $(BR2_PACKAGE_IPUTILS_TFTPD),tftp) 40 41# 42# arping 43# 44ifeq ($(BR2_PACKAGE_IPUTILS_ARPING),y) 45IPUTILS_CONF_OPTS += -DBUILD_ARPING=true 46 47# move some binaries to the same location as where Busybox installs 48# the corresponding applets, so that we have a single version of the 49# tools (from iputils) 50define IPUTILS_MOVE_ARPING_BINARY 51 mv $(TARGET_DIR)/usr/bin/arping $(TARGET_DIR)/usr/sbin/arping 52endef 53IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_MOVE_ARPING_BINARY 54 55else 56IPUTILS_CONF_OPTS += -DBUILD_ARPING=false 57endif 58 59# 60# ping 61# 62ifeq ($(BR2_PACKAGE_IPUTILS_PING),y) 63IPUTILS_CONF_OPTS += -DBUILD_PING=true 64 65# same reason to move the ping binary as for arping 66ifeq ($(BR2_ROOTFS_MERGED_USR),) 67define IPUTILS_MOVE_PING_BINARY 68 mv $(TARGET_DIR)/usr/bin/ping $(TARGET_DIR)/bin/ping 69endef 70IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_MOVE_PING_BINARY 71endif 72 73# upstream requires distros to create symlink 74define IPUTILS_CREATE_PING6_SYMLINK 75 ln -sf ping $(TARGET_DIR)/bin/ping6 76endef 77IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_CREATE_PING6_SYMLINK 78 79else 80IPUTILS_CONF_OPTS += -DBUILD_PING=false 81endif 82 83# 84# tftpd 85# 86ifeq ($(BR2_PACKAGE_IPUTILS_TFTPD),y) 87IPUTILS_CONF_OPTS += -DBUILD_TFTPD=true 88 89else 90IPUTILS_CONF_OPTS += -DBUILD_TFTPD=false 91endif 92 93# Handle libraries 94ifeq ($(BR2_PACKAGE_LIBCAP),y) 95IPUTILS_CONF_OPTS += -DUSE_CAP=true 96IPUTILS_DEPENDENCIES += libcap 97else 98IPUTILS_CONF_OPTS += -DUSE_CAP=false 99endif 100 101ifeq ($(BR2_PACKAGE_LIBIDN2),y) 102IPUTILS_CONF_OPTS += -DUSE_IDN=true 103IPUTILS_DEPENDENCIES += libidn2 104else 105IPUTILS_CONF_OPTS += -DUSE_IDN=false 106endif 107 108ifeq ($(BR2_PACKAGE_SYSTEMD),y) 109IPUTILS_DEPENDENCIES += systemd 110endif 111 112ifeq ($(BR2_SYSTEM_ENABLE_NLS),y) 113IPUTILS_CONF_OPTS += -DUSE_GETTEXT=true 114else 115IPUTILS_CONF_OPTS += -DUSE_GETTEXT=false 116endif 117 118# XSL Stylesheets for DocBook 5 not packaged for buildroot 119IPUTILS_CONF_OPTS += -DBUILD_MANS=false -DBUILD_HTML_MANS=false 120 121# handle permissions ourselves 122IPUTILS_CONF_OPTS += -DNO_SETCAP_OR_SUID=true 123ifeq ($(BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES),y) 124define IPUTILS_PERMISSIONS 125 $(if $(BR2_PACKAGE_IPUTILS_ARPING),\ 126 /usr/sbin/arping f 755 0 0 - - - - -,) 127 $(if $(BR2_PACKAGE_IPUTILS_CLOCKDIFF),\ 128 /usr/bin/clockdiff f 755 0 0 - - - - - 129 |xattr cap_net_raw+p,) 130 $(if $(BR2_PACKAGE_IPUTILS_PING),\ 131 /bin/ping f 755 0 0 - - - - - 132 |xattr cap_net_raw+p,) 133 $(if $(BR2_PACKAGE_IPUTILS_TRACEROUTE6),\ 134 /usr/bin/traceroute6 f 755 0 0 - - - - - 135 |xattr cap_net_raw+p,) 136endef 137else 138define IPUTILS_PERMISSIONS 139 $(if $(BR2_PACKAGE_IPUTILS_ARPING),\ 140 /usr/sbin/arping f 755 0 0 - - - - -,) 141 $(if $(BR2_PACKAGE_IPUTILS_CLOCKDIFF),\ 142 /usr/bin/clockdiff f 4755 0 0 - - - - -,) 143 $(if $(BR2_PACKAGE_IPUTILS_PING),\ 144 /bin/ping f 4755 0 0 - - - - -,) 145 $(if $(BR2_PACKAGE_IPUTILS_TRACEROUTE6),\ 146 /usr/bin/traceroute6 f 4755 0 0 - - - - -,) 147endef 148endif 149 150$(eval $(meson-package)) 151