From c1a4de90c5a572611cd0772ad18cc5b24f9b0e72 Mon Sep 17 00:00:00 2001 From: B. Watson Date: Tue, 15 Feb 2022 11:14:05 -0500 Subject: libraries/rxtx: Allow other JDKs besides Oracle's. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- libraries/rxtx/README | 4 ++-- libraries/rxtx/rxtx.SlackBuild | 28 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) (limited to 'libraries') diff --git a/libraries/rxtx/README b/libraries/rxtx/README index 055dfecd8b..ddc1b0180e 100644 --- a/libraries/rxtx/README +++ b/libraries/rxtx/README @@ -1,7 +1,7 @@ RXTX is a Java library providing serial and parallel port communication. -To build RXTX requires the jdk package (available in Slackware's extra/ -directory). +RXTX's .info file says it requires the jdk package, but other JDKs can +be used instead (e.g. openjdk8, adoptopenjdk). If you are upgrading from rxtx-2.0_7pre2, please note that the javacomm package is no longer required and should be uninstalled before building diff --git a/libraries/rxtx/rxtx.SlackBuild b/libraries/rxtx/rxtx.SlackBuild index ca79523c70..aeff018b9f 100644 --- a/libraries/rxtx/rxtx.SlackBuild +++ b/libraries/rxtx/rxtx.SlackBuild @@ -64,11 +64,23 @@ else fi # Let's make sure that jdk is installed and the relevant environment variables -# are set correctly (we need JAVA_HOME): -if [ -r /etc/profile.d/jdk.sh ]; then - . /etc/profile.d/jdk.sh -else - echo "JDK does not appear to be installed; exiting..." +# are set correctly (we need JAVA_HOME). +# 20220215 bkw: look at /etc/profile.d/*jdk* and pick the first one +# that's executable. we just have too many jdk choices, and some of us +# don't want to jump through oracle's hoops to download their jdk. +if [ -z "$JAVA_HOME" ]; then + JDKS="jdk jdk11 openjdk8 adoptopenjdk zulu-openjdk11" + JDKS+=" zulu-openjdk8 zulu-openjdk11 zulu-openjdk17" + for i in $JDKS; do + if [ -x /etc/profile.d/$i.sh ]; then + . /etc/profile.d/$i.sh + break + fi + done +fi + +if [ -z "$JAVA_HOME" ]; then + echo "No usable JDK appears to be installed; exiting..." exit 1 fi @@ -83,9 +95,9 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ + -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; + -exec chmod 644 {} \+ # Disable obsolete UTS_RELEASE check # http://mailman.qbang.org/pipermail/rxtx/2009-September/5399616.html @@ -110,7 +122,7 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - AUTHORS COPYING ChangeLog INSTALL PORTING README \ + AUTHORS COPYING ChangeLog PORTING README \ SerialPortInstructions.txt TODO \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -- cgit v1.2.3