commit 17fd30c3c5384ec4e00d5cfc28bceac751525a57 Author: Jason Staten Date: Mon Sep 26 04:24:28 2022 +0000 Working install diff --git a/APKBUILD b/APKBUILD new file mode 100644 index 0000000..22e1ad3 --- /dev/null +++ b/APKBUILD @@ -0,0 +1,62 @@ +# Maintainer: Jason Staten +pkgname=honk +pkgver=0.9.8 +pkgrel=0 +pkgdesc="An ActivityPub server with minimal setup and support costs." +url="https://humungus.tedunangst.com/r/honk" +arch="all" +license="ISC" +depends="" +makedepends="go sqlite-dev" +checkdepends="" +install="$pkgname.post-install $pkgname.post-deinstall" +subpackages="$pkgname-doc $pkgname-openrc" +source="https://humungus.tedunangst.com/r/$pkgname/d/$pkgname-$pkgver.tgz + $pkgname.confd + $pkgname.initd + " +builddir="$srcdir/" + +build() { + cd "$pkgname-$pkgver" + make all +} + +package() { + install -Dm755 "$pkgname-$pkgver/$pkgname" "$pkgdir/usr/bin/$pkgname" + install -Dm644 "$pkgname-$pkgver/"/views/* -t "$pkgdir/usr/share/$pkgname/views/" + install -Dm644 "$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname" + install -Dm755 "$pkgname.initd" "$pkgdir/etc/init.d/$pkgname" + + DOCS="$pkgname-$pkgver/docs" + MANDIR="$pkgdir/usr/share/man/man" + + install -Dm644 $DOCS/* -t "$pkgdir/usr/share/$pkgname/docs/" + + install -Dm644 $DOCS/honk.1 -t ${_MANDIR}1/ + install -Dm644 $DOCS/honk.3 -t ${_MANDIR}3/ + install -Dm644 $DOCS/honk.5 -t ${_MANDIR}5/ + install -Dm644 $DOCS/honk.8 -t ${_MANDIR}8/ + + install -Dm644 $DOCS/activitypub.7 ${MANDIR}7/honk_activitypub.7 + install -Dm644 $DOCS/hfcs.1 ${MANDIR}1/honk_hfcs.1 + install -Dm644 $DOCS/intro.1 ${MANDIR}1/honk_intro.1 + install -Dm644 $DOCS/vim.3 ${MANDIR}3/honk_vim.3 + + install -Dm644 "$pkgname-$pkgver"/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" +} + +doc() { + default_doc +} + +check() { + cd "$pkgname-$pkgver" + make test +} + +sha512sums=" +f32be393698eb3b3ae72d223814eee2a15af3e892ab4b9140314da3ce96d4b4582a8b73c3fa5adede34a4d9d9b2cfc8d7dbb933d516eba8e3820d125c217a354 honk-0.9.8.tgz +d9ff33c5df779bda5bf21a6f7e8d7fa2ec768d86abdd9f094e58e4207192448283dad6187089625746b010851a4b82e55d978742d03293e7259629135f3429e7 honk.confd +5b3398e6e8a02ae41ae22b3b26c71f6e28719f86b0058c287523e4603b763bbb60439059f8d6c50f343ddd825624690a979e7ca1122acdbf4847ccef620e0fc4 honk.initd +" diff --git a/honk.confd b/honk.confd new file mode 100644 index 0000000..18f9b59 --- /dev/null +++ b/honk.confd @@ -0,0 +1,5 @@ +# honk options +# +# HONK_LOGFILE +# HONK_DATADIR +# HONK_OPTS diff --git a/honk.initd b/honk.initd new file mode 100644 index 0000000..7da1fb3 --- /dev/null +++ b/honk.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run + +HONK_DATADIR="${HONK_DATADIR:-/srv/honk}" + +supervisor=supervise-daemon + +name="honk" +command="/usr/bin/honk" +command_args="--viewdir=/usr/share/honk --datadir=${HONK_DATADIR} --log=syslog ${HONK_OPTS}" +command_user="honk:honk" + +depend() { + need net +} + +start_pre() { + checkpath -f -m 0644 -o honk ${HONK_DATADIR}/honk.db + checkpath -f -m 0644 -o honk ${HONK_DATADIR}/blob.db +} diff --git a/honk.post-deinstall b/honk.post-deinstall new file mode 100755 index 0000000..34213c4 --- /dev/null +++ b/honk.post-deinstall @@ -0,0 +1,5 @@ +#!/bin/sh + +delgroup honk +deluser honk +exit 0 diff --git a/honk.post-install b/honk.post-install new file mode 100755 index 0000000..12f90ff --- /dev/null +++ b/honk.post-install @@ -0,0 +1,8 @@ +#!/bin/sh + +addgroup -S honk 2>/dev/null +adduser -S -D -h /srv/honk -s /sbin/nologin -G honk -g honk honk>/dev/null + +printf "Initialize honk before enabling:\nsudo --user=honk /usr/bin/honk -datadir=/srv/honk init\n" + +exit 0