aboutsummaryrefslogtreecommitdiff
path: root/system/intelmas/intelmas.SlackBuild
diff options
context:
space:
mode:
authorAlexander Verbovetsky <alik@ejik.org>2020-02-23 23:42:47 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-02-23 23:42:47 +0700
commit1e13b12c9b8d7243082a76e0e84ac75468709510 (patch)
tree3377951fcdb7fc14377c4c81ca4850ef74f42061 /system/intelmas/intelmas.SlackBuild
parentede67b9b9a007424c11db374adeeaa39930a8848 (diff)
system/intelmas: Added (Intel Memory And Storage Tool).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/intelmas/intelmas.SlackBuild')
-rw-r--r--system/intelmas/intelmas.SlackBuild84
1 files changed, 84 insertions, 0 deletions
diff --git a/system/intelmas/intelmas.SlackBuild b/system/intelmas/intelmas.SlackBuild
new file mode 100644
index 000000000000..3cd7ff438ef0
--- /dev/null
+++ b/system/intelmas/intelmas.SlackBuild
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+# Slackware build script for intelmas
+
+# Copyright 2020, Alexander Verbovetsky, Moscow, Russia
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=intelmas
+VERSION=${VERSION:-1.0.5}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+case "$ARCH" in
+ i?86) RPMARCH=i386 ;;
+ x86_64) RPMARCH=x86_64 ;;
+ *) printf "\n$ARCH is unsupported for the Intel Memory And Storage Tool.\n\n"
+ exit 1 ;;
+esac
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+
+unzip "$CWD/Intel*MAS_CLI_Tool_${VERSION}*Linux*.zip"
+rpm2cpio intelmas-${VERSION}*.$RPMARCH.rpm | cpio -imdv
+
+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 \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# The library path is hard-coded, so we stick with /usr/lib
+cp -a usr $PKG
+mv $PKG/usr/bin $PKG/usr/sbin
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a *.pdf *.PDF $PKG/usr/doc/$PRGNAM-$VERSION 2>/dev/null || :
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+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}