Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_CPE_ID:=cpe:/a:tcpdump:tcpdump
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/tcpdump/default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. DEPENDS:=+libpcap
  26. TITLE:=Network monitoring and data acquisition tool
  27. URL:=http://www.tcpdump.org/
  28. endef
  29. define Package/tcpdump
  30. $(Package/tcpdump/default)
  31. VARIANT:=full
  32. endef
  33. define Package/tcpdump-mini
  34. $(Package/tcpdump/default)
  35. TITLE+= (minimal version)
  36. VARIANT:=mini
  37. endef
  38. CONFIGURE_ARGS += \
  39. --without-cap-ng \
  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))