Simplify npmrc default configuration

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2019-10-28 21:17:18 -04:00
parent 7d86b7301d
commit 2526ca953f
No known key found for this signature in database
GPG Key ID: 7A25556236BAA3A3
2 changed files with 10 additions and 32 deletions

View File

@ -1,26 +0,0 @@
From d5f88f988423c6304549eb2724b05c9344b0b88b Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
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 <sgallagh@redhat.com>
---
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

View File

@ -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 <sgallagh@redhat.com> - 1:12.13.0-2
- Simplify npmrc default configuration
* Mon Oct 28 2019 Stephen Gallagher <sgallagh@redhat.com> - 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