slackbuilds_ponce/network/vmware-horizon-client/vmware-horizon-client.SlackBuild
Erich Ritz d1e0a8bdca
network/vmware-horizon-client: Updated for version 2312.1_8.12.1_23543969.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-04-25 22:19:07 +07:00

122 lines
4.7 KiB
Bash

#!/bin/bash
# Slackware build script for vmware-horizon-client
# Copyright 2015 Beni Keller, Schwyz, Switzerland
# Copyright 2024 Erich Ritz, Jenks, Oklahoma, USA
# 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.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=vmware-horizon-client
SRCNAM=VMware-Horizon-Client
VERSION=${VERSION:-2312.1_8.12.1_23543969}
DEBVERSION=${VERSION//_/-}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
# Upstream only has binary support for x86_64 at present.
if [ "$ARCH" = "x86_64" ]; then
DEBARCH="x64"
else
echo "Sorry, the VMware Horizon Client binary is currently available for x86_64 only."
exit 1
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $PKG
ar p $CWD/${SRCNAM}-${DEBVERSION}.$DEBARCH.deb data.tar.gz | tar xzv
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 {} \;
# Move lib to lib64
mv $PKG/usr/lib $PKG/usr/lib64
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/bin/vmware-appstub
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/bin/vmware-url-filter
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/bin/vmware-view
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/bin/vmware-view-lib-scan
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/bin/vmware-view-log-collector
sed -i 's-/usr/lib-/usr/lib64-g' $PKG/usr/lib64/vmware/view/integratedPrinting/integrated-printing-setup.sh
#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
#find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
# | cut -f 1 -d : | xargs chmod 755 2> /dev/null || true
# Handle Debian's postinst:
ln -s /lib64/libudev.so.1 $PKG/usr/lib64/vmware/libudev.so.0
ln -s /usr/lib64/libsecret-1.so $PKG/usr/lib64/vmware/libsecret.so
mkdir -p $PKG/etc/rc0.d
mkdir -p $PKG/etc/rc3.d
mkdir -p $PKG/etc/rc4.d
mkdir -p $PKG/etc/rc6.d
ln -s /etc/init.d/ftsprhv $PKG/etc/rc0.d/K08ftsprhv
ln -s /etc/init.d/ftsprhv $PKG/etc/rc6.d/K08ftsprhv
ln -s /etc/init.d/ftsprhv $PKG/etc/rc3.d/S50ftsprhv
ln -s /etc/init.d/ftsprhv $PKG/etc/rc4.d/S50ftsprhv
ln -s /etc/init.d/ftscanhv $PKG/etc/rc0.d/K08ftscanhv
ln -s /etc/init.d/ftscanhv $PKG/etc/rc6.d/K08ftscanhv
ln -s /etc/init.d/ftscanhv $PKG/etc/rc3.d/S50ftscanhv
ln -s /etc/init.d/ftscanhv $PKG/etc/rc4.d/S50ftscanhv
ln -s /etc/init.d/vmware-USBArbitrator $PKG/etc/rc0.d/K01vmware-USBArbitrator
ln -s /etc/init.d/vmware-USBArbitrator $PKG/etc/rc6.d/K01vmware-USBArbitrator
ln -s /etc/init.d/vmware-USBArbitrator $PKG/etc/rc3.d/S01vmware-USBArbitrator
ln -s /etc/init.d/vmware-USBArbitrator $PKG/etc/rc4.d/S01vmware-USBArbitrator
ln -sf /usr/lib64/vmware/view/usb/vmware-usbarbitrator $PKG/usr/bin/vmware-usbarbitrator
chmod +755 $PKG/usr/lib64/vmware/view/html5mmr/*.so*
chmod +755 $PKG/usr/lib64/vmware/view/vdpService/webrtcRedir/libwebrtc_sharedlib.so
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/doc/vmware-horizon-client/* $PKG/usr/doc/$PRGNAM-$VERSION/
rm -rf $PKG/usr/share/doc
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
cat $CWD/douninst.sh > $PKG/install/douninst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE