f8de02d5599c65a4873356993c49e000754c79dc
[openwrt/svn-archive/archive.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 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libpcap
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Low-level packet capture library
29 DESCRIPTION:=\
30 This package contains a system-independent library for user-level \\\
31 network packet capture.
32 URL:=http://www.tcpdump.org/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(TARGET_CFLAGS)" \
39 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
40 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
41 ac_cv_linux_vers= \
42 ./configure \
43 --target=$(GNU_TARGET_NAME) \
44 --host=$(GNU_TARGET_NAME) \
45 --build=$(GNU_HOST_NAME) \
46 --program-prefix="" \
47 --program-suffix="" \
48 --prefix=/usr \
49 --exec-prefix=/usr \
50 --bindir=/usr/bin \
51 --datadir=/usr/share \
52 --includedir=/usr/include \
53 --infodir=/usr/share/info \
54 --libdir=/usr/lib \
55 --libexecdir=/usr/lib \
56 --localstatedir=/var \
57 --mandir=/usr/share/man \
58 --sbindir=/usr/sbin \
59 --sysconfdir=/etc \
60 $(DISABLE_NLS) \
61 $(DISABLE_LARGEFILE) \
62 --enable-shared \
63 --enable-static \
64 --disable-yydebug \
65 --enable-ipv6 \
66 --with-build-cc="$(HOSTCC)" \
67 --with-pcap=linux \
68 );
69 endef
70
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
74 DESTDIR="$(PKG_INSTALL_DIR)" \
75 all install
76 endef
77
78 define Build/InstallDev
79 mkdir -p $(STAGING_DIR)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap{,-bpf,-namedb}.h \
81 $(STAGING_DIR)/usr/include/
82 mkdir -p $(STAGING_DIR)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
84 $(STAGING_DIR)/usr/lib/
85 endef
86
87 define Build/UninstallDev
88 rm -rf $(STAGING_DIR)/usr/include/pcap{,-bpf,-named}.h \
89 $(STAGING_DIR)/usr/lib/libpcap.{a,so*}
90 endef
91
92 define Package/libpcap/install
93 install -m0755 -d $(1)/usr/lib
94 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
95 endef
96
97 $(eval $(call BuildPackage,libpcap))