aboutsummaryrefslogtreecommitdiff
path: root/libraries/rxtx
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-02-15 11:14:05 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-02-16 08:20:07 +0700
commitc1a4de90c5a572611cd0772ad18cc5b24f9b0e72 (patch)
tree4c2d1340dfa9c04a7d9ae55821345ca22b70e86c /libraries/rxtx
parent48ea000283f8100877c08c99f12332c1b7660c12 (diff)
libraries/rxtx: Allow other JDKs besides Oracle's.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/rxtx')
-rw-r--r--libraries/rxtx/README4
-rw-r--r--libraries/rxtx/rxtx.SlackBuild28
2 files changed, 22 insertions, 10 deletions
diff --git a/libraries/rxtx/README b/libraries/rxtx/README
index 055dfecd8bf3..ddc1b0180e95 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 ca79523c702b..aeff018b9fc7 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