summaryrefslogtreecommitdiffstats
path: root/rules/nmap.make
blob: c1de3bed6b9b9640aa727161130a9c92bb496bb8 (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 Ixia Corporation (www.ixiacom.com), by Milan Bobde
#               2008 by Marc Kleine-Budde <mkl@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_NMAP) += nmap

#
# Paths and names
#
NMAP_VERSION	:= 4.62
NMAP		:= nmap-$(NMAP_VERSION)
NMAP_SUFFIX	:= tar.bz2
NMAP_URL	:= http://nmap.org/dist/$(NMAP).$(NMAP_SUFFIX)
NMAP_SOURCE	:= $(SRCDIR)/$(NMAP).$(NMAP_SUFFIX)
NMAP_DIR	:= $(BUILDDIR)/$(NMAP)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(NMAP_SOURCE):
	@$(call targetinfo)
	@$(call get, NMAP)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

NMAP_PATH := PATH=$(CROSS_PATH)
NMAP_ENV  := \
	$(CROSS_ENV) \
	ac_cv_linux_vers=$(KERNEL_VERSION_MAJOR)

#
# autoconf
#
NMAP_AUTOCONF := $(CROSS_AUTOCONF_USR) \
	--with-libpcre=$(SYSROOT)/usr \
	--with-libpcap=included \
	--without-liblua \
	--without-zenmap \
	\
	--enable-protochain \
	--disable-optimizer-dbg \
	--disable-yydebug

ifdef PTXCONF_NMAP__IPV6
NMAP_AUTOCONF += --enable-ipv6
else
NMAP_AUTOCONF += --disable-ipv6
endif

ifdef PTXCONF_NMAP__OPENSSL
NMAP_AUTOCONF += --with-openssl=$(SYSROOT)
else
NMAP_AUTOCONF += --without-openssl
endif

ifdef PTXCONF_ARCH_MINGW
NMAP_AUTOCONF += --with-pcap=null
else
NMAP_AUTOCONF += --with-pcap=linux
endif

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/nmap.targetinstall:
	@$(call targetinfo)

	@$(call install_init, nmap)
	@$(call install_fixup, nmap,PACKAGE,nmap)
	@$(call install_fixup, nmap,PRIORITY,optional)
	@$(call install_fixup, nmap,VERSION,$(NMAP_VERSION))
	@$(call install_fixup, nmap,SECTION,base)
	@$(call install_fixup, nmap,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, nmap,DEPENDS,)
	@$(call install_fixup, nmap,DESCRIPTION,missing)

	@$(call install_copy, nmap, 0, 0, 0755, $(NMAP_DIR)/nmap, /usr/bin/nmap)

ifdef PTXCONF_NMAP__SERVICES
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-mac-prefixes,	/usr/share/nmap/nmap-mac-prefixes, n)
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-os-db,		/usr/share/nmap/nmap-os-db, n)
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-protocols,	/usr/share/nmap/nmap-protocols, n)
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-rpc,		/usr/share/nmap/nmap-rpc, n)
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-service-probes,/usr/share/nmap/nmap-service-probes, n)
	@$(call install_copy, nmap, 0, 0, 0644, $(NMAP_DIR)/nmap-services,	/usr/share/nmap/nmap-services, n)
endif
	@$(call install_finish, nmap)
	@$(call touch)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

nmap_clean:
	rm -rf $(STATEDIR)/nmap.*
	rm -rf $(PKGDIR)/nmap_*
	rm -rf $(NMAP_DIR)

# vim: syntax=make