From 2526ca953f7d2de94348a77127a85b39a4a8407d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 28 Oct 2019 21:17:18 -0400 Subject: [PATCH] Simplify npmrc default configuration Signed-off-by: Stephen Gallagher --- ...-npmrc-for-the-default-configuration.patch | 26 ------------------- nodejs.spec | 16 +++++++----- 2 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 0002-Use-etc-npmrc-for-the-default-configuration.patch diff --git a/0002-Use-etc-npmrc-for-the-default-configuration.patch b/0002-Use-etc-npmrc-for-the-default-configuration.patch deleted file mode 100644 index 6d79f42..0000000 --- a/0002-Use-etc-npmrc-for-the-default-configuration.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d5f88f988423c6304549eb2724b05c9344b0b88b Mon Sep 17 00:00:00 2001 -From: Stephen Gallagher -Date: Mon, 28 Oct 2019 13:24:57 -0400 -Subject: [PATCH 2/3] Use /etc/npmrc for the default configuration - -Signed-off-by: Stephen Gallagher ---- - deps/npm/lib/config/defaults.js | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js -index 57d373df1e10c349142e14fa9e4bbc95b7df79e3..0ffe6aed8562070cd1d021010b13bef30bac8763 100644 ---- a/deps/npm/lib/config/defaults.js -+++ b/deps/npm/lib/config/defaults.js -@@ -153,7 +153,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { - 'commit-hooks': true, - - global: false, -- globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), -+ globalconfig: '/etc/npmrc', - 'global-style': false, - group: process.platform === 'win32' ? 0 - : process.env.SUDO_GID || (process.getgid && process.getgid()), --- -2.23.0 - diff --git a/nodejs.spec b/nodejs.spec index e799bd8..94a71db 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -8,7 +8,7 @@ # This is used by both the nodejs package and the npm subpackage thar # has a separate version - the name is special so that rpmdev-bumpspec # will bump this rather than adding .1 to the end. -%global baserelease 1 +%global baserelease 2 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -138,10 +138,6 @@ Source7: nodejs_native.attr # Disable running gyp on bundled deps we don't use Patch1: 0001-Disable-running-gyp-on-shared-deps.patch -# Use /etc/npmrc for the default configuration -# We'll use this to set the prefix to /usr/local for `npm -g install` -Patch2: 0002-Use-etc-npmrc-for-the-default-configuration.patch - # Patch to install both node and libnode.so, using the correct libdir Patch3: 0003-Install-both-binaries-and-use-libdir.patch @@ -503,8 +499,12 @@ chmod 0755 %{buildroot}%{_prefix}/lib/node_modules/npm/node_modules/node-gyp/bin # Drop the NPM default configuration in place mkdir -p %{buildroot}%{_sysconfdir} -cp %{SOURCE1} %{buildroot}%{_sysconfdir}/ +cp %{SOURCE1} %{buildroot}%{_sysconfdir}/npmrc +# NPM upstream expectes it to be in /usr/etc/npmrc, so we'll put a symlink here +# This is done in the interests of keeping /usr read-only. +mkdir -p %{buildroot}%{_prefix}/etc +ln -s %{_sysconfdir}/npmrc %{buildroot}%{_prefix}/etc/npmrc %check # Fail the build if the versions don't match @@ -609,6 +609,7 @@ end %{_bindir}/npx %{_prefix}/lib/node_modules/npm %config(noreplace) %{_sysconfdir}/npmrc +%{_prefix}/etc/npmrc %ghost %{_sysconfdir}/npmignore %doc %{_mandir}/man*/npm* %doc %{_mandir}/man*/npx* @@ -625,6 +626,9 @@ end %{_pkgdocdir}/npm/doc %changelog +* Mon Oct 28 2019 Stephen Gallagher - 1:12.13.0-2 +- Simplify npmrc default configuration + * Mon Oct 28 2019 Stephen Gallagher - 1:12.13.0-1 - Update to 12.13.0 (LTS) - https://github.com/nodejs/node/blob/v12.13.0/doc/changelogs/CHANGELOG_V12.md