summaryrefslogtreecommitdiffstats
path: root/system/powershell/powershell.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/powershell/powershell.SlackBuild')
-rw-r--r--system/powershell/powershell.SlackBuild49
1 files changed, 26 insertions, 23 deletions
diff --git a/system/powershell/powershell.SlackBuild b/system/powershell/powershell.SlackBuild
index 9232ac2e5e..630b66e764 100644
--- a/system/powershell/powershell.SlackBuild
+++ b/system/powershell/powershell.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
#
# Slackware build script for powershell.
#
-# Copyright 2019 Reza Talebi, Shahin Shahr, Iran.
+# Copyright 2022 Reza Talebi, Shahin Shahr, Iran.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,38 +22,39 @@
# 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=powershell
-VERSION=${VERSION:-7.0.3}
+VERSION=${VERSION:-7.4.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
+ ARCH=$( uname -m )
+fi
+
+if [ "$ARCH" = "x86_64" ]; then
+ ARCHITECTURE="x64"
+else
+ echo "Package for $ARCH architecture is not available."
+ exit 1
+fi
+
+# 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
-CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-
set -e
-if [ "$( uname -m )" = "x86_64" ]; then
- ARCH="x86_64"
- ARCHITECTURE="x64"
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
- BITS="amd64"
-else
- echo "Package for $(uname -m) architecture is not available."
- exit 1
-fi
-
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -64,12 +65,14 @@ mkdir -p opt/microsoft/powershell
tar -zxf $CWD/$PRGNAM-${VERSION}-linux-${ARCHITECTURE}.tar.gz -C opt/microsoft/powershell
chown -R root:root opt/microsoft/powershell
+mkdir -p usr/bin/
+ln -s /opt/microsoft/powershell/pwsh usr/bin/pwsh
+
mkdir -p usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg --linkadd y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE