Index: head/databases/mongodb34/Makefile =================================================================== --- head/databases/mongodb34/Makefile (revision 468697) +++ head/databases/mongodb34/Makefile (revision 468698) @@ -1,80 +1,88 @@ # $FreeBSD$ PORTNAME= mongodb DISTVERSIONPREFIX= r DISTVERSION= 3.4.9 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= databases net MASTER_SITES= https://fastdl.mongodb.org/src/ \ http://fastdl.mongodb.org/src/ \ http://download.mongodb.org/src/ PKGNAMESUFFIX= ${PORTVERSION:R:S/.//} DISTNAME= mongodb-src-${DISTVERSIONPREFIX}${DISTVERSION} MAINTAINER= eric@camachat.org COMMENT= Distributed document-oriented "NoSQL" database # mongodb is AGPLv3, C++ driver is APACHE20 LICENSE= AGPLv3 APACHE20 LICENSE_COMB= multi BROKEN_SSL= openssl-devel BROKEN_SSL_REASON_openssl-devel= no member named 'SSLv2_method' in the global namespace ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= "Only supported on amd64 (i386 deprecated in v3)" LIB_DEPENDS= libpcre.so:devel/pcre \ libsnappy.so:archivers/snappy \ libboost_system.so:devel/boost-libs TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml \ ${PYTHON_PKGNAMEPREFIX}pymongo>=3.0:databases/pymongo CONFLICTS_BUILD= mongo-cxx-driver CHOSEN_COMPILER_TYPE= clang USES= compiler:c++14-lang cpe python:build scons USE_RC_SUBR= mongod 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 WITH_DEBUG= yes USERS= mongodb GROUPS= mongodb OPTIONS_DEFINE= SASL SSL OPTIONS_DEFAULT= SASL SSL SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASL_MAKE_ARGS= --use-sasl-client SSL_USES= ssl SSL_MAKE_ARGS= --ssl + +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200057 +SUB_LIST+= LEGACY_LIMITS="@comment " MODERN_LIMITS="" +.else +SUB_LIST+= LEGACY_LIMITS="" MODERN_LIMITS="@comment " +.endif ALL_TARGET= core TEST_TARGET= unittests PORTSCOUT= limitw:1,even CPE_PRODUCT= mongodb post-install: .for f in mongo mongod mongoperf mongos ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} .endfor ${CP} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.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} .include Index: head/databases/mongodb34/files/mongod.in =================================================================== --- head/databases/mongodb34/files/mongod.in (revision 468697) +++ head/databases/mongodb34/files/mongod.in (revision 468698) @@ -1,61 +1,62 @@ #!/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. +%%LEGACY_LIMITS%%# mongod_limits (bool): Set to "NO" by default. +%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mongodb` +%%LEGACY_LIMITS%%# 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". # 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"} +%%LEGACY_LIMITS%%: ${mongod_limits="NO"} : ${mongod_dbpath="/var/db/mongodb"} : ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"} : ${mongod_user="mongodb"} : ${mongod_group="mongodb"} : ${mongod_config="%%PREFIX%%/etc/mongodb.conf"} pidfile="${mongod_dbpath}/mongod.lock" 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 [ $? -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 +%%LEGACY_LIMITS%% if checkyesno mongod_limits; then +%%LEGACY_LIMITS%% eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null +%%LEGACY_LIMITS%% else +%%LEGACY_LIMITS%% return 0 +%%LEGACY_LIMITS%% fi +%%MODERN_LIMITS%% return 0 } run_rc_command "$1"