summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7016c786188d341813cb17a1907c3ce4e7119443 (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
# Maintainer: Amy Wilson <awils_1@xsmail.com>

pkgname=nxt-git
pkgver=r5.d6f635f
pkgrel=1
pkgdesc="The Nxt Reference Software Client for use with the Nxt Cryptocurrency"
arch=('any')
url="http://nxt.org"
license=('MIT' 'GPL' 'MPL' 'APACHE')
depends=('java-runtime-headless>=8' 'systemd')
makedepends=('git' 'java-environment>=8')
source=('git+https://bitbucket.org/Jelurida/nxt.git'
        'logging.properties'
        'nxt.properties'
        'nxt.sysusers'
        'nxt.tmpfiles'
        'nxt.service'
        'nxt.desktop'
        'nxt.sh')
backup=('etc/nxt/nxt.properties'
        'etc/nxt/logging.properties')
sha256sums=('SKIP'
            'f1cf03e66d8b7510f6a6eb5558dcc924bdb193f4dacc1710d4e0e7d199d85603'
            '0445ee64f13c5a1a02d08550abef008640329d9aea8303d1d57317d0dfd87135'
            'd73213fe300346c548e991af0797b23b3c608e803f741cd0ae89d3bb0549bfe3'
            '2f4775688213f0948364f1594162c12a6ec865501f7434847ce9bb7c73b11c59'
            '9c3ba3fff584e4baae3d9af88aa62418fd701094d2256e6e687300ce35b1f6f8'
            '9c5cd343af10ba63d024280e79453fa92a1c0864b47c77020eaa86fc316f5661'
            'c3beaaf62b9d499e023426d4206d8eb775d7dcf6f7b005b3bb34b12d64d9c1af')

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

build() {
  cd nxt

  mkdir classes
  shopt -s globstar
  javac -encoding utf8 -sourcepath src/java/nxt -classpath "lib/*:classes" -d classes src/java/nxt/**/*.java
  jar cf nxt.jar -C classes .
}

package() {
  cd nxt

  install -d "$pkgdir/usr/share/java/nxt"
  cp     -rt "$pkgdir/usr/share/java/nxt" nxt.jar lib conf addons
  rm     -rf "$pkgdir/usr/share/java/nxt/"{addons/src,conf/.gitignore}

  install -d "$pkgdir/usr/share/nxt"
  cp     -rt "$pkgdir/usr/share/nxt" ./html

  install -Dm644 -t "$pkgdir/etc/nxt" ../{nxt,logging}.properties

  # Service files
  install -Dm644 ../nxt.service  "$pkgdir/usr/lib/systemd/system/nxt.service"
  install -Dm644 ../nxt.sysusers "$pkgdir/usr/lib/sysusers.d/nxt.conf"
  install -Dm644 ../nxt.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/nxt.conf"

  # Desktop files
  install -Dm644 html/www/img/nxt_logo.png "${pkgdir}/usr/share/pixmaps/nxt.png"
  install -Dm644 ../nxt.desktop            "${pkgdir}/usr/share/applications/nxt.desktop"
  install -Dm755 ../nxt.sh                 "$pkgdir/usr/bin/nxt"

  # License files
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" ./{3RD-PARTY-LICENSES,LICENSE}.txt
}