From 4221a4e4035cb01ca03fe4ceba8bde369f1806a6 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Aug 2017 22:21:16 +0200 Subject: www-servers/gatling: 0.15 Also bump EAPI 6, use SSL URLs, and address init script Bashism Package-Manager: Portage-2.3.8, Repoman-2.3.3 --- www-servers/gatling/Manifest | 1 + www-servers/gatling/files/gatling.initd-3 | 63 +++++++++++++++++++++++++++++++ www-servers/gatling/gatling-0.15.ebuild | 63 +++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 www-servers/gatling/files/gatling.initd-3 create mode 100644 www-servers/gatling/gatling-0.15.ebuild diff --git a/www-servers/gatling/Manifest b/www-servers/gatling/Manifest index fa8313c8501e..d209c348c911 100644 --- a/www-servers/gatling/Manifest +++ b/www-servers/gatling/Manifest @@ -1,2 +1,3 @@ DIST gatling-0.12.tar.bz2 99540 SHA256 ffe4dbff99404eb80e6aac215fdf6bf8174355edc33dd1848a51fc1093296a7c SHA512 50330e92576ce8002acaba9692cb9270ed2d794b1118e697193bd47beadac8ae75a8e2e0b802923172961d74e50cbe114b5e39c083b79a975c0a1bf4c86cab0a WHIRLPOOL 5f16ffff9bfc0e91281833b543c050daaa5fe9f6f419e5a0a3b03f6853cb40468b375df849cfc4b036544131e1cefa97ccdde377629499f0a010cb56add33881 DIST gatling-0.13.tar.bz2 108128 SHA256 b42145fdf7b66602fa8bc64661c2762172f6d33dbd9d53efebf821cd81e89245 SHA512 b9fa604aa8bb8c5d40d9c3eaaa536ed5e73d0ed93eccb41ca4744316ad893dc6fe92fe2c1f0247de82d4eda63b0ab7ab338355d9963fb58f23d39a2c678a1db8 WHIRLPOOL c9d90bec09cf07bc506bd84491d550834d48e0e3b19b2e7095ab43a4a3cd7a182fc1660d5a5cef878f1e1a7b3d367c5e76efc75df77269ab89d64c73c2af7a59 +DIST gatling-0.15.tar.xz 121804 SHA256 6fa329d0ced0c80deb8dde5460e9d9e984bee94f265043d7fdec0e253dce9aa4 SHA512 b76d220a0644f1e6e7ea966a4eff409964c564fc4a31c4efdb764e5f7b5857bc58c26bc31e860fe35df932cbd60fb2b0f4f21c75cb5aa56427e8a2a453684716 WHIRLPOOL 74d4613ca83500d11e81fc4a59e4a1749d0cac7baf1da16d7cbfb4573e3d94bddd1adc7f563de61942f46dd1e5dc88b19f498182eb63919ff71773ef31a19a38 diff --git a/www-servers/gatling/files/gatling.initd-3 b/www-servers/gatling/files/gatling.initd-3 new file mode 100644 index 000000000000..33c5e5a3095f --- /dev/null +++ b/www-servers/gatling/files/gatling.initd-3 @@ -0,0 +1,63 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 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} 2>/dev/null)" ]; 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/www-servers/gatling/gatling-0.15.ebuild b/www-servers/gatling/gatling-0.15.ebuild new file mode 100644 index 000000000000..f2b75dd25464 --- /dev/null +++ b/www-servers/gatling/gatling-0.15.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit eutils toolchain-funcs user + +DESCRIPTION="High performance web server" +HOMEPAGE="https://www.fefe.de/gatling/" +SRC_URI="https://www.fefe.de/gatling/${P}.tar.xz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="libressl ssl diet" +REQUIRED_USE="ssl? ( !diet )" + +DEPEND=">=dev-libs/libowfat-0.25[diet=] + diet? ( dev-libs/dietlibc ) + ssl? ( + !libressl? ( dev-libs/openssl:0 ) + libressl? ( dev-libs/libressl ) + )" +RDEPEND="${DEPEND}" + +src_prepare() { + rm Makefile # leaves us with GNUmakefile + epatch "${FILESDIR}/${PN}-0.13-compile.patch" + eapply_user +} + +src_compile() { + local DIET= + use diet && DIET='/usr/bin/diet' + + local targets='gatling' + use ssl && targets+=' tlsgatling' + + emake DIET="${DIET}" CC="$(tc-getCC)" \ + CFLAGS="${CFLAGS} -I${ROOT}usr/include/libowfat" \ + LDFLAGS="${LDFLAGS}" prefix=/usr ${targets} \ + || die "emake ${targets} failed" +} + +src_install() { + doman gatling.1 || die "installing manpage failed" + + newconfd "${FILESDIR}/gatling.confd" gatling || die + newinitd "${FILESDIR}/gatling.initd-3" gatling || die + dodoc README.{ftp,http} || die "installing docs failed" + + dobin gatling || die "installing gatling binary failed" + use ssl && { + dodoc README.tls || die "installing docs failed" + dobin tlsgatling || die "installing tlsgatling binary failed" + } +} + +pkg_setup() { + ebegin "Creating gatling user and group" + enewgroup gatling + enewuser ${PN} -1 -1 /var/www/localhost ${PN} +} -- cgit v1.2.3-65-gdbad