arch-pkgs/rollup/PKGBUILD

47 lines
1.6 KiB
Text
Raw Normal View History

# Maintainer: Simon Legner <Simon.Legner@gmail.com>
# Contributor: George Rawlinson <george@rawlinson.net.nz>
pkgname=rollup
2022-06-21 02:29:09 +00:00
pkgver=2.75.7
pkgrel=1
pkgdesc='Next-generation ES6 module bundler'
arch=(any)
url='https://rollupjs.org/'
license=('MIT')
depends=('nodejs')
makedepends=('npm' 'jq')
source=("$pkgname-$pkgver.tar.gz::https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
noextract=("$pkgname-$pkgver.tar.gz")
2022-06-21 02:29:09 +00:00
sha512sums=('5521358b2d1e68060d0b11176a579385d157a99278daa0c16ad030adf9cf94434467c7ab43ed0b617e095ce2cf71e59f66957556d6706777450ae399892c85b5')
b2sums=('2248ebd59ed9c6d6f194046326cccb18a8a45aff1823421da439323f0cb777b20e6ad71c98d670284bfce2e6de3388245e23891d814ae1605e479a266ed8fb8d')
package() {
local NPM_FLAGS=(--no-audit --no-fund --no-update-notifier)
npm install \
--global \
--prefix "$pkgdir/usr" \
--cache "$srcdir/npm-cache" \
"${NPM_FLAGS[@]}" \
"$pkgname-$pkgver.tar.gz"
# install licenses
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" \
"$pkgdir/usr/lib/node_modules/rollup/LICENSE.md"
# install documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" \
"$pkgdir/usr/lib/node_modules/rollup/"{CHANGELOG,README}.md
# remove references to ${src,pkg}dir
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
# npm gives ownership of ALL FILES to build user
# https://bugs.archlinux.org/task/63396
chown -R root:root "$pkgdir"
}