From 4451d0f190321c26d65591caa7728174d2bc8869 Mon Sep 17 00:00:00 2001 From: Julien Roy Date: Wed, 25 Jan 2023 23:59:58 -0500 Subject: net-im/mautrix-discord: new package, add 0_pre20230124 Signed-off-by: Julien Roy --- net-im/mautrix-discord/Manifest | 2 + net-im/mautrix-discord/files/mautrix-slack.initd | 25 +++++++++ net-im/mautrix-discord/files/mautrix-slack.service | 12 ++++ .../mautrix-discord-0_pre20230124.ebuild | 64 ++++++++++++++++++++++ net-im/mautrix-discord/metadata.xml | 18 ++++++ 5 files changed, 121 insertions(+) create mode 100644 net-im/mautrix-discord/Manifest create mode 100644 net-im/mautrix-discord/files/mautrix-slack.initd create mode 100644 net-im/mautrix-discord/files/mautrix-slack.service create mode 100644 net-im/mautrix-discord/mautrix-discord-0_pre20230124.ebuild create mode 100644 net-im/mautrix-discord/metadata.xml (limited to 'net-im/mautrix-discord') diff --git a/net-im/mautrix-discord/Manifest b/net-im/mautrix-discord/Manifest new file mode 100644 index 0000000..5d16a5f --- /dev/null +++ b/net-im/mautrix-discord/Manifest @@ -0,0 +1,2 @@ +DIST mautrix-discord-0_pre20230124.gh.tar.gz 78169 BLAKE2B e914f39d4eac89f305f0b161dc77da8dd30c84de83bbecb8578ddf210f82a0db5a7b83436bd819235fa9aa4b3efdb7f5ba41c289f2d0032e362ef2203574735b SHA512 5ef25078aa202215dc24429736afe4b5ca6408ecb4e35b7d5df72c14374e6714827bd273fcfc4897836599bbfc62fbe73cfa25a1a1c5bd342370e6fb9f43b0c1 +DIST mautrix-discord-0_pre20230124.tar.xz 14405308 BLAKE2B 1c691ed99c5d18de004bdf50fbf8962c94598f0b49c9e137dec08243645ee9b42d9c654c9d573b26781e2e98647ad03f1acb4fc711df0590449600cc6812fd2e SHA512 d492d26c436f00129a0e37d2ece013f6b8a57a537b04d5bb26c4d0881cc70050d9a36241ef265591e1b051e055ef44518cb12223bd3f8d2fce826b776bedd1bf diff --git a/net-im/mautrix-discord/files/mautrix-slack.initd b/net-im/mautrix-discord/files/mautrix-slack.initd new file mode 100644 index 0000000..18c6b06 --- /dev/null +++ b/net-im/mautrix-discord/files/mautrix-slack.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="mautrix-discord daemon" +description="A Matrix-Discord puppeting bridge" +module="mautrix_discord" + +pidfile="/run/${RC_SVCNAME}.pid" +command="/usr/bin/mautrix-discord" +command_args="-c /etc/mautrix/${module}.yaml -r /var/lib/mautrix/discord/registration.yaml" +command_background=true +command_user="mautrix-discord:mautrix" + +output_log="/var/log/mautrix/discord/daemon.log" +error_log="/var/log/mautrix/discord/daemon.log" + +depend() { + need net +} + +start_pre() { + checkpath -d -m 0755 -o "$command_user" /var/lib/mautrix/discord + checkpath -f -m 0644 -o "$command_user" "$output_log" +} diff --git a/net-im/mautrix-discord/files/mautrix-slack.service b/net-im/mautrix-discord/files/mautrix-slack.service new file mode 100644 index 0000000..a9ed892 --- /dev/null +++ b/net-im/mautrix-discord/files/mautrix-slack.service @@ -0,0 +1,12 @@ +[Unit] +Description=A Matrix-Discord puppeting bridge +After=network.target + +[Service] +User=mautrix-discord +Group=mautrix +Restart=always +ExecStart=/usr/bin/mautrix-discord -c /etc/mautrix/mautrix_discord.yaml -r /var/lib/mautrix/discord/registration.yaml + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/net-im/mautrix-discord/mautrix-discord-0_pre20230124.ebuild b/net-im/mautrix-discord/mautrix-discord-0_pre20230124.ebuild new file mode 100644 index 0000000..c8b8810 --- /dev/null +++ b/net-im/mautrix-discord/mautrix-discord-0_pre20230124.ebuild @@ -0,0 +1,64 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +COMMIT="587cf8a17ed20285d0be23e7838e8cd6d53ec483" +DESCRIPTION="A Matrix-Discord puppeting bridge" +HOMEPAGE="https://github.com/mautrix/discord" +SRC_URI="https://github.com/mautrix/discord/archive/${COMMIT}.tar.gz -> ${P}.gh.tar.gz + https://jroy.ca/dist/${P}.tar.xz +" +S="${WORKDIR}/discord-${COMMIT}" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + acct-user/${PN} + dev-libs/olm +" +DEPEND="${RDEPEND}" + +src_compile() { + ego build +} + +src_install() { + dobin mautrix-discord + + keepdir /var/log/mautrix/discord + 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-discord/metadata.xml b/net-im/mautrix-discord/metadata.xml new file mode 100644 index 0000000..88c9bcc --- /dev/null +++ b/net-im/mautrix-discord/metadata.xml @@ -0,0 +1,18 @@ + + + + + julien@jroy.ca + Julien Roy + + + + Tulir Asokan + tulir@maunium.net + + https://github.com/mautrix/slack/releases + https://docs.mau.fi/bridges/go/slack/index.html + https://github.com/mautrix/slack/issues + mautrix/slack + + -- cgit v1.2.3