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.
9 include $(TOPDIR
)/rules.mk
15 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)/$(PKG_NAME
)-$(PKG_VERSION
)
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=http
://www.tcpdump.org
/release
/
18 PKG_MD5SUM
:=79025766e8027df154cb1f32de8a7974
21 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/libpcap
28 TITLE
:=Low-level packet capture library
29 DESCRIPTION
:=A system-independent library for user-level network packet capture.
30 URL
:=http
://www.tcpdump.org
/
33 define Build
/Configure
34 (cd
$(PKG_BUILD_DIR
); rm -f config.cache
; \
35 $(TARGET_CONFIGURE_OPTS
) \
36 CFLAGS
="$(TARGET_CFLAGS)" \
37 CPPFLAGS
="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
38 LDFLAGS
="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
41 --target
=$(GNU_TARGET_NAME
) \
42 --host
=$(GNU_TARGET_NAME
) \
43 --build
=$(GNU_HOST_NAME
) \
49 --datadir=/usr
/share \
50 --includedir=/usr
/include \
51 --infodir=/usr
/share
/info \
53 --libexecdir
=/usr
/lib \
54 --localstatedir
=/var \
55 --mandir=/usr
/share
/man \
59 $(DISABLE_LARGEFILE
) \
64 --with-build-cc
=$(HOSTCC
) \
70 rm -rf
$(PKG_INSTALL_DIR
)
71 mkdir
-p
$(PKG_INSTALL_DIR
)
72 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
73 CCOPT
="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
74 DESTDIR
="$(PKG_INSTALL_DIR)" \
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
/
87 define Build
/UninstallDev
88 rm -rf
$(STAGING_DIR
)/usr
/include/pcap
{,-bpf
,-named
}.h \
89 $(STAGING_DIR
)/usr
/lib
/libpcap.
{a
,so
*}
92 define Package
/libpcap
/install
93 install -m0755
-d
$(1)/usr
/lib
94 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpcap.so.
* $(1)/usr
/lib
/
97 $(eval
$(call BuildPackage
,libpcap
))