arch-pkgs/nodejs-homebridge-webos-tv/PKGBUILD

32 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=nodejs-homebridge-webos-tv
_pkgname="${pkgname#nodejs-}"
pkgver=2.2.2
pkgrel=1
pkgdesc="Homebridge plugin for LG webOS TVs"
arch=('any')
url="https://github.com/merdok/homebridge-webos-tv"
license=('MIT')
depends=('homebridge')
makedepends=('npm')
options=('!strip')
source=("$_pkgname-$pkgver.tar.gz::https://registry.npmjs.org/$_pkgname/-/$_pkgname-$pkgver.tgz")
noextract=("$_pkgname-$pkgver.tar.gz")
b2sums=('6a208aba330c24a70864f373a7b986d3f38c65ebc46735acebd5c03f363dfe9c13d0e656aac99cb033ece450d96738c83396e6c987c66b6e0d2435fd23165453')
package() {
npm install --global --prefix "$pkgdir/usr" "$_pkgname-$pkgver.tar.gz"
# Non-deterministic race in npm gives 777 permissions to random directories
# See https://github.com/npm/cli/issues/1103 for details
find "$pkgdir/usr" -type d -exec chmod 755 {} +
# npm gives ownership of ALL FILES to build user
# https://bugs.archlinux.org/task/63396
chown -R root:root "$pkgdir"
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" \
"$pkgdir/usr/lib/node_modules/$_pkgname/LICENSE"
}