slackbuilds_ponce/desktop/xkblayout-state/xkblayout-state.SlackBuild
B. Watson 37b486883b
desktop/xkblayout-state: Updated for v1b_git20211006, new maint.
Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-10-12 11:34:43 +07:00

80 lines
1.9 KiB
Bash

#!/bin/bash
# Slackware build script for xkblayout-state
# Original author: Alexander Verbovetsky, Moscow, Russia
# Now maintained by B. Watson <urchlay@slackware.uk>.
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20241008 bkw:
# - take over maintenance.
# - update for 1b_git20211006.
# - relicense as WTFPL.
# - strip binary.
# - use standard SLKCFLAGS (they were missing).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=xkblayout-state
VERSION=${VERSION:-1b_git20211006}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
HASH=${HASH:-f311779ed95f43f1fdebed0f710ad84057e6fe19}
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
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
elif [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2 -fPIC"
else
SLKCFLAGS="-O2"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$HASH
tar xvf $CWD/$PRGNAM-$HASH.tar.gz
cd $PRGNAM-$HASH
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
make CXXFLAGS="$SLKCFLAGS"
mkdir -p $PKG/usr/bin
install -s -m 0755 -o root -g root xkblayout-state $PKG/usr/bin/
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a README.md $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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