add nmap
[openwrt.git] / openwrt / package / nmap / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=nmap
6 PKG_VERSION:=3.81
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=0713306dda85aee2c95ef31b4b7d2838
9
10 PKG_SOURCE_URL:=http://download.insecure.org/nmap/dist
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
12 PKG_CAT:=bzcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 IPKG_NMAP:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 IDIR_NMAP:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
18 INFO_NMAP:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
19
20 $(DL_DIR)/$(PKG_SOURCE):
21 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
22
23 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
24 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
25 $(PATCH) $(PKG_BUILD_DIR) ./patches
26 touch $(PKG_BUILD_DIR)/.prepared
27
28 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
29 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
30 $(TARGET_CONFIGURE_OPTS) \
31 libpcapdir="$(STAGING_DIR)/usr/lib" \
32 CFLAGS="$(TARGET_CFLAGS)" \
33 CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -nostdinc++ -nodefaultlibs " \
34 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
35 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -fno-builtin -nostdinc++ -nodefaultlibs -luClibc++ -lc -lm" \
36 ac_cv_prog_CXX="$(TARGET_CXX)" \
37 ./configure \
38 --target=$(GNU_TARGET_NAME) \
39 --host=$(GNU_TARGET_NAME) \
40 --build=$(GNU_HOST_NAME) \
41 --program-prefix="" \
42 --program-suffix="" \
43 --prefix=/usr \
44 --exec-prefix=/usr \
45 --bindir=/usr/bin \
46 --datadir=/usr/share \
47 --includedir=/usr/include \
48 --infodir=/usr/share/info \
49 --libdir=/usr/lib \
50 --libexecdir=/usr/lib \
51 --localstatedir=/var \
52 --mandir=/usr/share/man \
53 --sbindir=/usr/sbin \
54 --sysconfdir=/etc \
55 --without-openssl \
56 --with-libpcap="$(STAGING_DIR)/usr" \
57 --with-libpcre="$(STAGING_DIR)/usr" \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 );
61 touch $(PKG_BUILD_DIR)/.configured
62
63 $(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.configured
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 $(TARGET_CONFIGURE_OPTS) \
66 CCOPT="-fno-builtin -nostdinc++ -nodefaultlibs $(TARGET_CFLAGS)"
67
68 $(IPKG_NMAP): $(PKG_BUILD_DIR)/$(PKG_NAME)
69 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_NMAP) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
70 mkdir -p $(IDIR_NMAP)/usr/share/nmap
71 for file in mac-prefixes os-fingerprints protocols rpc service-probes services; do \
72 cp $(PKG_BUILD_DIR)/nmap-$$file $(IDIR_NMAP)/usr/share/nmap; \
73 done
74 mkdir -p $(IDIR_NMAP)/usr/sbin
75 cp $(PKG_BUILD_DIR)/$(PKG_NAME) $(IDIR_NMAP)/usr/sbin/
76 $(STRIP) $(IDIR_NMAP)/usr/sbin/*
77 mkdir -p $(PACKAGE_DIR)
78 $(IPKG_BUILD) $(IDIR_NMAP) $(PACKAGE_DIR)
79
80 $(INFO_NMAP): $(IPKG_NMAP)
81 $(IPKG) install $(IPKG_NMAP)
82
83 source: $(DL_DIR)/$(PKG_SOURCE)
84 prepare: $(PKG_BUILD_DIR)/.prepared
85 compile: $(IPKG_NMAP)
86 install: $(INFO_NMAP)
87
88 clean:
89 rm -rf $(PKG_BUILD_DIR) $(IPKG_NMAP)
This page took 0.047798 seconds and 5 git commands to generate.