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.

105 lines
2.6 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libndpi
  9. PKG_VERSION:=4.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
  13. PKG_HASH:=99e0aba6396fd633c3840f30e4942f6591a08066d037f560b65ba64e7310f4d6
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>, Toni Uhlig <matzeton@googlemail.com>
  16. PKG_LICENSE:=LGPL-3.0-or-later
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_FIXUP:=autoreconf
  19. PKG_REMOVE_FILES:=autogen.sh
  20. PKG_BUILD_DEPENDS:=libpcap
  21. PKG_BUILD_PARALLEL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. ifeq ($(CONFIG_LIBNDPI_GCRYPT),)
  24. CONFIGURE_ARGS += --disable-gcrypt
  25. endif
  26. ifneq ($(CONFIG_LIBNDPI_MAXMINDDB),)
  27. CONFIGURE_ARGS += --with-maxminddb
  28. endif
  29. define Package/libndpi
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. TITLE:=Library for deep-packet inspection
  33. URL:=https://github.com/ntop/nDPI
  34. DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_MAXMINDDB:libmaxminddb +libpcap +libjson-c
  35. endef
  36. define Package/libndpi/description
  37. nDPI is an open source LGPLv3 library for deep-packet inspection.
  38. Based on OpenDPI it includes ntop extensions.
  39. endef
  40. define Package/libndpi/config
  41. config LIBNDPI_GCRYPT
  42. bool "GCrypt support"
  43. depends on PACKAGE_libndpi
  44. default n
  45. help
  46. This option enables QUIC client hello decryption.
  47. Disabled by default.
  48. config LIBNDPI_MAXMINDDB
  49. bool "Maxmind GeoIP support"
  50. depends on PACKAGE_libndpi
  51. default n
  52. help
  53. This options enables geographical information processing
  54. and serialization based on IP addresses.
  55. Disabled by default.
  56. endef
  57. define Build/Prepare
  58. $(PKG_UNPACK)
  59. $(Build/Patch)
  60. mv $(PKG_BUILD_DIR)/configure.seed $(PKG_BUILD_DIR)/configure.ac
  61. $(SED) "s/@NDPI_MAJOR@/3/g" \
  62. -e "s/@NDPI_MINOR@/4/g" \
  63. -e "s/@NDPI_PATCH@/0/g" \
  64. -e "s/@NDPI_VERSION_SHORT@/3.4.0/g" \
  65. -e "s/@FUZZY@/dnl> /g" \
  66. $(PKG_BUILD_DIR)/configure.ac
  67. endef
  68. define Build/InstallDev
  69. $(INSTALL_DIR) $(1)/usr/include/ndpi
  70. $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
  71. $(1)/usr/include/ndpi/
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  74. $(1)/usr/lib/
  75. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  76. $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
  77. $(1)/usr/lib/pkgconfig/
  78. endef
  79. define Package/libndpi/install
  80. $(INSTALL_DIR) $(1)/usr/lib/
  81. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  82. $(1)/usr/lib/
  83. $(INSTALL_DIR) $(1)/usr/bin/
  84. $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
  85. $(1)/usr/bin/
  86. endef
  87. $(eval $(call BuildPackage,libndpi))