summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1e62dc3f2889322d87d76ad7a5ff905156fcf604 (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
# Maintainer: redfish <redfish@galactica.pw>

pkgname=dat-gateway-git
_name=${pkgname%%-git}
pkgver=2.3.1beta.g6350ed7
pkgrel=1
pkgdesc="In-memory Dat to HTTP gateway"
arch=(any)
url="https://github.com/garbados/dat-gateway"
license=('Apache-2.0')
depends=('nodejs' 'npm')
conflicts=("$_name")
provides=("$_name")
install="$_name.install"
source=(git+https://github.com/garbados/dat-gateway.git
	dat-gateway.service)

# There are some native binaries being built, but .node files confuse strip, so
# don't bother stripping anything.
options=(!strip)

pkgver() {
  cd "$_name"
  printf "%s.g%s" \
  	$(cat package.json | sed -n 's/.*"version":\s* "\([^"]\+\)".*/\1/p' | sed 's/-//g') \
  	$(git rev-parse --short HEAD)
}

package(){
  npm install --user root --prefix "${pkgdir}/usr" -g $(npm pack ${srcdir}/$_name | tail -1)
  find ${pkgdir} -type d -exec chmod 0755  {} \; # npm creates 777 dirs, causes warnings
  install -Dm0644 $_name.service ${pkgdir}/usr/lib/systemd/system/$_name.service
}

sha256sums=('SKIP'
            '3bc2048a9dcf89e935c276615dcb19da8728fd68842c12ebac1912bfd5a65b15')