summaryrefslogtreecommitdiff
path: root/databases/mongodb36/files
diff options
context:
space:
mode:
authorNikolai Lifanov <lifanov@FreeBSD.org>2018-02-05 18:43:20 +0000
committerNikolai Lifanov <lifanov@FreeBSD.org>2018-02-05 18:43:20 +0000
commit938aa7f992b8698f94dbfbe1fa54b2e0b13dd780 (patch)
tree9dfb11792fde3a63aa5de6cd99e34f29ec89b296 /databases/mongodb36/files
parentFix build of dosbox with clang 6. (diff)
re-add databases/mongodb36 - it was not repocopied
Pointyhat to: lifanov Spotted by: danfe, mat PR: 224303 Submitted by: dev@dudu.ro Differential Revision: https://reviews.freebsd.org/D13594
Diffstat (limited to 'databases/mongodb36/files')
-rw-r--r--databases/mongodb36/files/mongod.in61
-rw-r--r--databases/mongodb36/files/patch-SConstruct48
-rw-r--r--databases/mongodb36/files/patch-rpm_mongod.conf25
-rw-r--r--databases/mongodb36/files/patch-src_mongo_db_repl_oplog__fetcher.cpp11
4 files changed, 145 insertions, 0 deletions
diff --git a/databases/mongodb36/files/mongod.in b/databases/mongodb36/files/mongod.in
new file mode 100644
index 000000000000..47d6b90904c8
--- /dev/null
+++ b/databases/mongodb36/files/mongod.in
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# PROVIDE: mongod
+# REQUIRE: NETWORK ldconfig
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# mongod_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable mongod.
+# mongod_limits (bool): Set to "NO" by default.
+# Set it to yes to run `limits -e -U mongodb`
+# just before mongod starts.
+# mongod_dbpath (str): Default to "/var/db/mongodb"
+# Base database directory.
+# mongod_flags (str): Custom additional arguments to be passed to mongod.
+# Default to "--logpath ${mongod_dbpath}/mongod.log --logappend".
+# mongod_config (str): Default to "%%PREFIX%%/etc/mongodb.conf"
+# Path to config file
+#
+
+. /etc/rc.subr
+
+name="mongod"
+rcvar=mongod_enable
+
+load_rc_config $name
+
+: ${mongod_enable="NO"}
+: ${mongod_limits="NO"}
+: ${mongod_dbpath="/var/db/mongodb"}
+: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"}
+: ${mongod_user="mongodb"}
+: ${mongod_group="mongodb"}
+: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"}
+
+pidfile="${mongod_dbpath}/mongod.lock"
+command=%%PREFIX%%/bin/${name}
+command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null"
+start_precmd="${name}_prestart"
+
+mongod_create_dbpath()
+{
+ mkdir ${mongod_dbpath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath}
+}
+
+mongod_prestart()
+{
+ if [ ! -d ${mongod_dbpath} ]; then
+ mongod_create_dbpath || return 1
+ fi
+ if checkyesno mongod_limits; then
+ eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
+ else
+ return 0
+ fi
+}
+
+run_rc_command "$1"
diff --git a/databases/mongodb36/files/patch-SConstruct b/databases/mongodb36/files/patch-SConstruct
new file mode 100644
index 000000000000..d7b1c853af78
--- /dev/null
+++ b/databases/mongodb36/files/patch-SConstruct
@@ -0,0 +1,48 @@
+--- SConstruct.orig 2018-01-04 23:28:55 UTC
++++ SConstruct
+@@ -922,9 +922,9 @@ if has_option('variables-help'):
+ print(env_vars.GenerateHelpText(env))
+ Exit(0)
+
+-unknown_vars = env_vars.UnknownVariables()
+-if unknown_vars:
+- env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
++#unknown_vars = env_vars.UnknownVariables()
++#if unknown_vars:
++# env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
+
+ def set_config_header_define(env, varname, varval = 1):
+ env['CONFIG_HEADER_DEFINES'][varname] = varval
+@@ -1612,7 +1612,7 @@ if env.TargetOSIs('posix'):
+ # If runtime hardening is requested, then build anything
+ # destined for an executable with the necessary flags for PIE.
+ env.AppendUnique(
+- PROGCCFLAGS=['-fPIE'],
++ PROGCCFLAGS=['-fpic'],
+ PROGLINKFLAGS=['-pie'],
+ )
+
+@@ -1626,7 +1626,7 @@ if env.TargetOSIs('posix'):
+ "-Wno-unknown-pragmas",
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+- if env.TargetOSIs('linux', 'darwin', 'solaris'):
++ if env.TargetOSIs('linux', 'darwin', 'solaris', 'freebsd'):
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+@@ -1661,10 +1661,10 @@ if env.TargetOSIs('posix'):
+ env.Append( CCFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
+ env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
+
+- if optBuild:
+- env.Append( CCFLAGS=["-O2"] )
+- else:
+- env.Append( CCFLAGS=["-O0"] )
++ #if optBuild:
++ # env.Append( CCFLAGS=["-O2"] )
++ #else:
++ # env.Append( CCFLAGS=["-O0"] )
+
+ # Promote linker warnings into errors. We can't yet do this on OS X because its linker considers
+ # noall_load obsolete and warns about it.
diff --git a/databases/mongodb36/files/patch-rpm_mongod.conf b/databases/mongodb36/files/patch-rpm_mongod.conf
new file mode 100644
index 000000000000..77f3b6026daf
--- /dev/null
+++ b/databases/mongodb36/files/patch-rpm_mongod.conf
@@ -0,0 +1,25 @@
+--- rpm/mongod.conf.orig 2018-01-04 23:28:55 UTC
++++ rpm/mongod.conf
+@@ -7,11 +7,11 @@
+ systemLog:
+ destination: file
+ logAppend: true
+- path: /var/log/mongodb/mongod.log
++ path: /var/db/mongodb/mongod.log
+
+ # Where and how to store data.
+ storage:
+- dbPath: /var/lib/mongo
++ dbPath: /var/db/mongodb
+ journal:
+ enabled: true
+ # engine:
+@@ -21,7 +21,7 @@ storage:
+ # how the process runs
+ processManagement:
+ fork: true # fork and run in background
+- pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
++ pidFilePath: /var/db/mongodb/mongod.lock # location of pidfile
+ timeZoneInfo: /usr/share/zoneinfo
+
+ # network interfaces
diff --git a/databases/mongodb36/files/patch-src_mongo_db_repl_oplog__fetcher.cpp b/databases/mongodb36/files/patch-src_mongo_db_repl_oplog__fetcher.cpp
new file mode 100644
index 000000000000..b68d7b656191
--- /dev/null
+++ b/databases/mongodb36/files/patch-src_mongo_db_repl_oplog__fetcher.cpp
@@ -0,0 +1,11 @@
+--- src/mongo/db/repl/oplog_fetcher.cpp.orig 2018-01-18 12:18:49 UTC
++++ src/mongo/db/repl/oplog_fetcher.cpp
+@@ -245,7 +245,7 @@ StatusWith<boost::optional<rpc::OplogQue
+ if (!metadataResult.isOK()) {
+ return metadataResult.getStatus();
+ }
+- oqMetadata = boost::make_optional<rpc::OplogQueryMetadata>(metadataResult.getValue());
++ oqMetadata = boost::make_optional(metadataResult.getValue());
+ }
+ return oqMetadata;
+ }