summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5d74a1f72a49f9bea81e5a80e4cef017a0ecc677 (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
# Maintainer: William Gathoye <william + aur at gathoye dot be>
# Contributor: Janne Heß <jannehess@gmail.com>

pkgname=mattermost-push-proxy
pkgver=5.9.0
pkgrel=1
pkgdesc='Mattermost Push Notifications Service'
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://github.com/mattermost/mattermost-push-proxy.git"
license=("Apache")

makedepends=('go-pie' 'git')
provides=("${pkgname}")
conflicts=("${pkgname}-git")
backup=('etc/mattermost-push-proxy/config.json')

source=(
    "https://github.com/mattermost/${pkgname}/archive/v${pkgver}.tar.gz"
    "${pkgname}.service"
    'mattermost-ldflags.patch'
)
sha512sums=(
    '0ed61fc1aef2a7ccc2d0df78cb0fedf6367834bf4ab05619d51c47803936a83cab6ca2c1cb0b1458aa768780cbb36d2377e31715a169f77acf32a531c7a3a79a'
    '6d646673f10d2e291d37bbfa53c0314f076922bf76ceadcecad8febb7ac377fedc1bbbc82d118e161ad662e1f363fb5ca0b3750a0601eedf56bdb9c5e084ede4'
    '0a6311b07df33cb5bed1d9e9a442e62fa75136e36a8a6100388151f39017c6457bbc62cb80a36ceb284c4ef8916efe230f81ea0a81d21001ad212469d3f77f22'
)
install="${pkgname}.install"

prepare() {
    cd "${srcdir}"
    mkdir -p src/github.com/mattermost
    cd src/github.com/mattermost
    ln -s "${srcdir}/mattermost-push-proxy-${pkgver}" "${pkgname}"
    cd "${pkgname}"

    # Testing the code with shadow breaks with Go 1.13, remove the test for now.
    # src.: https://github.com/mattermost/mattermost-server/issues/12202
    sed -r -iV Makefile \
        -e "/[$]\(GOPATH\)\/bin\/shadow/d"

    # Pass Arch Linux's Go compilation flags to Mattermost in order to take
    # into account advanced features like PIE.
    patch < "${srcdir}"/mattermost-ldflags.patch
}

build() {
    cd "${srcdir}/src/github.com/mattermost/${pkgname}"
    GOPATH="${srcdir}" make build-server
}

package() {
    install -Dm755 "${srcdir}/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
    install -Dm644 "${srcdir}/src/github.com/mattermost/${pkgname}/config/${pkgname}.json" \
        "${pkgdir}/etc/${pkgname}/config.json"
    install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
}