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