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.

63 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. CMAKE_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../devel/ninja/ninja-cmake.mk
  20. define Package/libtins
  21. SECTION:=net
  22. CATEGORY:=Libraries
  23. TITLE:=libtins
  24. URL:=https://libtins.github.io/
  25. DEPENDS:=+libstdcpp +LIBTINS_ENABLE_PCAP:libpcap +LIBTINS_ENABLE_WPA2:libopenssl
  26. MENU:=1
  27. endef
  28. define Package/libtins/config
  29. source "$(SOURCE)/Config.in"
  30. endef
  31. define Package/libtins/description
  32. libtins is a high-level, multiplatform C++ network packet sniffing and crafting library.
  33. endef
  34. CMAKE_OPTIONS += \
  35. -D_RUN_RESULT_VAR=FORCE \
  36. -DLIBTINS_BUILD_EXAMPLES=OFF \
  37. -DLIBTINS_BUILD_TESTS=OFF \
  38. -DLIBTINS_ENABLE_ACK_TRACKER=$(if $(CONFIG_LIBTINS_ENABLE_ACK_TRACKER),ON,OFF) \
  39. -DLIBTINS_ENABLE_CXX11=$(if $(CONFIG_LIBTINS_ENABLE_CXX11),ON,OFF) \
  40. -DLIBTINS_ENABLE_DOT11=$(if $(CONFIG_LIBTINS_ENABLE_DOT11),ON,OFF) \
  41. -DLIBTINS_ENABLE_PCAP=$(if $(CONFIG_LIBTINS_ENABLE_PCAP),ON,OFF) \
  42. -DLIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA=$(if $(CONFIG_LIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA),ON,OFF) \
  43. -DLIBTINS_ENABLE_WPA2=$(if $(CONFIG_LIBTINS_ENABLE_WPA2),ON,OFF)
  44. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
  45. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  46. define Package/libtins/install
  47. $(INSTALL_DIR) $(1)/usr/lib
  48. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtins.so.* $(1)/usr/lib/
  49. endef
  50. $(eval $(call BuildPackage,libtins))