iputils.mk 3.4 KB

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