summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c25203b6777599bbe887e4e04ae644ff697cf44e (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
66
67
68
69
70
71
# Maintainer: Ivan Shapovalov <intelfx100@gmail.com>

pkgname=matrix-synapse-git
pkgver=0.17.0.r5.g27771b2
pkgrel=1
pkgdesc="Matrix reference homeserver"
license=('Apache')
arch=('any')
url="https://github.com/matrix-org/synapse"
depends=('python2-matrix-angular-sdk-git'
         'python2-twisted>=15.1.0' 'python2-service-identity'
         'python2-pyopenssl' 'python2-yaml' 'python2-pyasn1' 'python2-pynacl'
         'python2-daemonize' 'python2-py-bcrypt' 'python2-frozendict'
         'python2-pillow' 'python2-pydenticon' 'python2-ujson' 'python2-blist'
         'python2-pysaml2' 'python2-setuptools'
         'python2-systemd' 'python2-unpaddedbase64' 'python2-canonicaljson'
         'python2-signedjson' 'python2-pymacaroons-pynacl' 'python2-netaddr'
         'python2-service-identity')
makedepends=('python2-twisted' 'python2-mock' 'python2-setuptools_trial' 'git')
optdepends=('python2-psycopg2: PostgreSQL support (instead of built-in SQLite)'
            'python2-matrix-angular-sdk-git: built-in web client (UNMAINTAINED)'
            'python2-netaddr: URL previewing'
            'python2-jinja: e-mail notifications'
            'python2-bleach: e-mail notifications'
            'python2-ldap3: LDAP support'
            'python2-psutil: metrics')
source=("git://github.com/matrix-org/synapse.git#branch=develop"
        'sysusers-synapse.conf'
        'deps-relax-checks.patch')
md5sums=('SKIP'
         'dfbffdd307c5559357a2ff51a1906700'
         '6a088fd21cdaa4b93b1eee67a5cc0090')
backup=('etc/synapse/log_config.yaml')
install='synapse.install'
provides=('matrix-synapse')
conflicts=('matrix-synapse')

pkgver() {
	cd synapse
	git describe --long | sed 's/^v//;s/-rc/rc/;s/-r/./;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd synapse
	git apply -3 "$srcdir/deps-relax-checks.patch"
}

build() {
	cd synapse
	python2 setup.py build 
}

package() {
	cd synapse
	python2 setup.py install --root "${pkgdir}" --optimize=1 --skip-build

	for file in "$pkgdir/usr/lib/python2.7/site-packages/synapse"/{app,push}/*.py; do
		sed -re 's|env python$|&2.7|' -i "$file"
	done

	install -Dm644 "contrib/systemd/log_config.yaml" \
		"$pkgdir/etc/synapse/log_config.yaml"

	install -Dm644 "contrib/systemd/synapse.service" \
		"$pkgdir/usr/lib/systemd/system/synapse.service"

	install -Dm644 "$srcdir/sysusers-synapse.conf" \
		"$pkgdir/usr/lib/sysusers.d/synapse.conf"
}

# vim: set ts=4 sw=4 tw=0 ft=sh :