Makefile 2.5 KB

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