summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 52a28b72dd5b4069657e9cde848a6d83b32fae63 (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
# Maintainer: Carlos Mogas da Silva <r3pek@r3pek.org>

pkgname=mxisd
pkgver=1.3.0
pkgrel=1
pkgdesc="Federated Matrix Identity Server Daemon"
arch=('any')
url="https://github.com/kamax-io/mxisd"
license=('AGPL3')
depends=('java-runtime>=8')
makedepends=('gradle' 'java-environment>=8')
source=("https://github.com/kamax-io/${pkgname}/archive/v${pkgver}.tar.gz"
        "mxisd"
        "mxisd.tmpfiles")
sha256sums=('bc596367bb01a0fa5056728976c5a668e86a9fb5fd9760f2697c2d7b80baafb1'
            'd8293f3f6ab2b53840a875cd8af035b7d15b3e2fcc643c3faa9000e6dd1fa449'
            'daee6519e67f65e8ec836f80b5853f669ba46e3378b6e29e34550bd136baf718')
install='mxisd.install'

prepare() {
    cd "$pkgname-$pkgver"

    sed -i -e "s|def v = gitVersion()|def v = \"${pkgver}\"|g" build.gradle
    sed -i -e "s|\${gitVersion()}|${pkgver}|g" build.gradle
}

build() {
    cd "$pkgname-$pkgver"
    JAVA_HOME="/usr/lib/jvm/java-8-openjdk/" ./gradlew build
}

package() {
    cd "$pkgname-$pkgver"

    # Binaries
    install -dm 755 "${pkgdir}"/usr/lib/mxisd
    install -dm 755 "${pkgdir}"/usr/bin
    install -m 644 build/libs/mxisd-${pkgver}.jar "${pkgdir}"/usr/lib/mxisd/mxisd.jar
    install -m 755 "${srcdir}"/mxisd "${pkgdir}"/usr/bin/mxisd

    # Configuration
    install -dm 755 "${pkgdir}"/etc/mxisd
    install -m 644 mxisd.example.yaml "${pkgdir}"/etc/mxisd/mxisd.example.yml

    # Systemd
    install -dm 755 "${pkgdir}"/usr/lib/{systemd/system,tmpfiles.d}
    install -m 644 src/systemd/mxisd.service "${pkgdir}"/usr/lib/systemd/system/mxisd.service
    install -m 644 "${srcdir}"/mxisd.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/mxisd.conf
}