# Maintainer: Cristóbal Tapia pkgname=bibtex-tidy pkgver=1.11.0 pkgrel=1 pkgdesc="BibTeX Tidy - Cleaner and Formatter for BibTeX files " arch=('any') url="https://github.com/FlamingTempura/bibtex-tidy" license=('MIT') depends=('nodejs') makedepends=('npm' 'jq') source=("https://registry.npmjs.org/bibtex-tidy/-/$pkgname-$pkgver.tgz") noextract=("$pkgname-$pkgver.tgz") sha256sums=('bb5a12ab08fbcfac8e03e983aaaaa735ac9e80e083dc3820e06a93a6650967d3') package() { npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/$pkgname-$pkgver.tgz" find "$pkgdir/usr" -type d -exec chmod 755 {} + # 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/$pkgname/package.json" jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage" mv "$tmppackage" "$pkgjson" chmod 644 "$pkgjson" # Install license since the package doesn't include it # install -Dm 644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } # vim:set ts=2 sw=2 et:`