summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b773535a0f4dae06fdccc2c4e5de19b1a842dd19 (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
61
62
63
64
65
# Maintainer: bobpaul

_pkgbase=mautrix-hangouts
pkgname=${_pkgbase}-git
pkgver=r61.9f5d965
pkgrel=4
pkgdesc="A Matrix-Hangouts puppeting bridge with multi-user support"
arch=(any)
conflicts=(mautrix-hangouts)
license=(AGPLv3)
url=https://github.com/tulir/mautrix-hangouts
depends=(python
	     python-aiohttp
	     python-alembic
	     python-sqlalchemy
	     python-commonmark
	     python-ruamel-yaml
	     python-mautrix
	     python-magic-git
	     hangups
	     sudo
	    )
makedepends=(git)
optdepends=()
source=("${_pkgbase}::git+https://github.com/tulir/${_pkgbase}"
	    "usr-share.patch"
	    "README"
	    "mautrix-hangouts-db-upgrade"
	    "sysusers-mautrix-hangouts.conf"
	    "tmpfiles-mautrix-hangouts.conf"
	    "${_pkgbase}.service")
sha256sums=('SKIP'
            'ab5f4cb4d1f8d4c2199dd3f1499712abeed26ac65f3696dec9fb3ed5108da300'
            '797083657b11728c7e711182f6d161871fc2fcae02ee5e651d7082a5c34625bd'
            '918d04d07223c83324e18f44fc181abaadc49b747de76a9bcfd48e6bdda6bd05'
            '36aee765d66afa89778962432660ff49f711bf6982758e0c572d760568555758'
            'e078d74a16e9cbf8b7f6426274256e72f84ab34ed29c240cce3249985fb566da'
            '6029e541b610e8fe05463749a9f44490d796e0ccf752ccedbaa6d6430672ca64')

pkgver() {
  cd "$srcdir/${_pkgbase}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/${_pkgbase}"
  git reset --hard
  echo 'Apply patch to follow fileplacement guidelines per `man heir`'
  patch < ../usr-share.patch
  echo 'Applying patch to permit use of newest mautrix version'
  sed -i 's/^mautrix==/mautrix>=/' requirements.txt
}

package() {
  cd "$srcdir/${_pkgbase}"
  python setup.py install --root="$pkgdir/" --optimize=1
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  cd "$srcdir/"
  install -Dm644 "$srcdir"/README -t "$pkgdir"/etc/synapse/mautrix-hangouts/
  install -Dm755 "$srcdir"/mautrix-hangouts-db-upgrade -t "$pkgdir"/usr/bin/
  install -Dm644 ${_pkgbase}.service -t  "${pkgdir}"/usr/lib/systemd/system/
  install -Dm644 "$srcdir"/sysusers-mautrix-hangouts.conf "$pkgdir"/usr/lib/sysusers.d/mautrix-hangouts.conf
  install -Dm644 "$srcdir"/tmpfiles-mautrix-hangouts.conf "$pkgdir"/usr/lib/tmpfiles.d/mautrix-hangouts.conf
}