23d9eb345297d5d5d82007b161c8daf0ee2389cd
[openwrt.git] / openwrt / package / kismet / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=kismet
6 PKG_VERSION:=2005-04-R1
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=19b4f192eb11a418ed3f6bf65c1226af
9
10 PKG_SOURCE_URL:=http://www.kismetwireless.net/code
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 IPKG_SERVER:=$(PACKAGE_DIR)/$(PKG_NAME)-server_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 IDIR_SERVER:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)-server
18 INFO_SERVER:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-server.list
19
20 IPKG_DRONE:=$(PACKAGE_DIR)/$(PKG_NAME)-drone_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
21 IDIR_DRONE:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)-drone
22 INFO_DRONE:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-drone.list
23
24 IPKG_CLIENT:=$(PACKAGE_DIR)/$(PKG_NAME)-client_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
25 IDIR_CLIENT:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)-client
26 INFO_CLIENT:=$(IPKG_STATE_DIR)/info/$(PKG_NAME)-client.list
27
28 COMPILE_TARGETS:=
29 INSTALL_TARGETS:=
30 ifneq ($(BR2_PACKAGE_KISMET_SERVER),)
31 COMPILE_TARGETS+=$(IPKG_SERVER)
32 endif
33 ifeq ($(BR2_PACLAGE_KISMET_SERVER),y)
34 INSTALL_TARGETS+=$(INFO_SERVER)
35 endif
36 ifneq ($(BR2_PACKAGE_KISMET_CLIENT),)
37 COMPILE_TARGETS+=$(IPKG_CLIENT)
38 endif
39 ifeq ($(BR2_PACLAGE_KISMET_CLIENT),y)
40 INSTALL_TARGETS+=$(INFO_CLIENT)
41 endif
42 ifneq ($(BR2_PACKAGE_KISMET_DRONE),)
43 COMPILE_TARGETS+=$(IPKG_DRONE)
44 endif
45 ifeq ($(BR2_PACLAGE_KISMET_DRONE),y)
46 INSTALL_TARGETS+=$(INFO_DRONE)
47 endif
48
49
50
51 $(DL_DIR)/$(PKG_SOURCE):
52 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
53
54 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
55 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
56 $(PATCH) $(PKG_BUILD_DIR) ./patches
57 touch $(PKG_BUILD_DIR)/.prepared
58
59 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
60 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
61 $(TARGET_CONFIGURE_OPTS) \
62 CXXFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -fno-builtin -nostdinc++ -nodefaultlibs" \
63 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(LINUX_DIR)/include" \
64 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
65 ./configure \
66 --target=$(GNU_TARGET_NAME) \
67 --host=$(GNU_TARGET_NAME) \
68 --build=$(GNU_HOST_NAME) \
69 --program-prefix="" \
70 --program-suffix="" \
71 --prefix=/usr \
72 --exec-prefix=/usr \
73 --bindir=/usr/bin \
74 --datadir=/usr/share \
75 --includedir=/usr/include \
76 --infodir=/usr/share/info \
77 --libdir=/usr/lib \
78 --libexecdir=/usr/lib \
79 --localstatedir=/var \
80 --mandir=/usr/share/man \
81 --sbindir=/usr/sbin \
82 --sysconfdir=/etc \
83 --enable-syspcap=yes \
84 $(DISABLE_NLS) \
85 $(DISABLE_LARGEFILE) \
86 );
87 touch $(PKG_BUILD_DIR)/.configured
88
89 $(PKG_BUILD_DIR)/kismet_server $(PKG_BUILD_DIR)/kismet_drone $(PKG_BUILD_DIR)/kismet_client: $(PKG_BUILD_DIR)/.configured
90 $(MAKE) -C $(PKG_BUILD_DIR) \
91 CC=$(TARGET_CC) \
92 LIBS="-L$(STAGING_DIR)/lib -fno-builtin -nostdinc++ -nodefaultlibs -luClibc++ -lc -lm" \
93 CPPFLAGS="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(LINUX_DIR)/include"
94
95 $(IPKG_SERVER): $(PKG_BUILD_DIR)/kismet_server
96 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_SERVER) kismet-server.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
97 mkdir -p $(IDIR_SERVER)/etc
98 cp ./files/kismet.conf $(IDIR_SERVER)/etc/
99 echo '/etc/kismet.conf' > $(IDIR_SERVER)/CONTROL/conffiles
100 mkdir -p $(IDIR_SERVER)/usr/sbin
101 cp $< $(IDIR_SERVER)/usr/sbin/
102 $(STRIP) $(IDIR_SERVER)/usr/sbin/*
103 mkdir -p $(PACKAGE_DIR)
104 $(IPKG_BUILD) $(IDIR_SERVER) $(PACKAGE_DIR)
105
106 $(INFO_SERVER): $(IPKG_SERVER)
107 $(IPKG) install $(IPKG_SERVER)
108
109 $(IPKG_DRONE): $(PKG_BUILD_DIR)/kismet_drone
110 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_DRONE) kismet-drone.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
111 mkdir -p $(IDIR_DRONE)/etc
112 cp ./files/kismet_drone.conf $(IDIR_DRONE)/etc/
113 echo '/etc/kismet_drone.conf' > $(IDIR_DRONE)/CONTROL/conffiles
114 mkdir -p $(IDIR_DRONE)/usr/sbin
115 cp $< $(IDIR_DRONE)/usr/sbin/
116 $(STRIP) $(IDIR_DRONE)/usr/sbin/*
117 mkdir -p $(PACKAGE_DIR)
118 $(IPKG_BUILD) $(IDIR_DRONE) $(PACKAGE_DIR)
119
120 $(INFO_DRONE): $(IPKG_DRONE)
121 $(IPKG) install $(IPKG_DRONE)
122
123 $(IPKG_CLIENT): $(PKG_BUILD_DIR)/kismet_client
124 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_CLIENT) kismet-client.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
125 mkdir -p $(IDIR_CLIENT)/etc
126 cp ./files/kismet.conf $(IDIR_CLIENT)/etc/
127 echo '/etc/kismet.conf' > $(IDIR_CLIENT)/CONTROL/conffiles
128 mkdir -p $(IDIR_CLIENT)/usr/sbin
129 cp $< $(IDIR_CLIENT)/usr/sbin/
130 $(STRIP) $(IDIR_CLIENT)/usr/sbin/*
131 mkdir -p $(PACKAGE_DIR)
132 $(IPKG_BUILD) $(IDIR_CLIENT) $(PACKAGE_DIR)
133
134 $(INFO_CLIENT): $(IPKG_CLIENT)
135 $(IPKG) install $(IPKG_CLIENT)
136
137 source: $(DL_DIR)/$(PKG_SOURCE)
138 prepare: $(PKG_BUILD_DIR)/.prepared
139 compile: $(COMPILE_TARGETS)
140 install: $(INSTALL_TARGETS)
141
142 clean:
143 rm -rf $(PKG_BUILD_DIR) $(IPKG_KISMET)
This page took 0.054357 seconds and 3 git commands to generate.