blob: d12aa5f98c4c097f681ae3eaff441dc819babdb5 (
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
|
# Maintainer: Ashley Bone <ashley DOT bone AT pm DOT m>e
pkgname=zwave-js-server
pkgver=1.39.0
pkgrel=1
pkgdesc="Websocket server wrapper around Home Assistant's Z-Wave JS."
arch=('any')
url="https://github.com/zwave-js/zwave-js-server"
license=('Apache')
depends=('nodejs')
makedepends=('jq' 'npm')
source=("https://registry.npmjs.org/@zwave-js/server/-/server-$pkgver.tgz"
"zwave-js-server@.service")
noextract=("server-$pkgver.tgz")
sha256sums=('3cc15f2d8bb486022c4e64690e9f31473606262a8bafb5603d013943ab133c43'
'fe06a8ecc75ee009dfeb6b99402f0cee434f6ead2ef21773024928d8132e3df2')
package() {
npm install -g --prefix "$pkgdir/usr" "$srcdir/server-$pkgver.tgz"
install -dm755 "$pkgdir/usr/lib/systemd/system"
install -Dm644 "$pkgname@.service" "$pkgdir/usr/lib/systemd/system/"
# Remove references to $pkgdir
find "$pkgdir" -type f -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
# Remove references to $srcdir
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/@zwave-js/server/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
}
|