[packages/openjdk8] change jre bins/libs in %{dstdir} to symlinks inside %{jredir}

atler atler at pld-linux.org
Sun Jan 15 21:05:10 CET 2023


commit 37e6f52c9eb099027da61095c1d67b63932d87aa
Author: Jan Palus <atler at pld-linux.org>
Date:   Sun Jan 15 21:02:57 2023 +0100

    change jre bins/libs in %{dstdir} to symlinks inside %{jredir}
    
    makes $JAVA_HOME/bin/java work without openjdk8-jdk-base installed.
    fails to find libjli.so otherwise.

 openjdk8.spec | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/openjdk8.spec b/openjdk8.spec
index 1ce879a..e70802e 100644
--- a/openjdk8.spec
+++ b/openjdk8.spec
@@ -555,11 +555,19 @@ rmdir $RPM_BUILD_ROOT%{dstdir}/man
 # replace duplicates with symlinks, link to %{_bindir}
 for path in $RPM_BUILD_ROOT%{dstdir}/bin/*; do
 	filename=$(basename $path)
-        ln -sf "%{dstdir}/bin/$filename" $RPM_BUILD_ROOT%{_bindir}
+	if [ -e "$RPM_BUILD_ROOT%{jredir}/bin/$filename" ] && [ ! -L "$RPM_BUILD_ROOT%{jredir}/bin/$filename" ]; then
+		%{__rm} "$path"
+		ln -s "%{jredir}/bin/$filename" "$path"
+	fi
+	ln -sf "%{dstdir}/bin/$filename" $RPM_BUILD_ROOT%{_bindir}
 done
 
 ln -sf  "%{jredir}/bin/java" $RPM_BUILD_ROOT%{_bindir}
 
+%{__rm} $RPM_BUILD_ROOT%{dstdir}/lib/%{jre_arch}/{libjawt.so,jli/libjli.so}
+ln -s "%{jredir}/lib/%{jre_arch}/jli/libjli.so" "$RPM_BUILD_ROOT%{dstdir}/lib/%{jre_arch}/jli"
+ln -s "%{jredir}/lib/%{jre_arch}/libjawt.so" "$RPM_BUILD_ROOT%{dstdir}/lib/%{jre_arch}"
+
 # keep configuration in %{_sysconfdir} (not all *.properties go there)
 for config in management security \
 		logging.properties net.properties sound.properties; do
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openjdk8.git/commitdiff/37e6f52c9eb099027da61095c1d67b63932d87aa



More information about the pld-cvs-commit mailing list