aboutsummaryrefslogtreecommitdiff
path: root/system/mongo-tools/mongo-tools.SlackBuild
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-12-03 12:01:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-12-03 19:19:10 +0700
commit17fa82d3aacb3d88d6f0cc13a84ebfa42d77d6d8 (patch)
treec59ceb1fd9eb0eec8f4760b8c6e0a8452d551523 /system/mongo-tools/mongo-tools.SlackBuild
parent0df5d3baa5aa7d86acade79eb0e8fa98e36c9ce4 (diff)
system/mongo-tools: Updated for version 100.9.3.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mongo-tools/mongo-tools.SlackBuild')
-rw-r--r--system/mongo-tools/mongo-tools.SlackBuild37
1 files changed, 16 insertions, 21 deletions
diff --git a/system/mongo-tools/mongo-tools.SlackBuild b/system/mongo-tools/mongo-tools.SlackBuild
index ddb01204fc35a..fdd65a101246f 100644
--- a/system/mongo-tools/mongo-tools.SlackBuild
+++ b/system/mongo-tools/mongo-tools.SlackBuild
@@ -1,8 +1,7 @@
#!/bin/bash
-
# Slackware build script for mongo-tools
-
# Copyright 2015 Miguel De Anda <miguel@thedeanda.com>
+# Copyright 2023 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,11 +24,11 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=mongo-tools
-VERSION=${VERSION:-3.4.9}
+VERSION=${VERSION:-100.9.3}
+COMMITVER="bf0bef9e9f1991880d4423518851ea429a430eb2"
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-ARCHIVE=r${VERSION}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -39,9 +38,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
@@ -65,15 +61,12 @@ else
LIBDIRSUFFIX=""
fi
-set -e
-
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$ARCHIVE.tar.gz || tar xvf $CWD/$PRGNAM-$ARCHIVE.tar.gz
-mv $PRGNAM-r$VERSION $PRGNAM-$VERSION
-cd $PRGNAM-$VERSION
+rm -rf $PRGNAM-$COMMITVER
+unzip $CWD/$PRGNAM-$COMMITVER.zip
+cd $PRGNAM-$COMMITVER
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -81,24 +74,26 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-export GO111MODULE="off"
-
-TARGET_PATH=$PKG/usr/bin
-mkdir -p $TARGET_PATH
-. ./set_gopath.sh
+#export GO111MODULE="off"
+export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+go mod download github.com/fsnotify/fsnotify
+go run build.go -ldflags="$SLKCFLAGS" build
# next block taken from mongo-tools build script
-for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongooplog; do
+for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop; do
echo "Building ${i}..."
# if you have issues, remove/add -tags "ssl sasl"
- go build -o "$TARGET_PATH/$i" "$i/main/$i.go"
+ go build -o "bin/$i" "$i/main/$i.go"
done
+mkdir -p $PKG/usr/bin/
+install bin/* $PKG/usr/bin
+
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE.md README.md THIRD-PARTY-NOTICES CONTRIBUTING.md $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a *.md THIRD-PARTY-NOTICES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install