mirror of
https://src.fedoraproject.org/rpms/nodejs18.git
synced 2024-11-24 09:42:43 +00:00
Fix up shebangs for npm and npx
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
parent
00573643f6
commit
14431056f7
2 changed files with 32 additions and 2 deletions
|
@ -576,12 +576,22 @@ mv %{buildroot}%{_bindir}/node %{buildroot}%{_bindir}/node-%{nodejs_pkg_major}
|
|||
# Move the npm binary to npm-NODEJS_MAJOR
|
||||
rm -f %{buildroot}%{_bindir}/npm
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/bin/npm-cli.js
|
||||
|
||||
ln -srf %{buildroot}%{nodejs_private_sitelib}/npm/bin/npm-cli.js \
|
||||
%{buildroot}%{_bindir}/npm-%{nodejs_pkg_major}
|
||||
|
||||
# Move the npx binary to npm-NODEJS_MAJOR
|
||||
# Move the npx binary to npx-NODEJS_MAJOR
|
||||
rm -f %{buildroot}%{_bindir}/npx
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/bin/npx-cli.js
|
||||
|
||||
ln -srf %{buildroot}%{nodejs_private_sitelib}/npm/bin/npx-cli.js \
|
||||
%{buildroot}%{_bindir}/npx-%{nodejs_pkg_major}
|
||||
|
||||
|
@ -690,6 +700,11 @@ find %{buildroot}%{nodejs_private_sitelib}/npm \
|
|||
chmod 0755 %{buildroot}%{nodejs_private_sitelib}/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp
|
||||
chmod 0755 %{buildroot}%{nodejs_private_sitelib}/npm/node_modules/node-gyp/bin/node-gyp.js
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/node_modules/node-gyp/bin/node-gyp.js
|
||||
|
||||
# Drop the NPM builtin configuration in place
|
||||
sed -e 's#@SYSCONFDIR@#%{_sysconfdir}#g' \
|
||||
%{SOURCE201} > %{buildroot}%{nodejs_private_sitelib}/npm/npmrc
|
||||
|
|
|
@ -584,12 +584,22 @@ mv %{buildroot}%{_bindir}/node %{buildroot}%{_bindir}/node-%{nodejs_pkg_major}
|
|||
# Move the npm binary to npm-NODEJS_MAJOR
|
||||
rm -f %{buildroot}%{_bindir}/npm
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/bin/npm-cli.js
|
||||
|
||||
ln -srf %{buildroot}%{nodejs_private_sitelib}/npm/bin/npm-cli.js \
|
||||
%{buildroot}%{_bindir}/npm-%{nodejs_pkg_major}
|
||||
|
||||
# Move the npx binary to npm-NODEJS_MAJOR
|
||||
# Move the npx binary to npx-NODEJS_MAJOR
|
||||
rm -f %{buildroot}%{_bindir}/npx
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/bin/npx-cli.js
|
||||
|
||||
ln -srf %{buildroot}%{nodejs_private_sitelib}/npm/bin/npx-cli.js \
|
||||
%{buildroot}%{_bindir}/npx-%{nodejs_pkg_major}
|
||||
|
||||
|
@ -698,6 +708,11 @@ find %{buildroot}%{nodejs_private_sitelib}/npm \
|
|||
chmod 0755 %{buildroot}%{nodejs_private_sitelib}/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp
|
||||
chmod 0755 %{buildroot}%{nodejs_private_sitelib}/npm/node_modules/node-gyp/bin/node-gyp.js
|
||||
|
||||
# Set the hashbang to use the matching Node.js interpreter
|
||||
sed --in-place --regexp-extended \
|
||||
's;^#!/usr/bin/env node($|\ |\t)+;#!/usr/bin/node-%{nodejs_pkg_major};g' \
|
||||
%{buildroot}%{nodejs_private_sitelib}/npm/node_modules/node-gyp/bin/node-gyp.js
|
||||
|
||||
# Drop the NPM builtin configuration in place
|
||||
sed -e 's#@SYSCONFDIR@#%{_sysconfdir}#g' \
|
||||
%{SOURCE201} > %{buildroot}%{nodejs_private_sitelib}/npm/npmrc
|
||||
|
|
Loading…
Reference in a new issue