diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -1,27 +1,30 @@ # Maintainer: KarlFiabeschi 1984itsnow[at]gmail[dot]com _npmname=soccer-go -pkgname=nodejs-soccer-go -pkgver=0.4.0 -pkgrel=2 +pkgname=nodejs-soccer-go +pkgver=1.2.0 +pkgrel=1 pkgdesc="soccer-go is a node command line application to gather soccer stats and results" arch=('any') url="https://github.com/acifani/soccer-go" license=(MIT) depends=('nodejs') -makedepends=('npm') +makedepends=('npm' 'jq') source=(https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz) noextract=($_npmname-$pkgver.tgz) -sha256sums=(8bc9ba5779bc8175b244cd885a802d7867efbe1ea21b03c3ec97e8a8012ea873) +sha256sums=('1dc027ea14d11de079ad070b727149d19696febb7ca184cbbd17eb3d2acbd342') package() { - cd $srcdir - local _npmdir="$pkgdir/usr/lib/node_modules/" - mkdir -p $_npmdir - cd $_npmdir - npm install -g --prefix "$pkgdir/usr" $_npmname@$_npmver + npm install -g --cache "${srcdir}/npm-cache" --prefix "${pkgdir}/usr" "${srcdir}/${_npmname}-${pkgver}.tgz" # fix perms - chmod 755 ${pkgdir}/usr/bin - find ${pkgdir}/usr/lib/node_modules/ -type d -exec chmod 755 {} + + chown -R root:root "${pkgdir}" + find "${pkgdir}/usr" -type d -exec chmod 755 {} + + find "${pkgdir}" -type f -name "package.json" -print0 | xargs -0 sed -i "/_where/d" + + local tmppackage="$(mktemp)" + local pkgjson="${pkgdir}/usr/lib/node_modules/${pkgname#nodejs-}/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmppackage}" + mv "${tmppackage}" "${pkgjson}" + chmod 644 "${pkgjson}" } |