bd039f911dfa5c4b5fbc3fddff91922614086edf
[openwrt/openwrt.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
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libpcap
22 SECTION:=libs
23 CATEGORY:=Libraries
24 TITLE:=Low-level packet capture library
25 URL:=http://www.tcpdump.org/
26 endef
27
28 define Package/libpcap/description
29 This package contains a system-independent library for user-level network
30 packet capture.
31 endef
32
33 CONFIGURE_ARGS += \
34 --enable-shared \
35 --enable-static \
36 --disable-yydebug \
37 --enable-ipv6 \
38 --with-build-cc="$(HOSTCC)" \
39 --with-pcap=linux
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
44 DESTDIR="$(PKG_INSTALL_DIR)" \
45 all install
46 endef
47
48 define Build/InstallDev
49 mkdir -p $(1)/usr/include
50 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap{,-bpf,-namedb}.h \
51 $(1)/usr/include/
52 mkdir -p $(1)/usr/lib
53 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
54 $(1)/usr/lib/
55 endef
56
57 define Build/UninstallDev
58 rm -rf $(1)/usr/include/pcap{,-bpf,-namedb}.h \
59 $(1)/usr/lib/libpcap.{a,so*}
60 endef
61
62 define Package/libpcap/install
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
65 endef
66
67 $(eval $(call BuildPackage,libpcap))