Subject: [alpine-aports] [PATCH] testing/amap

From: systmkor <[email-masked]>
Date: Sun, 18 Jan 2015 21:00:47 -0800

Next-generation tool for assisting network penetration testing.
https://www.thc.org/thc-amap/
---
 testing/amap/APKBUILD | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 testing/amap/APKBUILD

diff --git a/testing/amap/APKBUILD b/testing/amap/APKBUILD
new file mode 100644
index 0000000..b6834b0
--- /dev/null
+++ b/testing/amap/APKBUILD
@@ -0,0 +1,70 @@
+# Contributor: Orion <[email-masked]>
+# Maintainer: Orion <[email-masked]>
+# Reference
+#    https://aur.archlinux.org/packages/amap/
+pkgname=amap
+pkgver=5.4
+pkgrel=0
+pkgdesc="Next-generation tool for assisting network penetration testing."
+url="https://www.thc.org/thc-amap/"
+arch="all"
+license="GPL2 custom"
+depends="pcre openssl"
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://freeworld.thc.org/releases/$pkgname-$pkgver.tar.gz"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man/man1/ \
+		--infodir=/usr/share/info \
+		--localstatedir=/var \
+		|| return 1
+	make || return 1
+}
+
+doc() {
+	cd "$_builddir"
+	mkdir -p $pkgdir-doc/usr/share/man/man1
+	install -Dm644 amap.1 $pkgdir-doc/usr/share/man/man1/amap.1
+}
+
+package() {
+	cd "$_builddir"
+
+	# Binaries
+	install -Dm755 amap $pkgdir/usr/bin/amap
+	ln $pkgdir/usr/bin/amap $pkgdir/usr/bin/amap6
+	install -Dm755 amapcrap $pkgdir/usr/bin/amapcrap
+
+	# Configurations
+	mkdir -p $pkgdir/etc
+	install -Dm644 appdefs.* $pkgdir/etc
+
+	# License
+	install -Dm644 LICENCE.AMAP $pkgdir/usr/share/licenses/$pkgname/LICENCE
+
+	rm -f "$pkgdir"/usr/lib/*.la
+}
+
+md5sums="2617c13b0738455c0e61c6e980b8decc  amap-5.4.tar.gz"
+sha256sums="a75ea58de75034de6b10b0de0065ec88e32f9e9af11c7d69edbffc4da9a5b059  amap-5.4.tar.gz"
+sha512sums="e1a9f03940eded3eedad0028786f4ea6c18077072d52eb2f843ef0b4ff736bf1766c4bdb4eff52d3a8f6038d8f795e39be1c15bcae8283ddae8f40a7fff8647d  amap-5.4.tar.gz"
-- 
2.2.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 21 Jan 2015 13:47:11 +0100

On Sun, 18 Jan 2015 21:00:47 -0800

> https://www.thc.org/thc-amap/

Not applied due to bad depends. see below.

> +++ b/testing/amap/APKBUILD

I believe both depends are wrong and probably just copied from arch linux.

They ship a bundled pcre-3.9 with the sources, which is used compile
time and linked in statically. This package will just pull in the system
pcre but never use it.

We probably want amap to use system pcre instead of bundled. You can do
that by patching the build scripts or you can run 'make LIB=-lpcre'. I
think i would prefer that it also uses the system pcre headers, just in
case they have introduced any ABI incompatible changes in headers since
3.9.

The openssl is not detected during build time:

Starting amap auto configuration ...

Checking for openssl ...
                     ... NOT found, SSL support disabled

Because you don't pull in the headers, only the openssl runtimes. So
the retulting apk will pull in openssl but never use it.

I think you probably mean to link amap with openssl. To do so you need
to remove it from depends and add openssl-dev to makedepends.

Please fix those two things and resend.

-nc

---