Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
  13. http://www.at.tcpdump.org/
  14. PKG_HASH:=eae98121cbb1c9adbedd9a777bf2eae9fa1c1c676424a54740311c8abcee5a5e
  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))