summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b7963836729f9fce5b8effc8bcc17ba4eaa5e444 (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
# Maintainer: Jonathan Knapp <jaknapp8+aur@gmail.com>
# URL: https://gitlab.com/thann/pingg
# Upstream: https://gitlab.com/thann/pingg

pkgname=pingg-git
pkgver=0.0.12.1.g22a7f0b
pkgrel=1
pkgdesc='Ping latency graphical CLI.'
arch=('any')
url='http://gitlab.com/thann/pingg/'
license=('UNLICENSE')
depends=('nodejs' 'traceroute')
makedepends=('git' 'npm' 'python2' 'gcc')
provides=('pingg')
conflicts=('pingg')
source=("$pkgname::git+https://gitlab.com/thann/pingg.git")
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/./g'
}

package() {
  cd "$pkgname"
  #npm install -g --prefix "$pkgdir"/usr --user root --unsafe-perm
  ## NOTE: npm broke both the --prefix and --root arguments =/
  npm install --production

  # copy files
  find * -exec install -D -m644 "{}" "$pkgdir/usr/lib/node_modules/pingg/{}" \;
  chmod +x "$pkgdir/usr/lib/node_modules/pingg/pingg"
  mkdir "$pkgdir/usr/bin/"
  ln -st "$pkgdir/usr/bin/" "/usr/lib/node_modules/pingg/pingg"

  # install desktop file and icon
  install -D -m644 thann.pingg.desktop "$pkgdir/usr/share/applications/thann.pingg.desktop"
  install -D -m644 icon.pingg.png "$pkgdir/usr/share/pixmaps/icon.pingg.png"

  # install license link
  mkdir -p "$pkgdir/usr/share/licenses/$pkgname/"
  ln -st "$pkgdir/usr/share/licenses/$pkgname/" "/usr/lib/node_modules/pingg/LICENSE"

  #HACK: remove references to $srcdir & $pkgdir (if you care)
  # npm install -g removeNPMAbsolutePaths --prefix "$pkgdir"/usr
  # "$pkgdir"/usr/bin/removeNPMAbsolutePaths "$pkgdir"/usr
  # npm uninstall -g removeNPMAbsolutePaths --prefix "$pkgdir"/usr
}