Namespace the v8 compat libraries

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2023-03-16 15:36:41 -04:00
parent 6e5a66a778
commit 580f45bab6
No known key found for this signature in database
GPG key ID: 45DB85A568286D11
2 changed files with 50 additions and 16 deletions

View file

@ -43,7 +43,8 @@
%global nodejs_default %{nodejs_major}
%endif
%global nodejs_private_sitelib %{nodejs_sitelib}_%{nodejs_major}
%global nodejs_default_sitelib %{_prefix}/lib/node_modules
%global nodejs_private_sitelib %{nodejs_default_sitelib}_%{nodejs_major}
# == Bundled Dependency Versions ==
@ -538,12 +539,12 @@ mv out/Release/lib/libnode.so.%{nodejs_soversion} out/Release/
# own the sitelib directory
mv %{buildroot}%{nodejs_sitelib} \
mv %{buildroot}%{nodejs_default_sitelib} \
%{buildroot}%{nodejs_private_sitelib}
%if 0%{?nodejs_default}
ln -srf %{buildroot}%{nodejs_private_sitelib} \
%{buildroot}%{nodejs_sitelib}
%{buildroot}%{nodejs_default_sitelib}
%else
rm -f %{buildroot}%{_datadir}/systemtap/tapset/node.stp
%endif
@ -590,10 +591,18 @@ for header in %{buildroot}%{_includedir}/node/libplatform %{buildroot}%{_include
ln -sf ./node/${header} %{buildroot}%{_includedir}/${header}
done
ln -s ./node/cppgc %{buildroot}%{_includedir}/cppgc
for soname in libv8 libv8_libbase libv8_libplatform; do
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/%{pkgname}-${soname}.so
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/%{pkgname}-${soname}.so.%{v8_major}
done
%if 0%{?nodejs_default}
for soname in libv8 libv8_libbase libv8_libplatform; do
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so.%{v8_major}
done
%endif
# install documentation
mkdir -p %{buildroot}%{_pkgdocdir}/html
@ -614,7 +623,7 @@ mv %{buildroot}/%{_datadir}/doc/node/gdbinit %{buildroot}/%{_pkgdocdir}/gdbinit
mkdir -p %{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man1 \
%{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man5 \
%{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man7 \
%{buildroot}%{nodejs_sitelib}/npm/man \
%{buildroot}%{nodejs_default_sitelib}/npm/man \
%{buildroot}%{nodejs_private_sitelib}/npm/man \
%{buildroot}%{_pkgdocdir}/npm
@ -739,12 +748,12 @@ end
%files -n %{pkgname}
%doc AUTHORS CHANGELOG.md onboarding.md GOVERNANCE.md README.md
%doc CHANGELOG.md onboarding.md GOVERNANCE.md README.md
%if 0%{?nodejs_default}
%{_bindir}/node
%doc %{_mandir}/man1/node.1*
%{nodejs_sitelib}
%{nodejs_default_sitelib}
%dir %{_datadir}/systemtap
%dir %{_datadir}/systemtap/tapset
@ -776,18 +785,26 @@ end
%license LICENSE
%{_libdir}/libnode.so.%{nodejs_soversion}
%{_libdir}/libv8.so.%{v8_major}
%{_libdir}/%{pkgname}-libv8_libbase.so.%{v8_major}
%{_libdir}/%{pkgname}-libv8_libplatform.so.%{v8_major}
%dir %{nodejs_datadir}/
%if 0%{?nodejs_default}
%{_libdir}/libv8_libbase.so.%{v8_major}
%{_libdir}/libv8_libplatform.so.%{v8_major}
%dir %{nodejs_datadir}/
%endif
%files -n v8-%{v8_major}.%{v8_minor}-devel
%{_includedir}/libplatform
%{_includedir}/v8*.h
%{_includedir}/cppgc
%{_libdir}/%{pkgname}-libv8.so
%{_libdir}/%{pkgname}-libv8_libbase.so
%{_libdir}/%{pkgname}-libv8_libplatform.so
%if 0%{?nodejs_default}
%{_libdir}/libv8.so
%{_libdir}/libv8_libbase.so
%{_libdir}/libv8_libplatform.so
%endif
%files -n %{pkgname}-npm

View file

@ -43,7 +43,8 @@
%global nodejs_default %{nodejs_major}
%endif
%global nodejs_private_sitelib %{nodejs_sitelib}_%{nodejs_major}
%global nodejs_default_sitelib %{_prefix}/lib/node_modules
%global nodejs_private_sitelib %{nodejs_default_sitelib}_%{nodejs_major}
# == Bundled Dependency Versions ==
@ -549,12 +550,12 @@ mv out/Release/lib/libnode.so.%{nodejs_soversion} out/Release/
# own the sitelib directory
mv %{buildroot}%{nodejs_sitelib} \
mv %{buildroot}%{nodejs_default_sitelib} \
%{buildroot}%{nodejs_private_sitelib}
%if 0%{?nodejs_default}
ln -srf %{buildroot}%{nodejs_private_sitelib} \
%{buildroot}%{nodejs_sitelib}
%{buildroot}%{nodejs_default_sitelib}
%else
rm -f %{buildroot}%{_datadir}/systemtap/tapset/node.stp
%endif
@ -601,10 +602,18 @@ for header in %{buildroot}%{_includedir}/node/libplatform %{buildroot}%{_include
ln -sf ./node/${header} %{buildroot}%{_includedir}/${header}
done
ln -s ./node/cppgc %{buildroot}%{_includedir}/cppgc
for soname in libv8 libv8_libbase libv8_libplatform; do
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/%{pkgname}-${soname}.so
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/%{pkgname}-${soname}.so.%{v8_major}
done
%if 0%{?nodejs_default}
for soname in libv8 libv8_libbase libv8_libplatform; do
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so
ln -s libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so.%{v8_major}
done
%endif
# install documentation
mkdir -p %{buildroot}%{_pkgdocdir}/html
@ -625,7 +634,7 @@ mv %{buildroot}/%{_datadir}/doc/node/gdbinit %{buildroot}/%{_pkgdocdir}/gdbinit
mkdir -p %{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man1 \
%{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man5 \
%{buildroot}%{_mandir}/nodejs-%{nodejs_major}/man7 \
%{buildroot}%{nodejs_sitelib}/npm/man \
%{buildroot}%{nodejs_default_sitelib}/npm/man \
%{buildroot}%{nodejs_private_sitelib}/npm/man \
%{buildroot}%{_pkgdocdir}/npm
@ -750,12 +759,12 @@ end
%files -n %{pkgname}
%doc AUTHORS CHANGELOG.md onboarding.md GOVERNANCE.md README.md
%doc CHANGELOG.md onboarding.md GOVERNANCE.md README.md
%if 0%{?nodejs_default}
%{_bindir}/node
%doc %{_mandir}/man1/node.1*
%{nodejs_sitelib}
%{nodejs_default_sitelib}
{% if NODE_MAJOR < 19 -%}
%dir %{_datadir}/systemtap
@ -788,18 +797,26 @@ end
%license LICENSE
%{_libdir}/libnode.so.%{nodejs_soversion}
%{_libdir}/libv8.so.%{v8_major}
%{_libdir}/%{pkgname}-libv8_libbase.so.%{v8_major}
%{_libdir}/%{pkgname}-libv8_libplatform.so.%{v8_major}
%dir %{nodejs_datadir}/
%if 0%{?nodejs_default}
%{_libdir}/libv8_libbase.so.%{v8_major}
%{_libdir}/libv8_libplatform.so.%{v8_major}
%dir %{nodejs_datadir}/
%endif
%files -n v8-%{v8_major}.%{v8_minor}-devel
%{_includedir}/libplatform
%{_includedir}/v8*.h
%{_includedir}/cppgc
%{_libdir}/%{pkgname}-libv8.so
%{_libdir}/%{pkgname}-libv8_libbase.so
%{_libdir}/%{pkgname}-libv8_libplatform.so
%if 0%{?nodejs_default}
%{_libdir}/libv8.so
%{_libdir}/libv8_libbase.so
%{_libdir}/libv8_libplatform.so
%endif
%files -n %{pkgname}-npm