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.

78 lines
2.0 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.2
  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:=6808c8c4495343e67863f4d30bb261c1e2daec5628ae0be257ba2a2dea7ec70a
  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. define Package/libndpi
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=Library for deep-packet inspection
  28. URL:=https://github.com/ntop/nDPI
  29. DEPENDS:=$(CXX_DEPENDS) +libpcap +libjson-c
  30. endef
  31. define Package/libndpi/description
  32. nDPI is an open source LGPLv3 library for deep-packet inspection.
  33. Based on OpenDPI it includes ntop extensions.
  34. endef
  35. define Build/Prepare
  36. $(PKG_UNPACK)
  37. $(Build/Patch)
  38. mv $(PKG_BUILD_DIR)/configure.seed $(PKG_BUILD_DIR)/configure.ac
  39. $(SED) "s/@NDPI_MAJOR@/3/g" \
  40. -e "s/@NDPI_MINOR@/2/g" \
  41. -e "s/@NDPI_PATCH@/0/g" \
  42. -e "s/@NDPI_VERSION_SHORT@/3.2.0/g" \
  43. $(PKG_BUILD_DIR)/configure.ac
  44. endef
  45. define Build/InstallDev
  46. $(INSTALL_DIR) $(1)/usr/include/ndpi
  47. $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
  48. $(1)/usr/include/ndpi/
  49. $(INSTALL_DIR) $(1)/usr/lib
  50. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  51. $(1)/usr/lib/
  52. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  53. $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
  54. $(1)/usr/lib/pkgconfig/
  55. endef
  56. define Package/libndpi/install
  57. $(INSTALL_DIR) $(1)/usr/lib/
  58. $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
  59. $(1)/usr/lib/
  60. $(INSTALL_DIR) $(1)/usr/bin/
  61. $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
  62. $(1)/usr/bin/
  63. endef
  64. $(eval $(call BuildPackage,libndpi))