forked from tastytea/overlay
www-apps/up-common-proxies: Add systemd support
This commit is contained in:
parent
789962e459
commit
57454b1bc3
|
@ -3,12 +3,13 @@
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
name="up-common-proxies"
|
name="up-common-proxies"
|
||||||
description="UnifiedPush common proxies (bin)"
|
description="Rewrite Proxy for some UnifiedPush providers"
|
||||||
command="/usr/bin/up-rewrite"
|
command="/usr/bin/up-rewrite"
|
||||||
pidfile="/run/${name}.pid"
|
pidfile="/run/${name}.pid"
|
||||||
logdir="/var/log/${name}"
|
logdir="/var/log/${name}"
|
||||||
command_background="yes"
|
command_background="yes"
|
||||||
command_user="gotify:gotify"
|
command_user="gotify:gotify"
|
||||||
|
directory="/etc/${name}"
|
||||||
error_log="${logdir}/${name}.log"
|
error_log="${logdir}/${name}.log"
|
||||||
command_args="-c /etc/${name}/config.toml"
|
command_args="-c /etc/${name}/config.toml"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
EAPI=8
|
EAPI=8
|
||||||
|
|
||||||
inherit go-module
|
inherit go-module systemd
|
||||||
|
|
||||||
DESCRIPTION="Rewrite proxy for UnifiedPush"
|
DESCRIPTION="Rewrite proxy for UnifiedPush"
|
||||||
HOMEPAGE="https://github.com/UnifiedPush/common-proxies"
|
HOMEPAGE="https://github.com/UnifiedPush/common-proxies"
|
||||||
|
@ -66,11 +66,25 @@ S="${WORKDIR}/${PN/up-/}-${PV}"
|
||||||
LICENSE="BSD-2 MIT"
|
LICENSE="BSD-2 MIT"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
IUSE="logrotate"
|
IUSE="logrotate systemd"
|
||||||
|
|
||||||
RDEPEND="acct-user/gotify"
|
RDEPEND="acct-user/gotify"
|
||||||
DEPEND="${RDEPEND}"
|
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() {
|
src_compile() {
|
||||||
emake local
|
emake local
|
||||||
}
|
}
|
||||||
|
@ -80,10 +94,11 @@ src_install() {
|
||||||
dodoc docs/{config.md,reverse_proxy.md}
|
dodoc docs/{config.md,reverse_proxy.md}
|
||||||
|
|
||||||
newinitd "${FILESDIR}/${PN}.initd" ${PN}
|
newinitd "${FILESDIR}/${PN}.initd" ${PN}
|
||||||
|
systemd_newunit up-rewrite-proxy.service ${PN}.service
|
||||||
|
|
||||||
if use logrotate; then
|
if use logrotate; then
|
||||||
insinto etc/logrotate.d
|
insinto etc/logrotate.d
|
||||||
newins "${FILESDIR}/${PN}.logrotate" "${PN}"
|
newins ${PN}.logrotate "${PN}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
diropts --owner=gotify --group=gotify --mode=750
|
diropts --owner=gotify --group=gotify --mode=750
|
||||||
|
|
Loading…
Reference in New Issue
Block a user