www-apps/up-common-proxies: Add systemd support
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
789962e459
commit
57454b1bc3
@ -3,12 +3,13 @@
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
name="up-common-proxies"
|
||||
description="UnifiedPush common proxies (bin)"
|
||||
description="Rewrite Proxy for some UnifiedPush providers"
|
||||
command="/usr/bin/up-rewrite"
|
||||
pidfile="/run/${name}.pid"
|
||||
logdir="/var/log/${name}"
|
||||
command_background="yes"
|
||||
command_user="gotify:gotify"
|
||||
directory="/etc/${name}"
|
||||
error_log="${logdir}/${name}.log"
|
||||
command_args="-c /etc/${name}/config.toml"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit go-module
|
||||
inherit go-module systemd
|
||||
|
||||
DESCRIPTION="Rewrite proxy for UnifiedPush"
|
||||
HOMEPAGE="https://github.com/UnifiedPush/common-proxies"
|
||||
@ -66,11 +66,25 @@ S="${WORKDIR}/${PN/up-/}-${PV}"
|
||||
LICENSE="BSD-2 MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="logrotate"
|
||||
IUSE="logrotate systemd"
|
||||
|
||||
RDEPEND="acct-user/gotify"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
sed -i -e "s|^WorkingDirectory=.*|WorkingDirectory=/etc/${PN}|" \
|
||||
-e 's|^ExecStart=.*|ExecStart=/usr/bin/up-rewrite-proxy|' \
|
||||
up-rewrite-proxy.service || die
|
||||
|
||||
cp "${FILESDIR}/${PN}.logrotate" . || die
|
||||
if use systemd; then
|
||||
sed -Ei "s/^(\s*)rc-service.*/\1systemctl restart ${PN}.service/" \
|
||||
${PN}.logrotate || die
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake local
|
||||
}
|
||||
@ -80,10 +94,11 @@ src_install() {
|
||||
dodoc docs/{config.md,reverse_proxy.md}
|
||||
|
||||
newinitd "${FILESDIR}/${PN}.initd" ${PN}
|
||||
systemd_newunit up-rewrite-proxy.service ${PN}.service
|
||||
|
||||
if use logrotate; then
|
||||
insinto etc/logrotate.d
|
||||
newins "${FILESDIR}/${PN}.logrotate" "${PN}"
|
||||
newins ${PN}.logrotate "${PN}"
|
||||
fi
|
||||
|
||||
diropts --owner=gotify --group=gotify --mode=750
|
||||
|
Reference in New Issue
Block a user