diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-12-02 09:46:06 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-12-03 19:19:10 +0700 |
commit | 0df5d3baa5aa7d86acade79eb0e8fa98e36c9ce4 (patch) | |
tree | 9af85ff7bdb6dd6ce097c3840a1691fe7cdad118 | |
parent | 6222c777ddf9b0f1d24a073ec04974634deb9992 (diff) |
system/mongodb: Updated for version 7.0.4.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/mongodb/files/rc.mongodb | 11 | ||||
-rw-r--r-- | system/mongodb/mongodb.SlackBuild | 14 | ||||
-rw-r--r-- | system/mongodb/mongodb.info | 12 | ||||
-rw-r--r-- | system/mongodb/patches/01_mongodb-4.4.1-boost.patch | 23 | ||||
-rw-r--r-- | system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch | 12 | ||||
-rw-r--r-- | system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch | 32 | ||||
-rw-r--r-- | system/mongodb/patches/05_mongodb-5.0.2-skip-no-exceptions.patch | 13 | ||||
-rw-r--r-- | system/mongodb/patches/mongodb-5.0.2-no-compass.patch (renamed from system/mongodb/patches/04_mongodb-5.0.2-no-compass.patch) | 0 | ||||
-rw-r--r-- | system/mongodb/patches/mongodb-5.0.2-skip-reqs-check.patch (renamed from system/mongodb/patches/06_mongodb-5.0.2-skip-reqs-check.patch) | 0 | ||||
-rw-r--r-- | system/mongodb/patches/mongodb-7.0.2-sconstruct.patch | 159 |
10 files changed, 177 insertions, 99 deletions
diff --git a/system/mongodb/files/rc.mongodb b/system/mongodb/files/rc.mongodb index 47ca19be76b0..f0b178c3cff4 100644 --- a/system/mongodb/files/rc.mongodb +++ b/system/mongodb/files/rc.mongodb @@ -7,7 +7,7 @@ # PID=/var/state/mongodb.pid -LOG=/var/log/mongodb +LOG=/var/log/mongodb/mongodb.log DBPATH=/var/lib/mongodb USER=mongo GROUP=mongo @@ -15,17 +15,16 @@ SHELL=${SHELL:-/bin/bash} mongo_start() { touch $LOG - chown $GROUP.$USER $LOG + chown $GROUP:$USER $LOG touch $PID - chown $GROUP.$USER $PID + chown $GROUP:$USER $PID su -l $USER -s $SHELL -c "/usr/bin/mongod \ --dbpath=$DBPATH \ --fork \ --pidfilepath=$PID \ --logappend \ - --logpath=$LOG \ - --nohttpinterface \ + --logpath=$LOG " && { echo "MongoDB server started successfully." } || { @@ -41,7 +40,7 @@ mongo_stop() { echo "Failed to stop MongoDB server" > /dev/stderr exit 1 } - # rm $PID + rm -f $PID } mongo_restart() { diff --git a/system/mongodb/mongodb.SlackBuild b/system/mongodb/mongodb.SlackBuild index fdf3e89a2312..d242ce9ec48e 100644 --- a/system/mongodb/mongodb.SlackBuild +++ b/system/mongodb/mongodb.SlackBuild @@ -3,6 +3,7 @@ # Slackware build script for MongoDB # 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 @@ -26,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM="mongodb" -VERSION=${VERSION:-5.0.4} +VERSION=${VERSION:-7.0.4} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +41,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 @@ -93,7 +91,7 @@ cd $SRC_FLDR rm -fR src/third_party/{boost,pcre-*,snappy-*,yaml-cpp,zlib-*} # remove compass rm -fR src/mongo/installer/compass -chown -R root.root . +chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ @@ -106,12 +104,14 @@ for i in $CWD/patches/* ; do patch -p1 < $i ; done scons_opts=( --disable-warnings-as-errors --use-system-boost - --use-system-pcre + --use-system-pcre2 --use-system-snappy --use-system-yaml --use-system-zlib --use-system-zstd --use-sasl-client + --use-system-libbson + --use-system-mongo-c --ssl ) @@ -146,7 +146,7 @@ cat $CWD/files/rc.mongodb > $PKG/etc/rc.d/rc.mongodb.new mkdir -p $PKG/var/{lib,log}/mongodb chmod 750 $PKG/var/{lib,log}/mongodb -chown mongo.mongo $PKG/var/{lib,log}/mongodb +chown mongo:mongo $PKG/var/{lib,log}/mongodb mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/system/mongodb/mongodb.info b/system/mongodb/mongodb.info index 149b6b35e596..d2fdea5b4df8 100644 --- a/system/mongodb/mongodb.info +++ b/system/mongodb/mongodb.info @@ -1,10 +1,10 @@ PRGNAM="mongodb" -VERSION="5.0.4" +VERSION="7.0.4" HOMEPAGE="https://www.mongodb.org/" DOWNLOAD="UNSUPPORTED" MD5SUM="" -DOWNLOAD_x86_64="https://fastdl.mongodb.org/src/mongodb-src-r5.0.4.tar.gz" -MD5SUM_x86_64="366a864aaf21cc391e910f46a3051461" -REQUIRES="cheetah3 python3-psutil snappy snowballstemmer yaml-cpp" -MAINTAINER="Miguel De Anda" -EMAIL="miguel@thedeanda.com" +DOWNLOAD_x86_64="https://fastdl.mongodb.org/src/mongodb-src-r7.0.4.tar.gz" +MD5SUM_x86_64="a9c3fba4d05505fe05f2d56530d5f326" +REQUIRES="cheetah3 python3-psutil snappy snowballstemmer yaml-cpp python3-jsonschema mongo-c-driver pymongo" +MAINTAINER="Willy Sudiarto Raharjo" +EMAIL="willysr@slackbuilds.org" diff --git a/system/mongodb/patches/01_mongodb-4.4.1-boost.patch b/system/mongodb/patches/01_mongodb-4.4.1-boost.patch deleted file mode 100644 index 009ca6826a4f..000000000000 --- a/system/mongodb/patches/01_mongodb-4.4.1-boost.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/SConstruct b/SConstruct -index 89c044ab..0484e475 100644 ---- a/SConstruct -+++ b/SConstruct -@@ -3511,17 +3511,11 @@ def doConfigure(myenv): - "BOOST_LOG_NO_SHORTHAND_NAMES", - "BOOST_LOG_USE_NATIVE_SYSLOG", - "BOOST_LOG_WITHOUT_THREAD_ATTR", -+ "BOOST_LOG_DYN_LINK", - "ABSL_FORCE_ALIGNED_ACCESS", - ] - ) - -- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk': -- conf.env.AppendUnique( -- CPPDEFINES=[ -- "BOOST_LOG_DYN_LINK", -- ] -- ) -- - if use_system_version_of_library("boost"): - if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ): - myenv.ConfError("can't find boost headers") diff --git a/system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch b/system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch deleted file mode 100644 index a6ff02dcf66f..000000000000 --- a/system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch +++ /dev/null @@ -1,12 +0,0 @@ -https://bugs.gentoo.org/768339 - ---- a/src/mongo/db/exec/plan_stats.h -+++ b/src/mongo/db/exec/plan_stats.h -@@ -33,6 +33,7 @@ - #include <cstdlib> - #include <string> - #include <vector> -+#include <optional> - - #include "mongo/db/index/multikey_paths.h" - diff --git a/system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch b/system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch deleted file mode 100644 index 2d1a2f9312bb..000000000000 --- a/system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/SConstruct b/SConstruct -index 115de78a..613110b7 100644 ---- a/SConstruct -+++ b/SConstruct -@@ -2366,7 +2366,6 @@ if env.TargetOSIs('posix'): - - # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used. - env.Append( CCFLAGS=["-fasynchronous-unwind-tables", -- "-ggdb" if not env.TargetOSIs('emscripten') else "-g", - "-Wall", - "-Wsign-compare", - "-Wno-unknown-pragmas", -@@ -2422,6 +2421,8 @@ if env.TargetOSIs('posix'): - - # env.Append( " -Wconversion" ) TODO: this doesn't really work yet - env.Append( CXXFLAGS=["-Woverloaded-virtual"] ) -+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] ) -+ env.Append( LINKFLAGS=os.environ['LDFLAGS'] ) - - # On OS X, clang doesn't want the pthread flag at link time, or it - # issues warnings which make it impossible for us to declare link -@@ -2473,8 +2474,8 @@ if env.TargetOSIs('posix'): - ], - ) - -- #make scons colorgcc friendly -- for key in ('HOME', 'TERM'): -+ #make scons colorgcc, distcc, ccache friendly -+ for key in ('HOME', 'PATH', 'TERM'): - try: - env['ENV'][key] = os.environ[key] - except KeyError: diff --git a/system/mongodb/patches/05_mongodb-5.0.2-skip-no-exceptions.patch b/system/mongodb/patches/05_mongodb-5.0.2-skip-no-exceptions.patch deleted file mode 100644 index ae69befcea82..000000000000 --- a/system/mongodb/patches/05_mongodb-5.0.2-skip-no-exceptions.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/SConstruct b/SConstruct -index 613110b7..4987e24e 100644 ---- a/SConstruct -+++ b/SConstruct -@@ -2958,7 +2958,7 @@ def doConfigure(myenv): - - # This warning was added in clang-5 and incorrectly flags our implementation of - # exceptionToStatus(). See https://bugs.llvm.org/show_bug.cgi?id=34804 -- AddToCCFLAGSIfSupported(myenv, "-Wno-exceptions") -+ #AddToCCFLAGSIfSupported(myenv, "-Wno-exceptions") - - # Enable sized deallocation support. - AddToCXXFLAGSIfSupported(myenv, '-fsized-deallocation') diff --git a/system/mongodb/patches/04_mongodb-5.0.2-no-compass.patch b/system/mongodb/patches/mongodb-5.0.2-no-compass.patch index 777251577298..777251577298 100644 --- a/system/mongodb/patches/04_mongodb-5.0.2-no-compass.patch +++ b/system/mongodb/patches/mongodb-5.0.2-no-compass.patch diff --git a/system/mongodb/patches/06_mongodb-5.0.2-skip-reqs-check.patch b/system/mongodb/patches/mongodb-5.0.2-skip-reqs-check.patch index 823d481c208f..823d481c208f 100644 --- a/system/mongodb/patches/06_mongodb-5.0.2-skip-reqs-check.patch +++ b/system/mongodb/patches/mongodb-5.0.2-skip-reqs-check.patch diff --git a/system/mongodb/patches/mongodb-7.0.2-sconstruct.patch b/system/mongodb/patches/mongodb-7.0.2-sconstruct.patch new file mode 100644 index 000000000000..822bd81d0b3a --- /dev/null +++ b/system/mongodb/patches/mongodb-7.0.2-sconstruct.patch @@ -0,0 +1,159 @@ +diff --git a/SConstruct b/SConstruct +index 92d557b..80ee9e8 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -23,7 +23,6 @@ from pkg_resources import parse_version + + import SCons + import SCons.Script +-from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics + from site_scons.mongo import build_profiles + + # This must be first, even before EnsureSConsVersion, if +@@ -1649,13 +1648,6 @@ env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption + + # The placement of this is intentional. Here we setup an atexit method to store tooling metrics. + # We should only register this function after env, env_vars and the parser have been properly initialized. +-SConsToolingMetrics.register_metrics( +- utc_starttime=datetime.utcnow(), +- artifact_dir=env.Dir('$BUILD_DIR').get_abspath(), +- env_vars=env_vars, +- env=env, +- parser=_parser, +-) + + if get_option('build-metrics'): + env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR' +@@ -3026,7 +3018,6 @@ if env.TargetOSIs('posix'): + env.Append( + CCFLAGS=[ + "-fasynchronous-unwind-tables", +- "-g2" if not env.TargetOSIs('emscripten') else "-g", + "-Wall", + "-Wsign-compare", + "-Wno-unknown-pragmas", +@@ -3093,6 +3084,8 @@ if env.TargetOSIs('posix'): + + # env.Append( " -Wconversion" ) TODO: this doesn't really work yet + env.Append(CXXFLAGS=["-Woverloaded-virtual"]) ++ env.Append(CXXFLAGS=os.environ['CXXFLAGS']) ++ env.Append(LINKFLAGS=os.environ['LDFLAGS']) + + # On OS X, clang doesn't want the pthread flag at link time, or it + # issues warnings which make it impossible for us to declare link +@@ -3143,7 +3136,7 @@ if env.TargetOSIs('posix'): + ], ) + + #make scons colorgcc friendly +- for key in ('HOME', 'TERM'): ++ for key in ('HOME', 'TERM', 'PATH'): + try: + env['ENV'][key] = os.environ[key] + except KeyError: +@@ -3543,33 +3536,6 @@ def doConfigure(myenv): + myenv.AddMethod( + functools.partial(var_func, var=var, func=CheckFlag), f"Check{var}Supported") + +- if myenv.ToolchainIs('gcc', 'clang'): +- # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker +- # because it is much faster. Don't use it if the user has already configured another linker +- # selection manually. +- if any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']): +- myenv.FatalError( +- f"Use the '--linker' option instead of modifying the LINKFLAGS directly.") +- +- linker_ld = get_option('linker') +- if linker_ld == 'auto': +- if not env.TargetOSIs('darwin', 'macOS'): +- if not myenv.AddToLINKFLAGSIfSupported('-fuse-ld=lld'): +- myenv.FatalError( +- f"The recommended linker 'lld' is not supported with the current compiler configuration, you can try the 'gold' linker with '--linker=gold'." +- ) +- elif link_model.startswith("dynamic") and linker_ld == 'bfd': +- # BFD is not supported due to issues with it causing warnings from some of +- # the third party libraries that mongodb is linked with: +- # https://jira.mongodb.org/browse/SERVER-49465 +- myenv.FatalError(f"Linker {linker_ld} is not supported with dynamic link model builds.") +- else: +- if not myenv.AddToLINKFLAGSIfSupported(f'-fuse-ld={linker_ld}'): +- myenv.FatalError(f"Linker {linker_ld} could not be configured.") +- +- if has_option('gcov') and myenv.AddToCCFLAGSIfSupported('-fprofile-update=single'): +- myenv.AppendUnique(LINKFLAGS=['-fprofile-update=single']) +- + detectCompiler = Configure( + myenv, + help=False, +@@ -4621,43 +4587,6 @@ def doConfigure(myenv): + if optBuild == "off" and myenv.ToolchainIs('clang') and env.TargetOSIs('darwin'): + myenv.AddToLINKFLAGSIfSupported("-Wl,-no_deduplicate") + +- # Apply any link time optimization settings as selected by the 'lto' option. +- if has_option('lto'): +- if myenv.ToolchainIs('msvc'): +- # Note that this is actually more aggressive than LTO, it is whole program +- # optimization due to /GL. However, this is historically what we have done for +- # windows, so we are keeping it. +- # +- # /GL implies /LTCG, so no need to say it in CCFLAGS, but we do need /LTCG on the +- # link flags. +- myenv.Append(CCFLAGS=['/GL']) +- myenv.Append(LINKFLAGS=['/LTCG']) +- myenv.Append(ARFLAGS=['/LTCG']) +- elif myenv.ToolchainIs('gcc', 'clang'): +- # For GCC and clang, the flag is -flto, and we need to pass it both on the compile +- # and link lines. +- if not myenv.AddToCCFLAGSIfSupported('-flto') or \ +- not myenv.AddToLINKFLAGSIfSupported('-flto'): +- myenv.ConfError("Link time optimization requested, " +- "but selected compiler does not honor -flto") +- +- if myenv.TargetOSIs('darwin'): +- myenv.AddToLINKFLAGSIfSupported('-Wl,-object_path_lto,${TARGET}.lto') +- else: +- # According to intel benchmarks -fno-plt increases perf +- # See PM-2215 +- if linker_ld != "gold": +- myenv.ConfError("lto compilation currently only works with the --linker=gold") +- if link_model != "object": +- myenv.ConfError( +- "lto compilation currently only works with the --link-model=object") +- if not myenv.AddToCCFLAGSIfSupported('-fno-plt') or \ +- not myenv.AddToLINKFLAGSIfSupported('-fno-plt'): +- myenv.ConfError("-fno-plt is not supported by the compiler") +- +- else: +- myenv.ConfError("Don't know how to enable --lto on current toolchain") +- + if get_option('runtime-hardening') == "on" and optBuild != "off": + # Older glibc doesn't work well with _FORTIFY_SOURCE=2. Selecting 2.11 as the minimum was an + # emperical decision, as that is the oldest non-broken glibc we seem to require. It is possible +@@ -5120,17 +5049,13 @@ def doConfigure(myenv): + "BOOST_LOG_NO_SHORTHAND_NAMES", + "BOOST_LOG_USE_NATIVE_SYSLOG", + "BOOST_LOG_WITHOUT_THREAD_ATTR", ++ "BOOST_LOG_DYN_LINK", + "BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS", + "BOOST_SYSTEM_NO_DEPRECATED", + "BOOST_THREAD_USES_DATETIME", + ("BOOST_THREAD_VERSION", "5"), + ]) + +- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk': +- conf.env.AppendUnique(CPPDEFINES=[ +- "BOOST_LOG_DYN_LINK", +- ]) +- + if use_system_version_of_library("boost"): + if not conf.CheckCXXHeader("boost/filesystem/operations.hpp"): + myenv.ConfError("can't find boost headers") +@@ -5327,6 +5252,9 @@ def doConfigure(myenv): + + mongoc_mode = get_option('use-system-mongo-c') + conf.env['MONGO_HAVE_LIBMONGOC'] = False ++ conf.env.ParseConfig('pkg-config libbson-1.0 libmongoc-1.0 --cflags') ++ conf.env['LIBDEPS_LIBBSON_SYSLIBDEP'] = 'bson-1.0' ++ + if mongoc_mode != 'off': + if conf.CheckLibWithHeader( + ["mongoc-1.0"], |