www-apps/gotify-server-bin: New package.
continuous-integration/drone/push Build is passing Details

Also add user and group.
This commit is contained in:
tastytea 2021-09-09 20:00:50 +02:00
parent 0c3a3f42af
commit 1cb21bebf1
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
9 changed files with 119 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-group
ACCT_GROUP_ID=-1

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,14 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-user
DESCRIPTION="User for www-servers/gotify-server{,-bin}"
ACCT_USER_ID=-1
ACCT_USER_HOME="/var/lib/gotify"
ACCT_USER_GROUPS=( gotify )
acct-user_add_deps

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,2 @@
DIST config.example.yml 2435 BLAKE2B 1b6c5e97b1698d808c0a245031b660dcd933ba55a699c9660e2cf3c04d51effdb4d628795953a4ad49ba32999c73b255e26b8eaf819f368b1a11e98dda814705 SHA512 3939797cf58a066416f039db7b52d0446c2993ac07d9d930c93c9708c0d5a827c328b75613976a931cd9bf93bc0b259b96275ac07d72d4008f87973674df196f
DIST gotify-server-bin-2.0.23.zip 9588107 BLAKE2B 1e8c025029863a9aeb07e0ef7b805befaea405635ce9e46983c29299619fbe2e3fe66b7e33057ba7a9281e72b7baa55780d163066b43a7ddcaf2b0a3aff2d118 SHA512 618ce705cdbbb66eaf834af6720d3205b288cae6b98da1c218b1dc86857633e9ed35de20bfe5a0ce933a7d40c7c1398f520682564c177b082e1c7b518c4c2482

View File

@ -0,0 +1,16 @@
#!/sbin/openrc-run
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="gotify-server-bin"
description="gotify server (bin)"
command="/usr/bin/${name}"
pidfile="/run/${name}.pid"
logdir="/var/log/${name}"
start_stop_daemon_args="--background --make-pidfile --pidfile ${pidfile} --user gotify:gotify --chdir /var/lib/gotify --stdout ${logdir}/${name}.log --stderr ${logdir}/error.log"
depend() {
need net
use dns
after logger
}

View File

@ -0,0 +1,6 @@
/var/log/gotify-server-bin/*.log {
missingok
notifempty
sharedscripts
endscript
}

View File

@ -0,0 +1,46 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Simple server for sending and receiving messages in real-time per WebSocket"
HOMEPAGE="https://gotify.net/"
SRC_URI="
https://github.com/gotify/server/releases/download/v${PV}/gotify-linux-amd64.zip -> ${P}.zip
https://raw.githubusercontent.com/gotify/server/v${PV}/config.example.yml
"
S="${WORKDIR}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="logrotate"
RDEPEND="acct-user/gotify"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip"
QA_PREBUILT="/usr/bin/${PN}"
src_prepare() {
cp "${DISTDIR}/config.example.yml" . || die
sed -i 's/listenaddr: ""/listenaddr: "[::1]"/' config.example.yml || die
default
}
src_install() {
newbin gotify-linux-amd64 ${PN}
dodoc config.example.yml
doinitd "${FILESDIR}/${PN}.initd"
if use logrotate; then
insinto etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotate" "${PN}"
fi
diropts --owner=gotify --group=gotify --mode=750
keepdir var/lib/gotify
keepdir etc/gotify
keepdir var/log/${PN}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@tastytea.de</email>
<name>tastytea</name>
</maintainer>
<use>
<flag name="logrotate">Use app-admin/logrotate for rotating logs</flag>
</use>
</pkgmetadata>