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.

113 lines
3.9 KiB

  1. #
  2. # Copyright (C) 2016-2021 eGloo, Incorporated
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=netifyd
  7. PKG_RELEASE:=1
  8. PKG_MAINTAINER:=Darryl Sokoloski <darryl@egloo.ca>
  9. PKG_LICENSE:=GPL-3.0-or-later
  10. PKG_BUILD_PARALLEL:=1
  11. PKG_FIXUP:=autoreconf
  12. PKG_INSTALL:=1
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_URL:=https://gitlab.com/netify.ai/public/netify-agent.git
  15. PKG_SOURCE_DATE:=2021-11-17
  16. PKG_SOURCE_VERSION:=v3.09
  17. #PKG_SOURCE_VERSION:=358ec2b0ac321e0608e78c75f6b7434ed1aec326
  18. PKG_MIRROR_HASH:=660079a75a17a07c638b25dab0ecc972c02fec2124930068bfcf15d28abf4121
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/netifyd
  21. SECTION:=net
  22. CATEGORY:=Network
  23. TITLE:=Netify Agent
  24. URL:=http://www.netify.ai/
  25. DEPENDS:=+ca-bundle +libcurl +libmnl +libnetfilter-conntrack +libpcap +zlib +libpthread @!USE_UCLIBC
  26. # Explicitly depend on libstdcpp rather than $(CXX_DEPENDS). At the moment
  27. # std::unordered_map is only available via libstdcpp which is required for
  28. # performance reasons.
  29. DEPENDS+=+libstdcpp
  30. endef
  31. define Package/netifyd/description
  32. The Netify Agent is a deep-packet inspection server which detects network
  33. protocols and applications. These detections can be saved locally, served over
  34. a UNIX or TCP socket, and/or "pushed" (via HTTP POSTs) to a remote third-party
  35. server. Flow metadata, network statistics, and detection classifications are
  36. JSON encoded for easy consumption by third-party applications.
  37. endef
  38. define Package/netifyd/conffiles
  39. /etc/netifyd.conf
  40. /etc/config/netifyd
  41. /etc/netify.d/agent.uuid
  42. /etc/netify.d/serial.uuid
  43. /etc/netify.d/site.uuid
  44. endef
  45. TARGET_CFLAGS+=-ffunction-sections -fdata-sections -Wno-psabi
  46. TARGET_CXXFLAGS+=-ffunction-sections -fdata-sections -Wno-psabi
  47. TARGET_LDFLAGS+=-Wl,--gc-sections
  48. CONFIGURE_ARGS+= \
  49. --sharedstatedir=/var/run \
  50. --enable-lean-and-mean \
  51. --disable-libtcmalloc \
  52. --without-systemdsystemunitdir \
  53. --without-tmpfilesdir
  54. # Disable configuration file-watch support (deprecated feature).
  55. # Not to be confused with kernel/system-level inotify support.
  56. CONFIGURE_ARGS+= \
  57. --disable-inotify
  58. ifneq ($(CONFIG_LIBCURL_ZLIB),y)
  59. CONFIGURE_ARGS+= \
  60. --without-libcurl-zlib
  61. endif
  62. define Build/Configure
  63. (cd $(PKG_BUILD_DIR); ./autogen.sh)
  64. $(call Build/Configure/Default)
  65. endef
  66. define Build/InstallDev
  67. $(INSTALL_DIR) $(1)/usr/include/netifyd
  68. $(CP) $(PKG_INSTALL_DIR)/usr/include/netifyd/*.h $(1)/usr/include/netifyd
  69. $(INSTALL_DIR) $(1)/usr/include/netifyd/pcap-compat
  70. $(CP) $(PKG_INSTALL_DIR)/usr/include/netifyd/pcap-compat/*.h $(1)/usr/include/netifyd/pcap-compat
  71. $(INSTALL_DIR) $(1)/usr/include/netifyd/nlohmann
  72. $(CP) $(PKG_INSTALL_DIR)/usr/include/netifyd/nlohmann/*.hpp $(1)/usr/include/netifyd/nlohmann
  73. $(INSTALL_DIR) $(1)/usr/include/libndpi-2.9.0
  74. $(INSTALL_DIR) $(1)/usr/include/libndpi-2.9.0/libndpi
  75. $(CP) $(PKG_INSTALL_DIR)/usr/include/libndpi-2.9.0/libndpi/*.h $(1)/usr/include/libndpi-2.9.0/libndpi
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.{a,so*} $(1)/usr/lib/
  78. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  79. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetifyd.pc $(1)/usr/lib/pkgconfig/
  80. endef
  81. define Package/netifyd/install
  82. $(INSTALL_DIR) $(1)/etc
  83. $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/netifyd.conf $(1)/etc
  84. $(INSTALL_DIR) $(1)/etc/config
  85. $(INSTALL_CONF) ./files/netifyd.config $(1)/etc/config/netifyd
  86. $(INSTALL_DIR) $(1)/etc/init.d
  87. $(INSTALL_BIN) ./files/netifyd.init $(1)/etc/init.d/netifyd
  88. $(INSTALL_DIR) $(1)/usr/sbin
  89. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netifyd $(1)/usr/sbin
  90. $(INSTALL_DIR) $(1)/usr/lib
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.so.* $(1)/usr/lib/
  92. $(INSTALL_DIR) $(1)/etc/netify.d
  93. $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/netify-sink.conf $(1)/etc/netify.d/netify-sink.conf
  94. $(INSTALL_DIR) $(1)/usr/share/netifyd
  95. $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/functions.sh $(1)/usr/share/netifyd
  96. endef
  97. $(eval $(call BuildPackage,netifyd))