summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2016-10-25 21:16:29 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2016-10-25 21:19:11 +0200
commit4799f90eea54a1a66495cd3a65b8ede487421eae (patch)
tree0c95e0dd9de32df85366e4a9711cc9c4964707e8 /testing
parentabde00db46cd7767703bc023da33a2a7fda4f5ce (diff)
downloadaports-4799f90eea54a1a66495cd3a65b8ede487421eae.zip
testing/gatling: new aport
Diffstat (limited to 'testing')
-rw-r--r--testing/gatling/APKBUILD64
-rw-r--r--testing/gatling/build-fixes.patch11
-rw-r--r--testing/gatling/gatling.confd49
-rw-r--r--testing/gatling/gatling.initd69
-rw-r--r--testing/gatling/gatling.pre-install10
5 files changed, 203 insertions, 0 deletions
diff --git a/testing/gatling/APKBUILD b/testing/gatling/APKBUILD
new file mode 100644
index 00000000000..5c6a52d897b
--- /dev/null
+++ b/testing/gatling/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer:
+pkgname=gatling
+pkgver=0.15
+pkgrel=0
+pkgdesc="High performance web server"
+url="https://www.fefe.de/gatling/"
+arch="x86_64 x86"
+license="GPL2"
+depends=""
+depends_dev=""
+makedepends="libressl-dev libowfat-dev zlib-dev"
+install="gatling.pre-install"
+subpackages="$pkgname-doc"
+source="https://www.fefe.de/$pkgname/$pkgname-$pkgver.tar.xz
+ build-fixes.patch
+
+ gatling.confd
+ gatling.initd"
+
+builddir="$srcdir/$pkgname-$pkgver"
+build() {
+ cd "$builddir"
+ CFLAGS="$CFLAGS -std=c99"
+
+ make prefix=/usr \
+ CFLAGS="$CFLAGS -I/usr/include/libowfat" \
+ LDFLAGS="$LDFLAGS" \
+ gatling tlsgatling || return 1
+}
+
+package() {
+ cd "$builddir"
+ install -Dm644 gatling.1 \
+ "$pkgdir"/usr/share/doc/man/man1/gatling.1 \
+ || return 1
+
+ mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
+ install -m644 README.ftp README.http README.tls \
+ "$pkgdir"/usr/share/doc/$pkgname/ \
+ || return 1
+
+ mkdir -p "$pkgdir"/usr/bin/
+ install -m755 gatling tlsgatling \
+ "$pkgdir"/usr/bin/ || return 1
+
+ install -Dm755 "$srcdir"/gatling.initd \
+ "$pkgdir"/etc/init.d/gatling || return 1
+ install -Dm644 "$srcdir"/gatling.confd \
+ "$pkgdir"/etc/conf.d/gatling || return 1
+}
+
+md5sums="08784f9014fa298b47ef09fee69a3c55 gatling-0.15.tar.xz
+24c05ce3ed75c16da9da69abc6e7682d build-fixes.patch
+661560d0d3c05625eca4cc7947fe0ad5 gatling.confd
+fa10da598217cfaabc93161b0b364f53 gatling.initd"
+sha256sums="6fa329d0ced0c80deb8dde5460e9d9e984bee94f265043d7fdec0e253dce9aa4 gatling-0.15.tar.xz
+6c355dccc45a0ccf3e333b6774e47a74c5d0c93832c969a1565f424d437fd639 build-fixes.patch
+6e8f2217b44d3d7aef0be0dc7ce97447ce5ac97d98e267c42af55d188b9b5ce7 gatling.confd
+42fe83c5a06a87585ba1ecbb49c58089940b96fbe5ec4239c93af1dc62e5380b gatling.initd"
+sha512sums="b76d220a0644f1e6e7ea966a4eff409964c564fc4a31c4efdb764e5f7b5857bc58c26bc31e860fe35df932cbd60fb2b0f4f21c75cb5aa56427e8a2a453684716 gatling-0.15.tar.xz
+888e3a3698a168313199d7d4ecbd48aae20de9d84e324322fdf1a7ebfab4d14af5f0d8ddf1b4475830d0e213ddac71f7db4efe50de0da8a0a2c8e95ed1ce9803 build-fixes.patch
+b51e5145fa5f67dd933f8b7c06d633545152b253c51891ef4519b83707b0001034506a7a8807a37d104dcab47320a5233093d9d89211b36753ac316e447b54a9 gatling.confd
+456ee7f2c62b682376f301b1727e32e68a53fe5b50bd9d9b1e00225e6d0e6bc62fa328b503ca2ebf899ff4c6ca68d9998785ee83749d4590c3c0196a5aadb133 gatling.initd"
diff --git a/testing/gatling/build-fixes.patch b/testing/gatling/build-fixes.patch
new file mode 100644
index 00000000000..2d33ea0f504
--- /dev/null
+++ b/testing/gatling/build-fixes.patch
@@ -0,0 +1,11 @@
+diff -upr gatling-0.15.orig/ssl.c gatling-0.15/ssl.c
+--- gatling-0.15.orig/ssl.c 2016-10-25 20:38:51.818531071 +0200
++++ gatling-0.15/ssl.c 2016-10-25 20:39:10.235187184 +0200
+@@ -9,6 +9,7 @@
+ #include <openssl/ssl.h>
+ #include <openssl/engine.h>
+ #include <ctype.h>
++#include <alloca.h>
+
+ static int library_inited;
+
diff --git a/testing/gatling/gatling.confd b/testing/gatling/gatling.confd
new file mode 100644
index 00000000000..29d9809878b
--- /dev/null
+++ b/testing/gatling/gatling.confd
@@ -0,0 +1,49 @@
+# /etc/conf.d/gatling
+
+# UID to run gatling server on
+GATLING_UID="gatling"
+
+# Bind to IP address
+IP="127.0.0.1"
+
+# Root directory
+ROOTDIR="/var/www"
+
+# Bind to Port
+PORT="80"
+
+# HTTP timeout
+HTTP_TIMEOUT="23"
+
+# Gatling pid file
+PID="/var/run/gatling.pid"
+
+# Virtual domain hosting
+VHOST="NO"
+
+# Directory indexing
+DIR_INDEXING="NO"
+
+# Secure Socket Connections SSL
+SSL="YES"
+
+# Prefetch value (see man page for details)
+PREFETCH="2M"
+
+# FTP access
+FTP="YES"
+
+# FTP timeout
+FTP_TIMEOUT="60"
+
+# FTP User Authorization
+FTP_AUTH="YES"
+
+# FTP file uploads
+FTP_UP="NO"
+
+# Enable ftp file downloads
+FTP_FILE_FETCH="YES"
+
+# Transparent proxy mode
+TRANS_PROXY="YES"
diff --git a/testing/gatling/gatling.initd b/testing/gatling/gatling.initd
new file mode 100644
index 00000000000..96c56f0225d
--- /dev/null
+++ b/testing/gatling/gatling.initd
@@ -0,0 +1,69 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Gatling high performance web server init script"
+extra_started_commands="reload"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ # Verify UID is valid for running process.
+ if ! id ${GATLING_UID} >/dev/null 2>&1; then
+ ewarn "User ${GATLING_UID} not found!"
+ return 1
+ fi
+
+ # Set gatling run opts
+ if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi
+ if yesno ${SSL};then SSL=-e;else SSL=-E;fi
+ if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi
+ if yesno ${FTP}; then FTP=-f;else FTP=-F;fi
+ if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi
+ if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi
+ if yesno ${TRANS_PROXY};then TRANS_PROXY=-t;else unset TRANS_PROXY;fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting gatling"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PID} \
+ --name gatling --exec /usr/bin/gatling -- \
+ -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+ ${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} \
+ -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+ ${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gatling"
+ start-stop-daemon --quiet --stop --pidfile ${PID}
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+
+ checkconfig || return 1
+
+ ebegin "Sending gatling the HUP signal"
+ start-stop-daemon --quiet --signal HUP --pidfile ${PID}
+
+ ebegin "Restarting gatling server"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PID} \
+ --name gatling --exec /usr/bin/gatling -- \
+ -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+ ${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} \
+ -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+ ${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
diff --git a/testing/gatling/gatling.pre-install b/testing/gatling/gatling.pre-install
new file mode 100644
index 00000000000..4baeb132cb2
--- /dev/null
+++ b/testing/gatling/gatling.pre-install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+addgroup -Sg 82 www-data 2>/dev/null
+addgroup -S gatling 2>/dev/null
+
+adduser -S -D -h /var/www -s /sbin/nologin \
+ -G gatling -g 'Gatling Daemon' gatling
+addgroup gatling www-data 2>/dev/null
+
+exit 0