summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKr1ss2021-01-29 16:24:14 +0100
committerKr1ss2021-01-29 16:24:14 +0100
commit4e4b81ffe9e45d3e2f7451a2d44ce51f20677a11 (patch)
tree33e9c0ac456d615903f93af501b84bcbe5df9989
parent6ee5985e10adac66cba96f93c288721ca3fa5c12 (diff)
downloadaur-4e4b81ffe9e45d3e2f7451a2d44ce51f20677a11.tar.gz
clean up package
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD38
2 files changed, 30 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 04d77902189c..8f9c73b14920 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = rdcli-git
- pkgdesc = A simple CLI tool to unrestrict links with real-debrid.com
+ pkgdesc = Simple CLI tool to unrestrict links with real-debrid.com
pkgver = 1.5.1.r121.d7b64c1
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/stoneo/rdcli
arch = any
license = GPL3
makedepends = git
makedepends = npm
+ makedepends = jq
depends = nodejs
provides = rdcli
conflicts = rdcli
- source = rdcli::git+https://github.com/ston3o/rdcli
+ source = git+https://github.com/stoneo/rdcli.git
sha256sums = SKIP
pkgname = rdcli-git
diff --git a/PKGBUILD b/PKGBUILD
index 08c4347ac22b..2498fcd64c30 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,34 +1,48 @@
# Maintainer : Kr1ss $(echo \<kr1ss+x-yandex+com\>|sed s/\+/./g\;s/\-/@/)
# Contributor : stoneo
+
pkgname=rdcli-git
+_name="${pkgname%-git}"
pkgver() {
- cd "$srcdir/${pkgname%-git}"
+ cd "$_name"
printf '%s.r%s.%s' \
"$(git tag -l | grep -P '.+\..+\.\d+' | sed -r 's/v?([0-9\.]+)(-.+)?/\1/g' | sort -Vr | sed 1q)" \
"$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
pkgver=1.5.1.r121.d7b64c1
-pkgrel=1
+pkgrel=2
-pkgdesc="A simple CLI tool to unrestrict links with real-debrid.com"
+pkgdesc='Simple CLI tool to unrestrict links with real-debrid.com'
arch=('any')
-url="https://github.com/stoneo/rdcli"
+url="https://github.com/stoneo/$_name"
license=('GPL3')
-provides=("${pkgname%-git}")
-conflicts=("${pkgname%-git}")
-depends=('nodejs')
-makedepends=('git' 'npm')
+provides=("$_name")
+conflicts=("$_name")
-#noextract=("$pkgname-${pkgver%-git}.tgz")
+makedepends=('git' 'npm' 'jq')
+depends=('nodejs')
-source=("${pkgname%-git}::git+https://github.com/ston3o/${pkgname%-git}")
+source=("git+$url.git")
sha256sums=('SKIP')
+
package() {
- cd "${pkgname%-git}"
- npm install -g --user root --prefix "$pkgdir/usr" "${pkgname%-git}"
+ cd "$_name"
+ npm install -g --user root --prefix "$pkgdir/usr" "$_name"
+
+ # Npm gives ownership of ALL FILES to build user
+ chown -R root:root "$pkgdir"
+
+ # Remove references to $pkgdir
+ find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i "/_where/d;s|$pkgdir||g"
+
+ # Remove references to $srcdir
+ cd "$pkgdir/usr/lib/node_modules/$_name"
+ jq '.|=with_entries(select(.key|test("_.+")|not))' <package.json |
+ install -m644 /dev/stdin package.json
}
+
# vim: ts=2 sw=2 et ft=PKGBUILD: