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>
20 PKG_LICENSE:=BSD-3-Clause
21 PKG_LICENSE_FILES:=LICENSE
25 PKG_LICENSE:=BSD-3-Clause
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/kernel.mk
30 define Package/libpcap
33 TITLE:=Low-level packet capture library
34 URL:=http://www.tcpdump.org/
38 define Package/libpcap/description
39 This package contains a system-independent library for user-level network packet
43 define Package/libpcap/config
44 source "$(SOURCE)/Config.in"
52 ac_cv_linux_vers=$(LINUX_VERSION) \
53 ac_cv_header_libusb_1_0_libusb_h=no \
54 ac_cv_netfilter_can_compile=no
61 --with-build-cc="$(HOSTCC)" \
72 ifeq ($(CONFIG_IPV6),y)
78 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
80 define Build/Configure
81 $(call Build/Configure/Default)
82 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
83 $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
84 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
85 $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
88 define Build/InstallDev
89 $(INSTALL_DIR) $(1)/usr/include
90 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
96 define Package/libpcap/install
97 $(INSTALL_DIR) $(1)/usr/lib
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
101 $(eval $(call BuildPackage,libpcap))