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