summaryrefslogtreecommitdiffstats
path: root/heisenbridge
diff options
context:
space:
mode:
Diffstat (limited to 'heisenbridge')
-rw-r--r--heisenbridge/.SRCINFO27
-rw-r--r--heisenbridge/PKGBUILD56
-rw-r--r--heisenbridge/heisenbridge.install7
-rw-r--r--heisenbridge/heisenbridge.service12
-rw-r--r--heisenbridge/heisenbridge.sysusers1
-rw-r--r--heisenbridge/heisenbridge.tmpfiles2
6 files changed, 105 insertions, 0 deletions
diff --git a/heisenbridge/.SRCINFO b/heisenbridge/.SRCINFO
new file mode 100644
index 0000000..3ebbeef
--- /dev/null
+++ b/heisenbridge/.SRCINFO
@@ -0,0 +1,27 @@
1pkgbase = heisenbridge
2 pkgdesc = a bouncer-style Matrix IRC bridge
3 pkgver = 1.15.0
4 pkgrel = 1
5 url = https://github.com/hifi/heisenbridge
6 install = heisenbridge.install
7 arch = any
8 license = MIT
9 makedepends = python-setuptools
10 makedepends = python-pytest-runner
11 depends = python
12 depends = python-aiohttp-socks
13 depends = python-async-timeout
14 depends = python-irc
15 depends = python-mautrix
16 depends = python-ruamel-yaml
17 backup = etc/heisenbridge/registration.yaml
18 source = heisenbridge-1.15.0.tar.gz::https://github.com/hifi/heisenbridge/archive/v1.15.0.tar.gz
19 source = heisenbridge.service
20 source = heisenbridge.sysusers
21 source = heisenbridge.tmpfiles
22 sha256sums = 29cfd803450ee7ca3aa2c20feb36e010a1499e6153f01819519b11760b883d0d
23 sha256sums = 67487b221bff329952f5c95186c4ea794c7e7a3e25e6d213075fd306c68cfa95
24 sha256sums = b3bc4328ead7afd186d5a191fabc347543c0fad17dc01047a4cf0532d999f255
25 sha256sums = 24bd23e4427aaf635a91b170c07abe8a6b1c62cbad47e50a161c12807641d351
26
27pkgname = heisenbridge
diff --git a/heisenbridge/PKGBUILD b/heisenbridge/PKGBUILD
new file mode 100644
index 0000000..d9e0bb6
--- /dev/null
+++ b/heisenbridge/PKGBUILD
@@ -0,0 +1,56 @@
1# Maintainer: Yigit Sever <yigit at yigitsever dot com>
2# Contributor: Bjoern Franke <[email protected]>
3
4pkgname=heisenbridge
5pkgver=1.15.0
6pkgrel=1
7pkgdesc="a bouncer-style Matrix IRC bridge"
8url="https://github.com/hifi/heisenbridge"
9depends=('python'
10 'python-aiohttp-socks'
11 'python-async-timeout'
12 'python-irc'
13 'python-mautrix'
14 'python-ruamel-yaml')
15makedepends=('python-setuptools' 'python-pytest-runner')
16license=('MIT')
17arch=('any')
18source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz" "${pkgname}.service" "${pkgname}.sysusers" "${pkgname}.tmpfiles")
19sha256sums=('29cfd803450ee7ca3aa2c20feb36e010a1499e6153f01819519b11760b883d0d'
20 '67487b221bff329952f5c95186c4ea794c7e7a3e25e6d213075fd306c68cfa95'
21 'b3bc4328ead7afd186d5a191fabc347543c0fad17dc01047a4cf0532d999f255'
22 '24bd23e4427aaf635a91b170c07abe8a6b1c62cbad47e50a161c12807641d351')
23backup=("etc/${pkgname}/registration.yaml")
24install="${pkgname}.install"
25_dirname="${pkgname}-${pkgver}"
26
27prepare() {
28 cd "${srcdir}/${_dirname}"
29 # create an empty registration file so that permissions get written
30 # properly from the get go. this way secret keys are never world
31 # readable
32 touch registration.yaml
33}
34
35build() {
36 cd "${srcdir}/${_dirname}"
37 python setup.py build
38}
39
40package() {
41 cd "${srcdir}/${_dirname}"
42
43 _shared_dir="/usr/share/${pkgname}"
44
45 python setup.py install --optimize=1 --skip-build --root="${pkgdir}/" --prefix="/usr" --install-data="${_shared_dir}"
46
47 # it's a semi-common failure for python packages to install tests in
48 # the main dir which would make them conflict eachother
49 rm -rf "${pkgdir}$(python -c 'import site; print(site.getsitepackages()[0])')/tests"
50
51 install -Dvm 644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
52 install -Dvm 644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
53 install -Dvm 644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
54
55 install -Dvm 640 registration.yaml "${pkgdir}/etc/${pkgname}/registration.yaml"
56}
diff --git a/heisenbridge/heisenbridge.install b/heisenbridge/heisenbridge.install
new file mode 100644
index 0000000..10184df
--- /dev/null
+++ b/heisenbridge/heisenbridge.install
@@ -0,0 +1,7 @@
1post_install() {
2 cat <<- 'EOF'
3 You may adjust the homeserver via
4 # systemctl edit heisenbridge.service
5 if you don't use localhost:8008 as your homeserver URL
6 EOF
7}
diff --git a/heisenbridge/heisenbridge.service b/heisenbridge/heisenbridge.service
new file mode 100644
index 0000000..e40dcf9
--- /dev/null
+++ b/heisenbridge/heisenbridge.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=a bouncer-style Matrix IRC bridge
3
4[Service]
5ExecStart=python -m heisenbridge -c /etc/heisenbridge/registration.yaml
6Restart=on-failure
7User=heisenbridge
8WorkingDirectory=~
9
10
11[Install]
12WantedBy=multi-user.target
diff --git a/heisenbridge/heisenbridge.sysusers b/heisenbridge/heisenbridge.sysusers
new file mode 100644
index 0000000..47fc57c
--- /dev/null
+++ b/heisenbridge/heisenbridge.sysusers
@@ -0,0 +1 @@
u heisenbridge - "Matrix IRC bridge" /var/lib/heisenbridge
diff --git a/heisenbridge/heisenbridge.tmpfiles b/heisenbridge/heisenbridge.tmpfiles
new file mode 100644
index 0000000..94db647
--- /dev/null
+++ b/heisenbridge/heisenbridge.tmpfiles
@@ -0,0 +1,2 @@
1z /etc/heisenbridge/* 640 heisenbridge heisenbridge
2d /var/lib/heisenbridge/ 700 heisenbridge heisenbridge