# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id: Portfile 143753 2015-12-21 00:57:24Z ryandesign@macports.org $ PortSystem 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup conflicts_build 1.0 PortGroup cxx11 1.0 PortGroup muniversal 1.0 name mongodb epoch 1 version 3.0.8 license {AGPL-3 OpenSSLException} categories databases maintainers ryandesign description High-performance, schema-free document-oriented database long_description ${description} platforms darwin homepage http://www.mongodb.org/ master_sites http://downloads.mongodb.org/src/ distname ${name}-src-r${version} checksums rmd160 e28dab91f3aa7089d1cc6f40c7140878b14c1c3c \ sha256 3574f2f577e212ff1876485e1502c91f70f996fbbcc5a4657fe440ac76bd97a5 depends_build port:scons depends_lib port:libpcap \ path:lib/libssl.dylib:openssl license_noconflict scons patchfiles-append patch-src-mongo-util-compress.cpp.diff use_configure no # mongodb 3.0.5 and later requires C++11. Forcing the use of libc++ is # acceptable because mongodb already requires OS X 10.7 or later, so we # know libc++ is available; mongodb doesn't provide any libraries for # other ports to use; and the only C++ libraries mongodb uses (boost, # pcre, snappy) are bundled. configure.cxx_stdlib libc++ compiler.blacklist-append *gcc* {clang < 503.0.40} macports-clang-3.3 # TODO: fix me conflicts_build libbson mongo-c-driver mongo-cxx-driver build.env TERM=xterm build.cmd ${prefix}/bin/scons build.target all mongobridge mongosniff build.args --cc=${configure.cc} \ --cxx=${configure.cxx} \ --c++11 \ --cpppath=${prefix}/include \ --disable-warnings-as-errors \ --libc++ \ --libpath=${prefix}/lib \ --osx-version-min=${macosx_deployment_target} \ --ssl # Specify a short variant dir because the default variant dir is deeply nested # and can be very long, so long that on some systems the build will fail with # "Argument list too long"; see https://jira.mongodb.org/browse/SERVER-13829 build.args-append --variant-dir=MP supported_archs i386 x86_64 lappend merger_build_args(i386) --32 lappend merger_build_args(x86_64) --64 lappend merger_destroot_args(i386) --32 lappend merger_destroot_args(x86_64) --64 if {![variant_isset universal] && [info exists merger_build_args(${build_arch})]} { build.args-append $merger_build_args(${build_arch}) } eval destroot.env [option build.env] eval destroot.args [option build.args] destroot.destdir --prefix=${destroot}${prefix} set dbdir ${prefix}/var/db/mongodb set logdir ${prefix}/var/log/mongodb set mongouser _mongo add_users ${mongouser} group=${mongouser} realname=MongoDB\ Server post-destroot { if {[variant_isset universal]} { system -W ${worksrcpath} "lipo -create ${worksrcpath}-i386/mongobridge ${worksrcpath}-x86_64/mongobridge -output mongobridge" } xinstall -W ${worksrcpath} mongobridge ${destroot}${prefix}/bin xinstall -m 755 -o ${mongouser} -g ${mongouser} -d \ ${destroot}${dbdir} \ ${destroot}${logdir} destroot.keepdirs-append \ ${destroot}${dbdir} \ ${destroot}${logdir} } startupitem.create yes startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend if {${os.platform} eq "darwin" && ${os.major} < 11} { depends_build depends_lib pre-fetch { ui_error "${name} @${version} requires OS X 10.7 or greater." return -code error "incompatible OS X version" } } livecheck.url ${homepage}downloads livecheck.regex {mongodb-src-r(\d+\.\d*[02468]\.\d+)\.}