From fdc88f407c5cf122f3a3483f274e85c1a60dfe37 Mon Sep 17 00:00:00 2001 From: Jostein Berntsen Date: Fri, 20 May 2022 16:50:16 +0100 Subject: [PATCH] office/timetrap: Fix to not remove executable. Signed-off-by: Dave Woodfall Signed-off-by: Willy Sudiarto Raharjo --- office/timetrap/timetrap.SlackBuild | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/office/timetrap/timetrap.SlackBuild b/office/timetrap/timetrap.SlackBuild index 7e85928e06..a93f30c42f 100644 --- a/office/timetrap/timetrap.SlackBuild +++ b/office/timetrap/timetrap.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for timetrap -# Copyright 2013-2021 Jostein Berntsen +# Copyright 2013-2022 Jostein Berntsen # 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