summaryrefslogtreecommitdiffstats
path: root/libraries/rxtx/rxtx.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/rxtx/rxtx.SlackBuild')
-rw-r--r--libraries/rxtx/rxtx.SlackBuild53
1 files changed, 38 insertions, 15 deletions
diff --git a/libraries/rxtx/rxtx.SlackBuild b/libraries/rxtx/rxtx.SlackBuild
index f5529f322d..3daaf6a91e 100644
--- a/libraries/rxtx/rxtx.SlackBuild
+++ b/libraries/rxtx/rxtx.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for rxtx
# Copyright 2011 David Spencer, Baildon, West Yorkshire, U.K.
@@ -21,26 +21,36 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=rxtx
VERSION=${VERSION:-2.2pre2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -54,11 +64,22 @@ 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 openjdk8 zulu-openjdk8"
+ 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
@@ -73,9 +94,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
@@ -100,13 +121,15 @@ 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
+rm -f $PKG/usr/lib*/*.la
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE