# Maintainer: George Rawlinson pkgname=nodejs-homebridge-denon-tv _pkgname="${pkgname#nodejs-}" pkgver=3.10.78 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=('3c504776dea0e245b55ce6f78c56fc9ad40dfb01abf3ababc25c5db4e62226f46f66691c07a5c59b74c7456941813dc386a0fa5b8d660a4894d6ad7d341f7197') package() { local NPM_FLAGS=(--no-audit --no-fund --no-update-notifier) npm install --global --prefix "$pkgdir/usr" "$_pkgname-$pkgver.tar.gz" "${NPM_FLAGS[@]}" # 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" }