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.

90 lines
2.3 KiB

  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=telegraf
  4. PKG_VERSION:=1.22.4
  5. PKG_RELEASE:=1
  6. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  7. PKG_SOURCE_URL:=https://codeload.github.com/influxdata/telegraf/tar.gz/v$(PKG_VERSION)?
  8. PKG_HASH:=828172fd3125eebc9777f3a4b42c5292bc85d6d87e4a5b41a7bb1b3e6fbc7d2a
  9. PKG_MAINTAINER:=Jonathan Pagel <jonny_tischbein@systemli.org>
  10. PKG_LICENSE:=MIT
  11. PKG_LICENSE_FILES:=LICENSE
  12. PKG_BUILD_DEPENDS:=golang/host
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_USE_MIPS16:=0
  15. GO_PKG:=github.com/influxdata/telegraf
  16. GO_PKG_BUILD_PKG:=github.com/influxdata/telegraf/cmd/telegraf
  17. GO_PKG_LDFLAGS_X:=main.version=$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../lang/golang/golang-package.mk
  20. define Package/telegraf/Default
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=Telegraf
  24. DEPENDS:=$(GO_ARCH_DEPENDS)
  25. endef
  26. define Package/telegraf-full
  27. $(call Package/telegraf/Default)
  28. TITLE+= (Full)
  29. VARIANT:=full
  30. endef
  31. define Package/telegraf
  32. $(call Package/telegraf/Default)
  33. TITLE+= (Small)
  34. VARIANT:=small
  35. endef
  36. define Package/telegraf/description/Default
  37. Telegraf is a plugin-driven agent for collecting and sending metrics and events.
  38. It supports various inputs (including prometheus endpoints) and is able to send data into InfluxDB.
  39. endef
  40. define Package/telegraf/description
  41. $(call Package/telegraf/description/Default)
  42. (Small build. Most plugins excluded)
  43. endef
  44. define Package/telegraf-full/description
  45. $(call Package/telegraf/description/Default)
  46. (Full build. including all plugins)
  47. endef
  48. define Package/telegraf/conffiles
  49. /etc/telegraf.conf
  50. endef
  51. Package/telegraf-full/conffiles = $(Package/telegraf/conffiles)
  52. define Build/Prepare
  53. $(call Build/Prepare/Default)
  54. ifeq ($(BUILD_VARIANT),small)
  55. $(CP) ./variant-$(BUILD_VARIANT)/* $(PKG_BUILD_DIR)/
  56. endif
  57. endef
  58. define Package/telegraf/install
  59. $(call GoPackage/Package/Install/Bin,$(1))
  60. $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
  61. $(INSTALL_BIN) ./files/etc/init.d/telegraf $(1)/etc/init.d/telegraf
  62. $(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/telegraf.conf $(1)/etc/telegraf.conf
  63. endef
  64. define Package/telegraf-full/install
  65. $(call Package/telegraf/install,$(1))
  66. endef
  67. $(eval $(call GoBinPackage,telegraf))
  68. $(eval $(call BuildPackage,telegraf))
  69. $(eval $(call GoBinPackage,telegraf-full))
  70. $(eval $(call BuildPackage,telegraf-full))