[packages/npm] - updated to 3.10.8 - build with bundled modules

mis mis at pld-linux.org
Mon Sep 12 10:03:27 CEST 2016


commit 2c86ef9863a6236d028a7bf9b5ce2b47517f4244
Author: mis <mistoo at gmail.com>
Date:   Mon Sep 12 10:01:52 2016 +0200

    - updated to 3.10.8
    - build with bundled modules

 cmd-shim-optional.patch |  40 +++++++--------
 link-globalPaths.patch  |  25 +++++-----
 npm.spec                | 130 ++++++++++--------------------------------------
 3 files changed, 58 insertions(+), 137 deletions(-)
---
diff --git a/npm.spec b/npm.spec
index 94c374f..03306e3 100644
--- a/npm.spec
+++ b/npm.spec
@@ -2,15 +2,19 @@
 # - put man3 to some -devel-doc package (man pages for npm programming)
 # - it can't live without this path: Error: ENOENT, no such file or directory '/usr/lib/node_modules/npm/man/man1/'
 # - npm-debug.log is created with 777 perms, should respect umask instead
+
+# build package without bundled node-gyp module
+%bcond_without  bundled_gyp 
+
 Summary:	A package manager for node.js
 Name:		npm
-Version:	1.4.25
-Release:	2
+Version:	3.10.8
+Release:	1
 License:	Artistic-2.0
 Group:		Development/Libraries
 Source0:	http://registry.npmjs.org/npm/-/%{name}-%{version}.tgz
-# Source0-md5:	9716206d0df970aaf80bd6df31264ba2
-Patch0:		link-globalPaths.patch
+# Source0-md5:	f470ec0065a5a181a432f008a3a97dda
+Patch0:		link-globalPaths.patch 
 Patch1:		cmd-shim-optional.patch
 URL:		http://npmjs.org/
 BuildRequires:	bash
@@ -18,105 +22,11 @@ BuildRequires:	nodejs >= 0.9
 BuildRequires:	rpmbuild(macros) >= 1.634
 BuildRequires:	sed >= 4.0
 Requires:	nodejs
-Requires:	nodejs-abbrev < 1.1.0
-Requires:	nodejs-abbrev >= 1.0.5
-Requires:	nodejs-ansi < 0.4.0
-Requires:	nodejs-ansi >= 0.3.0
-Requires:	nodejs-ansicolors < 0.4.0
-Requires:	nodejs-ansicolors >= 0.3.2
-Requires:	nodejs-ansistyles < 0.2.0
-Requires:	nodejs-ansistyles >= 0.1.3
-Requires:	nodejs-archy < 1.0.0
-Requires:	nodejs-block-stream = 0.0.7
-Requires:	nodejs-char-spinner < 1.1.0
-Requires:	nodejs-char-spinner >= 1.0.1
-Requires:	nodejs-child-process-close < 0.2.0
-Requires:	nodejs-child-process-close >= 0.1.1
-Requires:	nodejs-chmodr < 0.2.0
-Requires:	nodejs-chmodr >= 0.1.0
-Requires:	nodejs-chownr < 1.0.0
-Requires:	nodejs-columnify < 1.2.0
-Requires:	nodejs-columnify >= 1.1.0
-Requires:	nodejs-editor < 0.2.0
-Requires:	nodejs-editor >= 0.1.0
-Requires:	nodejs-fstream < 1.1
-Requires:	nodejs-fstream >= 1.0.2
-Requires:	nodejs-fstream-npm < 1.1
-Requires:	nodejs-fstream-npm >= 1.0.0
-Requires:	nodejs-github-url-from-git < 1.4
-Requires:	nodejs-github-url-from-git >= 1.3.0
-Requires:	nodejs-github-url-from-username-repo < 0.3.0
-Requires:	nodejs-github-url-from-username-repo >= 0.2.0
-Requires:	nodejs-glob < 4.1
-Requires:	nodejs-glob >= 4.0.5
-Requires:	nodejs-graceful-fs < 3.1.0
-Requires:	nodejs-graceful-fs >= 3.0.0
-Requires:	nodejs-inflight < 1.1.0
-Requires:	nodejs-inflight >= 1.0.1
-Requires:	nodejs-ini < 1.3.0
-Requires:	nodejs-ini >= 1.2.0
-Requires:	nodejs-init-package-json < 1.1
-Requires:	nodejs-init-package-json >= 1.0.0
-Requires:	nodejs-lockfile < 1.1
-Requires:	nodejs-lockfile >= 1.0.0
-Requires:	nodejs-lru-cache < 2.6.0
-Requires:	nodejs-lru-cache >= 2.5.0
-Requires:	nodejs-minimatch < 1.1
-Requires:	nodejs-minimatch >= 1.0.0
-Requires:	nodejs-mkdirp < 0.6
-Requires:	nodejs-mkdirp >= 0.5.0
-Requires:	nodejs-nopt < 3.1.0
-Requires:	nodejs-nopt >= 3.0.1
-Requires:	nodejs-npm-cache-filename < 1.1.0
-Requires:	nodejs-npm-cache-filename >= 1.0.1
-Requires:	nodejs-npm-install-checks < 1.1.0
-Requires:	nodejs-npm-install-checks >= 1.0.2
-Requires:	nodejs-npm-registry-client < 2.1
-Requires:	nodejs-npm-registry-client >= 2.0.6
-Requires:	nodejs-npm-user-validate < 0.2.0
-Requires:	nodejs-npm-user-validate >= 0.1.0
-Requires:	nodejs-npmconf < 1.2
-Requires:	nodejs-npmconf >= 1.1.4
-Requires:	nodejs-npmlog < 0.2.0
-Requires:	nodejs-npmlog >= 0.1.1
-Requires:	nodejs-once < 1.4.0
-Requires:	nodejs-once >= 1.3.0
-Requires:	nodejs-opener < 1.4.0
-Requires:	nodejs-opener >= 1.3.0
-Requires:	nodejs-osenv < 0.2.0
-Requires:	nodejs-osenv >= 0.1.0
-Requires:	nodejs-path-is-inside < 1.1.0
-Requires:	nodejs-path-is-inside >= 1.0.0
-Requires:	nodejs-read < 1.1.0
-Requires:	nodejs-read >= 1.0.4
-Requires:	nodejs-read-installed < 2.1.0
-Requires:	nodejs-read-installed >= 2.0.5
-Requires:	nodejs-read-package-json < 1.3
-Requires:	nodejs-read-package-json >= 1.2.6
-Requires:	nodejs-request < 2.31.0
-Requires:	nodejs-request >= 2.30.0
-Requires:	nodejs-retry < 0.7.0
-Requires:	nodejs-retry >= 0.6.0
-Requires:	nodejs-rimraf < 2.3.0
-Requires:	nodejs-rimraf >= 2.2.8
-Requires:	nodejs-semver < 2.4.0
-Requires:	nodejs-semver >= 2.3.0
-Requires:	nodejs-sha < 1.3.0
-Requires:	nodejs-sha >= 1.2.1
-Requires:	nodejs-slide < 1.2.0
-Requires:	nodejs-slide >= 1.1.5
-Requires:	nodejs-sorted-object < 1.1.0
-Requires:	nodejs-sorted-object >= 1.0.0
-Requires:	nodejs-tar < 1.1
-Requires:	nodejs-tar >= 1.0.1
-Requires:	nodejs-text-table < 0.3.0
-Requires:	nodejs-text-table >= 0.2.0
-Requires:	nodejs-uid-number = 0.0.5
-Requires:	nodejs-which < 2.0.0
-Requires:	nodejs-which >= 1.0.0
+%if %{without bundled_gyp}
 Suggests:	nodejs-gyp
-Conflicts:	nodejs-gyp < 1.0.1
-Conflicts:	nodejs-gyp >= 1.1
+Conflicts:	nodejs-gyp < 3.5.0
+Conflicts:	nodejs-gyp >= 3.4.0
+%endif
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -169,6 +79,17 @@ cp -a lib cli.js npmrc package.json $RPM_BUILD_ROOT%{nodejs_libdir}/npm
 cp -p bin/*.js $RPM_BUILD_ROOT%{nodejs_libdir}/npm/bin
 ln -s %{nodejs_libdir}/npm/bin/npm-cli.js $RPM_BUILD_ROOT%{_bindir}/npm
 
+# clean up node_modules/
+for i in README.md Readme.md README.markdown LICENSE LICENSE.md CHANGES.md \
+         changelog.md .npmignore .travis.yml test examples example; do 
+    find node_modules -name $i | xargs -r rm -r
+done
+
+%if %{without bundled_gyp}
+rm -r node_modules/node-gyp
+%endif
+cp -r node_modules $RPM_BUILD_ROOT%{nodejs_libdir}/npm/
+
 # for npm help
 install -d $RPM_BUILD_ROOT%{nodejs_libdir}/npm/doc
 cp -a doc/* $RPM_BUILD_ROOT%{nodejs_libdir}/npm/doc
@@ -209,19 +130,20 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{nodejs_libdir}/npm/lib
 %{nodejs_libdir}/npm/lib/*.js
 %{nodejs_libdir}/npm/lib/cache
+%{nodejs_libdir}/npm/lib/config
+%{nodejs_libdir}/npm/lib/install
 %{nodejs_libdir}/npm/lib/utils
+%{nodejs_libdir}/npm/node_modules
 
 # man symlink
 %{nodejs_libdir}/npm/man
 
 %dir %{nodejs_libdir}/npm/doc
-%{nodejs_libdir}/npm/doc/api
 %{nodejs_libdir}/npm/doc/cli
 %{nodejs_libdir}/npm/doc/files
 %{nodejs_libdir}/npm/doc/misc
 
 %{_mandir}/man1/npm*
-%{_mandir}/man3/npm*
 %{_mandir}/man5/npm*
 %{_mandir}/man5/package.json.5*
 %{_mandir}/man7/npm*
diff --git a/cmd-shim-optional.patch b/cmd-shim-optional.patch
index 05cf37b..bd61a68 100644
--- a/cmd-shim-optional.patch
+++ b/cmd-shim-optional.patch
@@ -1,21 +1,21 @@
---- npm-1.2.17/lib/build.js~	2013-04-03 19:11:45.000000000 +0300
-+++ npm-1.2.17/lib/build.js	2013-04-04 22:37:51.277211534 +0300
+--- npm-3.10.8/lib/build.js.orig	2016-07-01 22:52:19.000000000 +0200
++++ npm-3.10.8/lib/build.js	2016-09-12 09:38:31.069484189 +0200
 @@ -16,7 +16,7 @@
-   , readJson = require("read-package-json")
-   , link = require("./utils/link.js")
-   , linkIfExists = link.ifExists
--  , cmdShim = require("cmd-shim")
-+  , cmdShim = (process.platform === "win32") ? require("cmd-shim") : {}
-   , cmdShimIfExists = cmdShim.ifExists
-   , asyncMap = require("slide").asyncMap
- 
---- npm-1.4.22/package.json~	2014-07-31 20:24:36.000000000 +0300
-+++ npm-1.4.22/package.json	2016-01-10 01:14:20.995429555 +0200
-@@ -41,7 +41,6 @@
-     "child-process-close": "~0.1.1",
-     "chmodr": "~0.1.0",
-     "chownr": "0",
--    "cmd-shim": "~1.1.2",
-     "columnify": "~1.1.0",
-     "editor": "~0.1.0",
-     "fstream": "~0.1.29",
+ var readJson = require('read-package-json')
+ var link = require('./utils/link.js')
+ var linkIfExists = link.ifExists
+-var cmdShim = require('cmd-shim')
++var cmdShim = (process.platform === "win32") ? require("cmd-shim") : {}
+ var cmdShimIfExists = cmdShim.ifExists
+ var asyncMap = require('slide').asyncMap
+ var ini = require('ini')
+--- npm-3.10.8/package.json.orig	2016-09-09 03:21:47.000000000 +0200
++++ npm-3.10.8/package.json	2016-09-12 09:38:42.202817644 +0200
+@@ -37,7 +37,6 @@
+     "archy": "~1.0.0",
+     "asap": "~2.0.4",
+     "chownr": "~1.0.1",
+-    "cmd-shim": "~2.0.2",
+     "columnify": "~1.5.4",
+     "config-chain": "~1.1.10",
+     "dezalgo": "~1.0.3",
diff --git a/link-globalPaths.patch b/link-globalPaths.patch
index 042ccd0..1b36caa 100644
--- a/link-globalPaths.patch
+++ b/link-globalPaths.patch
@@ -1,15 +1,14 @@
-diff -ur npm-1.1.68-o/lib/link.js npm-1.1.68/lib/link.js
---- npm-1.1.68-o/lib/link.js	2012-08-22 11:43:26.000000000 -0600
-+++ npm-1.1.68/lib/link.js	2012-12-02 11:51:35.000000000 -0700
-@@ -9,6 +9,7 @@
-   , chain = require("slide").chain
-   , path = require("path")
-   , rm = require("./utils/gently-rm.js")
-+  , globalPaths = require('module').globalPaths
-   , build = require("./build.js")
- 
- module.exports = link
-@@ -78,11 +79,24 @@
+--- npm-3.10.8/lib/link.js.orig	2016-07-01 22:52:19.000000000 +0200
++++ npm-3.10.8/lib/link.js	2016-09-12 09:55:21.476161853 +0200
+@@ -8,6 +8,7 @@
+ var asyncMap = require('slide').asyncMap
+ var chain = require('slide').chain
+ var path = require('path')
++var globalPaths = require('module').globalPaths
+ var build = require('./build.js')
+ var npa = require('npm-package-arg')
+ var usage = require('./utils/usage')
+@@ -98,11 +99,24 @@
        })
      }
  
@@ -31,7 +30,7 @@ diff -ur npm-1.1.68-o/lib/link.js npm-1.1.68/lib/link.js
 +      if (er) return cb()
 +      if (!f || !f[0]) {
          rp = pp
-         return npm.commands.install(t, pkg, n)
+         return npm.commands.install(t, [pkg], n)
 -      } else if (!st.isSymbolicLink()) {
 +      } else if (!st[0].isSymbolicLink()) {
          rp = pp
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/npm.git/commitdiff/2c86ef9863a6236d028a7bf9b5ce2b47517f4244



More information about the pld-cvs-commit mailing list