2
0

Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.9.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
  13. http://www.tcpdump.org/release/
  14. PKG_HASH:=798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  18. PKG_LICENSE:=BSD-3-Clause
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/tcpdump/default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS:=+libpcap
  25. TITLE:=Network monitoring and data acquisition tool
  26. URL:=http://www.tcpdump.org/
  27. endef
  28. define Package/tcpdump
  29. $(Package/tcpdump/default)
  30. VARIANT:=full
  31. endef
  32. define Package/tcpdump-mini
  33. $(Package/tcpdump/default)
  34. TITLE+= (minimal version)
  35. VARIANT:=mini
  36. endef
  37. CONFIGURE_ARGS += \
  38. --without-crypto
  39. ifeq ($(CONFIG_IPV6),y)
  40. CONFIGURE_ARGS += \
  41. --enable-ipv6
  42. endif
  43. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  44. TARGET_LDFLAGS += -Wl,--gc-sections
  45. CONFIGURE_VARS += \
  46. BUILD_CC="$(TARGET_CC)" \
  47. HOSTCC="$(HOSTCC)" \
  48. td_cv_buggygetaddrinfo="no" \
  49. ac_cv_linux_vers=$(LINUX_VERSION) \
  50. ac_cv_header_rpc_rpcent_h=no \
  51. ac_cv_lib_rpc_main=no \
  52. ac_cv_path_PCAP_CONFIG=""
  53. MAKE_FLAGS :=
  54. ifeq ($(BUILD_VARIANT),mini)
  55. TARGET_CFLAGS += -DTCPDUMP_MINI
  56. CONFIGURE_ARGS += --disable-smb
  57. MAKE_FLAGS += TCPDUMP_MINI=1
  58. endif
  59. MAKE_FLAGS += \
  60. CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
  61. define Package/tcpdump/install
  62. $(INSTALL_DIR) $(1)/usr/sbin
  63. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/
  64. endef
  65. Package/tcpdump-mini/install = $(Package/tcpdump/install)
  66. $(eval $(call BuildPackage,tcpdump))
  67. $(eval $(call BuildPackage,tcpdump-mini))