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>[email protected]</email>
+       </maintainer>
+       <upstream>
+               <maintainer>
+                       <name>Tulir Asokan</name>
+                       <email>[email protected]</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>

Reply via email to