2015-08-30 20:23:57 +08:00
|
|
|
# Contribution from Arch:
|
|
|
|
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
|
|
|
|
pkgname=npm
|
2015-09-25 21:25:46 +08:00
|
|
|
pkgver=3.3.4
|
2015-08-30 20:23:57 +08:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc='A package manager for javascript'
|
|
|
|
arch=('any')
|
|
|
|
url='https://www.npmjs.com/'
|
|
|
|
license=('custom:Artistic')
|
|
|
|
depends=('nodejs')
|
|
|
|
makedepends=('procps-ng')
|
|
|
|
optdepends=('python2: for node-gyp')
|
2015-09-25 21:25:46 +08:00
|
|
|
provides=('nodejs-node-gyp')
|
2015-08-30 20:23:57 +08:00
|
|
|
options=('!emptydirs')
|
|
|
|
source=("https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz")
|
2015-09-25 21:25:46 +08:00
|
|
|
md5sums=('f07f154ec1ebb6fd5c5442547a0eaed7')
|
2015-08-30 20:23:57 +08:00
|
|
|
|
|
|
|
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
|
2015-09-25 21:25:46 +08:00
|
|
|
for _dir in man1 man5 man7; do
|
2015-08-30 20:23:57 +08:00
|
|
|
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"
|
|
|
|
}
|