This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tcpdump.mk
96 lines (67 loc) · 2.37 KB
/
tcpdump.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#########################################################
# tcpdump for uClinux and Asterisk,
# Ming C. Li April 2008
#
# usage: make -f tcpdump.mk tcpdump-package
#
# Run after "make -f libpcap.mk libpcap"
#########################################################
include rules.mk
TCPDUMP_SITE=http://www.tcpdump.org/release
TCPDUMP_VERSION=3.9.8
TCPDUMP_SOURCE=tcpdump-3.9.8.tar.gz
TCPDUMP_UNZIP=zcat
TCPDUMP_DIR=$(BUILD_DIR)/tcpdump-$(TCPDUMP_VERSION)
TARGET_DIR=$(BUILD_DIR)/tmp/tcpdump/ipkg/tcpdump
PKG_NAME:=tcpdump
PKG_VERSION:=$(TCPDUMP_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/tcpdump
STAGING_INC=$(STAGING_DIR)/usr/include
STAGING_LIB=$(STAGING_DIR)/usr/lib
TCPDUMP_CONFIGURE_OPTS=--host=bfin-linux-uclibc \
--prefix=$(TARGET_DIR)
$(DL_DIR)/$(TCPDUMP_SOURCE):
$(WGET) -P $(DL_DIR) $(TCPDUMP_SITE)/$(TCPDUMP_SOURCE)
tcpdump-source: $(DL_DIR)/$(TCPDUMP_SOURCE)
$(TCPDUMP_DIR)/.unpacked: $(DL_DIR)/$(TCPDUMP_SOURCE)
$(TCPDUMP_UNZIP) $(DL_DIR)/$(TCPDUMP_SOURCE) | \
tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
$(PATCH_KERNEL) $(TCPDUMP_DIR) patch tcpdump.patch
touch $(TCPDUMP_DIR)/.unpacked
$(TCPDUMP_DIR)/.configured: $(TCPDUMP_DIR)/.unpacked
cd $(TCPDUMP_DIR); CPPFLAGS=-I$(UCLINUX_DIST)/staging/usr/include ./configure $(TCPDUMP_CONFIGURE_OPTS); sed -e 's; -I/usr/include ; ;' -i Makefile
touch $(TCPDUMP_DIR)/.configured
tcpdump: $(TCPDUMP_DIR)/.configured
make -C $(TCPDUMP_DIR)
rm -Rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/bin
cp -v $(TCPDUMP_DIR)/tcpdump $(TARGET_DIR)/bin/
touch $(PKG_BUILD_DIR)/.built
all: tcpdump
dirclean:
rm -rf $(TCPDUMP_DIR)
#---------------------------------------------------------------------------
# CREATING PACKAGE
#---------------------------------------------------------------------------
define Package/tcpdump
SECTION:=network
CATEGORY:=Applications
TITLE:=TCPDUMP
DESCRIPTION:=\
TCPDUMP is a common computer network debugging tool to capture TCP/IP packets
URL:=http://www.tcpdump.org/
ARCHITECTURE:=bfin-uclinux
endef
# post installation - add the sym link for auto start
define Package/tcpdump/postinst
#!/bin/sh
endef
# pre-remove - remove sym link
define Package/tcpdump/prerm
#!/bin/sh
rm -rf /bin/tcpdump
endef
$(eval $(call BuildPackage,tcpdump))
tcpdump-package: tcpdump $(PACKAGE_DIR)/tcpdump_$(VERSION)_$(PKGARCH).ipk