diff options
author | yochananmarqos | 2019-09-18 09:52:50 -0600 |
---|---|---|
committer | yochananmarqos | 2019-09-18 09:52:50 -0600 |
commit | 009fb7d31319259562bd18cf5d44917bc9f993d3 (patch) | |
tree | 83f752fdce6e0c5be0e286421f1df77874f297dc | |
download | aur-009fb7d31319259562bd18cf5d44917bc9f993d3.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 35 |
2 files changed, 52 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..657188b51137 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = kmdr-cli + pkgdesc = The CLI tool for explaining commands from your terminal + pkgver = 0.1.34 + pkgrel = 1 + url = https://kmdr.sh + arch = any + license = MIT + makedepends = npm + makedepends = jq + depends = nodejs + provides = kmdr + conflicts = kmdr + source = kmdr-cli-0.1.34.tar.gz::https://github.com/ediardo/kmdr-cli/archive/v0.1.34.tar.gz + sha256sums = 8858a023beb7acfec8fe9a70955409ff29c9bbf66469c30767d4f13fecb725d9 + +pkgname = kmdr-cli + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5a2512e312c3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Mark Wagie <yochanan dot marqos at gmail dot com> +pkgname=kmdr-cli +pkgver=0.1.34 +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') +provides=("${pkgname%-cli}") +conflicts=("${pkgname%-cli}") +source=("$pkgname-$pkgver.tar.gz::https://github.com/ediardo/kmdr-cli/archive/v$pkgver.tar.gz") +sha256sums=('8858a023beb7acfec8fe9a70955409ff29c9bbf66469c30767d4f13fecb725d9') + +package() { + npm install --cache "$srcdir/npm-cache" -g --user root --prefix "$pkgdir"/usr \ + "$srcdir"/$pkgname-$pkgver.tar.gz + + # 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%-cli}/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" + mv "$tmppackage" "$pkgjson" + chmod 644 "$pkgjson" + + install -Dm644 "$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} |