Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=libpcap
  10. PKG_VERSION:=0.9.4
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.tcpdump.org/release/
  14. PKG_MD5SUM:=79025766e8027df154cb1f32de8a7974
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/libpcap
  17. SECTION:=libs
  18. CATEGORY:=Libraries
  19. TITLE:=Low-level packet capture library
  20. URL:=http://www.tcpdump.org/
  21. endef
  22. define Package/libpcap/description
  23. This package contains a system-independent library for user-level network
  24. packet capture.
  25. endef
  26. CONFIGURE_ARGS += \
  27. --enable-shared \
  28. --enable-static \
  29. --disable-yydebug \
  30. --enable-ipv6 \
  31. --with-build-cc="$(HOSTCC)" \
  32. --with-pcap=linux
  33. define Build/Compile
  34. $(MAKE) -C $(PKG_BUILD_DIR) \
  35. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
  36. DESTDIR="$(PKG_INSTALL_DIR)" \
  37. all install
  38. endef
  39. define Build/InstallDev
  40. mkdir -p $(1)/usr/include
  41. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap{,-bpf,-namedb}.h \
  42. $(1)/usr/include/
  43. mkdir -p $(1)/usr/lib
  44. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
  45. $(1)/usr/lib/
  46. endef
  47. define Build/UninstallDev
  48. rm -rf $(1)/usr/include/pcap{,-bpf,-namedb}.h \
  49. $(1)/usr/lib/libpcap.{a,so*}
  50. endef
  51. define Package/libpcap/install
  52. $(INSTALL_DIR) $(1)/usr/lib
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
  54. endef
  55. $(eval $(call BuildPackage,libpcap))