mirror of
https://github.com/SlackBuildsOrg/slackbuilds
synced 2024-09-30 05:39:56 +02:00
system/mongodb: Updated for version 5.0.4.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
8fb7497f26
commit
93d08acee1
14 changed files with 256 additions and 13 deletions
|
@ -7,9 +7,15 @@ the provided init script:
|
|||
# groupadd -g 285 mongo
|
||||
# useradd -u 285 -d /var/lib/mongodb -s /bin/false -g mongo mongo
|
||||
|
||||
|
||||
You'll also need to add the following to /etc/rc.d/rc.local
|
||||
|
||||
if [ -x /etc/rc.d/rc.mongodb ]; then
|
||||
/etc/rc.d/rc.mongodb start
|
||||
fi
|
||||
|
||||
NOTE: mongodb 5.0 requires use of the AVX instruction set: check if
|
||||
your cpu supports it with
|
||||
|
||||
grep avx /proc/cpuinfo | uniq
|
||||
|
||||
(no output means it doesn't)
|
||||
|
|
|
@ -23,3 +23,6 @@ preserve_perms() {
|
|||
}
|
||||
|
||||
preserve_perms etc/rc.d/rc.mongodb.new
|
||||
config etc/mongodb.conf.new
|
||||
config etc/mongos.conf.new
|
||||
config etc/logrotate.d/mongodb.new
|
||||
|
|
34
system/mongodb/files/mongodb.conf
Normal file
34
system/mongodb/files/mongodb.conf
Normal file
|
@ -0,0 +1,34 @@
|
|||
# !! IMPORTANT !!
|
||||
#
|
||||
# This file uses the YAML format as described in the documentation:
|
||||
# http://docs.mongodb.org/manual/reference/configuration-options/
|
||||
|
||||
storage:
|
||||
dbPath: "/var/lib/mongodb"
|
||||
#engine: wiredTiger
|
||||
|
||||
systemLog:
|
||||
destination: file
|
||||
path: "/var/log/mongodb/mongodb.log"
|
||||
quiet: true
|
||||
logAppend: true
|
||||
|
||||
net:
|
||||
port: 27017
|
||||
bindIp: 127.0.0.1
|
||||
#ssl:
|
||||
# mode: disabled
|
||||
|
||||
#security:
|
||||
#keyFile:
|
||||
#clusterAuthMode:
|
||||
|
||||
#replication:
|
||||
#replSetName:
|
||||
|
||||
# Specifies one of the MongoDB parameters described here:
|
||||
# http://docs.mongodb.org/manual/reference/parameters/
|
||||
#
|
||||
# You can specify multiple setParameter fields such as:
|
||||
# setParameter: {enableTestCommands: 1}
|
||||
#setParameter:
|
13
system/mongodb/files/mongodb.logrotate
Normal file
13
system/mongodb/files/mongodb.logrotate
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Default log rotation / compression keeps 1 year of logs.
|
||||
/var/log/mongodb/*.log {
|
||||
daily
|
||||
rotate 365
|
||||
dateext
|
||||
copytruncate
|
||||
delaycompress
|
||||
compress
|
||||
notifempty
|
||||
extension gz
|
||||
sharedscripts
|
||||
missingok
|
||||
}
|
30
system/mongodb/files/mongos.conf
Normal file
30
system/mongodb/files/mongos.conf
Normal file
|
@ -0,0 +1,30 @@
|
|||
# !! IMPORTANT !!
|
||||
#
|
||||
# This file uses the YAML format as described in the documentation:
|
||||
# http://docs.mongodb.org/manual/reference/configuration-options/
|
||||
|
||||
systemLog:
|
||||
destination: file
|
||||
path: "/var/log/mongodb/mongos.log"
|
||||
quiet: true
|
||||
logAppend: true
|
||||
|
||||
net:
|
||||
port: 27017
|
||||
bindIp: 127.0.0.1
|
||||
ssl:
|
||||
mode: disabled
|
||||
|
||||
#security:
|
||||
#keyFile:
|
||||
#clusterAuthMode:
|
||||
|
||||
#sharding:
|
||||
#configDB:
|
||||
|
||||
# Specifies one of the MongoDB parameters described here:
|
||||
# http://docs.mongodb.org/manual/reference/parameters/
|
||||
#
|
||||
# You can specify multiple setParameter fields such as:
|
||||
# setParameter: {enableTestCommands: 1}
|
||||
#setParameter:
|
|
@ -26,7 +26,7 @@
|
|||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM="mongodb"
|
||||
VERSION=${VERSION:-3.4.24}
|
||||
VERSION=${VERSION:-5.0.4}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
@ -58,6 +58,14 @@ MONGO_GROUP=${MONGO_GROUP:-285}
|
|||
SRC_FILE=$PRGNAM-src-r$VERSION.tar.gz
|
||||
SRC_FLDR=$PRGNAM-src-r$VERSION
|
||||
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Bail if user or group isn't valid on your system
|
||||
|
@ -89,6 +97,10 @@ mkdir -p $TMP $PKG $OUTPUT
|
|||
cd $TMP
|
||||
tar xvf $CWD/$SRC_FILE
|
||||
cd $SRC_FLDR
|
||||
# remove bundled libs
|
||||
rm -fR src/third_party/{boost,pcre-*,snappy-*,yaml-cpp,zlib-*}
|
||||
# remove compass
|
||||
rm -fR src/mongo/installer/compass
|
||||
chown -R root.root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
|
@ -96,28 +108,57 @@ 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 {} \;
|
||||
|
||||
# thanks gentoo, also for these patches
|
||||
for i in $CWD/patches/* ; do patch -p1 < $i ; done
|
||||
|
||||
scons_opts=(
|
||||
--disable-warnings-as-errors
|
||||
--use-system-boost
|
||||
--use-system-pcre
|
||||
--use-system-snappy
|
||||
--use-system-yaml
|
||||
--use-system-zlib
|
||||
--use-system-zstd
|
||||
--use-sasl-client
|
||||
--ssl
|
||||
)
|
||||
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
scons -j $MAKEJOBS --ssl --disable-warnings-as-errors --prefix=${PKG}/usr core install
|
||||
PREFIX=${PKG}/usr CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" LDFLAGS="-L /lib$LIBDIRSUFFIX -L/usr/lib$LIBDIRSUFFIX" \
|
||||
./buildscripts/scons.py "${scons_opts[@]}" --jobs="$MAKEJOBS" install-core
|
||||
else
|
||||
scons -j $MAKEJOBS --ssl --disable-warnings-as-errors --prefix=${PKG}/usr core --wiredtiger=off install
|
||||
PREFIX=${PKG}/usr CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" LDFLAGS="-L /lib$LIBDIRSUFFIX -L/usr/lib$LIBDIRSUFFIX" \
|
||||
./buildscripts/scons.py "${scons_opts[@]}" --jobs="$MAKEJOBS" --wiredtiger=off install-core
|
||||
fi
|
||||
|
||||
# manual install
|
||||
( cd build/install/bin
|
||||
for i in * ; do install -D -m 0755 $i $PKG/usr/bin/$i ; done )
|
||||
( cd debian
|
||||
for i in *.1 ; do install -D -m 0644 $i $PKG/usr/man/man1/$i ; done )
|
||||
|
||||
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
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION}
|
||||
cp distsrc/* ${PKG}/usr/doc/${PRGNAM}-${VERSION}
|
||||
|
||||
mkdir -p $PKG/etc/rc.d
|
||||
cat $CWD/rc.mongodb > $PKG/etc/rc.d/rc.mongodb.new
|
||||
mkdir -p $PKG/etc/{logrotate,rc}.d
|
||||
cat $CWD/files/mongodb.conf > $PKG/etc/mongodb.conf.new
|
||||
cat $CWD/files/mongos.conf > $PKG/etc/mongos.conf.new
|
||||
cat $CWD/files/mongodb.logrotate > $PKG/etc/logrotate.d/mongodb.new
|
||||
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
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
mkdir -p $PKG/var/lib/mongodb
|
||||
chown mongo.mongo $PKG/var/lib/mongodb
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
PRGNAM="mongodb"
|
||||
VERSION="3.4.24"
|
||||
VERSION="5.0.4"
|
||||
HOMEPAGE="https://www.mongodb.org/"
|
||||
DOWNLOAD="UNSUPPORTED"
|
||||
MD5SUM=""
|
||||
DOWNLOAD_x86_64="https://fastdl.mongodb.org/src/mongodb-src-r3.4.24.tar.gz"
|
||||
MD5SUM_x86_64="2033a6857e9e71bb2faede3a262c4524"
|
||||
REQUIRES=""
|
||||
DOWNLOAD_x86_64="https://fastdl.mongodb.org/src/mongodb-src-r5.0.4.tar.gz"
|
||||
MD5SUM_x86_64="366a864aaf21cc391e910f46a3051461"
|
||||
REQUIRES="cheetah3 psutil python3-PyYAML snappy snowballstemmer yaml-cpp"
|
||||
MAINTAINER="Miguel De Anda"
|
||||
EMAIL="miguel@thedeanda.com"
|
||||
|
|
23
system/mongodb/patches/01_mongodb-4.4.1-boost.patch
Normal file
23
system/mongodb/patches/01_mongodb-4.4.1-boost.patch
Normal file
|
@ -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")
|
12
system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch
Normal file
12
system/mongodb/patches/02_mongodb-4.4.1-gcc11.patch
Normal file
|
@ -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"
|
||||
|
32
system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch
Normal file
32
system/mongodb/patches/03_mongodb-5.0.2-fix-scons.patch
Normal file
|
@ -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:
|
12
system/mongodb/patches/04_mongodb-5.0.2-no-compass.patch
Normal file
12
system/mongodb/patches/04_mongodb-5.0.2-no-compass.patch
Normal file
|
@ -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=[
|
|
@ -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')
|
|
@ -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
|
Loading…
Reference in a new issue