Replace /usr/etc/npmrc symlink with builtin configuration
We want to have the system-level npmrc located at /etc/npmrc. By default, npm looks for it in /usr/etc/npmrc, so we placed a symlink to /etc/npmrc there. However, we are the only known package that has anything in /usr/etc, which confuses and/or breaks various tooling (see related bug). This gets rid of the symlink, and instead uses "builtin"-level configuration of npm to cause it to load the system-level configuration from /etc/npmrc.
This commit is contained in:
parent
1d46635e65
commit
6d2be7bed0
15
nodejs.spec
15
nodejs.spec
@ -175,6 +175,9 @@ Source100: %{name}-tarball.sh
|
|||||||
# nodejs-packaging SRPM.
|
# nodejs-packaging SRPM.
|
||||||
Source7: nodejs_native.attr
|
Source7: nodejs_native.attr
|
||||||
|
|
||||||
|
# Configure npm to look into /etc for configuration
|
||||||
|
Source8: npmrc.builtin.in
|
||||||
|
|
||||||
# These are full sources for dependencies included as WASM blobs in the source of Node itself.
|
# These are full sources for dependencies included as WASM blobs in the source of Node itself.
|
||||||
# Note: These sources would also include pre-compiled WASM blobs… so they are adjusted not to.
|
# Note: These sources would also include pre-compiled WASM blobs… so they are adjusted not to.
|
||||||
# Recipes for creating these blobs are included in the sources.
|
# Recipes for creating these blobs are included in the sources.
|
||||||
@ -565,15 +568,14 @@ chmod 0755 %{buildroot}%{_prefix}/lib/node_modules/npm/node_modules/node-gyp/bin
|
|||||||
# automatic dependency on /usr/bin/pwsh that we cannot satisfy.
|
# automatic dependency on /usr/bin/pwsh that we cannot satisfy.
|
||||||
chmod -x %{buildroot}%{_prefix}/lib/node_modules/corepack/shims/*.ps1
|
chmod -x %{buildroot}%{_prefix}/lib/node_modules/corepack/shims/*.ps1
|
||||||
|
|
||||||
|
# Drop the NPM builtin configuration in place
|
||||||
|
sed -e 's#@SYSCONFDIR@#%{_sysconfdir}#g' \
|
||||||
|
%{SOURCE8} > %{buildroot}%{_prefix}/lib/node_modules/npm/npmrc
|
||||||
|
|
||||||
# Drop the NPM default configuration in place
|
# Drop the NPM default configuration in place
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}
|
mkdir -p %{buildroot}%{_sysconfdir}
|
||||||
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/npmrc
|
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/npmrc
|
||||||
|
|
||||||
# NPM upstream expects 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
|
|
||||||
|
|
||||||
# Install the full-icu data files
|
# Install the full-icu data files
|
||||||
install -Dpm0644 -t %{buildroot}%{icudatadir} deps/icu/source/converted/*
|
install -Dpm0644 -t %{buildroot}%{icudatadir} deps/icu/source/converted/*
|
||||||
|
|
||||||
@ -700,7 +702,6 @@ end
|
|||||||
%{_bindir}/npx
|
%{_bindir}/npx
|
||||||
%{_prefix}/lib/node_modules/npm
|
%{_prefix}/lib/node_modules/npm
|
||||||
%config(noreplace) %{_sysconfdir}/npmrc
|
%config(noreplace) %{_sysconfdir}/npmrc
|
||||||
%{_prefix}/etc/npmrc
|
|
||||||
%ghost %{_sysconfdir}/npmignore
|
%ghost %{_sysconfdir}/npmignore
|
||||||
%doc %{_mandir}/man1/npm*.1*
|
%doc %{_mandir}/man1/npm*.1*
|
||||||
%doc %{_mandir}/man1/npx.1*
|
%doc %{_mandir}/man1/npx.1*
|
||||||
@ -737,6 +738,8 @@ end
|
|||||||
- Rebase to 18.16.1
|
- Rebase to 18.16.1
|
||||||
Resolves: rhbz#2188290 rhbz#2166926
|
Resolves: rhbz#2188290 rhbz#2166926
|
||||||
Resolves: CVE-2023-30581 CVE-2023-30588 CVE-2023-30589 CVE-2023-30590
|
Resolves: CVE-2023-30581 CVE-2023-30588 CVE-2023-30589 CVE-2023-30590
|
||||||
|
- Replace /usr/etc/npmrc symlink with builtin configuration
|
||||||
|
Resolves: rhbz#2222287
|
||||||
|
|
||||||
* Tue May 30 2023 Jan Staněk <jstanek@redhat.com> - 1:18.14.2-3
|
* Tue May 30 2023 Jan Staněk <jstanek@redhat.com> - 1:18.14.2-3
|
||||||
- Update bundled c-ares to 1.19.1
|
- Update bundled c-ares to 1.19.1
|
||||||
|
5
npmrc.builtin.in
Normal file
5
npmrc.builtin.in
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This is the distibution-level configuration file for npm.
|
||||||
|
# To configure NPM on a system level, use the globalconfig below (defaults to @SYSCONFDIR@/npmrc).
|
||||||
|
# vim:set filetype=dosini:
|
||||||
|
|
||||||
|
globalconfig=@SYSCONFDIR@/npmrc
|
Loading…
Reference in New Issue
Block a user