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:=7e7321fb3aff2f2bb05c8229f3795d4a
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
22 PKG_LICENSE:=BSD-3-Clause
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/kernel.mk
27 define Package/libpcap
30 TITLE:=Low-level packet capture library
31 URL:=http://www.tcpdump.org/
35 define Package/libpcap/description
36 This package contains a system-independent library for user-level network packet
40 define Package/libpcap/config
41 source "$(SOURCE)/Config.in"
49 ac_cv_linux_vers=$(LINUX_VERSION) \
50 ac_cv_header_libusb_1_0_libusb_h=no \
51 ac_cv_netfilter_can_compile=no
58 --with-build-cc="$(HOSTCC)" \
69 ifeq ($(CONFIG_IPV6),y)
75 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
77 define Build/Configure
78 $(call Build/Configure/Default)
79 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
80 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
81 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
82 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
85 define Build/InstallDev
86 $(INSTALL_DIR) $(1)/usr/include
87 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
89 $(INSTALL_DIR) $(1)/usr/lib
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
93 define Package/libpcap/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
98 $(eval $(call BuildPackage,libpcap))