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.

64 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2017 Steven Hessing
  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:=libtins
  9. PKG_VERSION:=4.2
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/mfontanini/libtins/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=a9fed73e13f06b06a4857d342bb30815fa8c359d00bd69547e567eecbbb4c3a1
  14. PKG_MAINTAINER:= Steven Hessing <steven.hessing@gmail.com>
  15. PKG_LICENSE:=BSD-2-Clause
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_BUILD_PARALLEL:=1
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/libtins
  22. SECTION:=net
  23. CATEGORY:=Libraries
  24. TITLE:=libtins
  25. URL:=https://libtins.github.io/
  26. DEPENDS:=+libstdcpp +LIBTINS_ENABLE_PCAP:libpcap +LIBTINS_ENABLE_WPA2:libopenssl
  27. MENU:=1
  28. endef
  29. define Package/libtins/config
  30. source "$(SOURCE)/Config.in"
  31. endef
  32. define Package/libtins/description
  33. libtins is a high-level, multiplatform C++ network packet sniffing and crafting library.
  34. endef
  35. CMAKE_OPTIONS += \
  36. -D_RUN_RESULT_VAR=FORCE \
  37. -DLIBTINS_BUILD_EXAMPLES=OFF \
  38. -DLIBTINS_BUILD_TESTS=OFF \
  39. -DLIBTINS_ENABLE_ACK_TRACKER=$(if $(CONFIG_LIBTINS_ENABLE_ACK_TRACKER),ON,OFF) \
  40. -DLIBTINS_ENABLE_CXX11=$(if $(CONFIG_LIBTINS_ENABLE_CXX11),ON,OFF) \
  41. -DLIBTINS_ENABLE_DOT11=$(if $(CONFIG_LIBTINS_ENABLE_DOT11),ON,OFF) \
  42. -DLIBTINS_ENABLE_PCAP=$(if $(CONFIG_LIBTINS_ENABLE_PCAP),ON,OFF) \
  43. -DLIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA=$(if $(CONFIG_LIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA),ON,OFF) \
  44. -DLIBTINS_ENABLE_WPA2=$(if $(CONFIG_LIBTINS_ENABLE_WPA2),ON,OFF)
  45. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
  46. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  47. define Package/libtins/install
  48. $(INSTALL_DIR) $(1)/usr/lib
  49. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtins.so.* $(1)/usr/lib/
  50. endef
  51. $(eval $(call BuildPackage,libtins))