update nmap to 4.20 (patch by jens muecke)
[packages.git] / net / nmap / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=nmap
12 PKG_VERSION:=4.20
13 PKG_RELEASE:=1
14
15 PKG_MD5SUM:=ea50419f99472200c4184a304e3831ea
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://download.insecure.org/nmap/dist
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/nmap
26   SECTION:=net
27   CATEGORY:=Network
28   DEPENDS:=+libdnet +libpcap +libpcre +uclibcxx
29   TITLE:=Network exploration and/or security auditing utility
30   DESCRIPTION:=\
31         A free open source utility for network exploration or security auditing.
32   URL:=http://www.insecure.org/nmap/
33 endef
34
35 define Build/Configure
36         $(call Build/Configure/Default, \
37                 --without-openssl \
38                 --without-nmapfe \
39                 --with-libdnet="$(STAGING_DIR)/usr" \
40                 --with-libpcap="$(STAGING_DIR)/usr" \
41                 --with-libpcre="$(STAGING_DIR)/usr" \
42                 , \
43                 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
44                 LIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc" \
45         )
46 endef
47
48 define Build/Compile    
49         mkdir -p $(PKG_INSTALL_DIR)
50         $(MAKE) -C $(PKG_BUILD_DIR) \
51                 DESTDIR="$(PKG_INSTALL_DIR)" \
52                 all install
53 endef
54
55 define Package/nmap/install     
56         $(INSTALL_DIR) $(1)/usr/bin
57         $(CP) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
58         $(INSTALL_DIR) $(1)/usr/share/nmap
59         for file in mac-prefixes os-fingerprints protocols rpc service-probes services; do \
60                 $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/nmap-$$$$file $(1)/usr/share/nmap/ ; \
61         done
62 endef
63
64 $(eval $(call BuildPackage,nmap))