iputils.mk 3.7 KB

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