2006-06-27 03:35:46 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-05-24 10:18:36 +03:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=libpcap
|
2009-04-25 06:30:10 +03:00
|
|
|
PKG_VERSION:=1.0.0
|
2006-05-24 10:18:36 +03:00
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.tcpdump.org/release/
|
2009-04-25 06:30:10 +03:00
|
|
|
PKG_MD5SUM:=9ad1358c5dec48456405eac197a46d3d
|
2006-05-24 10:18:36 +03:00
|
|
|
|
2006-06-21 05:32:39 +03:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-05-24 10:18:36 +03:00
|
|
|
|
|
|
|
define Package/libpcap
|
2006-09-23 22:29:00 +03:00
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
|
|
|
TITLE:=Low-level packet capture library
|
|
|
|
URL:=http://www.tcpdump.org/
|
2006-05-24 10:18:36 +03:00
|
|
|
endef
|
|
|
|
|
2007-09-07 11:34:51 +03:00
|
|
|
define Package/libpcap/description
|
2008-07-07 17:41:48 +03:00
|
|
|
This package contains a system-independent library for user-level network
|
2007-09-07 11:34:51 +03:00
|
|
|
packet capture.
|
|
|
|
endef
|
|
|
|
|
2009-04-25 06:30:10 +03:00
|
|
|
define Package/libpcap/config
|
|
|
|
config PCAP_HAS_USB
|
|
|
|
bool "Include USB support"
|
|
|
|
depends PACKAGE_libpcap
|
|
|
|
depends PACKAGE_kmod-usb-core
|
|
|
|
default n
|
|
|
|
|
|
|
|
config PCAP_HAS_BT
|
|
|
|
bool "Include bluetooth support"
|
|
|
|
depends PACKAGE_libpcap
|
|
|
|
depends PACKAGE_kmod-bluetooth
|
|
|
|
default n
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2008-12-19 08:35:23 +02:00
|
|
|
TARGET_CFLAGS += \
|
|
|
|
-ffunction-sections -fdata-sections
|
2008-08-07 01:10:29 +03:00
|
|
|
|
2007-02-26 01:34:57 +02:00
|
|
|
CONFIGURE_ARGS += \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--disable-yydebug \
|
|
|
|
--enable-ipv6 \
|
|
|
|
--with-build-cc="$(HOSTCC)" \
|
2009-04-25 06:30:10 +03:00
|
|
|
--with-pcap=linux \
|
|
|
|
--without-septel \
|
|
|
|
--without-dag
|
2006-05-24 10:18:36 +03:00
|
|
|
|
|
|
|
define Build/Compile
|
2009-04-25 06:30:10 +03:00
|
|
|
rm -rf $(PKG_INSTALL_DIR)
|
|
|
|
$(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
|
|
|
|
$(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
|
|
|
|
$(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
|
2006-05-24 10:18:36 +03:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
|
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
|
|
all install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2009-04-25 06:30:10 +03:00
|
|
|
mkdir -p $(1)/usr/include $(1)/usr/lib
|
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/include/pcap* \
|
2007-09-28 04:45:11 +03:00
|
|
|
$(1)/usr/include/
|
2009-04-25 06:30:10 +03:00
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
|
2007-09-28 04:45:11 +03:00
|
|
|
$(1)/usr/lib/
|
2006-05-24 10:18:36 +03:00
|
|
|
endef
|
|
|
|
|
2006-06-18 21:30:40 +03:00
|
|
|
define Package/libpcap/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2006-06-18 21:30:40 +03:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
|
2006-05-24 10:18:36 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,libpcap))
|