aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorbsam <bsam@FreeBSD.org>2017-05-09 23:34:01 +0800
committerbsam <bsam@FreeBSD.org>2017-05-09 23:34:01 +0800
commite104ff930b231002d68eafed7ac08fb64cf2a662 (patch)
tree5ff1f7828d1888112c3ffa2c716aa05e54fb7f6b /databases
parent84995c5b4be2a171107ffe9b587d2c8b97a95df0 (diff)
downloadfreebsd-ports-gnome-e104ff930b231002d68eafed7ac08fb64cf2a662.tar.gz
freebsd-ports-gnome-e104ff930b231002d68eafed7ac08fb64cf2a662.tar.zst
freebsd-ports-gnome-e104ff930b231002d68eafed7ac08fb64cf2a662.zip
New port: databases/mongodb34-rocks.
This is a port of a MongoDB database with a RocksDB storage engine. PR: 210570 Submitted by: Šimun Mikecin <numisemis@yahoo.com>
Diffstat (limited to 'databases')
-rw-r--r--databases/Makefile1
-rw-r--r--databases/mongodb34-rocks/Makefile94
-rw-r--r--databases/mongodb34-rocks/distinfo5
-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
-rw-r--r--databases/mongodb34-rocks/pkg-descr7
-rw-r--r--databases/mongodb34-rocks/pkg-plist5
9 files changed, 269 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile
index 89779c5682a5..eedafe9a0e5f 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -189,6 +189,7 @@
SUBDIR += mongodb32
SUBDIR += mongodb32-tools
SUBDIR += mongodb34
+ SUBDIR += mongodb34-rocks
SUBDIR += mongodb34-tools
SUBDIR += mrtg-mysql-load
SUBDIR += mtools-mongodb
diff --git a/databases/mongodb34-rocks/Makefile b/databases/mongodb34-rocks/Makefile
new file mode 100644
index 000000000000..820b235197e9
--- /dev/null
+++ b/databases/mongodb34-rocks/Makefile
@@ -0,0 +1,94 @@
+# $FreeBSD$
+
+PORTNAME= mongodb
+PORTVERSION= 3.4.4
+DISTVERSIONPREFIX= r
+CATEGORIES= databases net
+MASTER_SITES= https://fastdl.mongodb.org/src/:main \
+ http://fastdl.mongodb.org/src/:main \
+ http://download.mongodb.org/src/:main \
+ https://github.com/mongodb-partners/mongo-rocks/archive/:module
+PKGNAMESUFFIX= ${PORTVERSION:R:S/.//}-rocks
+DISTNAME= mongodb-src-${DISTVERSIONPREFIX}${PORTVERSION}
+DISTFILES= mongodb-src-r${PORTVERSION}.tar.gz:main \
+ r${PORTVERSION}.tar.gz:module
+
+MAINTAINER= numisemis@yahoo.com
+COMMENT= Distributed document-oriented database with a RocksDB Storage Engine
+
+# mongodb is AGPLv3, C++ driver is APACHE20
+LICENSE= AGPLv3 APACHE20
+LICENSE_COMB= multi
+
+LIB_DEPENDS= libpcre.so:devel/pcre \
+ libsnappy.so:archivers/snappy \
+ libboost_system.so:devel/boost-libs \
+ librocksdb.so:databases/rocksdb \
+ liblz4.so:archivers/liblz4
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml \
+ ${PYTHON_PKGNAMEPREFIX}pymongo>=3.0:databases/pymongo
+
+CHOSEN_COMPILER_TYPE= clang
+
+ONLY_FOR_ARCHS= amd64
+ONLY_FOR_ARCHS_REASON= "Only supported on amd64 (i386 deprecated in v3)"
+
+CONFLICTS_BUILD= mongo-cxx-driver
+OPTIONS_DEFINE= SASL SSL
+OPTIONS_DEFAULT= SASL SSL
+
+SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
+SASL_MAKE_ARGS= --use-sasl-client
+
+SSL_USE= yes
+SSL_MAKE_ARGS= --ssl
+
+USES= compiler:c++14-lang cpe execinfo python:build scons
+
+WITH_DEBUG=yes
+MAKE_ARGS= --prefix=${STAGEDIR}${PREFIX} \
+ --use-system-pcre --use-system-snappy \
+ --use-system-boost --use-system-zlib \
+ --cxx-std=14 --libc++ \
+ --runtime-hardening=on \
+ --disable-warnings-as-errors \
+ VERBOSE=on
+
+USERS= mongodb
+GROUPS= mongodb
+
+USE_RC_SUBR= mongod \
+ mongos
+
+ALL_TARGET= core
+TEST_TARGET= unittests
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MSSL}
+USES+= ssl
+.endif
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+ @${MKDIR} ${WRKSRC}/src/mongo/db/modules/
+ @${LN} -sf ${WRKDIR}/mongo-rocks-r${PORTVERSION} ${WRKSRC}/src/mongo/db/modules/rocks
+
+post-install:
+.for f in mongo mongod mongoperf mongos
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f}
+.endfor
+ ${CP} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongod.conf.sample
+
+do-test:
+ @cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${TEST_TARGET} &&\
+ ${PYTHON_CMD} ${BUILD_WRKSRC}/buildscripts/resmoke.py\
+ --suites=unittests --jobs=${MAKE_JOBS_NUMBER}
+
+PORTSCOUT= limitw:1,even
+
+CPE_PRODUCT= mongodb
+
+.include <bsd.port.post.mk>
diff --git a/databases/mongodb34-rocks/distinfo b/databases/mongodb34-rocks/distinfo
new file mode 100644
index 000000000000..b86e02c93442
--- /dev/null
+++ b/databases/mongodb34-rocks/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1493235174
+SHA256 (mongodb-src-r3.4.4.tar.gz) = 09e962bf3428474b9790bbd464cb6176817f9da6121c30e096240dbb4d51c9f6
+SIZE (mongodb-src-r3.4.4.tar.gz) = 39867133
+SHA256 (r3.4.4.tar.gz) = ec8ca07013672dad538b0e64c7645fa61ce2f464f8912d412fc89e7649dc3fdc
+SIZE (r3.4.4.tar.gz) = 56756
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
diff --git a/databases/mongodb34-rocks/pkg-descr b/databases/mongodb34-rocks/pkg-descr
new file mode 100644
index 000000000000..0561aff05acb
--- /dev/null
+++ b/databases/mongodb34-rocks/pkg-descr
@@ -0,0 +1,7 @@
+Mongo (from "humongous") is a high-performance, open source,
+schema-free, document-oriented database. A common name in the
+"NOSQL" community.
+
+This port uses a RocksDB Storage Engine as a MongoDB backend.
+
+WWW: http://www.mongodb.org/
diff --git a/databases/mongodb34-rocks/pkg-plist b/databases/mongodb34-rocks/pkg-plist
new file mode 100644
index 000000000000..90670821820a
--- /dev/null
+++ b/databases/mongodb34-rocks/pkg-plist
@@ -0,0 +1,5 @@
+@sample etc/mongod.conf.sample
+bin/mongo
+bin/mongod
+bin/mongoperf
+bin/mongos