summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-10-25 00:45:34 +0200
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-10-25 00:45:34 +0200
commitd347cc66625be1f9ab9cb9a53da90a69e43402e3 (patch)
tree9777f4aa4b9582020cb1e9ad0b7394ec37406faf /net-im
parent95c915236b34e18321931abf6a24a41de2a3dc21 (diff)
downloadenomicon-d347cc66625be1f9ab9cb9a53da90a69e43402e3.tar.xz
net-im/dendrite: new package, add 9999
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'net-im')
-rw-r--r--net-im/dendrite/dendrite-9999.ebuild53
-rw-r--r--net-im/dendrite/files/dendrite.conf5
-rw-r--r--net-im/dendrite/files/dendrite.init15
3 files changed, 73 insertions, 0 deletions
diff --git a/net-im/dendrite/dendrite-9999.ebuild b/net-im/dendrite/dendrite-9999.ebuild
new file mode 100644
index 0000000..3cdaa1a
--- /dev/null
+++ b/net-im/dendrite/dendrite-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module unpacker git-r3
+
+EGIT_REPO_URI="https://github.com/matrix-org/dendrite.git"
+KEYWORDS=""
+
+DESCRIPTION="Dendrite is a second-generation Matrix homeserver written in Go!"
+HOMEPAGE="https://github.com/matrix-org/dendrite"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="acct-user/dendrite ${DEPEND}"
+BDEPEND=">=dev-lang/go-1.18.0"
+
+src_unpack() {
+ if [[ ${PV} == *9999 ]]; then
+ git-r3_src_unpack
+ go-module_live_vendor
+ else
+ unpacker_src_unpack
+ go-module_src_unpack
+ fi
+}
+
+src_compile() {
+ # bug 906073
+ use elibc_musl && export CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
+
+ GOBIN="${S}/bin" go install -trimpath -v "${S}/./cmd/..." || die
+}
+
+src_install() {
+ # Put SQLite databases in /var/lib/dendrite
+ sed -i 's"connection_string: file:"connection_string: file:/var/lib/dendrite/"' dendrite-sample.yaml || die
+
+ dobin "${S}/bin/"*
+
+ insinto /etc/dendrite
+ newins dendrite-sample.yaml dendrite.yaml
+
+ newconfd "${FILESDIR}/dendrite.conf" dendrite
+ newinitd "${FILESDIR}/dendrite.init" dendrite
+
+ keepdir /var/log/dendrite
+ fowners dendrite:dendrite /var/log/dendrite
+}
diff --git a/net-im/dendrite/files/dendrite.conf b/net-im/dendrite/files/dendrite.conf
new file mode 100644
index 0000000..3977fca
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.conf
@@ -0,0 +1,5 @@
+# dendrite options
+dendrite_args="--config /etc/dendrite/dendrite.yaml"
+
+dendrite_group="dendrite"
+dendrite_user="dendrite"
diff --git a/net-im/dendrite/files/dendrite.init b/net-im/dendrite/files/dendrite.init
new file mode 100644
index 0000000..a492747
--- /dev/null
+++ b/net-im/dendrite/files/dendrite.init
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="Dendrite"
+description=""
+command=/usr/bin/dendrite
+command_args="${dendrite_args}"
+command_background="true"
+command_user="${dendrite_user}:${dendrite_group}"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need net
+}