1
0
mirror of https://github.com/bertptrs/aur.git synced 2025-12-28 05:50:31 +01:00

Initial packaging.

This commit is contained in:
2019-04-30 11:06:47 +02:00
commit cee6c1bd73
3 changed files with 52 additions and 0 deletions

32
PKGBUILD Normal file
View File

@@ -0,0 +1,32 @@
# Maintainer: Bert Peters <bert@bertptrs.nl>
_npmname=node-pre-gyp
pkgname=nodejs-node-pre-gyp
pkgver=0.12.0
pkgrel=1
pkgdesc="Node.js tool for easy binary deployment of C++ addons "
arch=('any')
url="https://github.com/mapbox/node-pre-gyp"
license=('GPL')
depends=('nodejs')
makedepends=('npm' 'jq')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
noextract=("$pkgname-$pkgver.tar.gz")
sha256sums=('6d3207e85c68539da11ea5f10fb730cdaf9170ed855158957df00b5a8d692c67')
package() {
npm install -g --user root --prefix "$pkgdir/usr" "$pkgname-$pkgver.tar.gz"
# Remove references to $pkgdir
find "$pkgdir" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d"
# Remove references to $srcdir
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/$_npmname/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
# Install LICENSE in a more findable spot.
install -Dm644 -t "$pkgdir/usr/share/licences/$pkgname" \
"$pkgdir/usr/lib/node_modules/$_npmname/LICENSE"
}