summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancoism902021-12-06 13:04:35 +0100
committerfrancoism902021-12-06 13:04:35 +0100
commitf833081b2c3c5480ea848f3e95896adcb93a0cd5 (patch)
tree6a816e85ddccbc2adcaa42d714d170b5cfcd8283
downloadaur-f833081b2c3c5480ea848f3e95896adcb93a0cd5.tar.gz
Initial commit
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD48
2 files changed, 63 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..606da8822ab3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = soketi
+ pkgdesc = Just another simple, fast, and resilient open-source WebSockets server.
+ pkgver = 0.19.0
+ pkgrel = 1
+ url = https://github.com/soketi/soketi
+ arch = any
+ license = MIT
+ makedepends = npm
+ makedepends = jq
+ depends = nodejs
+ noextract = soketi-0.19.0.tar.gz
+ source = https://registry.npmjs.org/@soketi/soketi/-/soketi-0.19.0.tgz
+ sha512sums = 401aba2a2ed474a8beea1474bd4a05ab04e442f4a8334fb5c08ec6505218b79ad613b499256c4721ca070e4208a339df6f58de143d0d028a00cbf68a88128e12
+
+pkgname = soketi
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..8e312d50ddb8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: f.menning@pm.me
+# Contributer: Felix Yan <felixonmars@archlinux.org>
+# Contributer: gardenapple@posteo.net
+
+_npmname=@soketi/soketi
+pkgname=soketi
+pkgdesc='Just another simple, fast, and resilient open-source WebSockets server.'
+pkgver=0.19.0
+pkgrel=1
+arch=('any')
+url='https://github.com/soketi/soketi'
+license=('MIT')
+depends=('nodejs')
+makedepends=('npm' 'jq')
+source=(https://registry.npmjs.org/$_npmname/-/$pkgname-$pkgver.tgz)
+noextract=($pkgname-$pkgver.tar.gz)
+sha512sums=('401aba2a2ed474a8beea1474bd4a05ab04e442f4a8334fb5c08ec6505218b79ad613b499256c4721ca070e4208a339df6f58de143d0d028a00cbf68a88128e12')
+
+# see: https://wiki.archlinux.org/index.php/Node.js_package_guidelines
+
+package() {
+ npm install -g --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz"
+
+ # Non-deterministic race in npm gives 777 permissions to random directories.
+ # See https://github.com/npm/npm/issues/9359 for details.
+ chmod -R u=rwX,go=rX "$pkgdir"
+
+ # npm gives ownership of ALL FILES to build user
+ # https://bugs.archlinux.org/task/63396
+ chown -R root:root "${pkgdir}"
+
+ # 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"
+
+ find "$pkgdir" -type f -name package.json | while read pkgjson; do
+ local tmppackage="$(mktemp)"
+ jq 'del(.man)' "$pkgjson" > "$tmppackage"
+ mv "$tmppackage" "$pkgjson"
+ chmod 644 "$pkgjson"
+ done
+}