diff options
author | demon <demon@FreeBSD.org> | 2016-01-23 20:46:58 +0800 |
---|---|---|
committer | demon <demon@FreeBSD.org> | 2016-01-23 20:46:58 +0800 |
commit | c7fc1d5d1da173070ada64d52d66f8bbbabeecb8 (patch) | |
tree | 48b3215a3dbc6eeb9899a0cf4895ef3352a79ccf /databases/mongodb32 | |
parent | 0fc2bcac28119b21ce2daede9738583cb0d215ae (diff) | |
download | freebsd-ports-gnome-c7fc1d5d1da173070ada64d52d66f8bbbabeecb8.tar.gz freebsd-ports-gnome-c7fc1d5d1da173070ada64d52d66f8bbbabeecb8.tar.zst freebsd-ports-gnome-c7fc1d5d1da173070ada64d52d66f8bbbabeecb8.zip |
Add a port for mongodb version 3.2.
PR: 205510
Submitted by: Brendan Molloy <brendan+freebsd@bbqsrc.net>
Maintainer of databases/mongodb port timeout (3 weeks)
I bumped version to 3.2.1.
mongodb32-tools port coming soon.
Diffstat (limited to 'databases/mongodb32')
-rw-r--r-- | databases/mongodb32/Makefile | 65 | ||||
-rw-r--r-- | databases/mongodb32/distinfo | 2 | ||||
-rw-r--r-- | databases/mongodb32/files/mongod.in | 59 | ||||
-rw-r--r-- | databases/mongodb32/files/patch-SConstruct | 15 | ||||
-rw-r--r-- | databases/mongodb32/pkg-descr | 5 | ||||
-rw-r--r-- | databases/mongodb32/pkg-plist | 7 |
6 files changed, 153 insertions, 0 deletions
diff --git a/databases/mongodb32/Makefile b/databases/mongodb32/Makefile new file mode 100644 index 000000000000..fa1307f92e4c --- /dev/null +++ b/databases/mongodb32/Makefile @@ -0,0 +1,65 @@ +# Created by: Brendan Molloy <brendan+freebsd@bbqsrc.net> +# $FreeBSD$ + +PORTNAME= mongodb32 +PORTVERSION= 3.2.1 +DISTVERSIONPREFIX= r +CATEGORIES= databases net +MASTER_SITES= https://fastdl.mongodb.org/src/ \ + http://fastdl.mongodb.org/src/ \ + http://download.mongodb.org/src/ +DISTNAME= mongodb-src-${DISTVERSIONPREFIX}${PORTVERSION} + +MAINTAINER= brendan+freebsd@bbqsrc.net +COMMENT= NOSQL distributed document-oriented database + +# mongodb is AGPLv3, C++ driver is APACHE20 +LICENSE= AGPLv3 APACHE20 +LICENSE_COMB= multi + +LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre \ + libsnappy.so:${PORTSDIR}/archivers/snappy +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:${PORTSDIR}/devel/py-yaml \ + ${PYTHON_PKGNAMEPREFIX}pymongo>=3.0:${PORTSDIR}/databases/pymongo + +ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than i386 and amd64" + +OPTIONS_DEFINE= SASL SSL +OPTIONS_DEFAULT=SSL + +SASL_LIB_DEPENDS= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2 +SASL_MAKE_ARGS= --use-sasl-client + +SSL_USE= openssl=yes +SSL_MAKE_ARGS= --ssl + +USES= cpe execinfo python:build scons +MAKE_ARGS= --prefix=${STAGEDIR}${PREFIX} \ + --use-system-pcre --use-system-snappy \ + --release + +USERS= mongodb +GROUPS= mongodb + +USE_RC_SUBR= mongod + +ALL_TARGET= core +TEST_TARGET= unittests + +post-install: +.for f in mongo mongod mongoperf mongos mongosniff + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} +.endfor + +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.mk> diff --git a/databases/mongodb32/distinfo b/databases/mongodb32/distinfo new file mode 100644 index 000000000000..1e4d4f0bcb84 --- /dev/null +++ b/databases/mongodb32/distinfo @@ -0,0 +1,2 @@ +SHA256 (mongodb-src-r3.2.1.tar.gz) = 50431a3ba5ab68bd0bed4a157a8528ca27753a63cf101f13135255e4e9d42f15 +SIZE (mongodb-src-r3.2.1.tar.gz) = 26397562 diff --git a/databases/mongodb32/files/mongod.in b/databases/mongodb32/files/mongod.in new file mode 100644 index 000000000000..bdf24bea76e0 --- /dev/null +++ b/databases/mongodb32/files/mongod.in @@ -0,0 +1,59 @@ +#!/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". +# + +. /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"} + +pidfile="${mongod_dbpath}/mongod.lock" +command=%%PREFIX%%/bin/${name} +command_args="--config %%PREFIX%%/etc/mongodb.conf --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/mongodb32/files/patch-SConstruct b/databases/mongodb32/files/patch-SConstruct new file mode 100644 index 000000000000..0fcfc03ac7de --- /dev/null +++ b/databases/mongodb32/files/patch-SConstruct @@ -0,0 +1,15 @@ +--- SConstruct.orig 2015-12-02 19:01:34 UTC ++++ SConstruct +@@ -840,9 +840,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 diff --git a/databases/mongodb32/pkg-descr b/databases/mongodb32/pkg-descr new file mode 100644 index 000000000000..24f53e80363b --- /dev/null +++ b/databases/mongodb32/pkg-descr @@ -0,0 +1,5 @@ +Mongo (from "humongous") is a high-performance, open source, +schema-free, document-oriented database. A common name in the +"NOSQL" community. + +WWW: http://www.mongodb.org/ diff --git a/databases/mongodb32/pkg-plist b/databases/mongodb32/pkg-plist new file mode 100644 index 000000000000..2f0f87183282 --- /dev/null +++ b/databases/mongodb32/pkg-plist @@ -0,0 +1,7 @@ +@unexec if [ ! -s %D/etc/mongodb.conf ]; then /bin/rm -f %D/etc/mongodb.conf; fi +@exec if [ ! -f %D/etc/mongodb.conf ]; then /usr/bin/touch %D/etc/mongodb.conf; fi +bin/mongo +bin/mongod +bin/mongoperf +bin/mongos +bin/mongosniff |