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.

92 lines
2.3 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:=3.4
  10. PKG_RELEASE:=2
  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:=dc9b291c7fde94edb45fb0f222e0d93c93f8d6d37f4efba20ebd9c655bfcedf9
  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. define Package/libndpi
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE:=Library for deep-packet inspection
  30. URL:=https://github.com/ntop/nDPI
  31. DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +libpcap +libjson-c
  32. endef
  33. define Package/libndpi/description
  34. nDPI is an open source LGPLv3 library for deep-packet inspection.
  35. Based on OpenDPI it includes ntop extensions.
  36. endef
  37. define Package/libndpi/config
  38. config LIBNDPI_GCRYPT
  39. bool "GCrypt support"
  40. depends on PACKAGE_libndpi
  41. default n
  42. help
  43. This option enables QUIC client hello decryption.
  44. Disabled by default.
  45. endef
  46. define Build/Prepare
  47. $(PKG_UNPACK)
  48. $(Build/Patch)
  49. mv $(PKG_BUILD_DIR)/configure.seed $(PKG_BUILD_DIR)/configure.ac
  50. $(SED) "s/@NDPI_MAJOR@/3/g" \
  51. -e "s/@NDPI_MINOR@/4/g" \
  52. -e "s/@NDPI_PATCH@/0/g" \
  53. -e "s/@NDPI_VERSION_SHORT@/3.4.0/g" \
  54. -e "s/@FUZZY@/dnl> /g" \
  55. $(PKG_BUILD_DIR)/configure.ac
  56. endef
  57. define Build/InstallDev
  58. $(INSTALL_DIR) $(1)/usr/include/ndpi
  59. $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
  60. $(1)/usr/include/ndpi/
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  63. $(1)/usr/lib/
  64. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  65. $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
  66. $(1)/usr/lib/pkgconfig/
  67. endef
  68. define Package/libndpi/install
  69. $(INSTALL_DIR) $(1)/usr/lib/
  70. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  71. $(1)/usr/lib/
  72. $(INSTALL_DIR) $(1)/usr/bin/
  73. $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
  74. $(1)/usr/bin/
  75. endef
  76. $(eval $(call BuildPackage,libndpi))