summaryrefslogtreecommitdiff
path: root/user/nmap/APKBUILD
blob: 3cf0b1db3540b78d3221540858eaa4000d95bdf6 (plain) (blame)
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
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=nmap
pkgver=7.70
pkgrel=0
pkgdesc="A network exploration tool and security/port scanner"
url="https://nmap.org/"
arch="all"
license="GPL-2.0-only"
depends=""
makedepends="linux-headers openssl-dev libpcap-dev pcre-dev zlib-dev libssh2-dev lua5.3-dev"
options="!checkroot"
subpackages="
	$pkgname-doc
	$pkgname-scripts::noarch
	$pkgname-nselibs::noarch
	$pkgname-nping
	$pkgname-ncat"
source="https://nmap.org/dist/$pkgname-$pkgver.tar.bz2"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	cd "$builddir"
        # zenmap and ndiff require python 2
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--without-zenmap \
		--without-ndiff \
		--with-openssl=yes \
		--with-libpcap=yes \
		--with-libpcre=yes \
		--with-libz=yes \
		--with-libssh2=yes \
		--with-liblua=/usr/lua5.3
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

scripts() {
	depends="$pkgname-nselibs"
	pkgdesc="$pkgdesc (scripts)"

	mkdir -p "$subpkgdir"/usr/share/nmap/
	mv "$pkgdir"/usr/share/nmap/scripts \
		"$subpkgdir"/usr/share/nmap/
}

nselibs() {
	pkgdesc="$pkgdesc (nselibs)"

	mkdir -p "$subpkgdir"/usr/share/nmap/
	mv "$pkgdir"/usr/share/nmap/nse_main.lua \
		"$pkgdir"/usr/share/nmap/nselib \
		"$subpkgdir"/usr/share/nmap/
}

ncat() {
	pkgdesc="$pkgdesc (ncat tool)"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ncat "$subpkgdir"/usr/bin
}

nping() {
	pkgdesc="$pkgdesc (nping tool)"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/nping "$subpkgdir"/usr/bin
}

sha512sums="084c148b022ff6550e269d976d0077f7932a10e2ef218236fe13aa3a70b4eb6506df03329868fc68cb3ce78e4360b200f5a7a491d3145028fed679ef1c9ecae5  nmap-7.70.tar.bz2"