office/timetrap: Fix to not remove executable.

Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Jostein Berntsen 2022-05-20 16:50:16 +01:00 committed by Willy Sudiarto Raharjo
parent d7cdd9ca3b
commit fdc88f407c
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -2,7 +2,7 @@
# Slackware build script for timetrap
# Copyright 2013-2021 Jostein Berntsen <jvbernts@online.no>
# Copyright 2013-2022 Jostein Berntsen <jvbernts@online.no>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -27,11 +27,16 @@
# - get rid of hardcoded dependency versions in the gemspec.
# - remove redundant t and dev_t scripts from /usr/bin.
# 20220520 bkw: Modified by Jostein Berntsen, BUILD=3:
# - fix: Update removal line so the executable t is retained
# - Added variable to check for Ruby version and sed line to ensure compatibility
# for newer Ruby versions than 3.0.0
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=timetrap
VERSION=${VERSION:-1.15.2}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -102,7 +107,7 @@ gem install \
$CWD/$PRGNAM-$VERSION.gem
# 20220303 bkw: don't need these extra almost-identical scripts in /usr/bin:
rm -f $PKG/usr/bin/{t,dev_t}
rm -f $PKG/usr/bin/{dev_t}
# 20220303 bkw: the version numbers of the deps are hardcoded in the
# .gemspec. Any time someone updates one of them, it would break
@ -118,6 +123,8 @@ rm -f $PKG/usr/bin/{t,dev_t}
cd $PKG
cp $CWD/remove_hardcoded_versions.diff tmp.diff
[ "$ARCH" = "x86_64" ] || sed -i 's,usr/lib64,usr/lib,g' tmp.diff
RUBYVERSION=$(ls /usr/lib*/ruby/gems)
sed -i "s/gems\/3\.[0-9]\.[0-9]\//gems\/$RUBYVERSION\//g" *.diff
patch -p1 < tmp.diff
rm -f tmp.diff