libndpi: bump to release 4.8
[feed/packages.git] / libs / libndpi / Makefile
1 #
2 # Copyright (C) 2017 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libndpi
11 PKG_VERSION:=4.8
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
16 PKG_HASH:=8f6235ba672d4ac8e4cbebb5611bc712a74587d9d53a649f483e4bcca5b80e58
17 PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
18
19 PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>, Toni Uhlig <matzeton@googlemail.com>
20 PKG_LICENSE:=LGPL-3.0-or-later
21 PKG_LICENSE_FILES:=COPYING
22
23 PKG_FIXUP:=autoreconf
24 PKG_REMOVE_FILES:=autogen.sh
25 PKG_BUILD_DEPENDS:=libpcap
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 ifeq ($(LIBNDPI_NDPIREADER),)
31 CONFIGURE_ARGS += --with-only-libndpi
32 endif
33
34 ifneq ($(CONFIG_LIBNDPI_GCRYPT),)
35 CONFIGURE_ARGS += --with-local-libgcrypt
36 endif
37
38 ifneq ($(CONFIG_LIBNDPI_PCRE),)
39 CONFIGURE_ARGS += --with-pcre
40 endif
41
42 ifneq ($(CONFIG_LIBNDPI_MAXMINDDB),)
43 CONFIGURE_ARGS += --with-maxminddb
44 endif
45
46 define Package/libndpi
47 SECTION:=libs
48 CATEGORY:=Libraries
49 TITLE:=Library for deep-packet inspection
50 URL:=https://github.com/ntop/nDPI
51 DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_PCRE:libpcre +LIBNDPI_MAXMINDDB:libmaxminddb +LIBNDPI_NDPIREADER:libpcap
52 endef
53
54 define Package/libndpi/description
55 nDPI is an open source LGPLv3 library for deep-packet inspection.
56 Based on OpenDPI it includes ntop extensions.
57 endef
58
59 define Package/libndpi/config
60 config LIBNDPI_NDPIREADER
61 bool "Enable ndpiReader"
62 depends on PACKAGE_libndpi
63 default n
64 help
65 This option builds and installs ndpiReader,
66 an example application that show some nDPI features.
67
68 config LIBNDPI_GCRYPT
69 bool "Use host GCrypt"
70 depends on PACKAGE_libndpi
71 default n
72 help
73 This option enables the use of libgcrypt to decrypt QUIC client hello's.
74 If disabled, nDPI will use a builtin lightweight libgcrypt version to
75 decrypt QUIC client hello's.
76 Disabled by default.
77
78 config LIBNDPI_PCRE
79 bool "pcre support"
80 depends on PACKAGE_libndpi
81 default n
82 help
83 This option enables the use of regular expressions.
84 Used by nDPI to detect RCE injection.
85 Disabled by default.
86
87 config LIBNDPI_MAXMINDDB
88 bool "Maxmind GeoIP support"
89 depends on PACKAGE_libndpi
90 default n
91 help
92 This options enables geographical information processing
93 and serialization based on IP addresses.
94 Disabled by default.
95 endef
96
97 define Build/InstallDev
98 $(INSTALL_DIR) $(1)/usr/include/ndpi
99 $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
100 $(1)/usr/include/ndpi/
101
102 $(INSTALL_DIR) $(1)/usr/lib
103 $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
104 $(1)/usr/lib/
105
106 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
107 $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
108 $(1)/usr/lib/pkgconfig/
109 endef
110
111 define Package/libndpi/install
112 $(INSTALL_DIR) $(1)/usr/lib/
113 $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
114 $(1)/usr/lib/
115 $(INSTALL_DIR) $(1)/usr/bin/
116 ifneq ($(LIBNDPI_NDPIREADER),)
117 $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
118 $(1)/usr/bin/
119 endif
120 endef
121
122 $(eval $(call BuildPackage,libndpi))