blob: bb428881d1be79648594d8cf2fd03fde93c64c3c [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=tcpdump
11PKG_VERSION:=4.99.5
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=https://www.tcpdump.org/release/
16PKG_HASH:=8c75856e00addeeadf70dad67c9ff3dd368536b2b8563abf6854d7c764cd3adb
17
18PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19PKG_LICENSE:=BSD-3-Clause
20PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump
21
22PKG_INSTALL:=1
23PKG_BUILD_FLAGS:=gc-sections
24PKG_BUILD_PARALLEL:=1
25
26include $(INCLUDE_DIR)/package.mk
27
28define Package/tcpdump/default
29 SECTION:=net
30 CATEGORY:=Network
31 DEPENDS:=+libpcap
32 TITLE:=Network monitoring and data acquisition tool
33 URL:=http://www.tcpdump.org/
34endef
35
36define Package/tcpdump
37 $(Package/tcpdump/default)
38 VARIANT:=full
39endef
40
41define Package/tcpdump-mini
42 $(Package/tcpdump/default)
43 TITLE+= (minimal version)
44 VARIANT:=mini
45endef
46
47CONFIGURE_ARGS += \
48 --without-cap-ng \
49 --without-crypto \
50 $(call autoconf_bool,CONFIG_IPV6,ipv6)
51
52ifeq ($(BUILD_VARIANT),mini)
53 TARGET_CFLAGS += -DTCPDUMP_MINI
54 CONFIGURE_ARGS += --disable-smb
55 MAKE_FLAGS += TCPDUMP_MINI=1
56endif
57
58define Package/tcpdump/install
59 $(INSTALL_DIR) $(1)/usr/bin
60 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tcpdump $(1)/usr/bin/
61endef
62
63Package/tcpdump-mini/install = $(Package/tcpdump/install)
64
65$(eval $(call BuildPackage,tcpdump))
66$(eval $(call BuildPackage,tcpdump-mini))