Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # Copyright (C) 2006-2013 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:=libpcap
  9. PKG_VERSION:=1.10.1
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.tcpdump.org/release/
  13. PKG_HASH:=ed285f4accaf05344f90975757b3dbfe772ba41d1c401c2648b7fa45b711bdd4
  14. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_ASLR_PIE_REGULAR:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/libpcap
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=Low-level packet capture library
  24. URL:=http://www.tcpdump.org/
  25. MENU:=1
  26. ABI_VERSION:=1
  27. endef
  28. define Package/libpcap/description
  29. This package contains a system-independent library for user-level network packet
  30. capture.
  31. endef
  32. define Package/libpcap/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. define Package/rpcapd
  36. SECTION:=net
  37. CATEGORY:=Network
  38. TITLE:=Capture daemon to be controlled by a remote libpcap application
  39. URL:=http://www.tcpdump.org/
  40. DEPENDS+= +libpcap
  41. endef
  42. ifdef CONFIG_PACKAGE_rpcapd
  43. CMAKE_OPTIONS += \
  44. -DENABLE_REMOTE=ON
  45. endif
  46. CMAKE_OPTIONS += \
  47. -DBUILD_SHARED_LIBS=ON \
  48. -DBUILD_WITH_LIBNL=OFF \
  49. -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
  50. -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
  51. # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
  52. CMAKE_OPTIONS += \
  53. -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
  54. -DDISABLE_DAG=ON \
  55. -DDISABLE_DBUS=ON \
  56. -DDISABLE_DPDK=ON \
  57. -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
  58. -DDISABLE_NETMAP=ON \
  59. -DDISABLE_RDMA=ON \
  60. -DDISABLE_SEPTEL=ON \
  61. -DDISABLE_SNF=ON \
  62. -DDISABLE_TC=ON \
  63. # Debugging options
  64. CMAKE_OPTIONS += \
  65. -DBDEBUG=OFF \
  66. -DYYDEBUG=OFF \
  67. define Build/InstallDev
  68. $(call Build/InstallDev/cmake,$(1))
  69. $(SED) \
  70. 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
  71. $(1)/usr/bin/pcap-config
  72. $(INSTALL_DIR) $(2)/bin
  73. $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
  74. endef
  75. define Package/libpcap/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
  78. endef
  79. define Package/rpcapd/install
  80. $(INSTALL_DIR) $(1)/usr/sbin
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/
  82. endef
  83. $(eval $(call BuildPackage,libpcap))
  84. $(eval $(call BuildPackage,rpcapd))