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
1.9 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:=2.8
  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:=f98def4d0e43818317b20e2887ce500b2d6a5a9c8ddb28cf57ae51caae0f33cc
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
  16. PKG_LICENSE:=LGPLv3
  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@/2/g" \
  40. -e "s/@NDPI_MINOR@/8/g" \
  41. -e "s/@NDPI_PATCH@/0/g" \
  42. -e "s/@NDPI_VERSION_SHORT@/2.8.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))