aboutsummaryrefslogtreecommitdiff
path: root/net-im/heisenbridge/heisenbridge-1.14.1.ebuild
blob: bb9f595c5524d55eed31c08253d4abea0b520438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..10} )

inherit distutils-r1 systemd

DESCRIPTION="A bouncer-style Matrix IRC bridge"
HOMEPAGE="https://github.com/hifi/heisenbridge/"
SRC_URI="https://github.com/hifi/heisenbridge/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"

RDEPEND="
	acct-user/${PN}
	dev-python/irc[${PYTHON_USEDEP}]
	dev-python/mautrix[${PYTHON_USEDEP}]
	dev-python/python-socks[${PYTHON_USEDEP}]
	dev-python/ruamel-yaml[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}/heisenbridge-1.14.1-qanotice.patch"
)

distutils_enable_tests pytest

src_install() {
	distutils-r1_src_install

	newinitd "${FILESDIR}/heisenbridge.initd" "${PN}"
	newconfd "${FILESDIR}/heisenbridge.confd" "${PN}"
	systemd_dounit "${FILESDIR}/${PN}.service"
}

pkg_postinst() {
	einfo
	elog "Before you can use ${PN}, you must configure it correctly"
	elog "The configuration file is located at \"/etc/conf.d/${PN}"
	elog "Then, you must generate the registration file using the following command"
	elog "If you are using synapse:"
	elog "/usr/bin/python -m ${PN} -c /var/lib/${PN}/registration.yaml --generate https://example.com"
	elog "If you are using Dendrite, Conduit or others:"
	elog "/usr/bin/python -m ${PN} -c /var/lib/${PN}/registration.yaml --generate-compat https://example.com"
	elog "Notice the URL at the end, replace it with your homeserver's URL"
	elog "Then, you must register the bridge with your homeserver"
	elog "Refer to your homeserver's documentation for instruction"
	elog "The registration file is located at /var/lib/${PN}/registration.yaml"
	elog "Finally, you may start the ${PN} daemon"
	einfo

}