aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-03-03 13:03:41 -0500
committerAndrew Clemons <andrew.clemons@gmail.com>2022-03-05 00:20:04 +1300
commit654c0dd1dd8fb27cd0a5332ded32455d1fe6f19d (patch)
tree4c7984bd35f4f7afed6f82532b95a62dce66f5e9
parent4f6877dfe422be7c52be11051d85a8e11d16ea10 (diff)
office/timetrap: Fix gemspec (hardcoded versions).
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
-rw-r--r--office/timetrap/remove_hardcoded_versions.diff43
-rw-r--r--office/timetrap/timetrap.SlackBuild52
-rw-r--r--office/timetrap/timetrap.info2
3 files changed, 75 insertions, 22 deletions
diff --git a/office/timetrap/remove_hardcoded_versions.diff b/office/timetrap/remove_hardcoded_versions.diff
new file mode 100644
index 0000000000000..80f53082ffdcc
--- /dev/null
+++ b/office/timetrap/remove_hardcoded_versions.diff
@@ -0,0 +1,43 @@
+diff -Naur package-timetrap.orig/usr/lib64/ruby/gems/3.0.0/gems/timetrap-1.15.2/timetrap.gemspec package-timetrap/usr/lib64/ruby/gems/3.0.0/gems/timetrap-1.15.2/timetrap.gemspec
+--- package-timetrap.orig/usr/lib64/ruby/gems/3.0.0/gems/timetrap-1.15.2/timetrap.gemspec 2022-03-03 12:47:47.581366263 -0500
++++ package-timetrap/usr/lib64/ruby/gems/3.0.0/gems/timetrap-1.15.2/timetrap.gemspec 2022-03-03 12:49:43.847293432 -0500
+@@ -25,8 +25,8 @@
+ # More recent versions of icalendar drop support for Ruby 1.8.7
+ spec.add_development_dependency "icalendar", "~> 1.3.0"
+ spec.add_development_dependency "json", "~> 2.3"
+- spec.add_dependency "sequel", "~> 5.30.0"
+- spec.add_dependency "sqlite3", "~> 1.4.2"
++ spec.add_dependency "sequel"
++ spec.add_dependency "sqlite3"
+
+- spec.add_dependency "chronic", "~> 0.10.2"
++ spec.add_dependency "chronic"
+ end
+diff -Naur package-timetrap.orig/usr/lib64/ruby/gems/3.0.0/specifications/timetrap-1.15.2.gemspec package-timetrap/usr/lib64/ruby/gems/3.0.0/specifications/timetrap-1.15.2.gemspec
+--- package-timetrap.orig/usr/lib64/ruby/gems/3.0.0/specifications/timetrap-1.15.2.gemspec 2022-03-03 12:47:47.618366877 -0500
++++ package-timetrap/usr/lib64/ruby/gems/3.0.0/specifications/timetrap-1.15.2.gemspec 2022-03-03 12:54:37.636163127 -0500
+@@ -31,9 +31,9 @@
+ s.add_development_dependency(%q<fakefs>.freeze, ["~> 0.20"])
+ s.add_development_dependency(%q<icalendar>.freeze, ["~> 1.3.0"])
+ s.add_development_dependency(%q<json>.freeze, ["~> 2.3"])
+- s.add_runtime_dependency(%q<sequel>.freeze, ["~> 5.30.0"])
+- s.add_runtime_dependency(%q<sqlite3>.freeze, ["~> 1.4.2"])
+- s.add_runtime_dependency(%q<chronic>.freeze, ["~> 0.10.2"])
++ s.add_runtime_dependency(%q<sequel>)
++ s.add_runtime_dependency(%q<sqlite3>)
++ s.add_runtime_dependency(%q<chronic>)
+ else
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.1"])
+ s.add_dependency(%q<rake>.freeze, ["~> 13.0"])
+@@ -41,8 +41,8 @@
+ s.add_dependency(%q<fakefs>.freeze, ["~> 0.20"])
+ s.add_dependency(%q<icalendar>.freeze, ["~> 1.3.0"])
+ s.add_dependency(%q<json>.freeze, ["~> 2.3"])
+- s.add_dependency(%q<sequel>.freeze, ["~> 5.30.0"])
+- s.add_dependency(%q<sqlite3>.freeze, ["~> 1.4.2"])
+- s.add_dependency(%q<chronic>.freeze, ["~> 0.10.2"])
++ s.add_dependency(%q<sequel>)
++ s.add_dependency(%q<sqlite3>)
++ s.add_dependency(%q<chronic>)
+ end
+ end
diff --git a/office/timetrap/timetrap.SlackBuild b/office/timetrap/timetrap.SlackBuild
index 39e387b0322b5..7e85928e065a2 100644
--- a/office/timetrap/timetrap.SlackBuild
+++ b/office/timetrap/timetrap.SlackBuild
@@ -22,11 +22,16 @@
# 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.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=timetrap
VERSION=${VERSION:-1.15.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -38,9 +43,6 @@ 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.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -50,25 +52,16 @@ 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
@@ -108,8 +101,25 @@ 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/{t,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
+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
diff --git a/office/timetrap/timetrap.info b/office/timetrap/timetrap.info
index 2541e179220b7..202f7214b548e 100644
--- a/office/timetrap/timetrap.info
+++ b/office/timetrap/timetrap.info
@@ -5,6 +5,6 @@ DOWNLOAD="http://rubygems.org/downloads/timetrap-1.15.2.gem"
MD5SUM="c7c84dc593201b1764268ca46dc06c2c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="sequel4 sqlite3 chronic"
+REQUIRES="sequel sqlite3 chronic"
MAINTAINER="Jostein Berntsen"
EMAIL="jvbernts@online.no"