# Maintainer: Gergely Imreh # Contributor: Matthew McGinn pkgname=versionist pkgdesc='Flexible CHANGELOG generation toolkit that adapts to your commit conventions' pkgver=6.1.0 pkgrel=1 arch=('any') url='https://github.com/balena-io/versionist' _github_url="https://github.com/balena-io/versionist" license=('APACHE') depends=('nodejs>=4.0.0') makedepends=('npm' 'jq') source=(http://registry.npmjs.org/$pkgname/-/${pkgname}-${pkgver}.tgz) noextract=(${pkgname}-${pkgver}.tgz) sha256sums=('78890ca9fa4e323d4f226c11a87f0df33ced66284c7b78c0b1fc646eb80d5f1b') package() { npm install --global --only=production --user root --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tgz" 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}" }