add SIOCGIWRANGE
[openwrt.git] / obsolete-buildroot / make / tcpdump.mk
1 ## tcpdump
2
3 TCPDUMP_VERSION:=3.8.3
4 TCPDUMP_RELEASE:=1
5
6 TCPDUMP_SOURCE:=tcpdump-$(TCPDUMP_VERSION).tar.gz
7 TCPDUMP_SITE:=http://www.tcpdump.org/release/
8 TCPDUMP_DIR:=$(BUILD_DIR)/tcpdump-$(TCPDUMP_VERSION)
9 TCPDUMP_CAT:=zcat
10
11 TCPDUMP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/tcpdump
12
13 TCPDUMP_BUILD_DIR := $(BUILD_DIR)/tcpdump_$(TCPDUMP_VERSION)-$(TCPDUMP_RELEASE)
14 TCPDUMP_IPK_DIR := $(OPENWRT_IPK_DIR)/tcpdump
15 TCPDUMP_IPK := $(TCPDUMP_BUILD_DIR)_$(ARCH).ipk
16
17
18 $(DL_DIR)/$(TCPDUMP_SOURCE):
19 $(WGET) -P $(DL_DIR) $(TCPDUMP_SITE)/$(TCPDUMP_SOURCE)
20
21
22 $(TCPDUMP_DIR)/.stamp-unpacked: $(DL_DIR)/$(TCPDUMP_SOURCE)
23 $(TCPDUMP_CAT) $(DL_DIR)/$(TCPDUMP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
24
25 touch $(TCPDUMP_DIR)/.stamp-unpacked
26
27
28 $(TCPDUMP_DIR)/.stamp-patched: $(TCPDUMP_DIR)/.stamp-unpacked
29 $(SOURCE_DIR)/patch-kernel.sh $(TCPDUMP_DIR) $(TCPDUMP_PATCH_DIR)
30 $(SOURCE_DIR)/patch-kernel.sh $(TCPDUMP_DIR) $(TCPDUMP_DIR)/debian/patches *patch
31
32 touch $(TCPDUMP_DIR)/.stamp-patched
33
34
35 $(TCPDUMP_DIR)/.stamp-configured: $(TCPDUMP_DIR)/.stamp-patched
36 cd $(TCPDUMP_DIR) ; \
37 rm -rf config.cache ; \
38 $(TARGET_CONFIGURE_OPTS) \
39 CFLAGS="$(TARGET_CFLAGS)" \
40 ac_cv_linux_vers="2" \
41 ./configure \
42 --target=$(GNU_TARGET_NAME) \
43 --host=$(GNU_TARGET_NAME) \
44 --build=$(GNU_HOST_NAME) \
45 --prefix=/usr \
46 --exec-prefix=/usr \
47 --bindir=/usr/bin \
48 --sbindir=/usr/sbin \
49 --libexecdir=/usr/lib/locate \
50 --sysconfdir=/etc \
51 --datadir=/usr/share \
52 --localstatedir=/var/lib \
53 --mandir=/usr/share/man \
54 --infodir=/usr/share/info \
55 --includedir=/usr/include \
56 --libdir=/usr/lib \
57 $(DISABLE_NLS) \
58 --enable-shared \
59 --disable-static \
60
61 touch $(TCPDUMP_DIR)/.stamp-configured
62
63
64 $(TCPDUMP_DIR)/.stamp-built: $(TCPDUMP_DIR)/.stamp-configured
65 cd $(TCPDUMP_DIR) ; \
66 $(MAKE) \
67 CC=$(TARGET_CC) \
68 CCOPT="$(TARGET_OPTIMIZATION)" \
69 INCLS="-I. -I$(srcdir)/missing" \
70 LDFLAGS="-lpcap" \
71 LIBS="" \
72
73 touch $(TCPDUMP_DIR)/.stamp-built
74
75
76 $(TCPDUMP_DIR)/.stamp-installed: $(TCPDUMP_DIR)/.stamp-built
77 mkdir -p $(TCPDUMP_BUILD_DIR)
78 cd $(TCPDUMP_DIR) ; \
79 $(MAKE) \
80 DESTDIR="$(TCPDUMP_BUILD_DIR)" \
81 install \
82
83 rm -rf $(TCPDUMP_BUILD_DIR)/usr/share
84
85 $(STRIP) $(TCPDUMP_BUILD_DIR)/usr/sbin/*
86
87 touch $(TCPDUMP_DIR)/.stamp-installed
88
89
90 $(TCPDUMP_IPK): $(TCPDUMP_DIR)/.stamp-installed
91 cp -a $(TCPDUMP_IPK_DIR)/CONTROL $(TCPDUMP_BUILD_DIR)/
92 perl -pi -e "s/^Vers.*:.*$$/Version: $(TCPDUMP_VERSION)-$(TCPDUMP_RELEASE)/" $(TCPDUMP_BUILD_DIR)/CONTROL/control
93 perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(TCPDUMP_BUILD_DIR)/CONTROL/control
94 cd $(BUILD_DIR); $(IPKG_BUILD) $(TCPDUMP_BUILD_DIR)
95
96
97 tcpdump-source: $(DL_DIR)/$(TCPDUMP_SOURCE)
98
99 # libpcap-clean prevent configure to find a local libpcap library
100 tcpdump-ipk: ipkg-utils libpcap-ipk libpcap-clean $(TCPDUMP_IPK)
101
102 tcpdump-clean:
103 $(MAKE) -C $(TCPDUMP_DIR) clean
104
105 tcpdump-clean-all:
106 rm -rf $(TCPDUMP_DIR)
107 rm -rf $(TCPDUMP_BUILD_DIR)
108 rm -rf $(TCPDUMP_IPK)
This page took 0.041833 seconds and 5 git commands to generate.