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

32 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=nodejs-homebridge-denon-tv
_pkgname="${pkgname#nodejs-}"
pkgver=3.10.65
pkgrel=1
pkgdesc="Homebridge plugin for Denon/Marantz AV receivers"
arch=('any')
url="https://github.com/grzegorz914/homebridge-denon-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=('83110eda4e39eaea1c32c4b7f8be3ac0f8c5861f0a9963b56d90dfbc732dfd4595ce2cfc8f7fa08e3a20ee33e10c1d0a4b28779f9e2229989fc90fb81635f724')
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"
}