diff options
author | bacteriostat | 2022-05-10 14:59:23 +0530 |
---|---|---|
committer | bacteriostat | 2022-05-10 14:59:23 +0530 |
commit | 5c30998f937a8ce1f2142024569725af0a0c6040 (patch) | |
tree | 62e7a584fdd949e7948a595a9c1a0733cca7cba2 | |
parent | 097110ab176537ef6c296a29d4365fde27df91bd (diff) | |
download | aur-5c30998f937a8ce1f2142024569725af0a0c6040.tar.gz |
Adds license
Refactor variables
-rw-r--r-- | PKGBUILD | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -1,7 +1,8 @@ # Maintainer: bacteriostat <dev.bacteriostat at aleeas dot com> # Contributor: Hugues Chabot <at google mail> -_npmname=serverless -pkgname=nodejs-$_npmname + +pkgname=nodejs-serverless +_pkgname=${pkgname#nodejs-} pkgver=3.16.0 pkgrel=2 pkgdesc="Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more" @@ -10,17 +11,25 @@ url="https://serverless.com/framework/docs/" license=(MIT) depends=('nodejs' 'npm') optdepends=() -source=(https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz) -noextract=($_npmname-$pkgver.tgz) +source=(https://registry.npmjs.org/$_pkgname/-/$_pkgname-$pkgver.tgz) +noextract=($_pkgname-$pkgver.tgz) sha1sums=('d721f6f12ba12661e50974c7895d6dab35efdf90') +prepare() { + tar -xf "$srcdir/$_pkgname-$pkgver.tgz" --directory "$srcdir" "package/LICENSE.txt" +} + package() { + # Install package using npm. npm install \ --global \ --prefix "$pkgdir/usr" \ --cache "$srcdir/npm-cache" \ --ignore-scripts \ - "$srcdir"/$_npmname-$pkgver.tgz + "$srcdir"/$_pkgname-$pkgver.tgz + + # Install license + install -Dm644 "$srcdir/package/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt" # Non-deterministic race in npm gives 777 permissions to random directories. # See https://github.com/npm/npm/issues/9359 for details. @@ -33,7 +42,7 @@ package() { # Remove local paths from package.json find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' local tmppackage="$(mktemp)" - local pkgjson="$pkgdir/usr/lib/node_modules/$_npmname/package.json" + 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" |