commit:     32cdbd6f041887bdf24cda7c277b320ae00339a3
Author:     Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Fri May 24 18:28:13 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Fri May 24 18:35:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=32cdbd6f

net-im/maubot: new package, add 0.4.2

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

 net-im/maubot/Manifest             |  1 +
 net-im/maubot/files/maubot.initd   | 28 +++++++++++++++++
 net-im/maubot/files/maubot.service | 12 ++++++++
 net-im/maubot/maubot-0.4.2.ebuild  | 61 ++++++++++++++++++++++++++++++++++++++
 net-im/maubot/metadata.xml         | 19 ++++++++++++
 5 files changed, 121 insertions(+)

diff --git a/net-im/maubot/Manifest b/net-im/maubot/Manifest
new file mode 100644
index 000000000..a37108d13
--- /dev/null
+++ b/net-im/maubot/Manifest
@@ -0,0 +1 @@
+DIST maubot-0.4.2.tar.gz 1981478 BLAKE2B 
47ed5ef89b37099ee071a08914bf0f7ae49c7f53786696d29e5f5a58ecae7dab4707b7bd2ac59bbc8246778a9c0ef487d5724fe5b61342f52637e0a0c74a7298
 SHA512 
136cc8870de804f0cf8b85efa21ed16ef56f803c64e8f04562b5c69402573596edf87a9c783670d09878f4cbf59613553ce6898c11aa166248d02d26704f7921

diff --git a/net-im/maubot/files/maubot.initd b/net-im/maubot/files/maubot.initd
new file mode 100644
index 000000000..f4b109d18
--- /dev/null
+++ b/net-im/maubot/files/maubot.initd
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="maubot daemon"
+description="A plugin-based Matrix bot system"
+module="maubot"
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/python"
+command_args="-m ${module} -c /etc/maubot/${module}.yaml"
+command_background=true
+command_user="maubot:maubot"
+
+output_log="/var/log/maubot/maubot_daemon.log"
+error_log="/var/log/maubot/maubot_daemon.log"
+
+depend() {
+       need net
+}
+
+start_pre() {
+       checkpath -d -m 0755 -o "$command_user" /var/lib/maubot
+       checkpath -d -m 0755 -o "$command_user" /var/lib/maubot/plugins
+       checkpath -d -m 0755 -o "$command_user" /var/lib/maubot/logs
+       checkpath -d -m 0755 -o "$command_user" /var/lib/maubot/trash
+       checkpath -f -m 0644 -o "$command_user" "$output_log"
+}

diff --git a/net-im/maubot/files/maubot.service 
b/net-im/maubot/files/maubot.service
new file mode 100644
index 000000000..92ed035ab
--- /dev/null
+++ b/net-im/maubot/files/maubot.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=A plugin-based Matrix bot system
+After=network.target
+
+[Service]
+User=maubot
+Group=maubot
+Restart=always
+ExecStart=/usr/bin/python -m maubot -c /etc/maubot/maubot.yaml
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file

diff --git a/net-im/maubot/maubot-0.4.2.ebuild 
b/net-im/maubot/maubot-0.4.2.ebuild
new file mode 100644
index 000000000..4429556fb
--- /dev/null
+++ b/net-im/maubot/maubot-0.4.2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYPI_NO_NORMALIZE=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1 pypi systemd
+
+DESCRIPTION="Plugin-based Matrix bot system"
+HOMEPAGE="https://github.com/maubot/maubot/";
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       acct-user/maubot
+       dev-python/aiohttp[${PYTHON_USEDEP}]
+       dev-python/aiosqlite[${PYTHON_USEDEP}]
+       dev-python/attrs[${PYTHON_USEDEP}]
+       dev-python/asyncpg[${PYTHON_USEDEP}]
+       dev-python/bcrypt[${PYTHON_USEDEP}]
+       dev-python/click[${PYTHON_USEDEP}]
+       dev-python/colorama[${PYTHON_USEDEP}]
+       dev-python/commonmark[${PYTHON_USEDEP}]
+       dev-python/cryptg[${PYTHON_USEDEP}]
+       dev-python/jinja[${PYTHON_USEDEP}]
+       dev-python/mautrix[${PYTHON_USEDEP}]
+       dev-python/packaging[${PYTHON_USEDEP}]
+       dev-python/pycryptodome[${PYTHON_USEDEP}]
+       dev-python/python-olm[${PYTHON_USEDEP}]
+       dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+       dev-python/sqlalchemy[${PYTHON_USEDEP}]
+       dev-python/unpaddedbase64[${PYTHON_USEDEP}]
+       dev-python/yarl[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+
+src_install() {
+       distutils-r1_src_install
+
+       keepdir /var/log/maubot
+       fowners root:maubot /var/log/maubot
+       fperms 770 /var/log/maubot
+       sed -i -e "s/\.\/${PN}.log/\/var\/log\/maubot\/${PN}.log/" 
"${ED}/usr/example-config.yaml" || die
+       sed -i -e "s/\.\/plugins/\/var\/lib\/maubot\/plugins/g" 
"${ED}/usr/example-config.yaml" || die
+       sed -i -e "s/\.\/trash/\/var\/lib\/maubot\/trash/g" 
"${ED}/usr/example-config.yaml" || die
+
+       insinto "/etc/maubot"
+       newins "${ED}/usr/example-config.yaml" "${PN}.yaml"
+       rm "${ED}/usr/example-config.yaml" || die
+
+       newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+       systemd_dounit "${FILESDIR}/${PN}.service"
+
+       fowners -R root:maubot /etc/maubot
+       fperms -R 770 /etc/maubot
+}

diff --git a/net-im/maubot/metadata.xml b/net-im/maubot/metadata.xml
new file mode 100644
index 000000000..62040c3fb
--- /dev/null
+++ b/net-im/maubot/metadata.xml
@@ -0,0 +1,19 @@
+<?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/maubot/maubot/releases</changelog>
+               <doc>https://docs.mau.fi/maubot/</doc>
+               <bugs-to>https://github.com/maubot/maubot/issues</bugs-to>
+               <remote-id type="github">maubot/maubot</remote-id>
+               <remote-id type="pypi">maubot</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to