summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4e759485532a5aec2d3f46a2af778d09d40f9c6f (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
# Maintainer: Leon Möller <jkhsjdhjs at totally dot rip>
# Maintainer: noobping <hello (at) noobping _dot_ dev>
# Contributor: k8ieone <rostik.medved (at) gmail _dot_ com>
# Contributor: satcom886 <rostik.medved (at) gmail _dot_ com>
#
# PKGBUILD based on bobpaul's ${pkgname}-git package

pkgname=maubot
pkgver=0.5.0
pkgrel=1
pkgdesc="A plugin-based Matrix bot system"
arch=(any)
license=(AGPL3)
url="https://github.com/maubot/maubot"
depends=('sudo' 'python-sqlalchemy' 'python-aiohttp' 'python-aiosqlite' 'python-asyncpg' 'python-attrs' 'python-bcrypt' 'python-click' 'python-colorama' 'python-commonmark' 'python-jinja' 'python-mautrix' 'python-packaging' 'python-questionary' 'python-ruamel-yaml' 'python-yarl')
makedepends=('python-pre-commit' 'python-isort' 'python-black' 'yarn')
optdepends=(
  "python-olm: e2be"
  "python-pycryptodome: e2be"
  "python-unpaddedbase64: e2be"
)
backup=(etc/${pkgname}/config.yaml)
install=${pkgname}.install
source=("${pkgname}-${pkgver/_rc/-rc}.tar.gz"::"${url}/archive/v${pkgver/_rc/-rc}.tar.gz"
    "sysusers-${pkgname}.conf"
    "tmpfiles-${pkgname}.conf"
    "${pkgname}.service")
sha256sums=('ded83dbd446091da07d2f3668f9eaa8675763e4e4bade3ee0ba836ae73b92715'
            '1c28db3c74b2d634f97b25c3b117a5d8198dbb3c8afb1fa31a429ab3479334b7'
            '3fda190e5e5a2dff7c6192c27427a902c286069fac6b56e9abf61b021d49bf9a'
            '8dfbed8ad630cc5ab0e111a7e5da3245ddf82881a00ed6b540bfdcb7ece33083')

prepare() {
  cd "${pkgname}-${pkgver/_rc/-rc}"
  msg2 'Applying patch to permit use of newest mautrix version'
  sed -i -E "s/([0-9a-z_.-]+).=.*/\1/" requirements.txt optional-requirements.txt
  msg2 'Build static files for management frontend'
  cd "${pkgname}/management/frontend"
  yarn -s
  yarn build -s
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver/_rc/-rc}"
  python setup.py install --root="${pkgdir}/" --optimize=1
  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE

  cd "${pkgname}"
  install -dm700 ${pkgdir}/etc/${pkgname}
  install -Dm600 example-config.yaml ${pkgdir}/etc/${pkgname}/config.yaml
  install -Dm600 example-config.yaml ${pkgdir}/usr/share/${pkgname}/example-config.yaml

  cd "${srcdir}/"
  install -Dm644 ${pkgname}.service -t  ${pkgdir}/usr/lib/systemd/system/
  install -Dm644 sysusers-${pkgname}.conf ${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf
  install -Dm644 tmpfiles-${pkgname}.conf ${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf

  rm ${pkgdir}/usr/example-config.yaml
}