summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD29
2 files changed, 44 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cd4a6c489c80
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = nodejs-jsondiffpatch
+ pkgdesc = diff and patch JavaScript objects (JSON)
+ pkgver = 0.3.11
+ pkgrel = 1
+ url = https://github.com/benjamine/jsondiffpatch
+ arch = any
+ license = MIT
+ makedepends = npm
+ depends = nodejs
+ noextract = jsondiffpatch-0.3.11.tgz
+ source = http://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.3.11.tgz
+ sha512sums = 5e2dc8ca076dfc11a19a5e9b754161803922d5380eb29de11b78a21f72adccff826a1b4671d3df2912e59d96d2c3eddbd6e99992198aaea5d481470a7a7ca1b4
+
+pkgname = nodejs-jsondiffpatch
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b4e337f7682b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,29 @@
+# Maintainer: Lukas Grossar <lukas.grossar@gmail.com>
+_npmname=jsondiffpatch
+pkgname=nodejs-jsondiffpatch
+pkgver=0.3.11
+pkgrel=1
+pkgdesc="diff and patch JavaScript objects (JSON)"
+arch=(any)
+url="https://github.com/benjamine/jsondiffpatch"
+license=(MIT)
+depends=('nodejs')
+makedepends=('npm')
+source=(http://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz)
+noextract=($_npmname-$pkgver.tgz)
+sha512sums=('5e2dc8ca076dfc11a19a5e9b754161803922d5380eb29de11b78a21f72adccff826a1b4671d3df2912e59d96d2c3eddbd6e99992198aaea5d481470a7a7ca1b4')
+
+package() {
+ npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/$_npmname-$pkgver.tgz"
+
+ # 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"
+ chmod u=rwX,go=rX -R "$pkgdir/usr/lib/node_modules/$_npmname"
+}