summaryrefslogtreecommitdiffstats
path: root/system/ksh-openbsd/ksh-openbsd.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/ksh-openbsd/ksh-openbsd.SlackBuild')
-rw-r--r--system/ksh-openbsd/ksh-openbsd.SlackBuild35
1 files changed, 24 insertions, 11 deletions
diff --git a/system/ksh-openbsd/ksh-openbsd.SlackBuild b/system/ksh-openbsd/ksh-openbsd.SlackBuild
index f1865aa260..de6c73ff57 100644
--- a/system/ksh-openbsd/ksh-openbsd.SlackBuild
+++ b/system/ksh-openbsd/ksh-openbsd.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2010-2019 LEVAI Daniel
# All rights reserved.
@@ -27,10 +27,13 @@
# Build script for the Linux port of OpenBSD's ksh
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=ksh-openbsd
VERSION=${VERSION:-20190804}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -40,7 +43,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -65,24 +72,30 @@ rm -Rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -Rf $PRGNAM-$VERSION
-[ -e $CWD/$VERSION.tar.gz ] && tar xvf $CWD/$VERSION.tar.gz
-[ -e $CWD/$PRGNAM-$VERSION.tar.gz ] && tar xf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
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 {} \+
CFLAGS="$SLKCFLAGS $(getconf LFS_CFLAGS)" make
-make check
+
+# 20230810 bkw: tired of this thing hanging when run in the background
+# as part of a long queue.
+case "$(ps -o stat= -p $$)" in
+ *+*) make check ;; # running in foreground
+ *) echo '*** Not running "make check" because we are in the background.' ;;
+esac
+
make install DESTDIR=$PKG
if [ -n "${PDKSH_BINNAME}" ];then
- mv $PKG/bin/pdksh $PKG/bin/"${PDKSH_BINNAME}"
- mv $PKG/usr/man/man1/pdksh.1 $PKG/usr/man/man1/"${PDKSH_BINNAME}".1
- mv $PKG/usr/man/man1/pdksh-sh.1 $PKG/usr/man/man1/"${PDKSH_BINNAME}"-sh.1
+ mv $PKG/bin/pdksh $PKG/bin/"${PDKSH_BINNAME}"
+ mv $PKG/usr/man/man1/pdksh.1 $PKG/usr/man/man1/"${PDKSH_BINNAME}".1
+ mv $PKG/usr/man/man1/pdksh-sh.1 $PKG/usr/man/man1/"${PDKSH_BINNAME}"-sh.1
fi
BINNAME=${PDKSH_BINNAME:-pdksh}
@@ -102,4 +115,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
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