Commit 3103badd authored by Jonathan Halmen's avatar Jonathan Halmen
Browse files

testing/soju: new aport

parent eca191e4
Pipeline #82817 passed with stages
in 3 minutes and 55 seconds
# Contributor: Jonathan Halmen <slowjo@halmen.xyz>
# Maintainer: Jonathan Halmen <slowjo@halmen.xyz>
pkgname=soju
pkgver=0.1.2
pkgrel=0
pkgdesc="A user-friendly IRC bouncer"
url="https://soju.im/"
arch="all"
options="!check" # upstream provides no tests
license="AGPL-3.0"
pkgusers="$pkgname"
pkggroups="$pkgusers"
install="$pkgname.pre-install"
makedepends="go scdoc"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://git.sr.ht/~emersion/soju/refs/download/v$pkgver/soju-$pkgver.tar.gz
soju.initd
soju.confd"
build() {
make
}
package() {
make PREFIX="/usr" DESTDIR="$pkgdir" install
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -Dm755 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
install -d -m750 -o $pkgusers -g $pkggroups "$pkgdir"/var/lib/soju
}
sha256sums="47c8a0e65675a4d5dff6e0716a55f8e13293a3dfc43326ec4d22745886d2317e soju-0.1.2.tar.gz
8c749ed6ef6637c7cb739adea10b9b6dd50ec672128dcc8722e51370e69c9e49 soju.initd
4aa9caacd6c78b9eaa209a106c65404e4ef8f0f6ed90b0eafe758956c4410a05 soju.confd"
# /etc/conf.d/soju
# run service as user
# user=soju
# configuration file
# config="/etc/soju/config"
# log service messages to file
# logfile="/var/log/soju.log"
#!/sbin/openrc-run
description="A user-friendly IRC bouncer."
user="${user:-soju}"
config="${config:-/etc/soju/config}"
logfile="${logfile:-/var/log/soju.log}"
extra_started_commands="reload"
description_reload="Reload TLS certs."
command="/usr/bin/soju"
command_args="-config $config"
command_background="true"
command_user="$user"
output_log="$logfile"
error_log="$logfile"
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need net
after firewall
}
start_pre() {
checkpath --owner "$command_user" -f "$logfile"
}
reload() {
ebegin "Reloading TLS certs from disk"
start-stop-daemon --signal SIGHUP --pidfile "$pidfile"
eend $?
}
#!/bin/sh
addgroup -S soju 2>/dev/null
adduser -S -D -H -h /var/lib/soju -s /sbin/nologin -G soju -g soju soju 2>/dev/null
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment