Gentoo Archives: gentoo-commits

From: Haelwenn Monnier <contact@×××××××××.me>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: www-servers/hinsightd/files/, www-servers/hinsightd/
Date: Tue, 25 May 2021 23:08:09
Message-Id: 1621956622.a9d6a6f50ee567c3f343da44e6ea5a7e97ac1063.lanodan@gentoo
1 commit: a9d6a6f50ee567c3f343da44e6ea5a7e97ac1063
2 Author: tiotags <tiotags1 <AT> gmail <DOT> com>
3 AuthorDate: Tue May 25 15:29:33 2021 +0000
4 Commit: Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
5 CommitDate: Tue May 25 15:30:22 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a9d6a6f5
7
8 www-servers/hinsightd: new version 0.9.4
9
10 Package-Manager: Portage-3.0.19, Repoman-3.0.3
11 Signed-off-by: Alexandru Campeanu <tiotags1 <AT> gmail.com>
12
13 www-servers/hinsightd/Manifest | 1 +
14 .../files/hinsightd-redefine-directories-v2.patch | 21 ++++++++++++++++
15 www-servers/hinsightd/files/init.d.sh | 9 +++----
16 ...insightd-9999.ebuild => hinsightd-0.9.4.ebuild} | 28 +++++++++++++---------
17 www-servers/hinsightd/hinsightd-9999.ebuild | 28 +++++++++++++---------
18 www-servers/hinsightd/metadata.xml | 12 +++++-----
19 6 files changed, 67 insertions(+), 32 deletions(-)
20
21 diff --git a/www-servers/hinsightd/Manifest b/www-servers/hinsightd/Manifest
22 index a3034ae29..56ef7b385 100644
23 --- a/www-servers/hinsightd/Manifest
24 +++ b/www-servers/hinsightd/Manifest
25 @@ -1 +1,2 @@
26 DIST hin9-v0.9.3.tar.gz 65343 BLAKE2B 4b475f8088aa113ae7dbd2cfe091ee10efb39d60b7277cb821eb010e752b39adf5e2a3c53aedc73c612ed4ba3d96178c09f255b9a07caf64b9cad34af2da5841 SHA512 768f0e55c2992b0ce50187a62e4c75ae2c2e2c31067d77898d221ad89afba20a3121853f01267bf6f1e43942ddca273bfed6c63849ce922c9c9d2c971a9061e0
27 +DIST hin9-v0.9.4.tar.gz 77019 BLAKE2B 7339b407ba60c740f51f47794bd5fa4b73c662c718841c8de10be53bc6bec53f5ba511e2f69859ef9312aa85a318f0feeab5088b839dcae1dd734951f52f87a4 SHA512 817ac692778b9b7d9b2b7dd82a0d92fa0303d875601d6b52ddd75bb470cab1c9ac39170a0a1f5737ec4d28849837a8b61bf34bc96481044fe9864932bcfdd6cf
28
29 diff --git a/www-servers/hinsightd/files/hinsightd-redefine-directories-v2.patch b/www-servers/hinsightd/files/hinsightd-redefine-directories-v2.patch
30 new file mode 100644
31 index 000000000..8406efc86
32 --- /dev/null
33 +++ b/www-servers/hinsightd/files/hinsightd-redefine-directories-v2.patch
34 @@ -0,0 +1,21 @@
35 +diff --git a/src/hin/conf.h b/src/hin/conf.h
36 +index 4a6f071..f4f6f36 100644
37 +--- a/src/hin/conf.h
38 ++++ b/src/hin/conf.h
39 +@@ -2,11 +2,11 @@
40 + #ifndef HIN_CONF_H
41 + #define HIN_CONF_H
42 +
43 +-#define HIN_CONF_PATH "workdir/main.lua"
44 +-#define HIN_LOGDIR_PATH "build/"
45 +-#define HIN_WORKDIR_PATH "./"
46 +-#define HIN_TEMP_PATH "/tmp/"
47 +-#define HIN_DEBUG_MASK 0xffffffff
48 ++#define HIN_CONF_PATH "/etc/hinsightd/main.lua"
49 ++#define HIN_LOGDIR_PATH "/var/log/hinsightd/"
50 ++#define HIN_WORKDIR_PATH "/etc/hinsightd/"
51 ++#define HIN_TEMP_PATH "/var/tmp/hinsightd/"
52 ++#define HIN_DEBUG_MASK 0x27f0f
53 +
54 + #define HIN_URING_QUEUE_DEPTH 256
55 + #define HIN_URING_DONT_FORK 0
56
57 diff --git a/www-servers/hinsightd/files/init.d.sh b/www-servers/hinsightd/files/init.d.sh
58 index bc05ab5c9..15cd2ced5 100644
59 --- a/www-servers/hinsightd/files/init.d.sh
60 +++ b/www-servers/hinsightd/files/init.d.sh
61 @@ -6,7 +6,8 @@ LOG_DIR=/var/log/$NAME
62 TMP_DIR=/var/tmp/$NAME
63 CWD_DIR=/var/www/localhost
64 PID_FILE=$RUN_DIR/$NAME.pid
65 -CFG_FILE=/etc/hinsightd/$NAME.lua
66 +CFG_FILE=/etc/hinsightd/main.lua
67 +LOG_FILE=$LOG_DIR/hindsight.log
68
69 RUN_FILE=/usr/bin/hinsightd
70 RUN_USER="hinsightd"
71 @@ -14,7 +15,7 @@ RUN_USER="hinsightd"
72 extra_commands="checkconfig reload"
73
74 command=$RUN_FILE
75 -command_args="--config $CFG_FILE --logdir $LOG_DIR/ --cwd $CWD_DIR/ --pidfile $PID_FILE --tmpdir $TMP_DIR"
76 +command_args="--config $CFG_FILE --logdir $LOG_DIR --cwd $CWD_DIR --pidfile $PID_FILE --tmpdir $TMP_DIR --log $LOG_FILE"
77 pidfile="$PID_FILE"
78 command_args_background="--daemonize"
79 command_user="$RUN_USER:$RUN_USER"
80 @@ -24,11 +25,11 @@ depend() {
81 }
82
83 checkconfig() {
84 - $command $command_args --pretend > /dev/null
85 + start-stop-daemon --quiet --user $RUN_USER --start --exec $command -- --check $command_args
86 }
87
88 start_pre() {
89 - checkpath --directory --owner $command_user --mode 0770 $LOG_DIR $TMP_DIR $RUN_DIR
90 + checkpath --directory --owner $command_user --mode 06770 $LOG_DIR $TMP_DIR $RUN_DIR
91 checkconfig || return 1
92 }
93
94
95 diff --git a/www-servers/hinsightd/hinsightd-9999.ebuild b/www-servers/hinsightd/hinsightd-0.9.4.ebuild
96 similarity index 66%
97 copy from www-servers/hinsightd/hinsightd-9999.ebuild
98 copy to www-servers/hinsightd/hinsightd-0.9.4.ebuild
99 index a7e45d693..f8d82a655 100644
100 --- a/www-servers/hinsightd/hinsightd-9999.ebuild
101 +++ b/www-servers/hinsightd/hinsightd-0.9.4.ebuild
102 @@ -42,8 +42,7 @@ RDEPEND="
103 DEPEND="${RDEPEND}"
104
105 PATCHES=(
106 - "${FILESDIR}/hinsightd-redefine-directories.patch"
107 - "${FILESDIR}/hinsightd-default-config.patch"
108 + "${FILESDIR}/hinsightd-redefine-directories-v2.patch"
109 )
110
111 src_configure() {
112 @@ -54,28 +53,35 @@ src_configure() {
113 }
114
115 src_install() {
116 - newbin "${BUILD_DIR}/hin9" hinsightd
117 - newinitd "${FILESDIR}/init.d.sh" hinsightd
118 - systemd_dounit "${FILESDIR}/hinsightd.service" # not tested
119 + newbin "${BUILD_DIR}/hin9" $PN
120 + newinitd "${FILESDIR}/init.d.sh" $PN
121 + systemd_dounit "${FILESDIR}/$PN.service" # not tested
122
123 - insinto /etc/hinsightd
124 - newins "${S}/workdir/main.lua" hinsightd.lua
125 + # config
126 + insinto /etc/$PN
127 + doins "${S}/workdir/main.lua"
128 + doins "${S}/workdir/lib.lua"
129 + doins "${S}/workdir/default_config.lua"
130
131 # logrotate
132 insinto /etc/logrotate.d
133 - newins "${FILESDIR}"/logrotate.d.sh hinsightd
134 + newins "${FILESDIR}"/logrotate.d.sh $PN
135
136 keepdir /var/www/localhost/htdocs
137 - keepdir /var/log/hinsightd
138 - keepdir /var/tmp/hinsightd
139 }
140
141 pkg_postinst() {
142 - fcaps CAP_NET_BIND_SERVICE /usr/bin/hinsightd
143 + fcaps CAP_NET_BIND_SERVICE /usr/bin/$PN
144
145 if kernel_is lt 5 7; then
146 ewarn ""
147 ewarn "hinsightd requires io_uring and kernel ~5.6.0"
148 ewarn ""
149 fi
150 +
151 + ewarn ""
152 + ewarn "hinsightd requires a higher than default RLIMIT_MEMLOCK for"
153 + ewarn "things like graceful restarting"
154 + ewarn "memory limit can be increased in /etc/security/limits.conf"
155 + ewarn ""
156 }
157
158 diff --git a/www-servers/hinsightd/hinsightd-9999.ebuild b/www-servers/hinsightd/hinsightd-9999.ebuild
159 index a7e45d693..f8d82a655 100644
160 --- a/www-servers/hinsightd/hinsightd-9999.ebuild
161 +++ b/www-servers/hinsightd/hinsightd-9999.ebuild
162 @@ -42,8 +42,7 @@ RDEPEND="
163 DEPEND="${RDEPEND}"
164
165 PATCHES=(
166 - "${FILESDIR}/hinsightd-redefine-directories.patch"
167 - "${FILESDIR}/hinsightd-default-config.patch"
168 + "${FILESDIR}/hinsightd-redefine-directories-v2.patch"
169 )
170
171 src_configure() {
172 @@ -54,28 +53,35 @@ src_configure() {
173 }
174
175 src_install() {
176 - newbin "${BUILD_DIR}/hin9" hinsightd
177 - newinitd "${FILESDIR}/init.d.sh" hinsightd
178 - systemd_dounit "${FILESDIR}/hinsightd.service" # not tested
179 + newbin "${BUILD_DIR}/hin9" $PN
180 + newinitd "${FILESDIR}/init.d.sh" $PN
181 + systemd_dounit "${FILESDIR}/$PN.service" # not tested
182
183 - insinto /etc/hinsightd
184 - newins "${S}/workdir/main.lua" hinsightd.lua
185 + # config
186 + insinto /etc/$PN
187 + doins "${S}/workdir/main.lua"
188 + doins "${S}/workdir/lib.lua"
189 + doins "${S}/workdir/default_config.lua"
190
191 # logrotate
192 insinto /etc/logrotate.d
193 - newins "${FILESDIR}"/logrotate.d.sh hinsightd
194 + newins "${FILESDIR}"/logrotate.d.sh $PN
195
196 keepdir /var/www/localhost/htdocs
197 - keepdir /var/log/hinsightd
198 - keepdir /var/tmp/hinsightd
199 }
200
201 pkg_postinst() {
202 - fcaps CAP_NET_BIND_SERVICE /usr/bin/hinsightd
203 + fcaps CAP_NET_BIND_SERVICE /usr/bin/$PN
204
205 if kernel_is lt 5 7; then
206 ewarn ""
207 ewarn "hinsightd requires io_uring and kernel ~5.6.0"
208 ewarn ""
209 fi
210 +
211 + ewarn ""
212 + ewarn "hinsightd requires a higher than default RLIMIT_MEMLOCK for"
213 + ewarn "things like graceful restarting"
214 + ewarn "memory limit can be increased in /etc/security/limits.conf"
215 + ewarn ""
216 }
217
218 diff --git a/www-servers/hinsightd/metadata.xml b/www-servers/hinsightd/metadata.xml
219 index f06968fc0..826bd5d5f 100644
220 --- a/www-servers/hinsightd/metadata.xml
221 +++ b/www-servers/hinsightd/metadata.xml
222 @@ -1,7 +1,10 @@
223 <?xml version="1.0" encoding="UTF-8"?>
224 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
225 <pkgmetadata>
226 - <!-- maintainer-needed -->
227 + <maintainer type="person">
228 + <email>tiotags1@×××××.com</email>
229 + <name>Alexandru Campeanu</name>
230 + </maintainer>
231 <upstream>
232 <changelog>https://gitlab.com/tiotags/hin9/-/blob/master/docs/changes.md</changelog>
233 <bugs-to>https://gitlab.com/tiotags/hin9/-/issues</bugs-to>
234 @@ -10,11 +13,8 @@
235 hinsightd is a http/1.1 webserver with a focus on simple code and
236 reliable behaviour.
237 Notable features: reverse proxying, output caching, ssl, pipelining,
238 - cgi, output compression with deflate, graceful restart, 304 status,
239 - etag, range requests and a very customizable config file using lua.
240 - Virtual hosts can be implemented in lua.
241 - Logging is entirely controled by lua.
242 - Full debug information can be toggled per request and outputted to console or a log file.
243 + cgi, output compression with deflate, graceful restart and a very
244 + customizable config file using lua.
245 </longdescription>
246 <use>
247 <flag name="openssl">Enable tls encryption with openssl</flag>