summaryrefslogtreecommitdiff
path: root/databases/mongodb34-rocks/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mongodb34-rocks/files')
-rw-r--r--databases/mongodb34-rocks/files/mongod.in63
-rw-r--r--databases/mongodb34-rocks/files/patch-SConstruct72
-rw-r--r--databases/mongodb34-rocks/files/patch-rpm_mongod.conf11
-rw-r--r--databases/mongodb34-rocks/files/patch-src_mongo_db_fts_unicode_string.cpp11
4 files changed, 157 insertions, 0 deletions
diff --git a/databases/mongodb34-rocks/files/mongod.in b/databases/mongodb34-rocks/files/mongod.in
new file mode 100644
index 000000000000..3878e3f68a54
--- /dev/null
+++ b/databases/mongodb34-rocks/files/mongod.in
@@ -0,0 +1,63 @@
+#!/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 /var/log/mongodb/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_logpath="/var/log/mongodb"}
+: ${mongod_flags="--logpath ${mongod_logpath}/mongod.log --logappend"}
+: ${mongod_user="mongodb"}
+: ${mongod_group="mongodb"}
+: ${mongod_config="%%PREFIX%%/etc/mongod.conf"}
+
+pidfile="/var/run/mongodb/mongod.pid"
+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
+ mkdir ${mongod_logpath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath} ${mongod_logpath}
+}
+
+mongod_prestart()
+{
+ if [ ! -d ${mongod_dbpath} -o ! -d ${mongod_logpath} ]; 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/mongodb34-rocks/files/patch-SConstruct b/databases/mongodb34-rocks/files/patch-SConstruct
new file mode 100644
index 000000000000..1a065848f46a
--- /dev/null
+++ b/databases/mongodb34-rocks/files/patch-SConstruct
@@ -0,0 +1,72 @@
+--- SConstruct.orig 2017-04-20 21:43:42 UTC
++++ SConstruct
+@@ -929,9 +929,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
+@@ -1550,7 +1550,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'],
+ )
+
+@@ -1564,7 +1564,7 @@ if env.TargetOSIs('posix'):
+ "-Wno-unknown-pragmas",
+ "-Winvalid-pch"] )
+ # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
+- if env.TargetOSIs('linux', 'osx', 'solaris'):
++ if env.TargetOSIs('linux', 'osx', 'solaris', 'freebsd'):
+ if not has_option("disable-warnings-as-errors"):
+ env.Append( CCFLAGS=["-Werror"] )
+
+@@ -1592,19 +1592,19 @@ 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.
+- if not env.TargetOSIs('osx'):
+- env.Append(
+- LINKFLAGS=[
+- "-Wl,--fatal-warnings",
+- ],
+- )
++ #if not env.TargetOSIs('osx'):
++ # env.Append(
++ # LINKFLAGS=[
++ # "-Wl,--fatal-warnings",
++ # ],
++ # )
+
+ mmapv1 = False
+ if get_option('mmapv1') == 'auto':
+@@ -2461,7 +2461,7 @@ def doConfigure(myenv):
+ }}
+ """.format(storage_class)
+ context.Message('Checking for storage class {0} '.format(storage_class))
+- ret = context.TryLink(textwrap.dedent(test_body), ".cpp")
++ ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
+ context.Result(ret)
+ return ret
+
diff --git a/databases/mongodb34-rocks/files/patch-rpm_mongod.conf b/databases/mongodb34-rocks/files/patch-rpm_mongod.conf
new file mode 100644
index 000000000000..6c0e6177cdb2
--- /dev/null
+++ b/databases/mongodb34-rocks/files/patch-rpm_mongod.conf
@@ -0,0 +1,11 @@
+--- rpm/mongod.conf.orig 2017-04-20 21:43:42 UTC
++++ rpm/mongod.conf
+@@ -11,7 +11,7 @@ systemLog:
+
+ # Where and how to store data.
+ storage:
+- dbPath: /var/lib/mongo
++ dbPath: /var/db/mongodb
+ journal:
+ enabled: true
+ # engine:
diff --git a/databases/mongodb34-rocks/files/patch-src_mongo_db_fts_unicode_string.cpp b/databases/mongodb34-rocks/files/patch-src_mongo_db_fts_unicode_string.cpp
new file mode 100644
index 000000000000..20fd4fb8f3e1
--- /dev/null
+++ b/databases/mongodb34-rocks/files/patch-src_mongo_db_fts_unicode_string.cpp
@@ -0,0 +1,11 @@
+--- src/mongo/db/fts/unicode/string.cpp.orig 2017-04-20 21:43:42 UTC
++++ src/mongo/db/fts/unicode/string.cpp
+@@ -274,7 +274,7 @@ bool String::substrMatch(const std::stri
+
+ // Case sensitive and diacritic sensitive.
+ return boost::algorithm::boyer_moore_search(
+- haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
++ haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end());
+ }
+
+ } // namespace unicode