Enable dtrace for Node.js < 19

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2023-03-01 13:10:27 -05:00
parent 18ed5c68ec
commit 0479a8dfd7
No known key found for this signature in database
GPG Key ID: 45DB85A568286D11
2 changed files with 39 additions and 0 deletions

View File

@ -184,6 +184,8 @@ BuildRequires: libatomic
BuildRequires: ninja-build
BuildRequires: unzip
Provides: nodejs = %{nodejs_envr}
%if %{with bundled}
@ -221,6 +223,11 @@ BuildRequires: openssl-devel >= %{openssl11_minimum}
%global ssl_configure --shared-openssl %{openssl_fips_configure}
%endif
# dtrace is not supported on Node.js 19+
%global dtrace_configure %{nil}
# we need the system certificate store
Requires: ca-certificates
@ -508,6 +515,7 @@ export PATH="${cwd}/.bin:$PATH"
--shared \
--libdir=%{_lib} \
%{ssl_configure} \
%{dtrace_configure} \
%{!?with_bundled_zlib:--shared-zlib} \
--shared-brotli \
--shared-libuv \
@ -534,6 +542,8 @@ mv %{buildroot}%{nodejs_sitelib} \
%if 0%{?nodejs_default}
ln -srf %{buildroot}%{nodejs_private_sitelib} \
%{buildroot}%{nodejs_sitelib}
%else
rm -f %{buildroot}%{_datadir}/systemtap/tapset/node.stp
%endif
@ -733,6 +743,8 @@ end
%{_bindir}/node
%doc %{_mandir}/man1/node.1*
%{nodejs_sitelib}
%endif
%{_bindir}/node-%{nodejs_major}

View File

@ -186,6 +186,10 @@ BuildRequires: libatomic
BuildRequires: ninja-build
BuildRequires: unzip
{% if NODE_MAJOR < 19 -%}
BuildRequires: systemtap-sdt-devel
{% endif %}
Provides: nodejs = %{nodejs_envr}
%if %{with bundled}
@ -223,6 +227,18 @@ BuildRequires: openssl-devel >= %{openssl11_minimum}
%global ssl_configure --shared-openssl %{openssl_fips_configure}
%endif
{% if NODE_MAJOR < 19 -%}
%if 0%{?nodejs_default}
%global dtrace_configure --with-dtrace
%else
# dtrace is only installed for the default version
%global dtrace_configure %{nil}
%endif
{% else %}
# dtrace is not supported on Node.js 19+
%global dtrace_configure %{nil}
{% endif %}
# we need the system certificate store
Requires: ca-certificates
@ -511,6 +527,7 @@ export PATH="${cwd}/.bin:$PATH"
--shared \
--libdir=%{_lib} \
%{ssl_configure} \
%{dtrace_configure} \
%{!?with_bundled_zlib:--shared-zlib} \
--shared-brotli \
--shared-libuv \
@ -537,6 +554,8 @@ mv %{buildroot}%{nodejs_sitelib} \
%if 0%{?nodejs_default}
ln -srf %{buildroot}%{nodejs_private_sitelib} \
%{buildroot}%{nodejs_sitelib}
%else
rm -f %{buildroot}%{_datadir}/systemtap/tapset/node.stp
%endif
@ -736,6 +755,14 @@ end
%{_bindir}/node
%doc %{_mandir}/man1/node.1*
%{nodejs_sitelib}
{% if NODE_MAJOR < 19 -%}
%dir %{_datadir}/systemtap
%dir %{_datadir}/systemtap/tapset
%{_datadir}/systemtap/tapset/node.stp
%dir %{_usr}/lib/dtrace
%{_usr}/lib/dtrace/node.d
{% endif %}
%endif
%{_bindir}/node-%{nodejs_major}