diff options
author | JustKidding | 2022-08-03 16:06:57 -0500 |
---|---|---|
committer | JustKidding | 2022-08-03 16:06:57 -0500 |
commit | 8c576ee6fcfb1f8aac72e39f68f4f0512f5d441f (patch) | |
tree | 8a2f18b64532521d83093a90af5e1859d8386e2a | |
download | aur-8c576ee6fcfb1f8aac72e39f68f4f0512f5d441f.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 50 | ||||
-rw-r--r-- | PKGBUILD | 159 | ||||
-rw-r--r-- | mongodb-4.4.1-boost.patch | 23 | ||||
-rw-r--r-- | mongodb-4.4.1-gcc11.patch | 12 | ||||
-rw-r--r-- | mongodb-5.0.2-boost-1.79.patch | 71 | ||||
-rw-r--r-- | mongodb-5.0.2-fix-scons.patch | 32 | ||||
-rw-r--r-- | mongodb-5.0.2-no-compass.patch | 12 | ||||
-rw-r--r-- | mongodb-5.0.2-skip-no-exceptions.patch | 13 | ||||
-rw-r--r-- | mongodb-5.0.2-skip-reqs-check.patch | 24 | ||||
-rw-r--r-- | mongodb-5.0.5-no-force-lld.patch | 49 | ||||
-rw-r--r-- | mongodb.sysusers | 1 | ||||
-rw-r--r-- | mongodb.tmpfiles | 2 |
12 files changed, 448 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0e2c60836c91 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,50 @@ +pkgbase = mongodb50 + pkgdesc = A high-performance, open source, schema-free document-oriented database + pkgver = 5.0.10 + pkgrel = 1 + url = https://www.mongodb.com/ + arch = x86_64 + license = Apache + license = custom:SSPL1 + makedepends = python-psutil + makedepends = python-setuptools + makedepends = python-regex + makedepends = python-cheetah3 + makedepends = python-yaml + makedepends = python-requests + makedepends = boost + depends = libstemmer + depends = snappy + depends = boost-libs + depends = pcre + depends = yaml-cpp + depends = curl + optdepends = mongodb-tools: mongoimport, mongodump, mongotop, etc + optdepends = mongosh-bin: interactive shell to connect with MongoDB + provides = mongodb + conflicts = mongodb + backup = etc/mongodb.conf + source = https://fastdl.mongodb.org/src/mongodb-src-r5.0.10.tar.gz + source = mongodb.sysusers + source = mongodb.tmpfiles + source = mongodb-4.4.1-boost.patch + source = mongodb-4.4.1-gcc11.patch + source = mongodb-5.0.2-fix-scons.patch + source = mongodb-5.0.2-no-compass.patch + source = mongodb-5.0.2-skip-no-exceptions.patch + source = mongodb-5.0.2-skip-reqs-check.patch + source = mongodb-5.0.2-boost-1.79.patch + source = mongodb-5.0.5-no-force-lld.patch + sha256sums = cba29fa10e851a176f72a8a14d2fcfa0bd5743b89fbddec4cf454efc14f11ac1 + sha256sums = 3757d548cfb0e697f59b9104f39a344bb3d15f802608085f838cb2495c065795 + sha256sums = b7d18726225cd447e353007f896ff7e4cbedb2f641077bce70ab9d292e8f8d39 + sha256sums = d3bc20d0cb4b8662b5326b8a3f2215281df5aed57550fa13de465e05e2044c25 + sha256sums = f7e6d87b68f7703cdbd45e255962ed5a4f6d583aa76d6fcf4fdc7005211fbf06 + sha256sums = 99e9080fa42b948a74221ea7601a0c2b54850c388eda6cafa9c245211ce56d0f + sha256sums = 41b75d19ed7c4671225f08589e317295b7abee934b876859c8777916272f3052 + sha256sums = 5b81ebc3ed68b307df76277aca3226feee33a00d8bb396206bdc7a8a1f58f3e4 + sha256sums = 4ff40320e04bf8c3e05cbc662f8ea549a6b8494d1fda64b1de190c88587bfafd + sha256sums = a04aec4f8bd99ad213e31eb45a9e1658695442082e7c4f8c4044f6326eaa1acd + sha256sums = f79f65824f81753d41d2274a6904930db11b06fe08f1442a24c30060cab27e32 + +pkgname = mongodb50 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..dfa48e37278c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,159 @@ +# Maintainer: JustKidding <jk@vin.ovh> + +pkgname=mongodb50 +_pkgname=mongodb +# #.<odd number>.# releases are unstable development/testing +pkgver=5.0.10 +pkgrel=1 +pkgdesc="A high-performance, open source, schema-free document-oriented database" +arch=("x86_64") +url="https://www.mongodb.com/" +license=("Apache" "custom:SSPL1") +depends=('libstemmer' 'snappy' 'boost-libs' 'pcre' 'yaml-cpp' 'curl') +makedepends=('python-psutil' 'python-setuptools' 'python-regex' 'python-cheetah3' 'python-yaml' 'python-requests' 'boost') +optdepends=('mongodb-tools: mongoimport, mongodump, mongotop, etc' + 'mongosh-bin: interactive shell to connect with MongoDB') +backup=("etc/mongodb.conf") +conflicts=(mongodb) +provides=(mongodb) +source=(https://fastdl.mongodb.org/src/mongodb-src-r$pkgver.tar.gz + mongodb.sysusers + mongodb.tmpfiles + mongodb-4.4.1-boost.patch + mongodb-4.4.1-gcc11.patch + mongodb-5.0.2-fix-scons.patch + mongodb-5.0.2-no-compass.patch + mongodb-5.0.2-skip-no-exceptions.patch + mongodb-5.0.2-skip-reqs-check.patch + mongodb-5.0.2-boost-1.79.patch + mongodb-5.0.5-no-force-lld.patch) +sha256sums=('cba29fa10e851a176f72a8a14d2fcfa0bd5743b89fbddec4cf454efc14f11ac1' + '3757d548cfb0e697f59b9104f39a344bb3d15f802608085f838cb2495c065795' + 'b7d18726225cd447e353007f896ff7e4cbedb2f641077bce70ab9d292e8f8d39' + 'd3bc20d0cb4b8662b5326b8a3f2215281df5aed57550fa13de465e05e2044c25' + 'f7e6d87b68f7703cdbd45e255962ed5a4f6d583aa76d6fcf4fdc7005211fbf06' + '99e9080fa42b948a74221ea7601a0c2b54850c388eda6cafa9c245211ce56d0f' + '41b75d19ed7c4671225f08589e317295b7abee934b876859c8777916272f3052' + '5b81ebc3ed68b307df76277aca3226feee33a00d8bb396206bdc7a8a1f58f3e4' + '4ff40320e04bf8c3e05cbc662f8ea549a6b8494d1fda64b1de190c88587bfafd' + 'a04aec4f8bd99ad213e31eb45a9e1658695442082e7c4f8c4044f6326eaa1acd' + 'f79f65824f81753d41d2274a6904930db11b06fe08f1442a24c30060cab27e32') + +_scons_args=( + --use-system-pcre # wait for pcre 8.44+ https://jira.mongodb.org/browse/SERVER-40836 and https://jira.mongodb.org/browse/SERVER-42990 + --use-system-snappy + --use-system-yaml # https://jira.mongodb.org/browse/SERVER-43980 + --use-system-zlib + --use-system-stemmer + --use-sasl-client + --ssl + --disable-warnings-as-errors + --use-system-boost # Doesn't compile + --use-system-zstd + --runtime-hardening=off +) + +all-flag-vars() { + echo {C,CXX}FLAGS +} + +_filter-var() { + local f x var=$1 new=() + shift + + for f in ${!var} ; do + for x in "$@" ; do + # Note this should work with globs like -O* + [[ ${f} == ${x} ]] && continue 2 + done + new+=( "${f}" ) + done + export ${var}="${new[*]}" +} + +filter-flags() { + local v + for v in $(all-flag-vars) ; do + _filter-var ${v} "$@" + done + return 0 +} + + +prepare() { + cd "${srcdir}/${_pkgname}-src-r${pkgver}" + + # Keep historical Arch dbPath + sed -i 's|dbPath: /var/lib/mongo|dbPath: /var/lib/mongodb|' rpm/mongod.conf + + # Keep historical Arch conf file name + sed -i 's|-f /etc/mongod.conf|-f /etc/mongodb.conf|' rpm/mongod.service + + # Keep historical Arch user name (no need for separate daemon group name) + sed -i 's/User=mongod/User=mongodb/' rpm/mongod.service + sed -i 's/Group=mongod/Group=mongodb/' rpm/mongod.service + sed -i 's/chown mongod:mongod/chown mongodb:mongodb/' rpm/mongod.service + + # Remove sysconfig file, used by upstream's init.d script not used on Arch + sed -i '/EnvironmentFile=-\/etc\/sysconfig\/mongod/d' rpm/mongod.service + + # Make systemd wait as long as it takes for MongoDB to start + # If MongoDB needs a long time to start, prevent systemd from restarting it every 90 seconds + # See: https://jira.mongodb.org/browse/SERVER-38086 + sed -i 's/\[Service]/[Service]\nTimeoutStartSec=infinity/' rpm/mongod.service + + if check_option debug y; then + _scons_args+=(--dbg=on) + fi + + if check_option lto y; then + _scons_args+=(--lto=on) + fi + + # apply gentoo patches + for file in $srcdir/*.patch; do + echo "Applying patch $file..." + patch -Np1 -i $file + done +} + +build() { + cd "${srcdir}/${_pkgname}-src-r${pkgver}" + + if check_option debug n; then + filter-flags '-m*' + filter-flags '-O?' + fi + + export SCONSFLAGS="$MAKEFLAGS" + ./buildscripts/scons.py install-devcore "${_scons_args[@]}" +} + +package() { + cd "${srcdir}/${_pkgname}-src-r${pkgver}" + + # Install binaries + install -D build/install/bin/mongo "$pkgdir/usr/bin/mongo" + install -D build/install/bin/mongod "$pkgdir/usr/bin/mongod" + install -D build/install/bin/mongos "$pkgdir/usr/bin/mongos" + + # Keep historical Arch conf file name + install -Dm644 "rpm/mongod.conf" "${pkgdir}/etc/${_pkgname}.conf" + + # Keep historical Arch service name + install -Dm644 "rpm/mongod.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + + # Install manpages + install -Dm644 "debian/mongo.1" "${pkgdir}/usr/share/man/man1/mongo.1" + install -Dm644 "debian/mongod.1" "${pkgdir}/usr/share/man/man1/mongod.1" + install -Dm644 "debian/mongos.1" "${pkgdir}/usr/share/man/man1/mongos.1" + + # Install systemd files + install -Dm644 "${srcdir}/${_pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf" + install -Dm644 "${srcdir}/${_pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${_pkgname}.conf" + + # Install license + install -D LICENSE-Community.txt "$pkgdir/usr/share/licenses/mongodb/LICENSE" +} +# vim:set ts=2 sw=2 et: + diff --git a/mongodb-4.4.1-boost.patch b/mongodb-4.4.1-boost.patch new file mode 100644 index 000000000000..009ca6826a4f --- /dev/null +++ b/mongodb-4.4.1-boost.patch @@ -0,0 +1,23 @@ +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/mongodb-4.4.1-gcc11.patch b/mongodb-4.4.1-gcc11.patch new file mode 100644 index 000000000000..a6ff02dcf66f --- /dev/null +++ b/mongodb-4.4.1-gcc11.patch @@ -0,0 +1,12 @@ +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/mongodb-5.0.2-boost-1.79.patch b/mongodb-5.0.2-boost-1.79.patch new file mode 100644 index 000000000000..39c76bacf426 --- /dev/null +++ b/mongodb-5.0.2-boost-1.79.patch @@ -0,0 +1,71 @@ +https://bugs.gentoo.org/844235 +--- a/src/mongo/db/auth/security_key_test.cpp ++++ b/src/mongo/db/auth/security_key_test.cpp +@@ -30,6 +30,7 @@ + #include "mongo/platform/basic.h" + + #include <boost/filesystem.hpp> ++#include <boost/filesystem/fstream.hpp> + + #include "mongo/base/string_data.h" + #include "mongo/db/auth/authorization_manager.h" +--- a/src/mongo/db/storage/storage_repair_observer.cpp ++++ b/src/mongo/db/storage/storage_repair_observer.cpp +@@ -41,6 +41,7 @@ + #include <sys/types.h> + #endif + ++#include <boost/filesystem/fstream.hpp> + #include <boost/filesystem/path.hpp> + + #include "mongo/db/dbhelpers.h" +--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp ++++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp +@@ -34,6 +34,7 @@ + #include "mongo/db/storage/kv/kv_engine_test_harness.h" + + #include <boost/filesystem.hpp> ++#include <boost/filesystem/fstream.hpp> + #include <boost/filesystem/path.hpp> + #include <memory> + +--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp ++++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp +@@ -36,6 +36,7 @@ + #include <limits> + + #include <boost/filesystem.hpp> ++#include <boost/filesystem/fstream.hpp> + #include <boost/filesystem/path.hpp> + + #include "mongo/base/simple_string_data_comparator.h" +--- a/src/mongo/shell/shell_utils_extended.cpp ++++ b/src/mongo/shell/shell_utils_extended.cpp +@@ -37,6 +37,7 @@ + #endif + + #include <boost/filesystem.hpp> ++#include <boost/filesystem/fstream.hpp> + #include <fmt/format.h> + #include <fstream> + +--- a/src/mongo/util/stacktrace_threads.cpp ++++ b/src/mongo/util/stacktrace_threads.cpp +@@ -36,6 +36,7 @@ + #include <array> + #include <atomic> + #include <boost/filesystem.hpp> ++#include <boost/filesystem/fstream.hpp> + #include <cstdint> + #include <cstdlib> + #include <dirent.h> +--- a/src/mongo/util/processinfo_linux.cpp ++++ b/src/mongo/util/processinfo_linux.cpp +@@ -36,6 +36,7 @@ + #include <iostream> + #include <malloc.h> + #include <pcrecpp.h> ++#include <fstream> + #include <sched.h> + #include <stdio.h> + #include <sys/mman.h> diff --git a/mongodb-5.0.2-fix-scons.patch b/mongodb-5.0.2-fix-scons.patch new file mode 100644 index 000000000000..2d1a2f9312bb --- /dev/null +++ b/mongodb-5.0.2-fix-scons.patch @@ -0,0 +1,32 @@ +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/mongodb-5.0.2-no-compass.patch b/mongodb-5.0.2-no-compass.patch new file mode 100644 index 000000000000..777251577298 --- /dev/null +++ b/mongodb-5.0.2-no-compass.patch @@ -0,0 +1,12 @@ +diff --git a/src/mongo/installer/SConscript b/src/mongo/installer/SConscript +index 5bd89fe9..489e70ac 100644 +--- a/src/mongo/installer/SConscript ++++ b/src/mongo/installer/SConscript +@@ -7,7 +7,6 @@ env = env.Clone() + + env.SConscript( + dirs=[ +- 'compass', + 'msi', + ], + exports=[ diff --git a/mongodb-5.0.2-skip-no-exceptions.patch b/mongodb-5.0.2-skip-no-exceptions.patch new file mode 100644 index 000000000000..ae69befcea82 --- /dev/null +++ b/mongodb-5.0.2-skip-no-exceptions.patch @@ -0,0 +1,13 @@ +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/mongodb-5.0.2-skip-reqs-check.patch b/mongodb-5.0.2-skip-reqs-check.patch new file mode 100644 index 000000000000..823d481c208f --- /dev/null +++ b/mongodb-5.0.2-skip-reqs-check.patch @@ -0,0 +1,24 @@ +diff --git a/buildscripts/scons.py b/buildscripts/scons.py +index 534fca32..c38f64df 100755 +--- a/buildscripts/scons.py ++++ b/buildscripts/scons.py +@@ -19,13 +19,13 @@ SITE_TOOLS_DIR = os.path.join(MONGODB_ROOT, 'site_scons') + sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path + + # pylint: disable=C0413 +-from mongo.pip_requirements import verify_requirements, MissingRequirements ++#from mongo.pip_requirements import verify_requirements, MissingRequirements + +-try: +- verify_requirements('etc/pip/compile-requirements.txt') +-except MissingRequirements as ex: +- print(ex) +- sys.exit(1) ++#try: ++# verify_requirements('etc/pip/compile-requirements.txt') ++#except MissingRequirements as ex: ++# print(ex) ++# sys.exit(1) + + try: + import SCons.Script diff --git a/mongodb-5.0.5-no-force-lld.patch b/mongodb-5.0.5-no-force-lld.patch new file mode 100644 index 000000000000..6ce92778b6bd --- /dev/null +++ b/mongodb-5.0.5-no-force-lld.patch @@ -0,0 +1,49 @@ +Don't automagically force lld > gold > bfd. Leave it up to the user. + +In particular, avoids issues with LTO enabled (via the flag/scons option) +where using GCC as compiler, as lld can't do LTO with GCC. + +https://bugs.gentoo.org/769986 +--- a/SConstruct ++++ b/SConstruct +@@ -2824,40 +2824,6 @@ def doConfigure(myenv): + def AddToSHLINKFLAGSIfSupported(env, flag): + return AddFlagIfSupported(env, 'C', '.c', flag, True, SHLINKFLAGS=[flag]) + +- 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': +- # lld has problems with separate debug info on some platforms. See: +- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556 +- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556 +- # +- # lld also apparently has problems with symbol resolution +- # in some esoteric configurations that apply for us when +- # using --link-model=dynamic mode, so disable lld there +- # too. See: +- # - https://bugs.llvm.org/show_bug.cgi?id=46676 +- # +- # We should revisit all of these issues the next time we upgrade our clang minimum. +- if get_option('separate-debug') == 'off' and get_option('link-model') != 'dynamic': +- if not AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=lld'): +- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold') +- else: +- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=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 AddToLINKFLAGSIfSupported(myenv, f'-fuse-ld={linker_ld}'): +- myenv.FatalError(f"Linker {linker_ld} could not be configured.") +- + detectCompiler = Configure(myenv, help=False, custom_tests = { + 'CheckForCXXLink': CheckForCXXLink, + }) diff --git a/mongodb.sysusers b/mongodb.sysusers new file mode 100644 index 000000000000..2b645013c923 --- /dev/null +++ b/mongodb.sysusers @@ -0,0 +1 @@ +u mongodb - - /var/lib/mongodb diff --git a/mongodb.tmpfiles b/mongodb.tmpfiles new file mode 100644 index 000000000000..57e9e7f6399e --- /dev/null +++ b/mongodb.tmpfiles @@ -0,0 +1,2 @@ +d /var/lib//mongodb 0700 mongodb mongodb - - +d /var/log//mongodb 0755 mongodb mongodb - - |