add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt/staging/chunkeey.git] / package / libpcap / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libpcap
12 PKG_VERSION:=0.9.4
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
17 PKG_MD5SUM:=79025766e8027df154cb1f32de8a7974
18 PKG_CAT:=zcat
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libpcap
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=Low-level packet capture library
26 DESCRIPTION:=\
27 This package contains a system-independent library for user-level \\\
28 network packet capture.
29 URL:=http://www.tcpdump.org/
30 endef
31
32 CONFIGURE_ARGS += \
33 --enable-shared \
34 --enable-static \
35 --disable-yydebug \
36 --enable-ipv6 \
37 --with-build-cc="$(HOSTCC)" \
38 --with-pcap=linux
39
40 define Build/Compile
41 $(MAKE) -C $(PKG_BUILD_DIR) \
42 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
43 DESTDIR="$(PKG_INSTALL_DIR)" \
44 all install
45 endef
46
47 define Build/InstallDev
48 mkdir -p $(STAGING_DIR)/usr/include
49 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap{,-bpf,-namedb}.h \
50 $(STAGING_DIR)/usr/include/
51 mkdir -p $(STAGING_DIR)/usr/lib
52 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
53 $(STAGING_DIR)/usr/lib/
54 endef
55
56 define Build/UninstallDev
57 rm -rf $(STAGING_DIR)/usr/include/pcap{,-bpf,-named}.h \
58 $(STAGING_DIR)/usr/lib/libpcap.{a,so*}
59 endef
60
61 define Package/libpcap/install
62 $(INSTALL_DIR) $(1)/usr/lib
63 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
64 endef
65
66 $(eval $(call BuildPackage,libpcap))