summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustKidding2022-08-03 14:18:16 -0500
committerJustKidding2022-08-03 14:18:16 -0500
commitaa3ac34d932f3edc0700d494a60881e7cc05c22a (patch)
treeeeef8ce0f00a86f12044d2dba860318e2b4e14fb
downloadaur-aa3ac34d932f3edc0700d494a60881e7cc05c22a.tar.gz
initial commit
-rw-r--r--.SRCINFO48
-rw-r--r--PKGBUILD127
-rw-r--r--mongodb-4.4.1-boost.patch23
-rw-r--r--mongodb-4.4.1-fix-scons.patch33
-rw-r--r--mongodb-4.4.1-gcc11.patch12
-rw-r--r--mongodb-4.4.10-boost-1.79.patch71
-rw-r--r--mongodb-4.4.10-no-force-lld.patch29
-rw-r--r--mongodb-4.4.8-no-compass.patch43
-rw-r--r--mongodb.sysusers1
-rw-r--r--mongodb.tmpfiles2
10 files changed, 389 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..bb1c61984092
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,48 @@
+pkgbase = mongodb44
+ pkgdesc = A high-performance, open source, schema-free document-oriented database (last version to support non-avx CPUs)
+ pkgver = 4.4.15
+ pkgrel = 1
+ url = https://www.mongodb.com/
+ arch = x86_64
+ arch = aarch64
+ license = Apache
+ license = custom:SSPL1
+ makedepends = scons
+ 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-r4.4.15.tar.gz
+ source = mongodb.sysusers
+ source = mongodb.tmpfiles
+ source = mongodb-4.4.1-fix-scons.patch
+ source = mongodb-4.4.8-no-compass.patch
+ source = mongodb-4.4.1-boost.patch
+ source = mongodb-4.4.1-gcc11.patch
+ source = mongodb-4.4.10-boost-1.79.patch
+ source = mongodb-4.4.10-no-force-lld.patch
+ sha256sums = fb7ef14e2539df0addc1e350ad2a0fdb7dd078a60d49ab15d9932f193ea1da33
+ sha256sums = 3757d548cfb0e697f59b9104f39a344bb3d15f802608085f838cb2495c065795
+ sha256sums = b7d18726225cd447e353007f896ff7e4cbedb2f641077bce70ab9d292e8f8d39
+ sha256sums = 631513598bf0e00b4f133d3f253ea76ae2958317fc2acc2d420726f1b76f09dd
+ sha256sums = 50c7d3968ee37bf25694f0fe8a92bb097c52c26361c78da620caa2ffa8cf4375
+ sha256sums = d3bc20d0cb4b8662b5326b8a3f2215281df5aed57550fa13de465e05e2044c25
+ sha256sums = f7e6d87b68f7703cdbd45e255962ed5a4f6d583aa76d6fcf4fdc7005211fbf06
+ sha256sums = 4202e039944fde80daa1bd3a5f332c522d8db96b4c3cf7c764355c5fc9089137
+ sha256sums = 76e61d1d4f5b4e7c8cd760b1fc0dc86978a8e180d184cdfc7f61fba7d5543a95
+
+pkgname = mongodb44
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..60584016deb2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,127 @@
+# Maintainer: JustKidding <jk@vin.ovh>
+
+pkgname=mongodb44
+_pkgname=mongodb
+# #.<odd number>.# releases are unstable development/testing
+pkgver=4.4.15
+pkgrel=1
+pkgdesc="A high-performance, open source, schema-free document-oriented database (last version to support non-avx CPUs)"
+arch=("x86_64" "aarch64")
+url="https://www.mongodb.com/"
+license=("Apache" "custom:SSPL1")
+depends=('libstemmer' 'snappy' 'boost-libs' 'pcre' 'yaml-cpp' 'curl')
+makedepends=('scons' '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-fix-scons.patch
+ mongodb-4.4.8-no-compass.patch
+ mongodb-4.4.1-boost.patch
+ mongodb-4.4.1-gcc11.patch
+ mongodb-4.4.10-boost-1.79.patch
+ mongodb-4.4.10-no-force-lld.patch)
+sha256sums=('fb7ef14e2539df0addc1e350ad2a0fdb7dd078a60d49ab15d9932f193ea1da33'
+ '3757d548cfb0e697f59b9104f39a344bb3d15f802608085f838cb2495c065795'
+ 'b7d18726225cd447e353007f896ff7e4cbedb2f641077bce70ab9d292e8f8d39'
+ '631513598bf0e00b4f133d3f253ea76ae2958317fc2acc2d420726f1b76f09dd'
+ '50c7d3968ee37bf25694f0fe8a92bb097c52c26361c78da620caa2ffa8cf4375'
+ 'd3bc20d0cb4b8662b5326b8a3f2215281df5aed57550fa13de465e05e2044c25'
+ 'f7e6d87b68f7703cdbd45e255962ed5a4f6d583aa76d6fcf4fdc7005211fbf06'
+ '4202e039944fde80daa1bd3a5f332c522d8db96b4c3cf7c764355c5fc9089137'
+ '76e61d1d4f5b4e7c8cd760b1fc0dc86978a8e180d184cdfc7f61fba7d5543a95')
+
+_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
+)
+
+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 [[ "$CARCH" == "aarch64" ]]; then
+ _scons_args+=(--use-hardware-crc32=off)
+ fi
+
+ 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}"
+
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons 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-fix-scons.patch b/mongodb-4.4.1-fix-scons.patch
new file mode 100644
index 000000000000..8b9d5d6d9fa2
--- /dev/null
+++ b/mongodb-4.4.1-fix-scons.patch
@@ -0,0 +1,33 @@
+diff --git a/SConstruct b/SConstruct
+index 89c044ab..a6d02072 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -2064,7 +2064,6 @@ if env.TargetOSIs('posix'):
+ env.Append( CCFLAGS=["-fno-omit-frame-pointer",
+ "-fno-strict-aliasing",
+ "-fasynchronous-unwind-tables",
+- "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -2076,6 +2075,9 @@ if env.TargetOSIs('posix'):
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
++
+ if env.ToolchainIs('clang'):
+ env.Append( CXXFLAGS=['-Werror=unused-result'] )
+
+@@ -2096,8 +2098,8 @@ if env.TargetOSIs('posix'):
+
+ env.Append( LIBS=[] )
+
+- #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-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-4.4.10-boost-1.79.patch b/mongodb-4.4.10-boost-1.79.patch
new file mode 100644
index 000000000000..601141e8d416
--- /dev/null
+++ b/mongodb-4.4.10-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 <fstream>
+
+ #include "mongo/bson/bson_validate.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>
+--- 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 <cctype>
+ #include <cstdint>
+ #include <cstdlib>
diff --git a/mongodb-4.4.10-no-force-lld.patch b/mongodb-4.4.10-no-force-lld.patch
new file mode 100644
index 000000000000..471f3e226820
--- /dev/null
+++ b/mongodb-4.4.10-no-force-lld.patch
@@ -0,0 +1,29 @@
+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
+@@ -3109,20 +3109,6 @@ def doConfigure(myenv):
+ myenv.Append( CCFLAGS=["/Zc:inline"])
+
+ 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 not any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']):
+-
+- # 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
+- if get_option('separate-debug') == 'off':
+- if not AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=lld'):
+- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold')
+- else:
+- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold')
+-
+ # Usually, --gdb-index is too expensive in big static binaries, but for dynamic
+ # builds it works well.
+ if link_model.startswith("dynamic"):
diff --git a/mongodb-4.4.8-no-compass.patch b/mongodb-4.4.8-no-compass.patch
new file mode 100644
index 000000000000..0755705ed55f
--- /dev/null
+++ b/mongodb-4.4.8-no-compass.patch
@@ -0,0 +1,43 @@
+diff --git a/src/mongo/SConscript b/src/mongo/SConscript
+index 62fbfc02..5be336f7 100644
+--- a/src/mongo/SConscript
++++ b/src/mongo/SConscript
+@@ -841,30 +841,6 @@ for full_dir, archive_dir in list(env["ARCHIVE_ADDITION_DIR_MAP"].items()):
+ for target in env["DIST_BINARIES"]:
+ installBinary(env, "db/modules/" + target)
+
+-compass_script = "install_compass"
+-if env.TargetOSIs('windows'):
+- compass_script = "Install-Compass.ps1"
+-
+-compass_installer = f"$BUILD_DIR/mongo/installer/compass/{compass_script}"
+-
+-distBinaries.append(compass_installer)
+-
+-if not hygienic:
+- compass_script_installer = env.Install("$DESTDIR/bin", compass_installer)
+-else:
+- compass_script_installer = env.AutoInstall(
+- target='$PREFIX_BINDIR',
+- source=[
+- compass_installer,
+- ],
+- AIB_COMPONENT='dist',
+- AIB_ROLE='runtime',
+- )
+-
+-if env.TargetOSIs('posix'):
+- env.AddPostAction( compass_script_installer, 'chmod 755 $TARGET' )
+- env.AddPostAction( compass_installer, 'chmod 755 $TARGET' )
+-
+ if not hygienic:
+ server_archive = env.Command(
+ target='#/${SERVER_ARCHIVE}',
+@@ -878,7 +854,6 @@ if not hygienic:
+ '--transform $BUILD_DIR/mongo/stripped/db/modules/enterprise=$SERVER_DIST_BASENAME/bin',
+ '--transform $BUILD_DIR/mongo/stripped=$SERVER_DIST_BASENAME/bin',
+ '--transform $BUILD_DIR/mongo=$SERVER_DIST_BASENAME/bin',
+- '--transform src/mongo/installer/compass=$SERVER_DIST_BASENAME/bin',
+ '${TEMPFILE(SOURCES[1:])}'
+ ],
+ ),
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 - -