aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-05-01 11:52:19 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-05-07 13:59:18 +0700
commitad90d4f2af5ca4195f562677d0dd5d1042649dc9 (patch)
treea0edf2db03cb74eaa5e49ff2c2fe6663fc69b098
parentad45cc17ddefd6076948334d1df37c9595732e77 (diff)
games/stuntrally: Don't include 32bit libs in 64bit pkg.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--games/stuntrally/stuntrally.SlackBuild44
1 files changed, 24 insertions, 20 deletions
diff --git a/games/stuntrally/stuntrally.SlackBuild b/games/stuntrally/stuntrally.SlackBuild
index 85464c446430e..bcec5d68ee0b3 100644
--- a/games/stuntrally/stuntrally.SlackBuild
+++ b/games/stuntrally/stuntrally.SlackBuild
@@ -22,12 +22,16 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220501 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - only package the correct set of binaries/libraries (32-bit or 64-bit).
+# - make .desktop files validate (mostly).
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=stuntrally
SRCNAM=StuntRally
VERSION=${VERSION:-2.6}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -39,9 +43,11 @@ if [ -z "$ARCH" ]; then
esac
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.
+case "$ARCH" in
+ i?86|x86_64) ;;
+ *) echo "ARCH=$ARCH unsupported" ;;
+esac
+
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -51,20 +57,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
set -e
rm -rf $PKG
@@ -76,9 +68,9 @@ cd $SRCNAM-$VERSION-linux64
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 \
+ -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 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
cd ..
mkdir -p $PKG/{opt/$PRGNAM/,usr/bin/}
cp -r StuntRally-$VERSION-linux64/* $PKG/opt/$PRGNAM/
@@ -89,9 +81,21 @@ ln -s /opt/$PRGNAM/sr-editor usr/bin/
mv opt/$PRGNAM/share usr/
rm -f $PKG/opt/$PRGNAM/lib/{32,64}/libstdc++.so.6
+# 20220501 bkw: x86_64 packages don't need the 32-bit exe and libs,
+# i?86 packages don't need the 64-bit ones. saves a bit of disk space.
+if [ "$ARCH" = "x86_64" ]; then
+ rm -rf $PKG/opt/$PRGNAM/bin/*_x86 $PKG/opt/$PRGNAM/lib/32
+else
+ rm -rf $PKG/opt/$PRGNAM/bin/*_x86_64 $PKG/opt/$PRGNAM/lib/64
+fi
+
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
+# 20220501 bkw: pacify desktop-file-validate somewhat.
+sed -i -e '/^Categories/s,Application;,,' \
+ $PKG/usr/share/applications/*.desktop
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a opt/$PRGNAM/License.txt opt/$PRGNAM/Readme.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild