net-im/mjolnir: new package, add 1.5.0

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-10-31 10:41:30 +01:00
parent e98ddd4b65
commit 835b762480
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
4 changed files with 94 additions and 0 deletions

2
net-im/mjolnir/Manifest Normal file
View File

@ -0,0 +1,2 @@
DIST mjolnir-1.5.0-deps.tar.xz 34428920 BLAKE2B b1876ea496c9ad4815a86ba6e5f9474cf76a9dd05e678fbc5c74a617920050604995abb41bdfe09590f3deb07605018be5c78a463ae7982613945021e2bd0b9c SHA512 676b6580e632e7bd2a96fe55d8887713a576a232777010421a3d6f675b5584a476736145530a6169281484e7e80fc7c66b35a0bf1a1521978ba76a18c15c8770
DIST mjolnir-1.5.0.tar.gz 194488 BLAKE2B e1b2a9335815b8a2f4452e3be1b27a903e9b96b565cbd567d5b4d52cb1e2ab914fd3be963abc6857e775343af79a4708320f6496f4242bcac9ed1898588fcdf4 SHA512 2f0d00e7c4e1cee8cdcc2565821638c3a979538402ccafd10beb0fd8edcd2cbf0e46f5bf11a6df2c02dfff49b89cbf731d9bcd5411b805d9079cdcac5484c06d

View File

@ -0,0 +1,23 @@
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="mjolnir daemon"
description="mjolnir daemon"
command=/usr/bin/node
command_args="mjolnir/index.js"
command_user="${MJOLNIR_USER:-synapse}"
supervisor="supervise-daemon"
supervise_daemon_args=" -d /opt/mjolnir -e NODE_ENV=\"production\""
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
}
start_pre() {
local cfg=/opt/mjolnir/config/production.yaml
[[ -f ${cfg} ]] || echo "${cfg} does not exist or is not a regular file" >&2
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@tastytea.de</email>
<name>Ronny (tastytea) Gutbrod</name>
</maintainer>
<upstream>
<remote-id type="github">matrix-org/mjolnir</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,58 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="A moderation tool for Matrix"
HOMEPAGE="https://github.com/matrix-org/mjolnir"
SRC_URI="
https://github.com/matrix-org/mjolnir/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
https://tastytea.de/files/gentoo/${P}-deps.tar.xz
"
# NOTE: to generate the deps archive:
# yarn --cache-folder ./yarn-cache install
# tar -caf ${P}-deps.tar.xz yarn-cache
LICENSE="0BSD Apache-2.0 BSD BSD-2 ISC MIT PYTHON Unlicense"
SLOT="0"
# KEYWORDS="~amd64"
IUSE="doc"
RDEPEND=">=net-libs/nodejs-16"
BDEPEND="sys-apps/yarn"
MY_YARNOPTS="--offline --non-interactive --no-progress --verbose"
src_prepare() {
yarn ${MY_YARNOPTS} --cache-folder ../yarn-cache install || die
default
}
src_compile() {
yarn ${MY_YARNOPTS} build || die
}
src_install() {
insinto /opt/${PN}
doins -r node_modules
insinto /opt/${PN}/${PN}
doins -r lib/*
keepdir /opt/${PN}/config
einstalldocs
dodoc config/default.yaml
use doc && dodoc docs/*
newinitd "${FILESDIR}"/${PN}.initd ${PN}
}
pkg_postinstall() {
if [[ ! -f "${EROOT}"/opt/${PN}/config/production.yaml ]]; then
elog "Copy the configuration example from /usr/share/doc/${PF}/default.yaml*"
elog "into /opt/${PN}/config/production.yaml and edit it."
fi
}