Skip to content

Instantly share code, notes, and snippets.

@Duncaen
Created June 2, 2015 23:00
Show Gist options
  • Select an option

  • Save Duncaen/6c2eb1a78724a666ab34 to your computer and use it in GitHub Desktop.

Select an option

Save Duncaen/6c2eb1a78724a666ab34 to your computer and use it in GitHub Desktop.
xbps-npm
#!/bin/sh
pkgname="$1"
version="$(npm view "$1" version)"
rev="1"
builddir=$(mktemp -d || die "failed to create tempdir, exiting...")
builddir="$builddir/$pkgname-$version"
mkdir -p "$builddir"
npm install "$pkgname@$version" --user root -g --prefix "${builddir}/usr"
xbps-create --quiet \
--architecture "noarch" \
--dependencies "nodejs" \
--homepage "$(npm view "$pkgname" homepage)" \
--license "$(npm view "$pkgname" license)" \
--pkgver "$pkgname-${version}_$rev" \
--desc "$(npm view "$pkgname" description)" \
"$builddir"
rm -rf "$builddir"
# mv "$pkgname-${version}_$rev.noarch.xbps" ~/npm_repo
# xbps-rindex -a ~/npm_repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment