summaryrefslogtreecommitdiff
path: root/databases/mongodb
diff options
context:
space:
mode:
authorryoon <ryoon>2015-05-02 08:10:33 +0000
committerryoon <ryoon>2015-05-02 08:10:33 +0000
commit9f11e0bca912bb378db0b75dabee1b4974f75c4e (patch)
treefa80f1ac0b10e0d6b8b1806c285bedb46e81e885 /databases/mongodb
parent23f380fa79576edb44a35c39163cca0158ec4c2a (diff)
downloadpkgsrc-9f11e0bca912bb378db0b75dabee1b4974f75c4e.tar.gz
Import mongodb-3.0.2 as databases/mongodb from pkgsrc-wip/mongodb.
Packged by jafour1 and updated by some users. Mongo (from "humongous") is a high-performance, open source, schema-free, document-oriented database. It features: document data model with dynamic schemas; full, flexible index support and rich queries; auto-Sharding for horizontal scalability; built-in replication for high availability; text search; advanced security; aggregation Framework and MapReduce; large media storage with GridFS.
Diffstat (limited to 'databases/mongodb')
-rw-r--r--databases/mongodb/CL11
-rw-r--r--databases/mongodb/DESCR6
-rw-r--r--databases/mongodb/Makefile127
-rw-r--r--databases/mongodb/PLIST22
-rw-r--r--databases/mongodb/distinfo16
-rw-r--r--databases/mongodb/files/mongodb.sh37
-rw-r--r--databases/mongodb/files/smf/manifest.xml40
-rw-r--r--databases/mongodb/files/smf/mongodb.sh33
-rw-r--r--databases/mongodb/options.mk11
-rw-r--r--databases/mongodb/patches/patch-SConstruct84
-rw-r--r--databases/mongodb/patches/patch-debian_mongod.conf23
-rw-r--r--databases/mongodb/patches/patch-src_mongo_base_initializer.h13
-rw-r--r--databases/mongodb/patches/patch-src_mongo_db_repl_isself.c24
-rw-r--r--databases/mongodb/patches/patch-src_mongo_platform_random.cpp14
-rw-r--r--databases/mongodb/patches/patch-src_mongo_shell_linenoise__utf8.h26
-rw-r--r--databases/mongodb/patches/patch-src_third__party_s2_base_port.h27
-rw-r--r--databases/mongodb/patches/patch-src_third__party_v8-3.25_SConscript35
-rw-r--r--databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform-posix.cc29
-rw-r--r--databases/mongodb/patches/patch-src_third__party_wiredtiger_SConscript24
-rw-r--r--databases/mongodb/patches/patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h158
20 files changed, 760 insertions, 0 deletions
diff --git a/databases/mongodb/CL b/databases/mongodb/CL
new file mode 100644
index 00000000000..56bd54e6138
--- /dev/null
+++ b/databases/mongodb/CL
@@ -0,0 +1,11 @@
+Import databases/mongodb 3.0.2 from pkgsrc-wip/mongodb
+
+Packged by jafour1 and updated by some users.
+
+
+Mongo (from "humongous") is a high-performance, open source, schema-free,
+document-oriented database. It features: document data model with dynamic
+schemas; full, flexible index support and rich queries; auto-Sharding for
+horizontal scalability; built-in replication for high availability; text
+search; advanced security; aggregation Framework and MapReduce; large media
+storage with GridFS.
diff --git a/databases/mongodb/DESCR b/databases/mongodb/DESCR
new file mode 100644
index 00000000000..b9167f540c3
--- /dev/null
+++ b/databases/mongodb/DESCR
@@ -0,0 +1,6 @@
+Mongo (from "humongous") is a high-performance, open source, schema-free,
+document-oriented database. It features: document data model with dynamic
+schemas; full, flexible index support and rich queries; auto-Sharding for
+horizontal scalability; built-in replication for high availability; text
+search; advanced security; aggregation Framework and MapReduce; large media
+storage with GridFS.
diff --git a/databases/mongodb/Makefile b/databases/mongodb/Makefile
new file mode 100644
index 00000000000..4cdf5fe7514
--- /dev/null
+++ b/databases/mongodb/Makefile
@@ -0,0 +1,127 @@
+# $NetBSD: Makefile,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+DISTNAME= mongodb-src-r3.0.2
+PKGNAME= ${DISTNAME:S/src-r//:S/-rc/rc/}
+CATEGORIES= databases
+MASTER_SITES= http://fastdl.mongodb.org/src/
+
+MAINTAINER= bartosz.kuzma@gmail.com
+HOMEPAGE= http://mongodb.org/
+COMMENT= NoSQL distributed document-oriented database
+LICENSE= gnu-agpl-v3 # Client and tools licensed under apache-2.0
+
+NO_CONFIGURE= yes
+USE_LANGUAGES= c c++
+
+BUILD_DEPENDS+= scons-[0-9]*:../../devel/scons
+
+SCONS_BIN= ${PREFIX}/bin/scons
+SCONS_ARGS= ${_MAKE_JOBS}
+SCONS_ARGS= --c++11=on
+SCONS_ARGS+= --cc=${WRAPPER_BINDIR}/${CC:Q}
+SCONS_ARGS+= --cxx=${WRAPPER_BINDIR}/${CXX:Q}
+SCONS_ARGS+= --use-system-boost=USE-SYSTEM-BOOST
+SCONS_ARGS+= --use-system-pcre=USE-SYSTEM-PCRE
+SCONS_ARGS+= --use-system-snappy=USE-SYSTEM-SNAPPY
+SCONS_ARGS+= --use-system-tcmalloc=USE-SYSTEM-TCMALLOC
+SCONS_ARGS+= --js-engine=v8-3.25
+# Avoid Argument list too long from mongod linking
+SCONS_ARGS+= --variant-dir=pkgsrc
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${MACHINE_ARCH} == "x86_64"
+SCONS_ARGS+= --64
+.else
+SCONS_ARGS+= --32
+.endif
+
+CPPFLAGS+= -fno-jump-tables
+
+.include "options.mk"
+
+SMF_METHODS+= mongodb
+
+BUILD_DEFS+= VARBASE
+BUILD_DEFS+= MONGODB_USER MONGODB_GROUP MONGODB_DBPATH
+BUILD_DEFS+= MONGODB_LOGPATH
+
+MONGODB_USER?= mongodb
+MONGODB_GROUP?= mongodb
+MONGODB_DBPATH?= ${VARBASE}/mongodb
+MONGODB_LOGPATH?= ${VARBASE}/log/mongodb
+
+PKG_USERS_VARS+= MONGODB_USER
+PKG_GROUPS_VARS+= MONGODB_GROUP
+
+PKG_GROUPS= ${MONGODB_GROUP}
+PKG_USERS= ${MONGODB_USER}:${MONGODB_GROUP}
+
+PKG_GECOS.${MONGODB_USER}= MongoDB database administrator
+PKG_HOME.${MONGODB_USER}= ${MONGODB_DBPATH}
+PKG_SHELL.${MONGODB_USER}= ${SH}
+
+OWN_DIRS_PERMS+= ${MONGODB_DBPATH} ${MONGODB_USER} ${MONGODB_GROUP} 0755
+OWN_DIRS_PERMS+= ${MONGODB_DBPATH}/journal ${MONGODB_USER} ${MONGODB_GROUP} 0755
+OWN_DIRS_PERMS+= ${MONGODB_LOGPATH} ${MONGODB_USER} ${MONGODB_GROUP} 0755
+
+FILES_SUBST+= MONGODB_USER=${MONGODB_USER}
+FILES_SUBST+= MONGODB_GROUP=${MONGODB_GROUP}
+FILES_SUBST+= MONGODB_DBPATH=${MONGODB_DBPATH}
+FILES_SUBST+= MONGODB_LOGPATH=${MONGODB_LOGPATH}
+
+# XXX No better idea how to pass CXXFLAGS and LDFLAGS to scons
+SUBST_CLASSES+= scons
+SUBST_STAGE.scons= pre-build
+SUBST_FILES.scons= SConstruct
+SUBST_VARS.scons= PREFIX CXXFLAGS LDFLAGS
+
+SUBST_CLASSES+= path
+SUBST_STAGE.path= pre-build
+SUBST_FILES.path= src/mongo/db/flushtest.cpp debian/mongod.conf
+SUBST_FILES.path+= debian/mongod.1 debian/mongo.1 src/mongo/shell/dbshell.cpp
+SUBST_SED.path= -e 's|/data/db|${MONGODB_DBPATH}|g'
+SUBST_SED.path+= -e 's|/etc|${PKG_SYSCONFDIR}|'
+SUBST_VARS.path= MONGODB_DBPATH MONGODB_LOGPATH
+
+MONGODB_MAN_FILES= bsondump.1 mongo.1 mongod.1 mongodump.1 mongoexport.1 \
+ mongofiles.1 mongoimport.1 mongooplog.1 mongoperf.1 \
+ mongorestore.1 mongos.1 mongosniff.1 mongostat.1 mongotop.1
+
+RCD_SCRIPTS= mongodb
+
+INSTALLATION_DIRS+= share/doc/mongodb share/examples/mongodb ${PKGMANDIR}/man1
+
+CONF_FILES+= share/examples/mongodb/mongod.conf \
+ ${PKG_SYSCONFDIR}/mongod.conf
+
+post-extract:
+ chmod -R g-w ${WRKSRC}
+
+do-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SCONS_BIN} ${SCONS_ARGS} core
+
+do-install:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SCONS_BIN} ${SCONS_ARGS} \
+ --prefix=${DESTDIR}${PREFIX} install
+
+do-test:
+ cd ${WRKSRC} && ./test
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/mongodb
+.for file in ${MONGODB_MAN_FILES}
+ ${INSTALL_MAN} ${WRKSRC}/debian/${file} \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/debian/mongod.conf \
+ ${DESTDIR}${PREFIX}/share/examples/mongodb
+
+.include "../../devel/boost-headers/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../devel/boost-python/buildlink3.mk"
+.include "../../devel/libexecinfo/buildlink3.mk"
+.include "../../devel/pcre/buildlink3.mk"
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../net/libpcap/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/mongodb/PLIST b/databases/mongodb/PLIST
new file mode 100644
index 00000000000..4358f026307
--- /dev/null
+++ b/databases/mongodb/PLIST
@@ -0,0 +1,22 @@
+@comment $NetBSD: PLIST,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+bin/mongo
+bin/mongod
+bin/mongoperf
+bin/mongos
+bin/mongosniff
+man/man1/bsondump.1
+man/man1/mongo.1
+man/man1/mongod.1
+man/man1/mongodump.1
+man/man1/mongoexport.1
+man/man1/mongofiles.1
+man/man1/mongoimport.1
+man/man1/mongooplog.1
+man/man1/mongoperf.1
+man/man1/mongorestore.1
+man/man1/mongos.1
+man/man1/mongosniff.1
+man/man1/mongostat.1
+man/man1/mongotop.1
+share/doc/mongodb/README
+share/examples/mongodb/mongod.conf
diff --git a/databases/mongodb/distinfo b/databases/mongodb/distinfo
new file mode 100644
index 00000000000..5cf92ed59b6
--- /dev/null
+++ b/databases/mongodb/distinfo
@@ -0,0 +1,16 @@
+$NetBSD: distinfo,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+SHA1 (mongodb-src-r3.0.2.tar.gz) = c24c4deb619e199d5c3688370b39ea6e4a4df204
+RMD160 (mongodb-src-r3.0.2.tar.gz) = 12571664adca8bcec7fe8daa6ee2a8a120261aea
+Size (mongodb-src-r3.0.2.tar.gz) = 26594777 bytes
+SHA1 (patch-SConstruct) = 656921b86b686c0dd2005036629d0149d6f713e7
+SHA1 (patch-debian_mongod.conf) = 35f3d7e7da4f573458bef0fe742c1790adec8200
+SHA1 (patch-src_mongo_base_initializer.h) = add32c5940c922a98122d0e6883eb3ad52dc25c5
+SHA1 (patch-src_mongo_db_repl_isself.c) = 93001bf0616c0fd64ac5e7ea03113885671540b0
+SHA1 (patch-src_mongo_platform_random.cpp) = ab275e90347a9d2e767f031df4e56a204647ddfe
+SHA1 (patch-src_mongo_shell_linenoise__utf8.h) = d505c22aeeee09b482bf3d3a6bd0cdc45c9ec0bc
+SHA1 (patch-src_third__party_s2_base_port.h) = 8e715efbfcacaba51d957c21aa32ccfd3cc4f736
+SHA1 (patch-src_third__party_v8-3.25_SConscript) = a8da59130c36b2be3b89498ba0b23b1c7c9ab9e6
+SHA1 (patch-src_third__party_v8-3.25_src_platform-posix.cc) = 2fa27016a9af828d1c01815739770918a2d53d16
+SHA1 (patch-src_third__party_wiredtiger_SConscript) = 576ae923cd77c5d21f44f82fc6bde7c3b5ffa250
+SHA1 (patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h) = e41064c0ff7268efc795782312ff413295cbcba7
diff --git a/databases/mongodb/files/mongodb.sh b/databases/mongodb/files/mongodb.sh
new file mode 100644
index 00000000000..e7ac2eafb17
--- /dev/null
+++ b/databases/mongodb/files/mongodb.sh
@@ -0,0 +1,37 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: mongodb.sh,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+#
+# PROVIDE: mongodb
+# REQUIRE: DAEMON LOGIN mountall
+# KEYWORD: shutdown
+#
+# You will need to set some variables in /etc/rc.conf to start MongoDB:
+#
+# mongodb=YES
+#
+# The following variables are optional:
+#
+# mongodb_user="@MONGODB_USER@" # user to run mongod as
+# mongodb_group="@MONGODB_GROUP@" # group to run mongod as
+# mongodb_dbpath="@MONGODB_DBPATH@" # path to MongoDB database directory
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="mongodb"
+rcvar=${name}
+command="@PREFIX@/bin/mongod"
+: ${mongodb_user:=@MONGODB_USER@}
+: ${mongodb_group:=@MONGODB_GROUP@}
+: ${mongodb_dbpath:=@MONGODB_DBPATH@}
+pidfile="${mongodb_dbpath}/mongod.pid"
+logfile="${mongodb_dbpath}/mongod.log"
+required_dirs="${mongodb_dbpath}"
+
+command_args="--fork --logpath ${logfile} --logappend --pidfilepath ${pidfile} --dbpath ${mongodb_dbpath} --smallfiles"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/databases/mongodb/files/smf/manifest.xml b/databases/mongodb/files/smf/manifest.xml
new file mode 100644
index 00000000000..442a1ccb505
--- /dev/null
+++ b/databases/mongodb/files/smf/manifest.xml
@@ -0,0 +1,40 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+<service_bundle type='manifest' name='export'>
+ <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='0'>
+ <create_default_instance enabled='false'/>
+ <single_instance/>
+ <dependency name='fs' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/system/filesystem/local'/>
+ </dependency>
+ <dependency name='net' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/network/loopback'/>
+ </dependency>
+ <dependency name='config' grouping='require_all' restart_on='none' type='path'>
+ <service_fmri value='file://@PKG_SYSCONFDIR@/mongod.conf'/>
+ </dependency>
+ <method_context working_directory='@MONGODB_DBPATH@'>
+ <method_credential group='@MONGODB_USER@' user='@MONGODB_GROUP@'/>
+ <method_environment>
+ <envvar name='PATH' value='@PREFIX@/bin:@PREFIX@/gnu/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin'/>
+ </method_environment>
+ </method_context>
+ <exec_method name='start' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ start' timeout_seconds='18446744073709551615'/>
+ <exec_method name='stop' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ stop' timeout_seconds='18446744073709551615'/>
+ <exec_method name='restart' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ restart' timeout_seconds='18446744073709551615'/>
+ <property_group name='replication' type='application'>
+ <propval name='name' type='astring' value=''/>
+ <propval name='key' type='astring' value=''/>
+ <propval name='members' type='astring' value=''/>
+ </property_group>
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>MongoDB Database</loctext>
+ </common_name>
+ <documentation>
+ <doc_link name='wiki.joyent.com' uri='http://wiki.joyent.com/display/jpc2/Joyent+MongoDB+SmartMachine'/>
+ </documentation>
+ </template>
+ </service>
+</service_bundle>
+
diff --git a/databases/mongodb/files/smf/mongodb.sh b/databases/mongodb/files/smf/mongodb.sh
new file mode 100644
index 00000000000..df97f6b9e4d
--- /dev/null
+++ b/databases/mongodb/files/smf/mongodb.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# SMF method for svc:/pkgsrc/mongodb:default
+
+. /lib/svc/share/smf_include.sh
+
+# mongodb doesn't really work with anything else but C locale
+export LANG=C
+
+PATH="@PREFIX@/bin:@PREFIX@/gnu/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin";
+MONGO_DBPATH="@MONGODB_DBPATH@";
+MONGO_CONF="@PKG_SYSCONFDIR@/mongod.conf";
+MONGO_PID="${MONGO_DBPATH}/mongod.pid";
+
+case "$1" in
+ 'start')
+ mongod --fork -f ${MONGO_CONF} --pidfilepath ${MONGO_PID}
+ ;;
+
+ 'stop')
+ [[ -s ${MONGO_PID} ]] && kill $(cat ${MONGO_PID}) 2>/dev/null
+ ;;
+
+ 'restart')
+ [[ -s ${MONGO_PID} ]] && kill $(cat ${MONGO_PID}) 2>/dev/null
+ sleep 3;
+ mongod --fork -f ${MONGO_CONF} --pidfilepath ${MONGO_PID}
+ ;;
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ exit 1;
+ ;;
+esac
diff --git a/databases/mongodb/options.mk b/databases/mongodb/options.mk
new file mode 100644
index 00000000000..63c20aa65d6
--- /dev/null
+++ b/databases/mongodb/options.mk
@@ -0,0 +1,11 @@
+# $NetBSD: options.mk,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.mongodb
+PKG_SUPPORTED_OPTIONS= ssl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+SCONS_ARGS+= --ssl
+.endif
diff --git a/databases/mongodb/patches/patch-SConstruct b/databases/mongodb/patches/patch-SConstruct
new file mode 100644
index 00000000000..03c5ebe5e69
--- /dev/null
+++ b/databases/mongodb/patches/patch-SConstruct
@@ -0,0 +1,84 @@
+$NetBSD: patch-SConstruct,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+Add support for NetBSD/Dragonfly, fix locations.
+--- SConstruct.orig 2015-04-08 20:28:08.000000000 +0000
++++ SConstruct
+@@ -53,7 +53,9 @@ nix = False
+ linux = False
+ darwin = False
+ windows = False
++dragonfly = False
+ freebsd = False
++netbsd = False
+ openbsd = False
+ solaris = False
+
+@@ -65,8 +67,12 @@ elif platform.startswith("linux"):
+ platform = "linux"
+ elif "sunos5" == platform:
+ solaris = True
++elif platform.startswith( "dragonfly" ):
++ dragonfly = True
+ elif platform.startswith( "freebsd" ):
+ freebsd = True
++elif platform.startswith( "netbsd" ):
++ netbsd = True
+ elif platform.startswith( "openbsd" ):
+ openbsd = True
+ elif "win32" == platform:
+@@ -848,6 +854,12 @@ elif solaris:
+ env.Append( CPPDEFINES=[ "__sunos__" ] )
+ env.Append( LIBS=["socket","resolv","lgrp"] )
+
++elif os.sys.platform.startswith( "dragonfly" ):
++ env.Append( CPPPATH=[ "@PREFIX@/include" ] )
++ env.Append( LIBPATH=[ "@PREFIX@/lib" ] )
++ env.Append( LIBS=[ "m" ] )
++ env.Append( CPPDEFINES=[ "__dragonfly__" ] )
++
+ elif freebsd:
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
+@@ -855,6 +867,12 @@ elif freebsd:
+ env.Append( CPPDEFINES=[ "__freebsd__" ] )
+ env.Append( CCFLAGS=[ "-fno-omit-frame-pointer" ] )
+
++elif os.sys.platform.startswith( "netbsd" ):
++ env.Append( CPPPATH=[ "@PREFIX@/include" ] )
++ env.Append( LIBPATH=[ "@PREFIX@/lib" ] )
++ env.Append( LIBS=[ "m" ] )
++ env.Append( CPPDEFINES=[ "__netbsd__" ] )
++
+ elif openbsd:
+ env.Append( EXTRACPPPATH=[ "/usr/local/include" ] )
+ env.Append( EXTRALIBPATH=[ "/usr/local/lib" ] )
+@@ -1020,8 +1038,11 @@ if nix:
+ env.Append( CCFLAGS=["-Werror"] )
+
+ env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
++ env.Append( CPPDEFINES=["XP_UNIX=1"] )
+ env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
++ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
+ env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
++ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
+
+ # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
+ # startup.
+@@ -2163,7 +2184,7 @@ def doConfigure(myenv):
+ Exit(1)
+
+ # requires ports devel/libexecinfo to be installed
+- if freebsd or openbsd:
++ if freebsd or openbsd or netbsd or dragonfly:
+ if not conf.CheckLib("execinfo"):
+ print("Cannot find libexecinfo, please install devel/libexecinfo.")
+ Exit(1)
+@@ -2409,7 +2430,7 @@ Export("mongoCodeVersion")
+ Export("usev8")
+ Export("v8version v8suffix")
+ Export("boostSuffix")
+-Export("darwin windows solaris linux freebsd nix openbsd")
++Export("darwin windows solaris linux freebsd nix openbsd netbsd dragonfly")
+ Export('module_sconscripts')
+ Export("debugBuild optBuild")
+ Export("s3push")
diff --git a/databases/mongodb/patches/patch-debian_mongod.conf b/databases/mongodb/patches/patch-debian_mongod.conf
new file mode 100644
index 00000000000..0c51a758db6
--- /dev/null
+++ b/databases/mongodb/patches/patch-debian_mongod.conf
@@ -0,0 +1,23 @@
+$NetBSD: patch-debian_mongod.conf,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+Use proper paths in default config file.
+--- debian/mongod.conf.orig 2014-04-07 00:36:57.000000000 +0000
++++ debian/mongod.conf
+@@ -5,13 +5,15 @@
+ # Note: if you run mongodb as a non-root user (recommended) you may
+ # need to create and set permissions for this directory manually,
+ # e.g., if the parent directory isn't mutable by the mongodb user.
+-dbpath=/var/lib/mongodb
++dbpath=@MONGODB_DBPATH@
+
+ #where to log
+-logpath=/var/log/mongodb/mongod.log
++logpath=@MONGODB_LOGPATH@/mongod.log
+
+ logappend=true
+
++pidfilepath = @MONGODB_DBPATH@/mongod.pid
++
+ #port = 27017
+
+ # Listen to local interface only. Comment out to listen on all interfaces.
diff --git a/databases/mongodb/patches/patch-src_mongo_base_initializer.h b/databases/mongodb/patches/patch-src_mongo_base_initializer.h
new file mode 100644
index 00000000000..c7a45a33735
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_mongo_base_initializer.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_mongo_base_initializer.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+Fixes at least SunOS.
+--- src/mongo/base/initializer.h.orig 2014-04-07 00:36:57.000000000 +0000
++++ src/mongo/base/initializer.h
+@@ -17,6 +17,7 @@
+
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+
+ #include "mongo/base/disallow_copying.h"
+ #include "mongo/base/initializer_context.h"
diff --git a/databases/mongodb/patches/patch-src_mongo_db_repl_isself.c b/databases/mongodb/patches/patch-src_mongo_db_repl_isself.c
new file mode 100644
index 00000000000..ea044e63e58
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_mongo_db_repl_isself.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_mongo_db_repl_isself.c,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Add NetBSD support.
+
+--- src/mongo/db/repl/isself.cpp.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/mongo/db/repl/isself.cpp
+@@ -47,7 +47,7 @@
+ #include "mongo/util/scopeguard.h"
+ #include "mongo/util/log.h"
+
+-#if defined(__linux__) || defined(__APPLE__) || defined(__freebsd__) || defined(__sunos__) || defined(__openbsd__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__freebsd__) || defined(__sunos__) || defined(__openbsd__) || defined(__netbsd__)
+ #define FASTPATH_UNIX 1
+ #endif
+
+@@ -60,7 +60,7 @@
+ #include <ifaddrs.h>
+ #include <netdb.h>
+
+-#ifdef __freebsd__
++#if defined __freebsd__ || defined __netbsd__
+ #include <netinet/in.h>
+ #endif
+
diff --git a/databases/mongodb/patches/patch-src_mongo_platform_random.cpp b/databases/mongodb/patches/patch-src_mongo_platform_random.cpp
new file mode 100644
index 00000000000..a56e228628c
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_mongo_platform_random.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_mongo_platform_random.cpp,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+Add NetBSD support.
+--- src/mongo/platform/random.cpp.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/mongo/platform/random.cpp
+@@ -117,7 +117,7 @@ namespace mongo {
+ return new WinSecureRandom();
+ }
+
+-#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__freebsd__)
++#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__freebsd__) || defined(__netbsd__)
+
+ class InputStreamSecureRandom : public SecureRandom {
+ public:
diff --git a/databases/mongodb/patches/patch-src_mongo_shell_linenoise__utf8.h b/databases/mongodb/patches/patch-src_mongo_shell_linenoise__utf8.h
new file mode 100644
index 00000000000..969db2b50ba
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_mongo_shell_linenoise__utf8.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_mongo_shell_linenoise__utf8.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+Use Boost swap instead of std. Fixes build on SunOS.
+--- src/mongo/shell/linenoise_utf8.h.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/mongo/shell/linenoise_utf8.h
+@@ -27,6 +27,7 @@
+ * then also delete it in the license file.
+ */
+
++#include <boost/core/swap.hpp>
+ #include <boost/smart_ptr/scoped_array.hpp>
+ #include <algorithm>
+ #include <string.h>
+@@ -155,9 +156,9 @@ struct UtfStringMixin {
+ size_t chars() const { return _chars; }
+
+ void swap( UtfStringMixin& other ) {
+- std::swap( _len, other._len );
+- std::swap( _cap, other._cap );
+- std::swap( _chars, other._chars );
++ boost::swap( _len, other._len );
++ boost::swap( _cap, other._cap );
++ boost::swap( _chars, other._chars );
+ _str.swap( other._str );
+ }
+
diff --git a/databases/mongodb/patches/patch-src_third__party_s2_base_port.h b/databases/mongodb/patches/patch-src_third__party_s2_base_port.h
new file mode 100644
index 00000000000..e6ceedac287
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_s2_base_port.h
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_third__party_s2_base_port.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Add NetBSD support.
+
+--- src/third_party/s2/base/port.h.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/third_party/s2/base/port.h
+@@ -102,7 +102,7 @@ typedef uint16_t u_int16_t;
+
+ #endif
+
+-#if defined __sunos__ || defined __freebsd__ || defined __openbsd__
++#if defined __sunos__ || defined __freebsd__ || defined __openbsd__ || defined __netbsd__
+ #ifdef _LITTLE_ENDIAN
+ #define IS_LITTLE_ENDIAN
+ #elif defined _BIG_ENDIAN
+@@ -139,6 +139,11 @@ typedef uint16_t u_int16_t;
+ #define bswap_16(x) swap16(x)
+ #define bswap_32(x) swap32(x)
+ #define bswap_64(x) swap64(x)
++#elif defined __netbsd__
++#include <machine/bswap.h>
++#define bswap_16(x) bswap16(x)
++#define bswap_32(x) bswap32(x)
++#define bswap_64(x) bswap64(x)
+ #else
+ #include <byteswap.h>
+ #endif
diff --git a/databases/mongodb/patches/patch-src_third__party_v8-3.25_SConscript b/databases/mongodb/patches/patch-src_third__party_v8-3.25_SConscript
new file mode 100644
index 00000000000..2619f141fe9
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_v8-3.25_SConscript
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_third__party_v8-3.25_SConscript,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Treat NetBSD like OpenBSD.
+
+--- src/third_party/v8-3.25/SConscript.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/third_party/v8-3.25/SConscript
+@@ -32,7 +32,7 @@ root_dir = dirname(File('SConscript').rf
+ sys.path.insert(0, join(root_dir, 'tools'))
+ import js2c
+
+-Import("env windows linux darwin solaris freebsd debugBuild openbsd")
++Import("env windows linux darwin solaris freebsd debugBuild openbsd dragonfly netbsd")
+
+ # pared-down copies of the equivalent structures in v8's SConstruct/SConscript:
+ LIBRARY_FLAGS = {
+@@ -313,6 +313,8 @@ SOURCES = {
+ 'os:linux': ['platform-linux.cc', 'platform-posix.cc'],
+ 'os:macos': ['platform-macos.cc', 'platform-posix.cc'],
+ 'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
++ 'os:dragonfly': ['platform-freebsd.cc', 'platform-posix.cc'],
++ 'os:netbsd': ['platform-openbsd.cc', 'platform-posix.cc'],
+ 'os:nullos': ['platform-nullos.cc'],
+ 'os:win32': ['platform-win32.cc', 'win32-math.cc'],
+ 'mode:release': [],
+@@ -377,6 +379,10 @@ def get_options():
+ os_string = 'os:solaris'
+ elif openbsd:
+ os_string = 'os:openbsd'
++ elif dragonfly:
++ os_string = 'os:dragonfly'
++ elif netbsd:
++ os_string = 'os:netbsd'
+ else:
+ os_string = 'os:nullos'
+
diff --git a/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform-posix.cc b/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform-posix.cc
new file mode 100644
index 00000000000..b9fa9625e01
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform-posix.cc
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_third__party_v8-3.25_src_platform-posix.cc,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Add NetBSD support from lang/nodejs.
+
+--- src/third_party/v8-3.25/src/platform-posix.cc.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/third_party/v8-3.25/src/platform-posix.cc
+@@ -588,8 +588,13 @@ Thread::Thread(const Options& options)
+ : data_(new PlatformData),
+ stack_size_(options.stack_size()),
+ start_semaphore_(NULL) {
++#if defined(__NetBSD__)
++ if (stack_size_ > 0 && stack_size_ < sysconf(_SC_THREAD_STACK_MIN)) {
++ stack_size_ = sysconf(_SC_THREAD_STACK_MIN);
++#else
+ if (stack_size_ > 0 && stack_size_ < PTHREAD_STACK_MIN) {
+ stack_size_ = PTHREAD_STACK_MIN;
++#endif
+ }
+ set_name(options.name());
+ }
+@@ -605,7 +610,7 @@ static void SetThreadName(const char* na
+ pthread_set_name_np(pthread_self(), name);
+ #elif V8_OS_NETBSD
+ STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
+- pthread_setname_np(pthread_self(), "%s", name);
++ pthread_setname_np(pthread_self(), "%s", (void *)name);
+ #elif V8_OS_MACOSX
+ // pthread_setname_np is only available in 10.6 or later, so test
+ // for it at runtime.
diff --git a/databases/mongodb/patches/patch-src_third__party_wiredtiger_SConscript b/databases/mongodb/patches/patch-src_third__party_wiredtiger_SConscript
new file mode 100644
index 00000000000..5628d4d707c
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_wiredtiger_SConscript
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_third__party_wiredtiger_SConscript,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Add NetBSD case.
+
+--- src/third_party/wiredtiger/SConscript.orig 2015-04-08 20:28:08.000000000 +0000
++++ src/third_party/wiredtiger/SConscript
+@@ -2,7 +2,7 @@
+ import re
+ import textwrap
+
+-Import("env windows darwin solaris linux freebsd openbsd debugBuild")
++Import("env windows darwin solaris linux freebsd openbsd netbsd debugBuild")
+
+ env = env.Clone()
+ env.InjectThirdPartyIncludePaths(libraries=['snappy', 'zlib'])
+@@ -28,6 +28,8 @@ elif freebsd:
+ env.Append(CPPPATH=["build_freebsd"])
+ elif openbsd:
+ env.Append(CPPPATH=["build_openbsd"])
++elif netbsd:
++ env.Append(CPPPATH=["build_netbsd"])
+ elif linux:
+ env.Append(CPPPATH=["build_linux"])
+ env.Append(CPPDEFINES=["_GNU_SOURCE"])
diff --git a/databases/mongodb/patches/patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h b/databases/mongodb/patches/patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h
new file mode 100644
index 00000000000..e6e82ece8d6
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h
@@ -0,0 +1,158 @@
+$NetBSD: patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h,v 1.1 2015/05/02 08:10:33 ryoon Exp $
+
+* Copy from OpenBSD case.
+
+--- src/third_party/wiredtiger/build_netbsd/wiredtiger_config.h.orig 2015-05-02 04:35:05.000000000 +0000
++++ src/third_party/wiredtiger/build_netbsd/wiredtiger_config.h
+@@ -0,0 +1,151 @@
++/* wiredtiger_config.h. Generated from config.hin by configure. */
++/* build_posix/config.hin. Generated from configure.ac by autoheader. */
++
++/* Define if building universal (internal helper macro) */
++/* #undef AC_APPLE_UNIVERSAL_BUILD */
++
++/* Define to 1 to pause for debugger attach on failure. */
++/* #undef HAVE_ATTACH */
++
++/* Build the LevelDB API with Basho LevelDB support. */
++/* #undef HAVE_BASHOLEVELDB */
++
++/* Snappy support automatically loaded. */
++/* #undef HAVE_BUILTIN_EXTENSION_SNAPPY */
++
++/* Zlib support automatically loaded. */
++/* #undef HAVE_BUILTIN_EXTENSION_ZLIB */
++
++/* Define to 1 if you have the `clock_gettime' function. */
++#define HAVE_CLOCK_GETTIME 1
++
++/* Define to 1 for diagnostic tests. */
++/* #undef HAVE_DIAGNOSTIC */
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define HAVE_DLFCN_H 1
++
++/* Define to 1 if you have the `fallocate' function. */
++/* #undef HAVE_FALLOCATE */
++
++/* Define to 1 if you have the `fcntl' function. */
++#define HAVE_FCNTL 1
++
++/* Define to 1 if you have the `fdatasync' function. */
++#define HAVE_FDATASYNC 1
++
++/* Define to 1 if you have the `fread_unlocked' function. */
++/* #undef HAVE_FREAD_UNLOCKED */
++
++/* Define to 1 if you have the `ftruncate' function. */
++#define HAVE_FTRUNCATE 1
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#define HAVE_GETTIMEOFDAY 1
++
++/* Build the LevelDB API with HyperLevelDB support. */
++/* #undef HAVE_HYPERLEVELDB */
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#define HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the `bz2' library (-lbz2). */
++/* #undef HAVE_LIBBZ2 */
++
++/* Define to 1 if you have the `dl' library (-ldl). */
++/* #undef HAVE_LIBDL */
++
++/* Define to 1 if you have the `pthread' library (-lpthread). */
++#define HAVE_LIBPTHREAD 1
++
++/* Define to 1 if you have the `rt' library (-lrt). */
++/* #undef HAVE_LIBRT */
++
++/* Define to 1 if you have the `snappy' library (-lsnappy). */
++/* #undef HAVE_LIBSNAPPY */
++
++/* Define to 1 if you have the `z' library (-lz). */
++/* #undef HAVE_LIBZ */
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the `posix_fadvise' function. */
++/* #undef HAVE_POSIX_FADVISE */
++
++/* Define to 1 if you have the `posix_fallocate' function. */
++/* #undef HAVE_POSIX_FALLOCATE */
++
++/* Define to 1 if you have the `posix_madvise' function. */
++#define HAVE_POSIX_MADVISE 1
++
++/* Define to 1 if you have the `posix_memalign' function. */
++#define HAVE_POSIX_MEMALIGN 1
++
++/* Define to 1 if you have the <pthread_np.h> header file. */
++/* #undef HAVE_PTHREAD_NP_H */
++
++/* Build the LevelDB API with RocksDB support. */
++/* #undef HAVE_ROCKSDB */
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#define HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#define HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#define HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strtouq' function. */
++#define HAVE_STRTOUQ 1
++
++/* Define to 1 if you have the `sync_file_range' function. */
++/* #undef HAVE_SYNC_FILE_RANGE */
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define HAVE_SYS_TYPES_H 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++
++/* Enable verbose message configuration. */
++/* #undef HAVE_VERBOSE */
++
++/* Spinlock type from mutex.h. */
++#define SPINLOCK_TYPE SPINLOCK_PTHREAD_MUTEX
++
++/* Define to 1 if you have the ANSI C header files. */
++#define STDC_HEADERS 1
++
++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
++ significant byte first (like Motorola and SPARC, unlike Intel). */
++#if defined AC_APPLE_UNIVERSAL_BUILD
++# if defined __BIG_ENDIAN__
++# define WORDS_BIGENDIAN 1
++# endif
++#else
++# ifndef WORDS_BIGENDIAN
++/* # undef WORDS_BIGENDIAN */
++# endif
++#endif
++
++/* Default alignment of buffers used for I/O */
++#define WT_BUFFER_ALIGNMENT_DEFAULT 0
++
++/* Enable large inode numbers on Mac OS X 10.5. */
++#ifndef _DARWIN_USE_64_BIT_INODE
++# define _DARWIN_USE_64_BIT_INODE 1
++#endif
++
++/* Number of bits in a file offset, on hosts where this is settable. */
++/* #undef _FILE_OFFSET_BITS */
++
++/* Define for large files, on AIX-style hosts. */
++/* #undef _LARGE_FILES */