mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-21 21:13:27 -04:00
www-servers/hinsightd: new version + changes
Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Alexandru Campeanu <tiotags1@gmail.com>
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
DIST hin9-v0.9.3.tar.gz 65343 BLAKE2B 4b475f8088aa113ae7dbd2cfe091ee10efb39d60b7277cb821eb010e752b39adf5e2a3c53aedc73c612ed4ba3d96178c09f255b9a07caf64b9cad34af2da5841 SHA512 768f0e55c2992b0ce50187a62e4c75ae2c2e2c31067d77898d221ad89afba20a3121853f01267bf6f1e43942ddca273bfed6c63849ce922c9c9d2c971a9061e0
|
||||
DIST hin9-v0.9.4.tar.gz 77019 BLAKE2B 7339b407ba60c740f51f47794bd5fa4b73c662c718841c8de10be53bc6bec53f5ba511e2f69859ef9312aa85a318f0feeab5088b839dcae1dd734951f52f87a4 SHA512 817ac692778b9b7d9b2b7dd82a0d92fa0303d875601d6b52ddd75bb470cab1c9ac39170a0a1f5737ec4d28849837a8b61bf34bc96481044fe9864932bcfdd6cf
|
||||
DIST hin9-v0.9.5.tar.gz 79621 BLAKE2B 2bf1fb03abf1d10d20bd47788e0d2eb39bc01be7fab867fb9b2ddb40e233cc0eed3e55cdfef84881c205de8d35da5bb9a4a56744a69e232b5f7baa6a5910c4a4 SHA512 8db159d95b008f3f4070844ba078f523f6159461c66ebe889e0a0af473e3a888cefa43eedc97c450b3a7bcc35079bfa4530cdcc8741da513a17e08ea896af1f5
|
||||
|
||||
21
www-servers/hinsightd/files/hinsightd-defines-v3.patch
Normal file
21
www-servers/hinsightd/files/hinsightd-defines-v3.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
diff --git a/src/hin/conf.h b/src/hin/conf.h
|
||||
index 61db395..1eaaa14 100644
|
||||
--- a/src/hin/conf.h
|
||||
+++ b/src/hin/conf.h
|
||||
@@ -2,11 +2,11 @@
|
||||
#ifndef HIN_CONF_H
|
||||
#define HIN_CONF_H
|
||||
|
||||
-#define HIN_CONF_PATH "workdir/main.lua"
|
||||
-#define HIN_LOGDIR_PATH "workdir/logs/"
|
||||
-#define HIN_WORKDIR_PATH "./"
|
||||
-#define HIN_TEMP_PATH "/tmp/"
|
||||
-#define HIN_DEBUG_MASK 0xffffffff
|
||||
+#define HIN_CONF_PATH "/etc/hinsightd/main.lua"
|
||||
+#define HIN_LOGDIR_PATH "/var/log/hinsightd/"
|
||||
+#define HIN_WORKDIR_PATH "/etc/hinsightd/"
|
||||
+#define HIN_TEMP_PATH "/var/tmp/hinsightd/"
|
||||
+#define HIN_DEBUG_MASK 0x27f0f
|
||||
|
||||
#define HIN_URING_QUEUE_DEPTH 256
|
||||
#define HIN_URING_DONT_FORK 0
|
||||
50
www-servers/hinsightd/files/initd-v1.sh
Normal file
50
www-servers/hinsightd/files/initd-v1.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
NAME=$RC_SVCNAME
|
||||
RUN_DIR=/var/run/$NAME
|
||||
LOG_DIR=/var/log/$NAME
|
||||
TMP_DIR=/var/tmp/$NAME
|
||||
CWD_DIR=/var/www/localhost
|
||||
PID_FILE=$RUN_DIR/$NAME.pid
|
||||
CFG_FILE=/etc/hinsightd/main.lua
|
||||
LOG_FILE=$LOG_DIR/hindsight.log
|
||||
|
||||
RUN_FILE=/usr/sbin/hinsightd
|
||||
RUN_USER="hinsightd"
|
||||
|
||||
extra_commands="checkconfig reload"
|
||||
|
||||
command=$RUN_FILE
|
||||
command_args="--config $CFG_FILE --logdir $LOG_DIR --cwd $CWD_DIR --pidfile $PID_FILE --tmpdir $TMP_DIR --log $LOG_FILE"
|
||||
pidfile="$PID_FILE"
|
||||
command_args_background="--daemonize"
|
||||
command_user="$RUN_USER:$RUN_USER"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
start-stop-daemon --quiet --user $RUN_USER --start --exec $command -- --check $command_args
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner $command_user --mode 06770 $LOG_DIR $TMP_DIR $RUN_DIR
|
||||
checkconfig || return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
if ! service_started "${NAME}" ; then
|
||||
eerror " * ERROR ${NAME} isn't running"
|
||||
return 1
|
||||
fi
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
echo " * Reloading ${NAME} ..."
|
||||
|
||||
start-stop-daemon --quiet --signal USR1 --pidfile ${PID_FILE}
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
87
www-servers/hinsightd/hinsightd-0.9.5.ebuild
Normal file
87
www-servers/hinsightd/hinsightd-0.9.5.ebuild
Normal file
@@ -0,0 +1,87 @@
|
||||
# Copyright 2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
LUA_COMPAT=( lua5-{1..4} luajit )
|
||||
|
||||
inherit fcaps lua-single systemd cmake linux-info
|
||||
|
||||
DESCRIPTION="hinsightd a http/1.1 webserver with (hopefully) minimal goals"
|
||||
HOMEPAGE="https://gitlab.com/tiotags/hin9"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://gitlab.com/tiotags/hin9.git"
|
||||
else
|
||||
SRC_URI="https://gitlab.com/tiotags/hin9/-/archive/v${PV}/hin9-v${PV}.tar.gz"
|
||||
S="${WORKDIR}/hin9-v${PV}"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
|
||||
IUSE="+openssl"
|
||||
REQUIRED_USE="${LUA_REQUIRED_USE}"
|
||||
|
||||
BDEPEND="
|
||||
dev-util/cmake
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${LUA_DEPS}
|
||||
acct-user/hinsightd
|
||||
acct-group/hinsightd
|
||||
sys-libs/liburing
|
||||
sys-libs/zlib
|
||||
openssl? ( dev-libs/openssl )
|
||||
"
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/hinsightd-defines-v3.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DUSE_OPENSSL=$(usex openssl)
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newsbin "${BUILD_DIR}/hin9" $PN
|
||||
newinitd "${FILESDIR}/initd-v1.sh" $PN
|
||||
systemd_dounit "${FILESDIR}/$PN.service" # not tested
|
||||
|
||||
# config
|
||||
insinto /etc/$PN
|
||||
doins "${S}/workdir/main.lua"
|
||||
doins "${S}/workdir/lib.lua"
|
||||
doins "${S}/workdir/default_config.lua"
|
||||
|
||||
# logrotate
|
||||
insinto /etc/logrotate.d
|
||||
newins "${FILESDIR}"/logrotate.d.sh $PN
|
||||
|
||||
keepdir /var/www/localhost/htdocs
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
fcaps CAP_NET_BIND_SERVICE /usr/sbin/$PN
|
||||
|
||||
if kernel_is lt 5 7; then
|
||||
ewarn ""
|
||||
ewarn "hinsightd requires io_uring and kernel ~5.6.0"
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
ewarn ""
|
||||
ewarn "hinsightd requires a higher than default RLIMIT_MEMLOCK for"
|
||||
ewarn "things like graceful restarting"
|
||||
ewarn "memory limit can be increased in /etc/security/limits.conf"
|
||||
ewarn ""
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
LUA_COMPAT=( lua5-{1..4} )
|
||||
LUA_COMPAT=( lua5-{1..4} luajit )
|
||||
|
||||
inherit fcaps lua-single systemd cmake linux-info
|
||||
|
||||
@@ -42,7 +42,7 @@ RDEPEND="
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/hinsightd-redefine-directories-v2.patch"
|
||||
"${FILESDIR}/hinsightd-defines-v3.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
@@ -53,8 +53,8 @@ src_configure() {
|
||||
}
|
||||
|
||||
src_install() {
|
||||
newbin "${BUILD_DIR}/hin9" $PN
|
||||
newinitd "${FILESDIR}/init.d.sh" $PN
|
||||
newsbin "${BUILD_DIR}/hin9" $PN
|
||||
newinitd "${FILESDIR}/initd-v1.sh" $PN
|
||||
systemd_dounit "${FILESDIR}/$PN.service" # not tested
|
||||
|
||||
# config
|
||||
@@ -71,7 +71,7 @@ src_install() {
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
fcaps CAP_NET_BIND_SERVICE /usr/bin/$PN
|
||||
fcaps CAP_NET_BIND_SERVICE /usr/sbin/$PN
|
||||
|
||||
if kernel_is lt 5 7; then
|
||||
ewarn ""
|
||||
|
||||
Reference in New Issue
Block a user