From 77d3dd21daf83362d63bfdcb1d2c19ec93e91b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Thu, 21 Oct 2021 13:36:18 +0200 Subject: [PATCH] Add soju-srht --- soju-srht/.SRCINFO | 25 +++++++++++++++++++++ soju-srht/PKGBUILD | 50 +++++++++++++++++++++++++++++++++++++++++ soju-srht/soju.install | 5 +++++ soju-srht/soju.service | 13 +++++++++++ soju-srht/soju.sysusers | 1 + soju-srht/soju.tmpfiles | 2 ++ 6 files changed, 96 insertions(+) create mode 100644 soju-srht/.SRCINFO create mode 100644 soju-srht/PKGBUILD create mode 100644 soju-srht/soju.install create mode 100644 soju-srht/soju.service create mode 100644 soju-srht/soju.sysusers create mode 100644 soju-srht/soju.tmpfiles diff --git a/soju-srht/.SRCINFO b/soju-srht/.SRCINFO new file mode 100644 index 0000000..572de4a --- /dev/null +++ b/soju-srht/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = soju + pkgdesc = A user-friendly IRC bouncer + pkgver = 0.2.2 + pkgrel = 1 + url = https://soju.im/ + install = soju.install + arch = x86_64 + license = AGPL3 + makedepends = go + makedepends = scdoc + depends = sqlite + backup = etc/soju/config + source = https://git.sr.ht/~emersion/soju/refs/download/v0.2.2/soju-0.2.2.tar.gz + source = https://git.sr.ht/~emersion/soju/refs/download/v0.2.2/soju-0.2.2.tar.gz.sig + source = soju.sysusers + source = soju.service + source = soju.tmpfiles + validpgpkeys = 34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48 + sha256sums = d55c5c6e7dac5855280e6d19ed54e65445f847ed9a620b0aee58d0e398c3107a + sha256sums = SKIP + sha256sums = c050d3f376f43e1cc22e75f445027862df8d09230e18cbb0913ab58ddced78aa + sha256sums = d90c047f5f27a06d45840698a0caa9940fc02c75187c04348882f20359655c2b + sha256sums = 7d9e772f42765a82be0459bcbded2074f68d450ab09c3627ca3b59978188b61b + +pkgname = soju diff --git a/soju-srht/PKGBUILD b/soju-srht/PKGBUILD new file mode 100644 index 0000000..0de8f37 --- /dev/null +++ b/soju-srht/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Thorben Günther + +pkgname=soju-srht +_pkgname=soju +pkgver=0.2.2 +pkgrel=3 +pkgdesc='A user-friendly IRC bouncer (with srht support)' +arch=('x86_64') +url='https://soju.im/' +license=('AGPL3') +depends=('sqlite') +makedepends=('go' 'scdoc') +install=$_pkgname.install +provides=('soju') +conflicts=('soju') +githash="20525785cd2c45d0925bc0d9fdd62507d3400fef" +source=( + "$pkgname-$pkgver.tar.gz::https://git.sr.ht/~emersion/soju/archive/$githash.tar.gz" + "soju.sysusers" + "soju.service" + "soju.tmpfiles" +) +sha256sums=('dc25ba4fcfe979d53a33411f6d94dc296a98616417999561ccc74e26f970f3de' + 'c050d3f376f43e1cc22e75f445027862df8d09230e18cbb0913ab58ddced78aa' + '4ad13c2c1246381743ede31801c7867009d7c242325dbdb2fe97def5dc46b185' + '7d9e772f42765a82be0459bcbded2074f68d450ab09c3627ca3b59978188b61b') +backup=('etc/soju/config') +validpgpkeys=('34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48') + +build() { + cd "$srcdir/$_pkgname-$githash" + export CGO_LDFLAGS="${LDFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + go build ./cmd/soju + go build ./cmd/sojuctl + + scdoc doc/soju.1 +} + +package() { + cd "$srcdir/$_pkgname-$githash" + make PREFIX=/usr DESTDIR=$pkgdir install + install -Dm644 "$srcdir/$_pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$_pkgname.conf" + install -Dm644 "$srcdir/$_pkgname.service" "$pkgdir/usr/lib/systemd/system/$_pkgname.service" + install -Dm644 "$srcdir/$_pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf" +} diff --git a/soju-srht/soju.install b/soju-srht/soju.install new file mode 100644 index 0000000..938d4ac --- /dev/null +++ b/soju-srht/soju.install @@ -0,0 +1,5 @@ +#/bin/bash + +post_install() { + echo '==> Modify /etc/soju/config (man soju)' +} diff --git a/soju-srht/soju.service b/soju-srht/soju.service new file mode 100644 index 0000000..fd39a29 --- /dev/null +++ b/soju-srht/soju.service @@ -0,0 +1,13 @@ +[Unit] +Description=soju IRC bouncer service +After=network.target + +[Service] +Type=simple +User=soju +Restart=always +ExecStart=/usr/bin/soju --config /etc/soju/config +Environment=SRHT_ENDPOINT=https://meta.xenrox.net + +[Install] +WantedBy=multi-user.target diff --git a/soju-srht/soju.sysusers b/soju-srht/soju.sysusers new file mode 100644 index 0000000..5d62936 --- /dev/null +++ b/soju-srht/soju.sysusers @@ -0,0 +1 @@ +u soju - "soju user" /var/lib/soju diff --git a/soju-srht/soju.tmpfiles b/soju-srht/soju.tmpfiles new file mode 100644 index 0000000..1e9850e --- /dev/null +++ b/soju-srht/soju.tmpfiles @@ -0,0 +1,2 @@ +d /var/lib/soju 0750 soju soju - +d /var/lib/soju/logs 0750 soju soju - -- 2.44.0