desktop/npm/PKGBUILD
2015-12-12 00:12:12 +01:00

45 lines
1.2 KiB
Bash

pkgname=npm
pkgver=3.5.3
pkgrel=1
pkgdesc='A package manager for javascript'
arch=('any')
url='https://www.npmjs.com/'
license=('custom:Artistic')
depends=('nodejs')
provides=('nodejs-node-gyp')
makedepends=('procps-ng')
optdepends=('python2: for node-gyp')
options=('!emptydirs')
source=("https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('dd9580f62d4804fe247ff0375e72c713d32160dcee69ec46b20a7e8969cffec9')
build() {
cd ${pkgname}-${pkgver}
make
}
package() {
cd ${pkgname}-${pkgver}
make NPMOPTS="--prefix=\"$pkgdir/usr\"" install
# Why 777? :/
chmod -R u=rwX,go=rX "$pkgdir"
# Fix files owned by nobody:
chown -R root "$pkgdir/usr/lib/node_modules"
# Fix wrong symlinks
for _dir in man1 man5 man7; do
rm -f "$pkgdir"/usr/share/man/$_dir/*
cd "$pkgdir"/usr/lib/node_modules/npm/man/$_dir
for _file in *; do
ln -s /usr/lib/node_modules/npm/man/$_dir/$_file "$pkgdir"/usr/share/man/$_dir/
done
done
# Make symlink for node-gyp
ln -s /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js "$pkgdir"/usr/bin/node-gyp
install -Dm644 "$srcdir/${pkgname}-${pkgver}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}