You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=mtr
  9. PKG_VERSION:=0.95
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/traviscross/mtr/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=12490fb660ba5fb34df8c06a0f62b4f9cbd11a584fc3f6eceda0a99124e8596f
  14. PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
  15. PKG_LICENSE:=GPL-2.0-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:matt_kimball_and_roger_wolff:mtr
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_FIXUP:=autoreconf
  21. CONFIGURE_ARGS += \
  22. --without-gtk \
  23. $(call autoconf_bool,CONFIG_IPV6,ipv6)
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/mtr/Default
  26. SECTION:=net
  27. CATEGORY:=Network
  28. DEPENDS:=+libncurses
  29. TITLE:=Full screen ncurses traceroute tool
  30. URL:=https://www.bitwizard.nl/mtr/
  31. PROVIDES:=mtr
  32. endef
  33. define Package/mtr-nojson
  34. $(Package/mtr/Default)
  35. TITLE+= Without JSON
  36. VARIANT:=nojson
  37. DEFAULT_VARIANT:=1
  38. endef
  39. define Package/mtr-json
  40. $(Package/mtr/Default)
  41. TITLE+= With JSON
  42. VARIANT:=json
  43. DEPENDS+=+jansson
  44. endef
  45. ifeq ($(BUILD_VARIANT),nojson)
  46. CONFIGURE_ARGS += --without-jansson
  47. endif
  48. define Package/mtr/description
  49. mtr combines the functionality of the 'traceroute' and 'ping' programs
  50. in a single network diagnostic tool.
  51. As mtr starts, it investigates the network connection between the host
  52. mtr runs on and a user-specified destination host. After it
  53. determines the address of each network hop between the machines,
  54. it sends a sequence ICMP ECHO requests to each one to determine the
  55. quality of the link to each machine. As it does this, it prints
  56. running statistics about each machine.
  57. endef
  58. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  59. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  60. CONFIGURE_VARS += ac_cv_lib_cap_cap_set_proc=no
  61. define Package/mtr/install/Default
  62. $(INSTALL_DIR) $(1)/usr/sbin
  63. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mtr $(1)/usr/sbin/
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mtr-packet $(1)/usr/sbin/
  65. endef
  66. Package/mtr-nojson/install = $(Package/mtr/install/Default)
  67. Package/mtr-json/install = $(Package/mtr/install/Default)
  68. $(eval $(call BuildPackage,mtr-nojson))
  69. $(eval $(call BuildPackage,mtr-json))