www-apps/honk: new package, add 0.9.8

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2022-12-01 17:07:49 +05:00
parent 7021f7d8c7
commit 91a6bc0640
5 changed files with 139 additions and 0 deletions

1
www-apps/honk/Manifest Normal file
View File

@@ -0,0 +1 @@
DIST honk-0.9.8.tgz 511957 BLAKE2B c07e4141be790d58170da6eb759486889b6c74d70b946e89b1598b2c1868175df1cb9f41649a34067f2ca6f3bddc77d4cc22a241761460b2487bf866b7d40650 SHA512 f32be393698eb3b3ae72d223814eee2a15af3e892ab4b9140314da3ce96d4b4582a8b73c3fa5adede34a4d9d9b2cfc8d7dbb933d516eba8e3820d125c217a354

56
www-apps/honk/files/honk Normal file
View File

@@ -0,0 +1,56 @@
#!/sbin/openrc-run
# shellcheck shell=sh
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
extra_stopped_commands="init"
extra_started_commands="upgrade"
description_init="Create the database"
description_upgrade="Upgrade the server"
name="Honk ActivityPub server"
command="/usr/bin/honk"
command_args="-datadir /var/lib/honk -viewdir /usr/share/honk -log /var/log/honk.log"
command_user="honk:honk"
command_background=yes
pidfile="/run/honk.pid"
depend() {
need net
}
fix_log_perms() {
checkpath -fo honk:honk /var/log/honk.log
}
check_db() {
if [ ! -f /var/lib/honk/honk.db ]; then
eerror "Please run 'rc-service honk init' before the first start"
return 1
fi
return 0
}
start_pre() {
fix_log_perms || return 1
check_db || return 1
start-stop-daemon --exec "${command}" --user "${command_user}" \
-- ${command_args} cleanup
}
init() {
fix_log_perms || return 1
start-stop-daemon --exec "${command}" --user "${command_user}" \
-- ${command_args} init
}
upgrade() {
fix_log_perms || return 1
check_db || return 1
start-stop-daemon --exec "${command}" --user "${command_user}" \
-- ${command_args} upgrade
}

View File

@@ -0,0 +1,20 @@
[Unit]
Description="Honk ActivityPub server"
After=syslog.target network.target
Requires=network.target
[Service]
Restart=always
RestartSec=30
ExecStart=/usr/bin/honk -datadir /var/lib/honk -viewdir /usr/share/honk
NoNewPrivileges=yes
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
ReadWritePaths=/var/lib/honk
User=honk
Group=honk
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,47 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd
DESCRIPTION="ActivityPub server with minimal setup and support costs"
HOMEPAGE="https://humungus.tedunangst.com/r/honk"
SRC_URI="https://humungus.tedunangst.com/r/${PN}/d/${P}.tgz"
LICENSE="BSD BSD-2 ISC MIT"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="dev-db/sqlite:3"
RDEPEND="
${DEPEND}
acct-user/honk
"
DOCS=( README docs/{changelog,ping}.txt docs/{intro.1,vim.3} )
src_install() {
dobin honk
doman docs/activitypub.7 docs/hfcs.1 docs/honk.{1,3,5,8}
einstalldocs
doinitd "${FILESDIR}"/honk
systemd_dounit "${FILESDIR}"/honk.service
insinto /usr/share/honk
doins -r views
diropts --owner honk --group honk
keepdir /var/lib/honk
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
einfo "To finish the installation, please run:"
einfo " # rc-service honk init"
else
einfo "To finish the upgrade, please run:"
einfo " # rc-service honk upgrade"
fi
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>cyber+gentoo@sysrq.in</email>
<name>Anna</name>
</maintainer>
<upstream>
<doc>https://humungus.tedunangst.com/r/honk/m</doc>
<maintainer>
<name>Ted Unangst</name>
<email>tedu@tedunangst.com</email>
</maintainer>
</upstream>
</pkgmetadata>