View | Details | Raw Unified | Return to bug 213220 | Differences between
and this patch

Collapse All | Expand All

(-)databases/mongodb34/Makefile (+92 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	mongodb
4
PORTVERSION=	${DISTVERSION:S/-//g}
5
DISTVERSIONPREFIX=	r
6
CATEGORIES=	databases net
7
MASTER_SITES=	https://fastdl.mongodb.org/src/ \
8
		http://fastdl.mongodb.org/src/ \
9
		http://download.mongodb.org/src/
10
PKGNAMESUFFIX=	${PORTVERSION:R:S/.//}
11
DISTVERSION=	3.4.3
12
DISTNAME=	mongodb-src-${DISTVERSIONPREFIX}${DISTVERSION}
13
14
MAINTAINER=	brendan+freebsd@bbqsrc.net
15
COMMENT=	Distributed document-oriented "NoSQL" database
16
17
# mongodb is AGPLv3, C++ driver is APACHE20
18
LICENSE=	AGPLv3 APACHE20
19
LICENSE_COMB=	multi
20
21
LIB_DEPENDS=	libpcre.so:devel/pcre \
22
		libsnappy.so:archivers/snappy \
23
		libboost_system.so:devel/boost-libs
24
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml \
25
		${PYTHON_PKGNAMEPREFIX}pymongo>=3.0:databases/pymongo
26
27
CHOSEN_COMPILER_TYPE=	clang
28
29
ONLY_FOR_ARCHS=	amd64
30
ONLY_FOR_ARCHS_REASON=	"Only supported on amd64 (i386 deprecated in v3)"
31
32
CONFLICTS_BUILD=	mongo-cxx-driver
33
OPTIONS_DEFINE=		SASL SSL
34
OPTIONS_DEFAULT=	SASL SSL
35
36
SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
37
SASL_MAKE_ARGS=		--use-sasl-client
38
39
SSL_USE=	yes
40
SSL_MAKE_ARGS=	--ssl
41
42
USES=		compiler:c++14-lang cpe execinfo python:build scons
43
44
WITH_DEBUG=yes
45
MAKE_ARGS=	--prefix=${STAGEDIR}${PREFIX} \
46
		--use-system-pcre --use-system-snappy \
47
		--use-system-boost --use-system-zlib \
48
		--cxx-std=14 --libc++ \
49
		--runtime-hardening=on \
50
    --disable-warnings-as-errors \
51
    VERBOSE=on
52
53
USERS=	mongodb
54
GROUPS=	mongodb
55
56
USE_RC_SUBR=	mongod
57
58
ALL_TARGET=	core
59
TEST_TARGET=	unittests
60
61
.include <bsd.port.options.mk>
62
63
.if ${PORT_OPTIONS:MSSL}
64
USES+=	ssl
65
.endif
66
67
.include <bsd.port.pre.mk>
68
69
.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 37
70
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang37:lang/clang37
71
CPP=	${LOCALBASE}/bin/clang-cpp37
72
CC=	${LOCALBASE}/bin/clang37
73
CXX=	${LOCALBASE}/bin/clang++37
74
.endif
75
76
post-install:
77
.for f in mongo mongod mongoperf mongos
78
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f}
79
.endfor
80
	${CP} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample
81
82
do-test:
83
	@cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} \
84
		${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${TEST_TARGET} &&\
85
		${PYTHON_CMD} ${BUILD_WRKSRC}/buildscripts/resmoke.py\
86
		--suites=unittests --jobs=${MAKE_JOBS_NUMBER}
87
88
PORTSCOUT=	limitw:1,even
89
90
CPE_PRODUCT=	mongodb
91
92
.include <bsd.port.post.mk>
(-)databases/mongodb34/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1490971850
2
SHA256 (mongodb-src-r3.4.3.tar.gz) = 889d49312ed072130936cfa3281123a0e89228c04f3f8e992a0b92669b28d767
3
SIZE (mongodb-src-r3.4.3.tar.gz) = 39832718
(-)databases/mongodb34/files/mongod.in (+62 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# PROVIDE: mongod
4
# REQUIRE: NETWORK ldconfig
5
# KEYWORD: shutdown
6
#
7
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
8
# to enable this service:
9
#
10
# mongod_enable (bool):  Set to "NO" by default.                                                                                                                                                                                             
11
#                        Set it to "YES" to enable mongod.
12
# mongod_limits (bool):  Set to "NO" by default.
13
#                        Set it to yes to run `limits -e -U mongodb`
14
#                        just before mongod starts.
15
# mongod_dbpath (str):   Default to "/var/db/mongodb"
16
#                        Base database directory.
17
# mongod_flags (str):    Custom additional arguments to be passed to mongod.
18
#                        Default to "--logpath ${mongod_dbpath}/mongod.log --logappend".
19
# mongod_config (str):	 Default to "%%PREFIX%%/etc/mongodb.conf"
20
#                        Path to config file
21
#
22
23
. /etc/rc.subr
24
25
name="mongod"
26
rcvar=mongod_enable
27
28
load_rc_config $name
29
30
: ${mongod_enable="NO"}
31
: ${mongod_limits="NO"}
32
: ${mongod_dbpath="/var/db/mongodb"}
33
: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"}
34
: ${mongod_user="mongodb"}
35
: ${mongod_group="mongodb"}
36
: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"}
37
38
pidfile="${mongod_dbpath}/mongod.lock"
39
command=%%PREFIX%%/bin/${name}
40
command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null"
41
start_precmd="${name}_prestart"
42
43
mongod_create_dbpath()
44
{
45
        mkdir ${mongod_dbpath} >/dev/null 2>/dev/null
46
        [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath}
47
}
48
49
50
mongod_prestart()
51
{
52
        if [ ! -d ${mongod_dbpath} ]; then
53
                mongod_create_dbpath || return 1
54
        fi
55
        if checkyesno mongod_limits; then
56
                eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
57
        else
58
                return 0
59
        fi
60
}
61
62
run_rc_command "$1"
(-)databases/mongodb34/files/patch-SConstruct (+72 lines)
Line 0 Link Here
1
--- SConstruct.orig	2017-02-01 11:00:25.000000000 -0800
2
+++ SConstruct	2017-02-03 15:15:08.834295000 -0800
3
@@ -929,9 +929,9 @@ if has_option('variables-help'):
4
     print env_vars.GenerateHelpText(env)
5
     Exit(0)
6
 
7
-unknown_vars = env_vars.UnknownVariables()
8
-if unknown_vars:
9
-    env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
10
+#unknown_vars = env_vars.UnknownVariables()
11
+#if unknown_vars:
12
+#    env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
13
 
14
 def set_config_header_define(env, varname, varval = 1):
15
     env['CONFIG_HEADER_DEFINES'][varname] = varval
16
@@ -1550,7 +1550,7 @@ if env.TargetOSIs('posix'):
17
             # If runtime hardening is requested, then build anything
18
             # destined for an executable with the necessary flags for PIE.
19
             env.AppendUnique(
20
-                PROGCCFLAGS=['-fPIE'],
21
+                PROGCCFLAGS=['-fpic'],
22
                 PROGLINKFLAGS=['-pie'],
23
             )
24
 
25
@@ -1564,7 +1564,7 @@ if env.TargetOSIs('posix'):
26
                          "-Wno-unknown-pragmas",
27
                          "-Winvalid-pch"] )
28
     # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
29
-    if env.TargetOSIs('linux', 'osx', 'solaris'):
30
+    if env.TargetOSIs('linux', 'osx', 'solaris', 'freebsd'):
31
         if not has_option("disable-warnings-as-errors"):
32
             env.Append( CCFLAGS=["-Werror"] )
33
 
34
@@ -1592,19 +1592,19 @@ if env.TargetOSIs('posix'):
35
         env.Append( CCFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
36
         env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
37
 
38
-    if optBuild:
39
-        env.Append( CCFLAGS=["-O2"] )
40
-    else:
41
-        env.Append( CCFLAGS=["-O0"] )
42
+    #if optBuild:
43
+    #    env.Append( CCFLAGS=["-O2"] )
44
+    #else:
45
+    #    env.Append( CCFLAGS=["-O0"] )
46
 
47
     # Promote linker warnings into errors. We can't yet do this on OS X because its linker considers
48
     # noall_load obsolete and warns about it.
49
-    if not env.TargetOSIs('osx'):
50
-        env.Append(
51
-            LINKFLAGS=[
52
-                "-Wl,--fatal-warnings",
53
-            ],
54
-        )
55
+    #if not env.TargetOSIs('osx'):
56
+    #    env.Append(
57
+    #        LINKFLAGS=[
58
+    #            "-Wl,--fatal-warnings",
59
+    #        ],
60
+    #    )
61
 
62
 mmapv1 = False
63
 if get_option('mmapv1') == 'auto':
64
@@ -2461,7 +2461,7 @@ def doConfigure(myenv):
65
         }}
66
         """.format(storage_class)
67
         context.Message('Checking for storage class {0} '.format(storage_class))
68
-        ret = context.TryLink(textwrap.dedent(test_body), ".cpp")
69
+        ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
70
         context.Result(ret)
71
         return ret
72
 
(-)databases/mongodb34/files/patch-rpm_mongod.conf (+31 lines)
Line 0 Link Here
1
--- rpm/mongod.conf.orig	2016-10-03 11:32:42.000000000 -0700
2
+++ rpm/mongod.conf	2016-10-04 17:46:16.568923000 -0700
3
@@ -1,4 +1,4 @@
4
-# mongod.conf
5
+# mongodb.conf
6
 
7
 # for documentation of all options, see:
8
 #   http://docs.mongodb.org/manual/reference/configuration-options/
9
@@ -7,11 +7,11 @@
10
 systemLog:
11
   destination: file
12
   logAppend: true
13
-  path: /var/log/mongodb/mongod.log
14
+  path: /var/log/mongodb/log
15
 
16
 # Where and how to store data.
17
 storage:
18
-  dbPath: /var/lib/mongo
19
+  dbPath: /var/db/mongo
20
   journal:
21
     enabled: true
22
 #  engine:
23
@@ -21,7 +21,7 @@ storage:
24
 # how the process runs
25
 processManagement:
26
   fork: true  # fork and run in background
27
-  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
28
+  pidFilePath: /var/run/mongodb/pid  # location of pidfile
29
 
30
 # network interfaces
31
 net:
(-)databases/mongodb34/files/patch-src_mongo_db_fts_unicode_string.cpp (+11 lines)
Line 0 Link Here
1
--- src/mongo/db/fts/unicode/string.cpp.orig	2017-01-18 18:38:12.914420000 -0800
2
+++ src/mongo/db/fts/unicode/string.cpp	2017-01-18 18:39:31.136578000 -0800
3
@@ -274,7 +274,7 @@ bool String::substrMatch(const std::stri
4
 
5
     // Case sensitive and diacritic sensitive.
6
     return boost::algorithm::boyer_moore_search(
7
-               haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
8
+               haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end());
9
 }
10
 
11
 }  // namespace unicode
(-)databases/mongodb34/pkg-descr (+5 lines)
Line 0 Link Here
1
Mongo (from "humongous") is a high-performance, open source,
2
schema-free, document-oriented database. A common name in the
3
"NOSQL" community.
4
5
WWW: http://www.mongodb.org/
(-)databases/mongodb34/pkg-plist (+5 lines)
Line 0 Link Here
1
@sample etc/mongodb.conf.sample
2
bin/mongo
3
bin/mongod
4
bin/mongoperf
5
bin/mongos

Return to bug 213220