From 04c81fa600e64d672b9f28f727a38089161dcfce Mon Sep 17 00:00:00 2001 From: Julien Roy Date: Thu, 25 May 2023 08:59:19 -0400 Subject: [PATCH] net-im/mautrix-discord: add 0.4.0 Signed-off-by: Julien Roy --- net-im/mautrix-discord/Manifest | 2 + .../mautrix-discord-0.4.0.ebuild | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 net-im/mautrix-discord/mautrix-discord-0.4.0.ebuild diff --git a/net-im/mautrix-discord/Manifest b/net-im/mautrix-discord/Manifest index dbb55164df..bb126931e6 100644 --- a/net-im/mautrix-discord/Manifest +++ b/net-im/mautrix-discord/Manifest @@ -1,2 +1,4 @@ DIST mautrix-discord-0.3.0.gh.tar.gz 102756 BLAKE2B 20e239b45087a3daa75c3ee1420df348a861d79595c86490c404e42ce6382b5be876e4ba215f9ceaa6b756d73741f05e6ed0ce8af9c43014a8dc6676251bece6 SHA512 5a5033f505f78977d078ed66a4cfab6141b3aaa4a3f16f64463f89508ec717162018d4a5cc1b4b207529e8b06bb70f8a26a77001830551b69c7bd587e8f759ca DIST mautrix-discord-0.3.0.tar.xz 63734228 BLAKE2B 6e7eb00fa3802d4142e66637c3a11f233e3981be6799009c12351c421df4e1a3129a014afd0bbc1b39f006d110c4706c19599ab5a8e0bddfbefc659bfee285b5 SHA512 2dceaf0798e6efbd3d30506b55c2fc4232148950b1505003b9c5827a78cb6ee4b000ba5715ea4801dffbf9d469e4573b46e8f5825646290c3774fadeac0dacc8 +DIST mautrix-discord-0.4.0.gh.tar.gz 109060 BLAKE2B 3232e639824845386491a323b06fbe4c4ff8ae80d22bce77b8c68adf17339cb2f1819e54a8a36e2dd896aa6b373d4cf756af2515b555ed33f19503e16e634964 SHA512 0e3ab86414e7b43ca399bffadfd3f8840baff98e296a9e399eacb0ba63b3a5f149c3cc6efbc6a064281921734d8d490d10fd4d85ce90f80a6d7a3ead06bdae6e +DIST mautrix-discord-0.4.0.tar.xz 61069068 BLAKE2B ad2b14937d30e20d003887c15cae0b6b6ee547ed3220a5f442bf2b20346b66cb0b622010f1a0cf645844524a980146bb713b376889af78133e490ecac8933dcf SHA512 53336a492abff8472f5a0a5987831c93f09045a50dc06a74ec53e7a3f2fe7359d08c811c4f93cdf718f24b2c7fb5f90f807405efcc68b287dc7d7f51ce0e8e10 diff --git a/net-im/mautrix-discord/mautrix-discord-0.4.0.ebuild b/net-im/mautrix-discord/mautrix-discord-0.4.0.ebuild new file mode 100644 index 0000000000..b1edd45144 --- /dev/null +++ b/net-im/mautrix-discord/mautrix-discord-0.4.0.ebuild @@ -0,0 +1,63 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +DESCRIPTION="A Matrix-Discord puppeting bridge" +HOMEPAGE="https://github.com/mautrix/discord" +SRC_URI="https://github.com/mautrix/discord/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz + https://jroy.ca/dist/${P}.tar.xz +" +S="${WORKDIR}/discord-${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-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" +}