summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/monkey/APKBUILD61
-rw-r--r--testing/monkey/monkey.confd5
-rw-r--r--testing/monkey/monkey.initd25
-rw-r--r--testing/monkey/strsignal.patch12
4 files changed, 103 insertions, 0 deletions
diff --git a/testing/monkey/APKBUILD b/testing/monkey/APKBUILD
new file mode 100644
index 000000000..32082b7cc
--- /dev/null
+++ b/testing/monkey/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+
+pkgname=monkey
+pkgver=1.0.1
+pkgrel=0
+pkgdesc='A fast and lightweight HTTP server designed for embedded devices.'
+url='http://monkey-project.com/'
+license='GPL2'
+arch='all'
+makedepends='bash'
+subpackages="$pkgname-doc"
+source="http://monkey-project.com/releases/1.0/$pkgname-$pkgver.tar.gz
+ strsignal.patch
+ monkey.initd
+ monkey.confd"
+
+prepare() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ # Use POSIX-compliant strsignal instead SYS_SIGLIST
+ patch -Np0 -i "$srcdir"/strsignal.patch || return 1
+
+ # Don't install the banana script, use OpenRC daemon instead
+ sed -i '/install -m 755 bin\/banana/d' configure || return 1
+ rm man/banana.1 || return 1
+
+ # Run monkey as http user
+ sed -i '737s/nobody/http/' configure || return 1
+}
+
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --sysconfdir=/etc/$pkgname \
+ --mandir=/usr/share/man \
+ --datadir=/var/www \
+ --logdir=/var/log/$pkgname \
+ --plugdir=/usr/lib/$pkgname \
+ || return 1
+
+ make || return 1
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install || return 1
+
+ install -D -m0755 "$srcdir"/monkey.initd \
+ "$pkgdir"/etc/init.d/monkey || return 1
+ install -D -m0644 "$srcdir"/monkey.confd \
+ "$pkgdir"/etc/conf.d/monkey || return 1
+}
+
+md5sums="5e08e4089e8b41ea90b0c98d6ca6433e monkey-1.0.1.tar.gz
+4e99ccbfbd00b17023c7b82e466c7aee strsignal.patch
+6630131d3ea75dbbf1033a4acc8cf983 monkey.initd
+71805f446a12d747c52e18b8ac4b4704 monkey.confd"
diff --git a/testing/monkey/monkey.confd b/testing/monkey/monkey.confd
new file mode 100644
index 000000000..818957c97
--- /dev/null
+++ b/testing/monkey/monkey.confd
@@ -0,0 +1,5 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Add any additional command line arguments here
+MONKEY_ARGS=""
diff --git a/testing/monkey/monkey.initd b/testing/monkey/monkey.initd
new file mode 100644
index 000000000..7ab26aa2a
--- /dev/null
+++ b/testing/monkey/monkey.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DAEMON="/usr/bin/monkey"
+CONFFILE="/etc/monkey/monkey.conf"
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting monkey"
+ start-stop-daemon --start --exec "${DAEMON}" -- "-D" "${MONKEY_ARGS}" >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping monkey"
+ local PORT=$(awk '/^ *Port/ { print $2 }' "${CONFFILE}")
+ local PIDFILE=$(awk '/^ *PidFile/ { print $2 }' "${CONFFILE}")
+ PIDFILE="${PIDFILE}"."${PORT}"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/testing/monkey/strsignal.patch b/testing/monkey/strsignal.patch
new file mode 100644
index 000000000..6908fe6b3
--- /dev/null
+++ b/testing/monkey/strsignal.patch
@@ -0,0 +1,12 @@
+--- ./src/mk_signals.c.orig
++++ ./src/mk_signals.c
+@@ -87,7 +87,7 @@
+ mk_utils_stacktrace();
+ #endif
+ mk_err("%s (%d), code=%d, addr=%p",
+- sys_siglist[signo], signo, si->si_code, si->si_addr);
++ strsignal(signo), signo, si->si_code, si->si_addr);
+ pthread_exit(NULL);
+ default:
+ /* let the kernel handle it */
+