Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # Copyright (C) 2007-2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=tcpdump
  9. PKG_VERSION:=4.5.1
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
  13. http://ftp.gwdg.de/pub/misc/tcpdump/ \
  14. http://www.at.tcpdump.org/ \
  15. http://www.br.tcpdump.org/
  16. PKG_MD5SUM:=973a2513d0076e34aa9da7e15ed98e1b
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  20. PKG_LICENSE:=BSD-3-Clause
  21. PKG_INSTALL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/tcpdump/default
  24. SECTION:=net
  25. CATEGORY:=Network
  26. DEPENDS:=+libpcap
  27. TITLE:=Network monitoring and data acquisition tool
  28. URL:=http://www.tcpdump.org/
  29. endef
  30. define Package/tcpdump
  31. $(Package/tcpdump/default)
  32. VARIANT:=full
  33. endef
  34. define Package/tcpdump-mini
  35. $(Package/tcpdump/default)
  36. TITLE+= (minimal version)
  37. VARIANT:=mini
  38. endef
  39. CONFIGURE_ARGS += \
  40. --without-crypto
  41. ifeq ($(CONFIG_IPV6),y)
  42. CONFIGURE_ARGS += \
  43. --enable-ipv6
  44. endif
  45. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  46. TARGET_LDFLAGS += -Wl,--gc-sections
  47. CONFIGURE_VARS += \
  48. BUILD_CC="$(TARGET_CC)" \
  49. HOSTCC="$(HOSTCC)" \
  50. td_cv_buggygetaddrinfo="no" \
  51. ac_cv_linux_vers=$(LINUX_VERSION) \
  52. ac_cv_header_rpc_rpcent_h=no \
  53. ac_cv_lib_rpc_main=no \
  54. ac_cv_path_PCAP_CONFIG=""
  55. MAKE_FLAGS :=
  56. ifeq ($(BUILD_VARIANT),mini)
  57. TARGET_CFLAGS += -DTCPDUMP_MINI
  58. CONFIGURE_ARGS += --disable-smb
  59. MAKE_FLAGS += TCPDUMP_MINI=1
  60. endif
  61. MAKE_FLAGS += \
  62. CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
  63. define Package/tcpdump/install
  64. $(INSTALL_DIR) $(1)/usr/sbin
  65. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/
  66. endef
  67. Package/tcpdump-mini/install = $(Package/tcpdump/install)
  68. $(eval $(call BuildPackage,tcpdump))
  69. $(eval $(call BuildPackage,tcpdump-mini))