summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 29d20c7bba3ccf2ef1a982cd3911848c04075ca6 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Maintainer: Tyler Cook <tcc@sandpolis.com>
pkgbase=sandpolis-git
pkgname=('sandpolis-server-git' 'sandpolis-viewer-git' 'sandpolis-viewer-cli-git')
pkgver=r750.4a370c73
pkgrel=1
pkgdesc='Ultimate remote management utility'
arch=('any')
url='https://github.com/Subterranean-Security/Sandpolis'
license=('Apache 2')
depends=('java-runtime>=13')
makedepends=('java-environment>=13' 'git')
source=("git+https://github.com/Subterranean-Security/Sandpolis.git")
sha512sums=('SKIP')

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

build() {
  cd "$srcdir/Sandpolis"
  ./gradlew --no-daemon -g "$startdir/.gradle" jar
}

check() {
  cd "$srcdir/Sandpolis"
  ./gradlew --no-daemon -g "$startdir/.gradle" test
}

package_sandpolis-server-git() {
  conflicts=('sandpolis-server')
  provides=('sandpolis-server')
  install=sandpolis-server.install

  cd "$srcdir/Sandpolis"

  # Install libraries
  ./gradlew --no-daemon -q -g "$startdir/.gradle" \
      -Dlib_dest="$pkgdir/usr/share/java/sandpolis-server/lib" :com.sandpolis.server.vanilla:install

  # Install scripts
  install -m755 -D "$startdir/sandpolis-server.sh" "$pkgdir/usr/bin/sandpolis-server"

  # Setup database directory
  install -d "$pkgdir/var/lib/sandpolis-server/db"

  # Setup gen directory
  install -d "$pkgdir/var/lib/sandpolis-server/gen"

  # Setup log directory
  install -d "$pkgdir/var/log/sandpolis-server"

  # Setup plugin directory
  install -d "$pkgdir/usr/share/java/sandpolis-server/plugin"

  # Install systemd unit
  install -m644 -D "$startdir/sandpolis-server.service" "$pkgdir/usr/lib/systemd/system/sandpolisd.service"
}

package_sandpolis-viewer-git() {
  conflicts=('sandpolis-viewer')
  provides=('sandpolis-viewer')

  cd "$srcdir/Sandpolis"

  # Install libraries
  ./gradlew --no-daemon -q -g "$startdir/.gradle" \
      -Dlib_dest="$pkgdir/usr/share/java/sandpolis-viewer/lib" :com.sandpolis.viewer.jfx:install

  # Install scripts
  install -m755 -D "$startdir/sandpolis-viewer.sh" "$pkgdir/usr/bin/sandpolis-viewer"

  # Setup log directory
  install -d "$pkgdir/var/log/sandpolis-viewer"

  # Setup plugin directory
  install -d "$pkgdir/usr/share/java/sandpolis-viewer/plugin"
}

package_sandpolis-viewer-cli-git() {
  conflicts=('sandpolis-viewer-cli')
  provides=('sandpolis-viewer-cli')

  cd "$srcdir/Sandpolis"

  # Install libraries
  ./gradlew --no-daemon -q -g "$startdir/.gradle" \
      -Dlib_dest="$pkgdir/usr/share/java/sandpolis-viewer-cli/lib" :com.sandpolis.viewer.cli:install

  # Install scripts
  install -m755 -D "$startdir/sandpolis-viewer-cli.sh" "$pkgdir/usr/bin/sandpolis-viewer-cli"

  # Setup log directory
  install -d "$pkgdir/var/log/sandpolis-viewer-cli"

  # Setup plugin directory
  install -d "$pkgdir/usr/share/java/sandpolis-viewer-cli/plugin"
}