Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/gatling/files/, www-servers/gatling/
Date: Sun, 27 Aug 2017 20:56:07
Message-Id: 1503867333.4221a4e4035cb01ca03fe4ceba8bde369f1806a6.sping@gentoo
1 commit: 4221a4e4035cb01ca03fe4ceba8bde369f1806a6
2 Author: Sebastian Pipping <sping <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 27 20:21:16 2017 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 27 20:55:33 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4221a4e4
7
8 www-servers/gatling: 0.15
9
10 Also bump EAPI 6, use SSL URLs, and address init script Bashism
11
12 Package-Manager: Portage-2.3.8, Repoman-2.3.3
13
14 www-servers/gatling/Manifest | 1 +
15 www-servers/gatling/files/gatling.initd-3 | 63 +++++++++++++++++++++++++++++++
16 www-servers/gatling/gatling-0.15.ebuild | 63 +++++++++++++++++++++++++++++++
17 3 files changed, 127 insertions(+)
18
19 diff --git a/www-servers/gatling/Manifest b/www-servers/gatling/Manifest
20 index fa8313c8501..d209c348c91 100644
21 --- a/www-servers/gatling/Manifest
22 +++ b/www-servers/gatling/Manifest
23 @@ -1,2 +1,3 @@
24 DIST gatling-0.12.tar.bz2 99540 SHA256 ffe4dbff99404eb80e6aac215fdf6bf8174355edc33dd1848a51fc1093296a7c SHA512 50330e92576ce8002acaba9692cb9270ed2d794b1118e697193bd47beadac8ae75a8e2e0b802923172961d74e50cbe114b5e39c083b79a975c0a1bf4c86cab0a WHIRLPOOL 5f16ffff9bfc0e91281833b543c050daaa5fe9f6f419e5a0a3b03f6853cb40468b375df849cfc4b036544131e1cefa97ccdde377629499f0a010cb56add33881
25 DIST gatling-0.13.tar.bz2 108128 SHA256 b42145fdf7b66602fa8bc64661c2762172f6d33dbd9d53efebf821cd81e89245 SHA512 b9fa604aa8bb8c5d40d9c3eaaa536ed5e73d0ed93eccb41ca4744316ad893dc6fe92fe2c1f0247de82d4eda63b0ab7ab338355d9963fb58f23d39a2c678a1db8 WHIRLPOOL c9d90bec09cf07bc506bd84491d550834d48e0e3b19b2e7095ab43a4a3cd7a182fc1660d5a5cef878f1e1a7b3d367c5e76efc75df77269ab89d64c73c2af7a59
26 +DIST gatling-0.15.tar.xz 121804 SHA256 6fa329d0ced0c80deb8dde5460e9d9e984bee94f265043d7fdec0e253dce9aa4 SHA512 b76d220a0644f1e6e7ea966a4eff409964c564fc4a31c4efdb764e5f7b5857bc58c26bc31e860fe35df932cbd60fb2b0f4f21c75cb5aa56427e8a2a453684716 WHIRLPOOL 74d4613ca83500d11e81fc4a59e4a1749d0cac7baf1da16d7cbfb4573e3d94bddd1adc7f563de61942f46dd1e5dc88b19f498182eb63919ff71773ef31a19a38
27
28 diff --git a/www-servers/gatling/files/gatling.initd-3 b/www-servers/gatling/files/gatling.initd-3
29 new file mode 100644
30 index 00000000000..33c5e5a3095
31 --- /dev/null
32 +++ b/www-servers/gatling/files/gatling.initd-3
33 @@ -0,0 +1,63 @@
34 +#!/sbin/openrc-run
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +description="Gatling high performance web server init script"
39 +extra_started_commands="reload"
40 +
41 +depend() {
42 + need net
43 +}
44 +
45 +checkconfig() {
46 + # Verify UID is valid for running process.
47 + if [ ! "$(id ${GATLING_UID} 2>/dev/null)" ]; then
48 + ewarn "User ${GATLING_UID} not found!"
49 + return 1
50 + fi
51 +
52 + # Set gatling run opts
53 + if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi
54 + if yesno ${SSL};then SSL=-e;else SSL=-E;fi
55 + if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi
56 + if yesno ${FTP}; then FTP=-f;else FTP=-F;fi
57 + if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi
58 + if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi
59 + if yesno ${TRANS_PROXY};then TRANS_PROXY=-t;else unset TRANS_PROXY;fi
60 +}
61 +
62 +start() {
63 + checkconfig || return 1
64 +
65 + ebegin "Starting gatling"
66 + start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
67 +--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
68 +${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
69 +${FTP_AUTH} ${FTP_UPLOADS}
70 + eend $?
71 +}
72 +
73 +stop() {
74 + ebegin "Stopping gatling"
75 + start-stop-daemon --quiet --stop --pidfile ${PID}
76 + eend $?
77 +}
78 +
79 +reload() {
80 + if ! service_started "${SVCNAME}" ; then
81 + eerror "${SVCNAME} isn't running"
82 + return 1
83 + fi
84 +
85 + checkconfig || return 1
86 +
87 + ebegin "Sending gatling the HUP signal"
88 + start-stop-daemon --quiet --signal HUP --pidfile ${PID}
89 +
90 + ebegin "Restarting gatling server"
91 + start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
92 +--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
93 +${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
94 +${FTP_AUTH} ${FTP_UPLOADS}
95 + eend $?
96 +}
97
98 diff --git a/www-servers/gatling/gatling-0.15.ebuild b/www-servers/gatling/gatling-0.15.ebuild
99 new file mode 100644
100 index 00000000000..f2b75dd2546
101 --- /dev/null
102 +++ b/www-servers/gatling/gatling-0.15.ebuild
103 @@ -0,0 +1,63 @@
104 +# Copyright 1999-2017 Gentoo Foundation
105 +# Distributed under the terms of the GNU General Public License v2
106 +
107 +EAPI="6"
108 +
109 +inherit eutils toolchain-funcs user
110 +
111 +DESCRIPTION="High performance web server"
112 +HOMEPAGE="https://www.fefe.de/gatling/"
113 +SRC_URI="https://www.fefe.de/gatling/${P}.tar.xz"
114 +LICENSE="GPL-2"
115 +SLOT="0"
116 +KEYWORDS="~amd64 ~x86"
117 +
118 +IUSE="libressl ssl diet"
119 +REQUIRED_USE="ssl? ( !diet )"
120 +
121 +DEPEND=">=dev-libs/libowfat-0.25[diet=]
122 + diet? ( dev-libs/dietlibc )
123 + ssl? (
124 + !libressl? ( dev-libs/openssl:0 )
125 + libressl? ( dev-libs/libressl )
126 + )"
127 +RDEPEND="${DEPEND}"
128 +
129 +src_prepare() {
130 + rm Makefile # leaves us with GNUmakefile
131 + epatch "${FILESDIR}/${PN}-0.13-compile.patch"
132 + eapply_user
133 +}
134 +
135 +src_compile() {
136 + local DIET=
137 + use diet && DIET='/usr/bin/diet'
138 +
139 + local targets='gatling'
140 + use ssl && targets+=' tlsgatling'
141 +
142 + emake DIET="${DIET}" CC="$(tc-getCC)" \
143 + CFLAGS="${CFLAGS} -I${ROOT}usr/include/libowfat" \
144 + LDFLAGS="${LDFLAGS}" prefix=/usr ${targets} \
145 + || die "emake ${targets} failed"
146 +}
147 +
148 +src_install() {
149 + doman gatling.1 || die "installing manpage failed"
150 +
151 + newconfd "${FILESDIR}/gatling.confd" gatling || die
152 + newinitd "${FILESDIR}/gatling.initd-3" gatling || die
153 + dodoc README.{ftp,http} || die "installing docs failed"
154 +
155 + dobin gatling || die "installing gatling binary failed"
156 + use ssl && {
157 + dodoc README.tls || die "installing docs failed"
158 + dobin tlsgatling || die "installing tlsgatling binary failed"
159 + }
160 +}
161 +
162 +pkg_setup() {
163 + ebegin "Creating gatling user and group"
164 + enewgroup gatling
165 + enewuser ${PN} -1 -1 /var/www/localhost ${PN}
166 +}