diff options
author | Matthew McGinn | 2019-10-01 16:15:40 +0200 |
---|---|---|
committer | Matthew McGinn | 2019-10-01 16:15:40 +0200 |
commit | d828c8814c591af650586c53717a2f0796bc6bbc (patch) | |
tree | fe51a15a147e0b2a1e4aa3af6b0c9c890c78a482 | |
download | aur-d828c8814c591af650586c53717a2f0796bc6bbc.tar.gz |
initial commit at 1.1.0
Signed-off-by: Matthew McGinn <mamcgi@gmail.com>
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 29 |
3 files changed, 51 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f9334c041104 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = ci-node-modules + pkgdesc = Clean install node_modules using the appropriate installation command + pkgver = 1.1.0 + pkgrel = 1 + url = https://balena.io/ + arch = any + license = APACHE + makedepends = npm + makedepends = jq + depends = bash + noextract = v1.1.0.tar.gz + options = !strip + source = https://github.com/balena-io-modules/ci-node-modules/archive/v1.1.0.tar.gz + sha256sums = d8b2926c39a2c55349457e5f35ffec3eb19796fe346aeeb6eac0bebc41e8a374 + +pkgname = ci-node-modules + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..95c116d0bdbd --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pkg/ +src/ +*.tgz +*.tar.xz +*.tar.gz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fce97ea8f7f3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: Matthew McGinn <mamcgi@gmail.com> + +pkgname=ci-node-modules +pkgdesc='Clean install node_modules using the appropriate installation command' +pkgver=1.1.0 +pkgrel=1 +arch=('any') +url='https://balena.io/' +_github_url="https://github.com/balena-io-modules/ci-node-modules" +license=('APACHE') +depends=('bash') +makedepends=('npm' 'jq') +source=("https://github.com/balena-io-modules/${pkgname}/archive/v${pkgver}.tar.gz") +noextract=("v${pkgver}.tar.gz") +options=(!strip) +sha256sums=('d8b2926c39a2c55349457e5f35ffec3eb19796fe346aeeb6eac0bebc41e8a374') + +package() { + npm install --global --production --user root --prefix "${pkgdir}/usr" "${srcdir}/v${pkgver}.tar.gz" + + find "${pkgdir}" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' + + find "${pkgdir}/usr" -type d -exec chmod 755 {} + + local tmppackage="$(mktemp)" + local pkgjson="${pkgdir}/usr/lib/node_modules/${pkgname}/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmppackage}" + mv "${tmppackage}" "${pkgjson}" + chmod 644 "${pkgjson}" +} |