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:=http://www.tcpdump.org/release/
16 PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/kernel.mk
26 define Package/libpcap
29 TITLE:=Low-level packet capture library
30 URL:=http://www.tcpdump.org/
34 define Package/libpcap/description
35 This package contains a system-independent library for user-level network packet
39 define Package/libpcap/config
40 source "$(SOURCE)/Config.in"
48 ac_cv_linux_vers=$(LINUX_VERSION) \
49 ac_cv_header_libusb_1_0_libusb_h=no \
50 ac_cv_netfilter_can_compile=no
58 --with-build-cc="$(HOSTCC)" \
66 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
68 define Build/Configure
69 $(call Build/Configure/Default)
70 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
71 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
72 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
73 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
76 define Build/InstallDev
77 $(INSTALL_DIR) $(1)/usr/include
78 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
84 define Package/libpcap/install
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
89 $(eval $(call BuildPackage,libpcap))