mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-12 16:16:22 +02:00
parent
85cb065bcc
commit
6a23d33f80
52
testing/soju/APKBUILD
Normal file
52
testing/soju/APKBUILD
Normal file
@ -0,0 +1,52 @@
|
||||
# Contributor: Michał Polański <michal@polanski.me>
|
||||
# Maintainer: Michał Polański <michal@polanski.me>
|
||||
pkgname=soju
|
||||
pkgver=0.1.2
|
||||
pkgrel=0
|
||||
pkgdesc="User-friendly IRC bouncer"
|
||||
url="https://soju.im/"
|
||||
license="AGPL-3.0"
|
||||
arch="all"
|
||||
options="chmod-clean"
|
||||
pkgusers="$pkgname"
|
||||
pkggroups="$pkgname"
|
||||
install="$pkgname.pre-install"
|
||||
depends="ca-certificates"
|
||||
makedepends="go scdoc"
|
||||
subpackages="$pkgname-openrc $pkgname-doc"
|
||||
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~emersion/soju/archive/v$pkgver.tar.gz
|
||||
$pkgname.initd
|
||||
$pkgname.confd
|
||||
config.patch
|
||||
makefile.patch
|
||||
"
|
||||
builddir="$srcdir/$pkgname-v$pkgver"
|
||||
|
||||
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="
|
||||
54515a524555c07cafc9f0fb40f785a4853dd54194ed536d3195c6d57a6401a3ef83e160e32e725415071597fd6deee29912b0778a989fc9d6264168112e99ef soju-0.1.2.tar.gz
|
||||
c717e56a732baee3686c3cdc94dce5ad27b66e952a20e26a7d9533309edc9b45a85a85346e3ff47da700952218d61a7df8572eeddf6eed166e541a5a81cf7371 soju.initd
|
||||
daca27e5deb5135b406e4160504efa011219147465c2f2b484b92db0aa9174173e37c62d32109937df3d2e8c430625e0ec25956775dd92f7fa1f55b19e0e8a18 soju.confd
|
||||
48b0192bc385da4fe8c801612aed6b85accb84b9435f8f590b251bbeb1362567da6676e487ba6535561050a42efa84d9a712dc843482190ccd1483c0e2f12fa8 config.patch
|
||||
599a809aa78406bc029ee63b4e7a8e8825972a397626529adce75c38c27f3d2b326335cac287b251344775f8735a9a47c8e35545df33a9d659d3ddac1bb575d5 makefile.patch
|
||||
"
|
||||
11
testing/soju/config.patch
Normal file
11
testing/soju/config.patch
Normal file
@ -0,0 +1,11 @@
|
||||
Add friendly comment to the config file
|
||||
|
||||
diff --git a/config.in b/config.in
|
||||
index a0b510e..056a466 100644
|
||||
--- a/config.in
|
||||
+++ b/config.in
|
||||
@@ -1,2 +1,4 @@
|
||||
+# See soju(1) for supported directives
|
||||
+
|
||||
db sqlite3 /var/lib/soju/main.db
|
||||
log fs /var/lib/soju/logs/
|
||||
15
testing/soju/makefile.patch
Normal file
15
testing/soju/makefile.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Don't create /var/lib/soju, it's done by soju.pre-install script
|
||||
with proper permissions.
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index bcf4e07..3f210f7 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -24,7 +24,6 @@ install: all
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
||||
mkdir -p $(DESTDIR)/etc/soju
|
||||
- mkdir -p $(DESTDIR)/var/lib/soju
|
||||
cp -f soju sojuctl $(DESTDIR)$(PREFIX)/$(BINDIR)
|
||||
cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
|
||||
cp -f config.in $(DESTDIR)/etc/soju/config
|
||||
7
testing/soju/soju.confd
Normal file
7
testing/soju/soju.confd
Normal file
@ -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
|
||||
27
testing/soju/soju.initd
Normal file
27
testing/soju/soju.initd
Normal file
@ -0,0 +1,27 @@
|
||||
#!/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() {
|
||||
[ -n "$error_log" ] && checkpath -f -o soju:soju "$error_log"
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading TLS certificate"
|
||||
$supervisor $RC_SVCNAME --signal HUP
|
||||
eend $?
|
||||
}
|
||||
9
testing/soju/soju.pre-install
Normal file
9
testing/soju/soju.pre-install
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user