From 4f9cef53069fd49dad938254356a35de820f41b8 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 9 Oct 2021 10:41:16 +0000 Subject: [PATCH] soju: new package --- sr.ht/soju/APKBUILD | 49 +++++++++++++++++++++++++++++++++++++ sr.ht/soju/soju.confd | 7 ++++++ sr.ht/soju/soju.initd | 28 +++++++++++++++++++++ sr.ht/soju/soju.pre-install | 9 +++++++ 4 files changed, 93 insertions(+) create mode 100644 sr.ht/soju/APKBUILD create mode 100644 sr.ht/soju/soju.confd create mode 100644 sr.ht/soju/soju.initd create mode 100644 sr.ht/soju/soju.pre-install diff --git a/sr.ht/soju/APKBUILD b/sr.ht/soju/APKBUILD new file mode 100644 index 0000000..59e17f4 --- /dev/null +++ b/sr.ht/soju/APKBUILD @@ -0,0 +1,49 @@ +# Contributor: Michał Polański +# Maintainer: Michał Polański +pkgname=soju +pkgver=0.2.2 +pkgrel=0 +pkgdesc="User-friendly IRC bouncer" +url="https://soju.im/" +license="AGPL-3.0" +arch="all" +options="chmod-clean !check" +pkgusers="$pkgname" +pkggroups="$pkgname" +install="$pkgname.pre-install" +depends="ca-certificates" +makedepends="go scdoc" +subpackages="$pkgname-openrc $pkgname-doc" +githash=f7fce788c153c032796786d7ad0b420be49b86d9 # branch srht +source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~emersion/soju/archive/$githash.tar.gz + $pkgname.initd + $pkgname.confd + " +builddir="$srcdir/$pkgname-$githash" + +export GOPATH="$srcdir" +export GOFLAGS="$GOFLAGS -trimpath" + +build() { + make +} + +check() { + go test ./... +} + +package() { + make DESTDIR="$pkgdir" PREFIX=/usr install + + install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + + # add additional docs + install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname doc/architecture.md +} + +sha512sums=" +ffb9a56d5593848279b059f11446aed92b3933e5b1c49ead23b7fad362e62cc382e3e8ee030c1ccccb8cd0ed2d03c1ec8953b820245fc825a1f033f960430acc soju-0.2.2.tar.gz +6072c070b7bdaea08406d60816c74752e5a037c56f823b35333311f1ae3328d7e9dcab22c5a82c8628cbdc92b505e4c2ea989a5118491feb82a44efe84216d06 soju.initd +daca27e5deb5135b406e4160504efa011219147465c2f2b484b92db0aa9174173e37c62d32109937df3d2e8c430625e0ec25956775dd92f7fa1f55b19e0e8a18 soju.confd +" diff --git a/sr.ht/soju/soju.confd b/sr.ht/soju/soju.confd new file mode 100644 index 0000000..133ae77 --- /dev/null +++ b/sr.ht/soju/soju.confd @@ -0,0 +1,7 @@ +# Configuration for /etc/init.d/soju + +# additional arguments to pass to the daemon +command_args="-config /etc/soju/config" + +# log destination +error_log=/var/log/soju.log diff --git a/sr.ht/soju/soju.initd b/sr.ht/soju/soju.initd new file mode 100644 index 0000000..2c1034c --- /dev/null +++ b/sr.ht/soju/soju.initd @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name="soju" +description="User-friendly IRC bouncer" + +command=/usr/bin/soju +command_user=soju:soju +directory="/var/lib/$RC_SVCNAME" + +extra_started_commands="reload" +description_reload="Reload TLS certificate" + +depend() { + need net localmount + after firewall +} + +start_pre() { + checkpath --directory --owner $command_user --mode 0775 "$directory" + [ -n "$error_log" ] && checkpath -f -o $command_user "$error_log" +} + +reload() { + ebegin "Reloading TLS certificate" + $supervisor $RC_SVCNAME --signal HUP + eend $? +} diff --git a/sr.ht/soju/soju.pre-install b/sr.ht/soju/soju.pre-install new file mode 100644 index 0000000..cba7dd9 --- /dev/null +++ b/sr.ht/soju/soju.pre-install @@ -0,0 +1,9 @@ +#!/bin/sh + +user=soju +group=soju + +addgroup -S $group 2>/dev/null +adduser -S -D -h /var/lib/$user -s /sbin/nologin -G $group -g $user $user 2>/dev/null + +exit 0 -- 2.45.2