aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorAaron Hurt <ahurt@ena.com>2016-06-09 13:57:20 -0500
committerJakub Jirutka <jakub@jirutka.cz>2016-06-17 02:03:46 +0200
commit1d12b9eb04b0c3f8c63711843ad7ff351af79087 (patch)
tree37d4c1146a818e1eec00d7e8963f6b779a582fa0 /testing
parentce73ece7e051ab9ecf7a77e4a3a73cc5687080e9 (diff)
downloadaports-1d12b9eb04b0c3f8c63711843ad7ff351af79087.tar.bz2
aports-1d12b9eb04b0c3f8c63711843ad7ff351af79087.tar.xz
testing/gearmand: new aport
http://gearman.org A distributed job queue
Diffstat (limited to 'testing')
-rw-r--r--testing/gearmand/APKBUILD85
-rw-r--r--testing/gearmand/gearmand.confd5
-rw-r--r--testing/gearmand/gearmand.initd16
-rw-r--r--testing/gearmand/gearmand.post-deinstall3
-rw-r--r--testing/gearmand/gearmand.pre-install7
-rw-r--r--testing/gearmand/libhashkit-common.h.patch25
-rw-r--r--testing/gearmand/libtest-cmdline.cc.patch22
7 files changed, 163 insertions, 0 deletions
diff --git a/testing/gearmand/APKBUILD b/testing/gearmand/APKBUILD
new file mode 100644
index 0000000000..e6b6b3e66f
--- /dev/null
+++ b/testing/gearmand/APKBUILD
@@ -0,0 +1,85 @@
+# Contributor: Aaron Hurt <ahurt@ena.com>
+# Maintainer: Aaron Hurt <ahurt@ena.com>
+pkgname=gearmand
+pkgver=1.1.12
+pkgrel=0
+pkgdesc="A distributed job queue"
+url="http://gearman.org"
+arch="all"
+license="BSD"
+makedepends="boost-dev gperf libevent-dev util-linux-dev
+ hiredis-dev openssl-dev sqlite-dev libmemcached-dev"
+install="$pkgname.pre-install $pkgname.post-deinstall"
+subpackages="$pkgname-doc gearman-dev:gearman_dev gearman-libs:gearman_libs"
+source="https://launchpad.net/${pkgname}/1.2/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz
+ libtest-cmdline.cc.patch
+ libhashkit-common.h.patch
+ $pkgname.initd
+ $pkgname.confd"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ # Configure with only the most commonly used persistence backends.
+ # We are explicitly disabling tokyo cabinet, pgsql and mysql to reduce
+ # dependencies and overall package size.
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --with-mysql=no \
+ --with-postgresql=no \
+ --disable-libpq \
+ --disable-libtokyocabinet \
+ --disable-libdrizzle \
+ --enable-ssl \
+ --enable-hiredis \
+ --enable-jobserver=no \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+}
+
+gearman_dev() {
+ default_dev
+
+ pkgdesc="Library providing Gearman client and worker functions (development files)"
+ depends="libevent-dev"
+}
+
+gearman_libs() {
+ pkgdesc="Library providing Gearman client and worker functions"
+
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgearman.so* "$subpkgdir"/usr/lib/
+}
+
+md5sums="99dd0be85b181eccf7fb1ca3c2a28a9f gearmand-1.1.12.tar.gz
+939d976aecd13653f6bf5d49d3d2f6e2 libtest-cmdline.cc.patch
+8b07c0d2f48e8b3573907d78c4825efc libhashkit-common.h.patch
+8ea6e267ce0ce3981f1e87901f212350 gearmand.initd
+295f6de0a94e6eb0a52c4e22ffca4e31 gearmand.confd"
+sha256sums="973d7a3523141a84c7b757c6f243febbc89a3631e919b532c056c814d8738acb gearmand-1.1.12.tar.gz
+d351e0b10ce2a45de5c16eed5de9e4c9f57ad04e5b835cc0e177e6ee59f6adc6 libtest-cmdline.cc.patch
+388fe9f3f637d263b3ee86dd6c0c752f25ad988eb0a507bc21ce7e3665fac2b6 libhashkit-common.h.patch
+637eb3a0d4e20667578fa953c562d50067e5a7b980ec3134fad600cc4939c60d gearmand.initd
+83221ac2af34063f7e8ec5ad3ba90bb534ae292c731182c8beb3984dad319fdd gearmand.confd"
+sha512sums="51d1596761c3f3ff3213edb64054fd9942b109383a51e998ff096ea972966dad1780a11814a3d37d4e8396365f402e3e3c9f759502dc3b6da25ea41936204e28 gearmand-1.1.12.tar.gz
+8d7c7473d8bcc06a6dfcb1975dd5b4992457661c6c2fab5e160f6252222af603003466c26de0c2d241d247ac33bc68f8fae853b7401691f36b2e6c57ff9b65ba libtest-cmdline.cc.patch
+08a1ce2ef071a33efc5c93de5812f83ee2b96ae604eaedb1d40a998ccb4e88a0f588d846d19623de9b8f98df18639168521763d27f1fb3ca046b4c679d61468b libhashkit-common.h.patch
+d97dbee95c0b96f0a81e42b730afdb9d129eb83e09be101e1bc2b2cd06a95fe1259265b912bf3850a51c6404e2c5883532a008946dfd46992cb488e1221dae97 gearmand.initd
+94373ff94862bcd9432f17ff55c94a99a9ad0432b9e863b2c710ba05a0b705378bb4d8ea821adf9859c0242d1b708050b3867faba085e7f776fab5ac1a8b013d gearmand.confd"
diff --git a/testing/gearmand/gearmand.confd b/testing/gearmand/gearmand.confd
new file mode 100644
index 0000000000..3948a91a7f
--- /dev/null
+++ b/testing/gearmand/gearmand.confd
@@ -0,0 +1,5 @@
+# Gearman server
+
+gearmand_user="gearmand"
+gearmand_group="gearmand"
+gearmand_opts=""
diff --git a/testing/gearmand/gearmand.initd b/testing/gearmand/gearmand.initd
new file mode 100644
index 0000000000..cae406efd8
--- /dev/null
+++ b/testing/gearmand/gearmand.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+
+name="gearmand"
+description="Gearman server"
+
+command="/usr/sbin/gearmand"
+command_args="-d $gearmand_opts"
+command_background="yes"
+
+pidfile="/run/${RC_SVCNAME}.pid"
+start_stop_daemon_args="--user=$gearmand_user:$gearmand_group"
+
+depend() {
+ need net localmount
+ after firewall
+}
diff --git a/testing/gearmand/gearmand.post-deinstall b/testing/gearmand/gearmand.post-deinstall
new file mode 100644
index 0000000000..34a45d326a
--- /dev/null
+++ b/testing/gearmand/gearmand.post-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "Please manually remove the 'gearmand' user and group if no longer needed" >&2
diff --git a/testing/gearmand/gearmand.pre-install b/testing/gearmand/gearmand.pre-install
new file mode 100644
index 0000000000..e52c97ecd4
--- /dev/null
+++ b/testing/gearmand/gearmand.pre-install
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+addgroup -S gearmand 2>/dev/null
+adduser -S -D -H -s /bin/false -G gearmand \
+ -g "Gearman Server" gearman 2>/dev/null
+
+exit 0
diff --git a/testing/gearmand/libhashkit-common.h.patch b/testing/gearmand/libhashkit-common.h.patch
new file mode 100644
index 0000000000..f8c424317d
--- /dev/null
+++ b/testing/gearmand/libhashkit-common.h.patch
@@ -0,0 +1,25 @@
+--- a/libhashkit/common.h
++++ b/libhashkit/common.h
+@@ -44,12 +44,22 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
++#include <limits.h>
+
+ #ifndef __WORDSIZE
+ # ifdef __MINGW32__
+ # define __WORDSIZE 32
+ # endif
+ #endif
++
++/* last try - use information from limits.h */
++#ifndef __WORDSIZE
++# if ULONG_MAX == 0xffffffffffffffff
++# define __WORDSIZE 64
++# elif ULONG_MAX == 0xffffffff
++# define __WORDSIZE 32
++# endif /* ULONG_MAX */
++#endif /* __WORDSIZE */
+
+ #include <libhashkit-1.0/hashkit.h>
+ #include "libhashkit/algorithm.h"
diff --git a/testing/gearmand/libtest-cmdline.cc.patch b/testing/gearmand/libtest-cmdline.cc.patch
new file mode 100644
index 0000000000..04dcc210bb
--- /dev/null
+++ b/testing/gearmand/libtest-cmdline.cc.patch
@@ -0,0 +1,22 @@
+--- a/libtest/cmdline.cc
++++ b/libtest/cmdline.cc
+@@ -61,10 +61,6 @@
+ #include <algorithm>
+ #include <stdexcept>
+
+-#ifndef __USE_GNU
+-static char **environ= NULL;
+-#endif
+-
+ #ifndef FD_CLOEXEC
+ # define FD_CLOEXEC 0
+ #endif
+@@ -201,7 +197,7 @@
+
+ fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+
+-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
++#if defined(POSIX_SPAWN_USEVFORK) && defined(__linux__)
+ // Use USEVFORK on linux
+ flags |= POSIX_SPAWN_USEVFORK;
+ #endif