summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2011-07-05 21:44:55 +0000
committerFabian Affolter <fabian@affolter-engineering.ch>2011-07-05 21:44:55 +0000
commit37c3cc1e3f72ed7301e749cfc1138609e7498c8a (patch)
treec71bb1c985d164f96484a4b28a3822e0b3997b47
parent7f9851115264bca9bce3926ddb29e533a23929dd (diff)
downloadaports-37c3cc1e3f72ed7301e749cfc1138609e7498c8a.tar.bz2
aports-37c3cc1e3f72ed7301e749cfc1138609e7498c8a.tar.xz
Initial APKBUILD for halberd
Package description: To cope with heavy traffic loads, web site administrators often install load balancer devices. These machines hide (possibly) many real web servers behind a virtual IP. They receive HTTP requests and redirect them to the real web servers in order to share the traffic between them. Halberd is a tool aimed at discovering real servers behind virtual IPs.
-rw-r--r--main/halberd/APKBUILD42
-rw-r--r--main/halberd/halberd-sslwrap.patch30
2 files changed, 72 insertions, 0 deletions
diff --git a/main/halberd/APKBUILD b/main/halberd/APKBUILD
new file mode 100644
index 000000000..b12213b2b
--- /dev/null
+++ b/main/halberd/APKBUILD
@@ -0,0 +1,42 @@
+# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=halberd
+pkgver=0.2.4
+pkgrel=0
+pkgdesc="Tool to discover HTTP load balancers"
+url="http://halberd.superadditive.com"
+arch="noarch"
+license="GPL2+"
+depends="python"
+depends_dev=""
+makedepends="python-dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://$pkgname.superadditive.com/dist/$pkgname-$pkgver.tar.gz
+ $pkgname-sslwrap.patch"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+prepare() {
+ cd "$_builddir"
+ patch -p0 -i "$srcdir"/$pkgname-sslwrap.patch || return 1
+}
+
+build() {
+ cd "$_builddir"
+ python setup.py build || return 1
+}
+
+package() {
+ cd "$_builddir"
+ python setup.py bdist_dumb --keep-temp --bdist-dir "$pkgdir" || return 1
+}
+
+doc() {
+ # The man page is not picked-up automatically
+ mkdir -p "$subpkgdir"/usr/share/man || return 1
+ mv "$_builddir"/man/man* "$subpkgdir"/usr/share/man/ || return 1
+}
+
+md5sums="d60d0fba8f379ea72c623ad1dd6052c3 halberd-0.2.4.tar.gz
+a46227da33465e246017c8ec4650d76f halberd-sslwrap.patch"
diff --git a/main/halberd/halberd-sslwrap.patch b/main/halberd/halberd-sslwrap.patch
new file mode 100644
index 000000000..fc172e034
--- /dev/null
+++ b/main/halberd/halberd-sslwrap.patch
@@ -0,0 +1,30 @@
+--- Halberd/clientlib.py.orig
++++ Halberd/clientlib.py
+@@ -31,6 +31,7 @@
+
+ import time
+ import socket
++import ssl
+ import urlparse
+
+ from itertools import takewhile
+@@ -310,7 +311,7 @@
+
+ self._recv = None
+ self._sslsock = None
+- self._timeout_exceptions.append(socket.sslerror)
++ self._timeout_exceptions.append(ssl.SSLError)
+
+ # Path to an SSL key file and certificate.
+ self.keyfile = None
+@@ -327,8 +328,8 @@
+ """
+ HTTPClient._connect(self, addr)
+ try:
+- self._sslsock = socket.ssl(self._sock, self.keyfile, self.certfile)
+- except socket.sslerror, msg:
++ self._sslsock = ssl.wrap_socket(self._sock, self.keyfile, self.certfile)
++ except ssl.SSLError, msg:
+ raise HTTPSError, msg
+
+ self._recv = self._sslsock.read