From 488005146a4c981d54db9a2b42589cd07d1ceb9d Mon Sep 17 00:00:00 2001 From: Niklaus 'vimja' Hofer Date: Sat, 22 Aug 2026 00:11:23 +0200 Subject: [PATCH] net-im/zendrite: new package, add 3.2.0 Signed-off-by: Niklaus 'vimja' Hofer --- net-im/zendrite/Manifest | 2 + net-im/zendrite/files/conf.1 | 17 ++++++++ net-im/zendrite/files/init.1 | 53 +++++++++++++++++++++++ net-im/zendrite/metadata.xml | 16 +++++++ net-im/zendrite/zendrite-3.2.0.ebuild | 61 +++++++++++++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 net-im/zendrite/Manifest create mode 100644 net-im/zendrite/files/conf.1 create mode 100644 net-im/zendrite/files/init.1 create mode 100644 net-im/zendrite/metadata.xml create mode 100644 net-im/zendrite/zendrite-3.2.0.ebuild diff --git a/net-im/zendrite/Manifest b/net-im/zendrite/Manifest new file mode 100644 index 0000000000..3f4967746d --- /dev/null +++ b/net-im/zendrite/Manifest @@ -0,0 +1,2 @@ +DIST zendrite-3.2.0-vendor.tar.xz 14934332 BLAKE2B f88a4401ca9823da25b50355b638e93705abbd68fc59ffc4ab3804dc272c1954062244e3601e5b9aa13233fd7964fc7170a0aa700c680d1c04a8a0caab6dd3a5 SHA512 de85ebdbdf6373b133a47aeb05ef666772ca401ad02e23e9e97f3ae5f28aa48054d21ef6246da76c167248535a3a2a2355cd64ed08bda9cd32d66463fceb395f +DIST zendrite-3.2.0.tar.gz 1451035 BLAKE2B 569f993180c91c14c14ca725782d3602ab6e4f45b22f0bc87b9011d566fd7c769a5f9dd422224b83fb83ff7499b21253266f00b9c2068476afa28253a7daeb67 SHA512 4233e77196bc5fb5a6ff41b1d14bc84d03e5ca149ca1af6105c0fb24d1c939fb59defa307bcbb785b24926b3c576cc92533fad1c45fa14970e6f339667971517 diff --git a/net-im/zendrite/files/conf.1 b/net-im/zendrite/files/conf.1 new file mode 100644 index 0000000000..13a7aa633e --- /dev/null +++ b/net-im/zendrite/files/conf.1 @@ -0,0 +1,17 @@ +# Increase the maximum number of open file descriptors. Set to a higher +# value for larger servers or if joining larger rooms. +rc_ulimit="-n 4096" + +# Specify the network service that corresponds to the "bind" setting +# in your configuration file. For example, if you bind to 127.0.0.1, +# this should be set to "loopback" which provides the loopback interface. +rc_need="loopback" + +# Uncomment if you are using PostgreSQL: +# rc_need="${rc_need} postgresql" + +# Use supervisor-daemon to manage the process: +supervisor="supervise-daemon" + +# Use to bind to different port (useful when running multiple instances). +# ZENDRITE_OPTS="-http-bind-address localhost:8008" diff --git a/net-im/zendrite/files/init.1 b/net-im/zendrite/files/init.1 new file mode 100644 index 0000000000..ad8e08be6a --- /dev/null +++ b/net-im/zendrite/files/init.1 @@ -0,0 +1,53 @@ +#!/sbin/openrc-run + +ZENDRITE=${SVCNAME#*.} +: ${ZENDRITE_CONFDIR:=${RC_PREFIX%/}/etc/zendrite} + +if [ -n "${ZENDRITE}" ] && [ ${SVCNAME} != "zendrite" ]; then + : ${ZENDRITE_CONFIG:=${ZENDRITE_CONFDIR}/${ZENDRITE}.yaml} + : ${ZENDRITE_PIDFILE:=${RC_PREFIX%/}/run/zendrite.${ZENDRITE}.pid} +else + : ${ZENDRITE_CONFIG:=${ZENDRITE_CONFDIR}/zendrite.yaml} + : ${ZENDRITE_PIDFILE:=${RC_PREFIX%/}/run/zendrite.pid} +fi + +if [ -n "${ZENDRITE_USER}" ]; then + : # Do nothing, ZENDRITE_USER is set externally. +else + ZENDRITE_USER='zendrite' +fi + +if [ -n "${ZENDRITE_WORKING_DIRECTORY}" ]; then + : # Do nothing, ZENDRITE_WORKING_DIRECTORY is set externally. +else + ZENDRITE_WORKING_DIRECTORY='${RC_PREFIX%/}/var/lib/zendrite' +fi + +# Where should supervise-daemon write zendrite's stdout to? +if [ -n "${ZENDRITE_STDOUT_FILE}" ]; then + : # Do nothing, ZENDRITE_STDOUT_FILE is set externally. +else + ZENDRITE_STDOUT_FILE="${RC_PREFIX%/}/var/log/zendrite/zendrite.stdout" +fi + +# Where should supervise-daemon write zendrite's stderr to? +if [ -n "${ZENDRITE_STDERR_FILE}" ]; then + : # Do nothing, ZENDRITE_STDERR_FILE is set externally. +else + ZENDRITE_STDERR_FILE="${RC_PREFIX%/}/var/log/zendrite/zendrite.stdout" +fi + +supervise_daemon_args="--stdout ${ZENDRITE_STDOUT_FILE} --stderr ${ZENDRITE_STDERR_FILE}" + +command="${RC_PREFIX%/}/usr/bin/zendrite" +command_args="${ZENDRITE_OPTS} -config ${ZENDRITE_CONFIG}" +command_user="${ZENDRITE_USER}:${ZENDRITE_USER}" +directory="${ZENDRITE_WORKING_DIRECTORY}" +pidfile="${ZENDRITE_PIDFILE}" + +start_pre() { + test -f "${ZENDRITE_CONFIG}" || { + echo "\"${ZENDRITE_CONFIG}\" does not exist or is not a regular file." >&2 + return 1 + } +} diff --git a/net-im/zendrite/metadata.xml b/net-im/zendrite/metadata.xml new file mode 100644 index 0000000000..cbb1ca2165 --- /dev/null +++ b/net-im/zendrite/metadata.xml @@ -0,0 +1,16 @@ + + + + + gentoo-bugzilla@vimja.email + Niklaus 'vimja' Hofer + + + Zendrite is a second-generation Matrix homeserver written in Go, designed to be efficient, reliable, and scalable. + + An opinionated fork of element-hq/dendrite https://zendrite.pat-s.me + + + https://codefloe.com/pat-s/zendrite/issues + + diff --git a/net-im/zendrite/zendrite-3.2.0.ebuild b/net-im/zendrite/zendrite-3.2.0.ebuild new file mode 100644 index 0000000000..f241f5c6ed --- /dev/null +++ b/net-im/zendrite/zendrite-3.2.0.ebuild @@ -0,0 +1,61 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module + +DESCRIPTION="Zendrite is a second-generation Matrix homeserver written in Go" +HOMEPAGE=" + https://zendrite.pat-s.me/ + https://codefloe.com/pat-s/zendrite +" +SRC_URI=" + https://codefloe.com/pat-s/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://vimja.cloud/public.php/dav/files/z59eKDyLFokW2KK/${CATEGORY}/${PN}/${P}-vendor.tar.xz +" + +S="${WORKDIR}/${PN}" + +# https://wiki.gentoo.org/wiki/Writing_go_Ebuilds#Licenses +LICENSE="AGPL-3+ Apache-2.0 BSD MIT MPL-2.0 ZLIB" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + >=dev-lang/go-1.25.0 + test? ( dev-libs/olm ) +" +RDEPEND=" + acct-user/zendrite + acct-group/zendrite +" + +src_compile() { + ego build ./... + GOBIN="${S}/bin" ego install ./... +} + +src_test() { + # Do not run tests that require access to a working PostgreSQL installation... + ego test ./... -skip "TestUpDropEventReferenceSHAPrevEvents|.*/postgres|.*/.*/postgres" +} + +src_install() { + + dobin "${S}"/bin/* + + insinto /etc/zendrite + doins "${S}"/zendrite-sample.yaml + + newinitd "${FILESDIR}"/init.1 zendrite + newconfd "${FILESDIR}"/conf.1 zendrite + + keepdir /var/log/zendrite + keepdir /var/lib/zendrite + + fowners zendrite:zendrite /var/log/zendrite +}