diff options
Diffstat (limited to 'office/timetrap/timetrap.SlackBuild')
-rw-r--r-- | office/timetrap/timetrap.SlackBuild | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/office/timetrap/timetrap.SlackBuild b/office/timetrap/timetrap.SlackBuild index 3751674657..a93f30c42f 100644 --- a/office/timetrap/timetrap.SlackBuild +++ b/office/timetrap/timetrap.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for timetrap -# Copyright 2013-2016 Jostein Berntsen <jbernts@broadpark.no> +# Copyright 2013-2022 Jostein Berntsen <jvbernts@online.no> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,23 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20220303 bkw: Modified by SlackBuilds.org, BUILD=2: +# - fix REQUIRES: sequel, not sequel4. +# - 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.1} -BUILD=${BUILD:-1} +VERSION=${VERSION:-1.15.2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,30 +48,25 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +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" - 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 +# 20220303 bkw: no SLKCFLAGS needed: there's no compiled C/C++ code. +# No LIBDIRSUFFIX needed, 'gem install' knows the right path to use. +# The only reason this isn't noarch is that the install path includes +# lib or lib64 (like pure python modules do). set -e rm -rf $PKG -mkdir -p $TMP $PKG $OUTPUT -cd $TMP +mkdir -p $TMP/$PRGNAM-$VERSION $PKG $OUTPUT +cd $TMP/$PRGNAM-$VERSION DESTDIR=$( ruby -r rbconfig -e ' include RbConfig @@ -98,8 +106,27 @@ gem install \ --bindir $PKG/usr/bin \ $CWD/$PRGNAM-$VERSION.gem -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 +# 20220303 bkw: don't need these extra almost-identical scripts in /usr/bin: +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 +# timetrap. So get rid of the version numbers. This may lead to +# breakage at some point, but right now it fixes timetrap complaining +# that it can't find its sequel dep at runtime (it wants 5.30.0, +# we actually have 5.42.0, and it seems to work fine). This diff is +# unusual as it patches $PKG after the build, because picking apart +# the .gem file, patching it, and reassembling it (and fixing the +# checksum) is more work than I care to do. + +# Note that the patch has hardcoded lib64 paths, so we sed it. +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 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -108,4 +135,4 @@ 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:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |