Move native module autorequires to nodejs-packaging

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2022-08-24 13:44:31 -04:00
parent 08c7ea5ebe
commit 7c7a75f64b
No known key found for this signature in database
GPG Key ID: 45DB85A568286D11
2 changed files with 4 additions and 24 deletions

View File

@ -146,11 +146,6 @@ Source3: https://github.com/unicode-org/icu/releases/download/release-%{icu_majo
Source4: https://github.com/unicode-org/icu/releases/download/release-%{icu_major}-%{icu_minor}/icu4c-%{icu_major}_%{icu_minor}-data-bin-l.zip Source4: https://github.com/unicode-org/icu/releases/download/release-%{icu_major}-%{icu_minor}/icu4c-%{icu_major}_%{icu_minor}-data-bin-l.zip
Source100: nodejs-sources.sh Source100: nodejs-sources.sh
# The native module Requires generator remains in the nodejs SRPM, so it knows
# the nodejs and v8 versions. The remainder has migrated to the
# nodejs-packaging SRPM.
Source7: nodejs_native.attr
# Disable running gyp on bundled deps we don't use # Disable running gyp on bundled deps we don't use
Patch1: 0001-Disable-running-gyp-on-shared-deps.patch Patch1: 0001-Disable-running-gyp-on-shared-deps.patch
@ -176,10 +171,14 @@ BuildRequires: gcc-c++ >= 8.3.0
%endif %endif
BuildRequires: jq BuildRequires: jq
%if %{with npm}
# needed to generate bundled provides for npm dependencies # needed to generate bundled provides for npm dependencies
# https://src.fedoraproject.org/rpms/nodejs/pull-request/2 # https://src.fedoraproject.org/rpms/nodejs/pull-request/2
# https://pagure.io/nodejs-packaging/pull-request/10 # https://pagure.io/nodejs-packaging/pull-request/10
BuildRequires: nodejs-packaging BuildRequires: nodejs-packaging
%endif
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: libatomic BuildRequires: libatomic
BuildRequires: ninja-build BuildRequires: ninja-build
@ -278,12 +277,6 @@ Provides: bundled(icu) = %{icu_version}
Provides: bundled(uvwasi) = %{uvwasi_version} Provides: bundled(uvwasi) = %{uvwasi_version}
Provides: bundled(histogram) = %{histogram_version} Provides: bundled(histogram) = %{histogram_version}
%if 0%{?fedora}
# Make sure to pull in the appropriate packaging macros when building RPMs
Requires: (nodejs-packaging if rpm-build)
%endif
# Make sure we keep NPM up to date when we update Node.js
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
Recommends: npm >= %{npm_epoch}:%{npm_version}-%{npm_release} Recommends: npm >= %{npm_epoch}:%{npm_version}-%{npm_release}
%endif %endif
@ -515,15 +508,6 @@ done
# own the sitelib directory # own the sitelib directory
mkdir -p %{buildroot}%{_prefix}/lib/node_modules mkdir -p %{buildroot}%{_prefix}/lib/node_modules
# ensure Requires are added to every native module that match the Provides from
# the nodejs build in the buildroot
install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs_native.attr
cat << EOF > %{buildroot}%{_rpmconfigdir}/nodejs_native.req
#!/bin/sh
echo 'nodejs(abi%{nodejs_major}) >= %nodejs_abi'
EOF
chmod 0755 %{buildroot}%{_rpmconfigdir}/nodejs_native.req
# install documentation # install documentation
mkdir -p %{buildroot}%{_pkgdocdir}/html mkdir -p %{buildroot}%{_pkgdocdir}/html
cp -pr doc/* %{buildroot}%{_pkgdocdir}/html cp -pr doc/* %{buildroot}%{_pkgdocdir}/html
@ -644,8 +628,6 @@ end
%{_usr}/lib/dtrace/node.d %{_usr}/lib/dtrace/node.d
%endif %endif
%{_rpmconfigdir}/fileattrs/nodejs_native.attr
%{_rpmconfigdir}/nodejs_native.req
%doc AUTHORS CHANGELOG.md onboarding.md GOVERNANCE.md README.md %doc AUTHORS CHANGELOG.md onboarding.md GOVERNANCE.md README.md
%doc %{_mandir}/man1/node.1* %doc %{_mandir}/man1/node.1*

View File

@ -1,2 +0,0 @@
%__nodejs_native_requires %{_rpmconfigdir}/nodejs_native.req
%__nodejs_native_path ^/usr/lib.*/node_modules/.*\\.node$