2 # Copyright (C) 2006-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://www.tcpdump.org/release/
16 PKG_HASH:=ed19a0383fad72e3ad435fd239d7cd80d64916b87269550159d20e47160ebe5f
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=LICENSE
21 PKG_CPE_ID:=cpe:/a:tcpdump:libpcap
23 PKG_ASLR_PIE_REGULAR:=1
25 PKG_CONFIG_DEPENDS := CONFIG_PACKAGE_rpcapd
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
30 define Package/libpcap
33 TITLE:=Low-level packet capture library
34 URL:=http://www.tcpdump.org/
39 define Package/libpcap/description
40 This package contains a system-independent library for user-level network packet
44 define Package/libpcap/config
45 source "$(SOURCE)/Config.in"
51 TITLE:=Capture daemon to be controlled by a remote libpcap application
52 URL:=http://www.tcpdump.org/
56 ifdef CONFIG_PACKAGE_rpcapd
62 -DBUILD_SHARED_LIBS=ON \
63 -DBUILD_WITH_LIBNL=OFF \
64 -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
65 -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
67 # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
69 -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
73 -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
85 define Build/InstallDev
86 $(call Build/InstallDev/cmake,$(1))
88 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
89 $(1)/usr/bin/pcap-config
90 $(INSTALL_DIR) $(2)/bin
91 $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
94 define Package/libpcap/install
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
99 define Package/rpcapd/install
100 $(INSTALL_DIR) $(1)/usr/sbin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/
104 $(eval $(call BuildPackage,libpcap))
105 $(eval $(call BuildPackage,rpcapd))