diff options
| author | Bjoern Franke | 2022-02-09 15:01:54 +0100 |
|---|---|---|
| committer | Bjoern Franke | 2022-02-09 15:01:54 +0100 |
| commit | 6e62cd07e12fdeaea9a9cf1f608cc8c613a5ff2e (patch) | |
| tree | 8d0cc7af5e80d86aa1a4c9bd2170e7092d3832c3 | |
| download | packages-6e62cd07e12fdeaea9a9cf1f608cc8c613a5ff2e.tar.gz packages-6e62cd07e12fdeaea9a9cf1f608cc8c613a5ff2e.tar.bz2 packages-6e62cd07e12fdeaea9a9cf1f608cc8c613a5ff2e.zip | |
initial commit
| -rw-r--r-- | .SRCINFO | 27 | ||||
| -rw-r--r-- | PKGBUILD | 50 | ||||
| -rw-r--r-- | heisenbridge.install | 7 | ||||
| -rw-r--r-- | heisenbridge.service | 12 | ||||
| -rw-r--r-- | heisenbridge.sysusers | 1 | ||||
| -rw-r--r-- | heisenbridge.tmpfiles | 2 |
6 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..9096de5 --- /dev/null +++ b/.SRCINFO | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | pkgbase = heisenbridge | ||
| 2 | pkgdesc = a bouncer-style Matrix IRC bridge | ||
| 3 | pkgver = 1.10.1 | ||
| 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-irc | ||
| 13 | depends = python-ruamel-yaml | ||
| 14 | depends = python-aiohttp-socks | ||
| 15 | depends = python-mautrix>=0.14.0 | ||
| 16 | depends = python-mautrix<0.15 | ||
| 17 | backup = etc/heisenbridge/registration.yaml | ||
| 18 | source = heisenbridge-1.10.1.tar.gz::https://github.com/hifi/heisenbridge/archive/v1.10.1.tar.gz | ||
| 19 | source = heisenbridge.service | ||
| 20 | source = heisenbridge.sysusers | ||
| 21 | source = heisenbridge.tmpfiles | ||
| 22 | sha256sums = 94e262001ec71626c0bc0e3d711be4bc7ef024dc9fe4451012296ab1033e3b1c | ||
| 23 | sha256sums = 67487b221bff329952f5c95186c4ea794c7e7a3e25e6d213075fd306c68cfa95 | ||
| 24 | sha256sums = b3bc4328ead7afd186d5a191fabc347543c0fad17dc01047a4cf0532d999f255 | ||
| 25 | sha256sums = 24bd23e4427aaf635a91b170c07abe8a6b1c62cbad47e50a161c12807641d351 | ||
| 26 | |||
| 27 | pkgname = heisenbridge | ||
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..ff789e5 --- /dev/null +++ b/PKGBUILD | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | # Maintainer: Bjoern Franke <bjo+aur@schafweide.org> | ||
| 2 | pkgname=heisenbridge | ||
| 3 | pkgver=1.10.1 | ||
| 4 | pkgrel=1 | ||
| 5 | pkgdesc="a bouncer-style Matrix IRC bridge" | ||
| 6 | url="https://github.com/hifi/heisenbridge" | ||
| 7 | depends=('python' 'python-irc' 'python-ruamel-yaml' 'python-aiohttp-socks' | ||
| 8 | 'python-mautrix>=0.14.0' 'python-mautrix<0.15') | ||
| 9 | makedepends=('python-setuptools' 'python-pytest-runner') | ||
| 10 | license=('MIT') | ||
| 11 | arch=('any') | ||
| 12 | source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz" "${pkgname}.service" "${pkgname}.sysusers" "${pkgname}.tmpfiles") | ||
| 13 | sha256sums=('94e262001ec71626c0bc0e3d711be4bc7ef024dc9fe4451012296ab1033e3b1c' | ||
| 14 | '67487b221bff329952f5c95186c4ea794c7e7a3e25e6d213075fd306c68cfa95' | ||
| 15 | 'b3bc4328ead7afd186d5a191fabc347543c0fad17dc01047a4cf0532d999f255' | ||
| 16 | '24bd23e4427aaf635a91b170c07abe8a6b1c62cbad47e50a161c12807641d351') | ||
| 17 | backup=("etc/${pkgname}/registration.yaml") | ||
| 18 | install="${pkgname}.install" | ||
| 19 | _dirname="${pkgname}-${pkgver}" | ||
| 20 | |||
| 21 | |||
| 22 | prepare() { | ||
| 23 | cd "${srcdir}/${_dirname}" | ||
| 24 | # create an empty registration file so that permissions get written properly from the get go | ||
| 25 | # this way secret keys are never world readable | ||
| 26 | # touch registration.yaml | ||
| 27 | } | ||
| 28 | |||
| 29 | build() { | ||
| 30 | cd "${srcdir}/${_dirname}" | ||
| 31 | python setup.py build | ||
| 32 | } | ||
| 33 | |||
| 34 | package() { | ||
| 35 | cd "${srcdir}/${_dirname}" | ||
| 36 | |||
| 37 | _shared_dir="/usr/share/${pkgname}" | ||
| 38 | |||
| 39 | python setup.py install --optimize=1 --skip-build --root="${pkgdir}/" --prefix="/usr" --install-data="${_shared_dir}" | ||
| 40 | |||
| 41 | # it's a semi-common failure for python packages to install tests in the main dir | ||
| 42 | # which would make them conflict eachother | ||
| 43 | rm -rf "${pkgdir}$(python -c 'import site; print(site.getsitepackages()[0])')/tests" | ||
| 44 | |||
| 45 | install -Dvm 644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" | ||
| 46 | install -Dvm 644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" | ||
| 47 | install -Dvm 644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" | ||
| 48 | |||
| 49 | install -Dvm 640 registration.yaml "${pkgdir}/etc/${pkgname}/registration.yaml" | ||
| 50 | } | ||
diff --git a/heisenbridge.install b/heisenbridge.install new file mode 100644 index 0000000..10184df --- /dev/null +++ b/heisenbridge.install | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | post_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.service b/heisenbridge.service new file mode 100644 index 0000000..e40dcf9 --- /dev/null +++ b/heisenbridge.service | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=a bouncer-style Matrix IRC bridge | ||
| 3 | |||
| 4 | [Service] | ||
| 5 | ExecStart=python -m heisenbridge -c /etc/heisenbridge/registration.yaml | ||
| 6 | Restart=on-failure | ||
| 7 | User=heisenbridge | ||
| 8 | WorkingDirectory=~ | ||
| 9 | |||
| 10 | |||
| 11 | [Install] | ||
| 12 | WantedBy=multi-user.target | ||
diff --git a/heisenbridge.sysusers b/heisenbridge.sysusers new file mode 100644 index 0000000..47fc57c --- /dev/null +++ b/heisenbridge.sysusers | |||
| @@ -0,0 +1 @@ | |||
| u heisenbridge - "Matrix IRC bridge" /var/lib/heisenbridge | |||
diff --git a/heisenbridge.tmpfiles b/heisenbridge.tmpfiles new file mode 100644 index 0000000..94db647 --- /dev/null +++ b/heisenbridge.tmpfiles | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | z /etc/heisenbridge/* 640 heisenbridge heisenbridge | ||
| 2 | d /var/lib/heisenbridge/ 700 heisenbridge heisenbridge | ||
