Mail archive
alpine-aports

[alpine-aports] [PATCH 2/2] main/nmap: split package into subpackages

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Thu, 19 Nov 2015 22:47:57 +0100

- nmap-nping: contains the optional nping binary
- nmap-ncat: contains the optional ncat binary
- nmap-nselibs: contains files for the nmap scripting engine
- nmap-scripts: contains example scripts for the nmap scripting engine
---
 main/nmap/APKBUILD | 45 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)
diff --git a/main/nmap/APKBUILD b/main/nmap/APKBUILD
index 6eaa2eb..044151c 100644
--- a/main/nmap/APKBUILD
+++ b/main/nmap/APKBUILD
_at_@ -2,15 +2,20 @@
 # Maintainer: Leonardo Arena <rnalrd_at_alpinelinux.org>
 pkgname=nmap
 pkgver=7.00
-pkgrel=0
+pkgrel=1
 pkgdesc="A network exploration tool and security/port scanner"
 url="http://nmap.org"
 arch="all"
-license="GPL2"
+license="custom"
 depends=""
 makedepends="libpcap-dev openssl-dev lua-dev linux-headers"
 install=""
-subpackages="$pkgname-doc"
+subpackages="
+	$pkgname-doc
+	$pkgname-scripts
+	$pkgname-nselibs
+	$pkgname-nping
+	$pkgname-ncat"
 source="http://nmap.org/dist/$pkgname-$pkgver.tar.bz2"
 
 _builddir="$srcdir"/$pkgname-$pkgver
_at_@ -34,10 +39,42 @@ build() {
 
 package() {
 	cd "$_builddir"
-	make DESTDIR="$pkgdir" install
+	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="6cdf5d03cc3294b99d69dfca83f2f2ee  nmap-7.00.tar.bz2"
 sha256sums="9f442301c615c608a385831c3505cdfed9b0795cd100f1a258b04509802802ae  nmap-7.00.tar.bz2"
 sha512sums="f8b4368de5956698e76a2a102102feb4bd00338cf983bfbf7bcd8c941288bb4a02c45469724e8a1daed87f41536a3f16a68fc604171fe23093575ac631637351  nmap-7.00.tar.bz2"
-- 
2.6.3
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Nov 19 2015 - 22:47:57 GMT