From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1612707-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 9C4FB158041
	for <garchives@archives.gentoo.org>; Tue, 19 Mar 2024 22:06:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 7B6D1E29E4;
	Tue, 19 Mar 2024 22:06:40 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 615A1E29E4
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2024 22:06:40 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 37C6333BEFF
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2024 22:06:39 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9952B158D
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 Mar 2024 22:06:36 +0000 (UTC)
From: "Julien Roy" <julien@jroy.ca>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Julien Roy" <julien@jroy.ca>
Message-ID: <1710885652.644f298c7898ecd52e35387b8fa9e26e23cb32a1.julien@gentoo>
Subject: [gentoo-commits] repo/proj/guru:master commit in: net-im/mautrix-meta/, net-im/mautrix-meta/files/
X-VCS-Repository: repo/proj/guru
X-VCS-Files: net-im/mautrix-meta/Manifest net-im/mautrix-meta/files/mautrix-meta.initd net-im/mautrix-meta/files/mautrix-meta.service net-im/mautrix-meta/mautrix-meta-0.2.0.ebuild net-im/mautrix-meta/metadata.xml
X-VCS-Directories: net-im/mautrix-meta/files/ net-im/mautrix-meta/
X-VCS-Committer: julien
X-VCS-Committer-Name: Julien Roy
X-VCS-Revision: 644f298c7898ecd52e35387b8fa9e26e23cb32a1
X-VCS-Branch: master
Date: Tue, 19 Mar 2024 22:06:36 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 53761062-8a98-4359-8e47-15d2d5bcf545
X-Archives-Hash: be56a9d06d8b0009f960e3b891d27f69
Message-ID: <20240319220636.lfYqK5tMvVM6Eykpjf-BlVSBzefrVB2OtePTBe2ZgF4@z>

commit:     644f298c7898ecd52e35387b8fa9e26e23cb32a1
Author:     Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Tue Mar 19 22:00:52 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Tue Mar 19 22:00:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=644f298c

net-im/mautrix-meta: new package, add 0.2.0

Signed-off-by: Julien Roy <julien <AT> jroy.ca>

 net-im/mautrix-meta/Manifest                   |  2 +
 net-im/mautrix-meta/files/mautrix-meta.initd   | 25 ++++++++++
 net-im/mautrix-meta/files/mautrix-meta.service | 12 +++++
 net-im/mautrix-meta/mautrix-meta-0.2.0.ebuild  | 63 ++++++++++++++++++++++++++
 net-im/mautrix-meta/metadata.xml               | 18 ++++++++
 5 files changed, 120 insertions(+)

diff --git a/net-im/mautrix-meta/Manifest b/net-im/mautrix-meta/Manifest
new file mode 100644
index 0000000000..b2e47a5e79
--- /dev/null
+++ b/net-im/mautrix-meta/Manifest
@@ -0,0 +1,2 @@
+DIST mautrix-meta-0.2.0.gh.tar.gz 198829 BLAKE2B 0dd9f02d5518d8fa3839c3df9388618a4051b41501fbc1b99ec5c0d213ab8482b0b909d9d7f572471429e441ab12d3f545d4a6ba5b67d3ae885e67b3685a35ae SHA512 76831c21a81c0b8e9ba9df144e938a647ac264e3dd2584df8190cd0bf9e875d8384b46c04e79486d923dc73aea909f585a0879ed7446009d1524e80490c9c7e0
+DIST mautrix-meta-0.2.0.tar.xz 28251872 BLAKE2B bca146d5da3093742fa8a6cb218251c75ba213c1dac48a9a8535971a38baf43c854f90882f40b0797029785bb40785d305d48feeab7cea6d985dfbf86614f00b SHA512 a5c267b49127ddc0052e2f823ed784951d5347567f31ec284516c8abab72a2f209069cfd378385075f86fd87416608d7d9dccb80247d7a44f46f4a037cc74b7e

diff --git a/net-im/mautrix-meta/files/mautrix-meta.initd b/net-im/mautrix-meta/files/mautrix-meta.initd
new file mode 100644
index 0000000000..d08fd4f82c
--- /dev/null
+++ b/net-im/mautrix-meta/files/mautrix-meta.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="mautrix-meta daemon"
+description="A Matrix-Meta puppeting bridge"
+module="mautrix_meta"
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/mautrix-meta"
+command_args="-c /etc/mautrix/${module}.yaml -r /var/lib/mautrix/meta/registration.yaml"
+command_background=true
+command_user="mautrix-meta:mautrix"
+
+output_log="/var/log/mautrix/meta/daemon.log"
+error_log="/var/log/mautrix/meta/daemon.log"
+
+depend() {
+	need net
+}
+
+start_pre() {
+	checkpath -d -m 0755 -o "$command_user" /var/lib/mautrix/meta
+	checkpath -f -m 0644 -o "$command_user" "$output_log"
+}

diff --git a/net-im/mautrix-meta/files/mautrix-meta.service b/net-im/mautrix-meta/files/mautrix-meta.service
new file mode 100644
index 0000000000..e7cf7b12a2
--- /dev/null
+++ b/net-im/mautrix-meta/files/mautrix-meta.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=A Matrix-Meta puppeting bridge
+After=network.target
+
+[Service]
+User=mautrix-meta
+Group=mautrix
+Restart=always
+ExecStart=/usr/bin/mautrix-meta -c /etc/mautrix/mautrix_meta.yaml -r /var/lib/mautrix/meta/registration.yaml
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file

diff --git a/net-im/mautrix-meta/mautrix-meta-0.2.0.ebuild b/net-im/mautrix-meta/mautrix-meta-0.2.0.ebuild
new file mode 100644
index 0000000000..748abe0dcb
--- /dev/null
+++ b/net-im/mautrix-meta/mautrix-meta-0.2.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="A Matrix-Facebook puppeting bridge"
+HOMEPAGE="https://github.com/mautrix/meta"
+SRC_URI="https://github.com/mautrix/meta/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz
+	https://jroy.ca/dist/${P}.tar.xz
+"
+S="${WORKDIR}/meta-${PV}"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	acct-user/${PN}
+	dev-libs/olm
+"
+DEPEND="${RDEPEND}"
+
+src_compile() {
+	ego build
+}
+
+src_install() {
+	dobin mautrix-meta
+
+	keepdir /var/log/mautrix/meta
+	fowners -R root:mautrix /var/log/mautrix
+	fperms -R 770 /var/log/mautrix
+	sed -i -e "s/\.\/logs/\/var\/log\/${PN/-/\\\/}/" "example-config.yaml" || die
+
+	insinto "/etc/mautrix"
+	newins "example-config.yaml" "${PN/-/_}.yaml"
+
+	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+	systemd_dounit "${FILESDIR}/${PN}.service"
+
+	fowners -R root:mautrix /etc/mautrix
+	fperms -R 770 /etc/mautrix
+}
+
+pkg_postinst() {
+	einfo
+	elog ""
+	elog "Before you can use ${PN}, you must configure it correctly"
+	elog "The configuration file is located at \"/etc/mautrix/${PN/-/_}.yaml\""
+	elog "When done, run the following command: emerge --config ${CATEGORY}/${PN}"
+	elog "Then, you must register the bridge with your homeserver"
+	elog "Refer your homeserver's documentation for instructions"
+	elog "The registration file is located at /var/lib/${PN/-/\/}/registration.yaml"
+	elog "Finally, you may start the ${PN} daemon"
+	einfo
+}
+
+pkg_config() {
+	su - "${PN}" -s /bin/sh -c \
+		"/usr/bin/${PN} -c /etc/mautrix/${PN/-/_}.yaml -g -r /var/lib/${PN/-/\/}/registration.yaml"
+}

diff --git a/net-im/mautrix-meta/metadata.xml b/net-im/mautrix-meta/metadata.xml
new file mode 100644
index 0000000000..a0c929a652
--- /dev/null
+++ b/net-im/mautrix-meta/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<name>Julien Roy</name>
+		<email>julien@jroy.ca</email>
+	</maintainer>
+	<upstream>
+		<maintainer>
+			<name>Tulir Asokan</name>
+			<email>tulir@maunium.net</email>
+		</maintainer>
+		<changelog>https://github.com/mautrix/meta/releases</changelog>
+		<doc>https://docs.mau.fi/bridges/go/meta/index.html</doc>
+		<bugs-to>https://github.com/mautrix/meta/issues</bugs-to>
+		<remote-id type="github">mautrix/meta</remote-id>
+	</upstream>
+</pkgmetadata>