summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b569a31e340b25a5cf87282a1a139232656e237b (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: Tyler Cook <tcc@sandpolis.com>
_module=com.sandpolis.client.lifegem
pkgdesc='Sandpolis desktop client'
pkgname=sandpolis-client-desktop
pkgver=7.0.0
pkgrel=1
url='https://github.com/sandpolis/sandpolis'
arch=('any')
license=('Mozilla Public License Version 2.0')
makedepends=('java-environment>=15' 'git')
depends=('java-runtime>=15')
provides=('sandpolis-client-desktop')
conflicts=('sandpolis-client-desktop')
source=("git+https://github.com/sandpolis/sandpolis.git#commit=a5de3be94f3d9a4b12344a7cebe9c06601900060" \
	"git+https://github.com/sandpolis/${_module}.git#commit=bad1066cc7fc4b34e6ac790afb010d97cf057e37")
sha512sums=('SKIP' 'SKIP')

prepare() {

	# Transplant submodule instead of initializing it
	cp -r "${srcdir}/${_module}" "${srcdir}/sandpolis"
}

pkgver() {
	cd "${srcdir}/sandpolis/${_module}"
	git describe --tags | tr -d 'v'
}

build() {
	cd "${srcdir}/sandpolis"
	./gradlew --no-daemon -g "${startdir}/.gradle" ":${_module}:assembleLib"
}

package() {

	# Setup directories
	install -d "${pkgdir}/usr/bin"
	install -d "${pkgdir}/usr/lib/systemd/system"
	install -d "${pkgdir}/usr/share/java/sandpolis-client-desktop/plugin"
	install -d "${pkgdir}/var/lib/sandpolis-client-desktop/data"
	install -d "${pkgdir}/var/log/sandpolis-client-desktop"

	# Install libraries
	cp -r "${srcdir}/sandpolis/${_module}/build/lib" \
		"${pkgdir}/usr/share/java/sandpolis-client-desktop"

	# Install invocation script
	cat <<-EOF >"${pkgdir}/usr/bin/sandpolis-client-desktop"
		#!/bin/sh
		exec /usr/bin/java \
		    -Dpath.data=/var/lib/sandpolis-client-desktop/data \
		    -Dpath.log=/var/log/sandpolis-client-desktop \
		    -Dpath.lib=/usr/share/java/sandpolis-client-desktop/lib \
		    --module-path /usr/share/java/sandpolis-client-desktop/lib \
		    -m ${_module}/${_module}.Main \
		"$@"
	EOF
	chmod 755 "${pkgdir}/usr/bin/sandpolis-client-desktop"
}