2 # Copyright (C) 2006 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
:=9ad1358c5dec48456405eac197a46d3d
18 include $(INCLUDE_DIR
)/package.mk
20 define Package
/libpcap
23 TITLE
:=Low-level packet capture library
24 URL
:=http
://www.tcpdump.org
/
27 define Package
/libpcap
/description
28 This package contains a system-independent library for user-level network
32 define Package
/libpcap
/config
34 bool
"Include USB support"
35 depends PACKAGE_libpcap
36 depends PACKAGE_kmod-usb-core
40 bool
"Include bluetooth support"
41 depends PACKAGE_libpcap
42 depends PACKAGE_kmod-bluetooth
48 -ffunction-sections
-fdata-sections
55 --with-build-cc
="$(HOSTCC)" \
61 rm -rf
$(PKG_INSTALL_DIR
)
62 $(if
$(CONFIG_PCAP_HAS_USB
),,$(SED
) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR
)/config.h
)
63 $(if
$(CONFIG_PCAP_HAS_USB
),,$(SED
) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR
)/Makefile
)
64 $(if
$(CONFIG_PCAP_HAS_BT
),,$(SED
) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR
)/config.h
)
65 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
66 CCOPT
="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
67 DESTDIR
="$(PKG_INSTALL_DIR)" \
71 define Build
/InstallDev
72 mkdir
-p
$(1)/usr
/include $(1)/usr
/lib
74 $(PKG_INSTALL_DIR
)/usr
/include/pcap
* \
77 $(PKG_INSTALL_DIR
)/usr
/lib
/libpcap.
{a
,so
*} \
81 define Package
/libpcap
/install
82 $(INSTALL_DIR
) $(1)/usr
/lib
83 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpcap.so.
* $(1)/usr
/lib
/
86 $(eval
$(call BuildPackage
,libpcap
))