Makefile 2.4 KB

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