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.

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