diff options
author | Mark Wagie | 2020-02-12 10:37:52 -0700 |
---|---|---|
committer | Mark Wagie | 2020-02-12 10:37:52 -0700 |
commit | af7195173e9abbe95a978a11b7ebde757755bbb3 (patch) | |
tree | 2024be59ba6e0818d72d4b1a34e0c3d25ae801d6 | |
download | aur-af7195173e9abbe95a978a11b7ebde757755bbb3.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 37 |
2 files changed, 52 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5c747f58ac45 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = kmdr + pkgdesc = The CLI tool for explaining commands from your terminal + pkgver = 0.4.3 + pkgrel = 1 + url = https://kmdr.sh + arch = any + license = MIT + makedepends = npm + makedepends = jq + depends = nodejs + source = kmdr-0.4.3.tar.gz::https://github.com/ediardo/kmdr-cli/archive/v0.4.3.tar.gz + sha256sums = 93bc650332fd3bc47ed8b9fde7a1baa898b5ed8562c77ee887ad0d343235dca3 + +pkgname = kmdr + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4ecc39d9486c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Mark Wagie <mark dot wagie at tutanota dot com> +pkgname=kmdr +pkgver=0.4.3 +pkgrel=1 +pkgdesc="The CLI tool for explaining commands from your terminal" +arch=('any') +url="https://kmdr.sh" +license=('MIT') +depends=('nodejs') +makedepends=('npm' 'jq') +source=("$pkgname-$pkgver.tar.gz::https://github.com/ediardo/kmdr-cli/archive/v$pkgver.tar.gz") +sha256sums=('93bc650332fd3bc47ed8b9fde7a1baa898b5ed8562c77ee887ad0d343235dca3') + +package() { + cd "kmdr-cli-$pkgver" + npm install kmdr@latest \ + --cache "$srcdir/npm-cache" \ + -g \ + --user root \ + --prefix "$pkgdir"/usr + + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. + find "$pkgdir"/usr -type d -exec chmod 755 {} + + + # 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/$pkgname/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" + mv "$tmppackage" "$pkgjson" + chmod 644 "$pkgjson" + + install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" +} |