summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD41
3 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ded311c18025
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = nodejs-csvtojson
+ pkgdesc = Blazing fast and Comprehensive CSV Parser
+ pkgver = 2.0.10
+ pkgrel = 1
+ url = https://github.com/Keyang/node-csvtojson
+ arch = any
+ license = MIT
+ makedepends = npm
+ makedepends = jq
+ depends = nodejs
+ noextract = csvtojson-2.0.10.tgz
+ source = https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz
+ sha256sums = 41ab7fecdc9cf7007696196d927560741cecdf7fc28c47565221178bfb3ae592
+
+pkgname = nodejs-csvtojson
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..05c6d4d4c97b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6605f3903724
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Caltlgin Stsodaat <contact@fossdaily.xyz>
+
+_pkgname='csvtojson'
+pkgname="nodejs-${_pkgname}"
+pkgver=2.0.10
+pkgrel=1
+pkgdesc='Blazing fast and Comprehensive CSV Parser'
+arch=('any')
+url='https://github.com/Keyang/node-csvtojson'
+_url_source='https://www.npmjs.com/package/csvtojson'
+license=('MIT')
+depends=('nodejs')
+makedepends=('npm' 'jq')
+noextract=("${_pkgname}-${pkgver}.tgz")
+source=("https://registry.npmjs.org/${_pkgname}/-/${_pkgname}-${pkgver}.tgz")
+sha256sums=('41ab7fecdc9cf7007696196d927560741cecdf7fc28c47565221178bfb3ae592')
+
+package() {
+ npm install -g \
+ --cache "${srcdir}/npm-cache" \
+ --prefix "${pkgdir}/usr" \
+ --user root \
+ "${srcdir}/${_pkgname}-${pkgver}.tgz"
+
+ find "${pkgdir}/usr" -type d -exec chmod 755 {} +
+ chown -R root:root "${pkgdir}"
+
+ find "${pkgdir}" -name 'package.json' -print0 | xargs -r -0 sed -i '/_where/d'
+
+ local PKG_TEMP="$(mktemp)"
+ local PKG_JSON="${pkgdir}/usr/lib/node_modules/${_pkgname}/package.json"
+ jq '.|=with_entries(select(.key|test("_.+")|not))' "${PKG_JSON}" > "${PKG_TEMP}"
+ mv -f "${PKG_TEMP}" "${PKG_JSON}"
+ chmod 644 "${PKG_JSON}"
+
+ cd "${pkgdir}/usr/lib/node_modules/${_pkgname}"
+ install -Dvm644 'readme.md' -t "${pkgdir}/usr/share/doc/${_pkgname}"
+ install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${_pkgname}"
+}
+
+# vim: ts=2 sw=2 et: