aboutsummaryrefslogtreecommitdiffstats
path: root/main/nmap/APKBUILD
blob: fe572b08a1e8579c0e7f4a33c663f25a0d3d3e0d (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=nmap
pkgver=7.10
pkgrel=0
pkgdesc="A network exploration tool and security/port scanner"
url="http://nmap.org"
arch="all"
license="custom"
depends=""
makedepends="libpcap-dev openssl-dev lua-dev linux-headers"
install=""
subpackages="
	$pkgname-doc
	$pkgname-scripts
	$pkgname-nselibs
	$pkgname-nping
	$pkgname-ncat"
source="http://nmap.org/dist/$pkgname-$pkgver.tar.bz2
	fortify-source.patch"

_builddir="$srcdir"/$pkgname-$pkgver
build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--without-zenmap \
		--with-liblua=/usr/include \
		--with-openssl=/usr/lib \
		|| return 1

	# fix LUA libs linking order
	make "LUA_LIBS=../liblua/liblua.a -ldl -lm" || return 1
}

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

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

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

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

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

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

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

md5sums="4fbc455d3f097755fca9d56ae60fa5bc  nmap-7.10.tar.bz2
cb569526cad25daaf60eb3fec751ebc7  fortify-source.patch"
sha256sums="58cf8896d09057d1c3533f430c06b22791d0227ebbb93dede2ccb73693ed4b4b  nmap-7.10.tar.bz2
afe6c342d3253a6de5117dd0a5f23cbcb4af2325fea739e01034df8582fdf884  fortify-source.patch"
sha512sums="38bdbc1902875db150faf2051d90d4200dd3c2ca2abbd7dbe55981899e90c1ab173f84d9d76f1a3d4d3ff1edf927373f948c12cfcb0eae79d8ede20607308e6f  nmap-7.10.tar.bz2
2d1f6e290723ac643f456a0e1ac95c4c966106cf2ab743839d25c835bf0141dc2d6bfee19285c3518d4c5f553b0505dabe5a496b769ba47b7adb03e791f05b8d  fortify-source.patch"