Alexander Afanasyev | 7009a6b | 2013-04-23 13:50:51 -0700 | [diff] [blame^] | 1 | # -*- 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 |
| 2 | # $Id: Portfile 105364 2013-04-18 22:24:52Z ryandesign@macports.org $ |
| 3 | |
| 4 | PortSystem 1.0 |
| 5 | PortGroup compiler_blacklist_versions 1.0 |
| 6 | |
| 7 | name mongodb |
| 8 | epoch 1 |
| 9 | version 2.4.2 |
| 10 | license AGPL-3 |
| 11 | categories databases |
| 12 | maintainers ryandesign |
| 13 | |
| 14 | description High-performance, schema-free document-oriented database |
| 15 | long_description ${description} |
| 16 | |
| 17 | platforms darwin |
| 18 | |
| 19 | homepage http://www.mongodb.org/ |
| 20 | master_sites http://downloads.mongodb.org/src/ |
| 21 | distname ${name}-src-r${version} |
| 22 | |
| 23 | checksums rmd160 896884f72ae94caee1405df658bd7878ef5c5fbb \ |
| 24 | sha256 d0a26fef7f425a6652ebfc3addbc7e1b01a10be65c9d68e464730687bd6721c3 |
| 25 | |
| 26 | depends_build port:scons |
| 27 | |
| 28 | depends_lib port:libpcap \ |
| 29 | port:pcre \ |
| 30 | port:snappy \ |
| 31 | port:v8 |
| 32 | |
| 33 | license_noconflict scons |
| 34 | |
| 35 | # As of mongodb 2.2.0, we use the bundled copy of boost to guard against |
| 36 | # potential incompatible changes that might be made in the boost port. |
| 37 | |
| 38 | patchfiles patch-SConstruct.diff \ |
| 39 | patch-distsrc-client-SConstruct.diff \ |
| 40 | patch-src-SConscript.client.diff \ |
| 41 | patch-src-mongo-util-compress.cpp.diff |
| 42 | |
| 43 | post-patch { |
| 44 | reinplace "s|@@PREFIX@@|${prefix}|g" \ |
| 45 | ${worksrcpath}/distsrc/client/SConstruct |
| 46 | } |
| 47 | |
| 48 | use_configure no |
| 49 | |
| 50 | variant universal {} |
| 51 | |
| 52 | compiler.blacklist gcc-4.0 {clang < 318.0.45} |
| 53 | |
| 54 | build.env TERM=xterm \ |
| 55 | ARCHFLAGS="[get_canonical_archflags]" \ |
| 56 | CPPFLAGS="${configure.cppflags}" \ |
| 57 | LDFLAGS="${configure.ldflags}" |
| 58 | |
| 59 | build.cmd ${prefix}/bin/scons |
| 60 | build.target all mongobridge mongosniff |
| 61 | build.args --cc=${configure.cc} \ |
| 62 | --cxx=${configure.cxx} \ |
| 63 | --full \ |
| 64 | --use-system-pcre \ |
| 65 | --use-system-snappy \ |
| 66 | --use-system-v8 \ |
| 67 | --extralib=pcre,pcrecpp,snappy |
| 68 | |
| 69 | eval destroot.env [option build.env] |
| 70 | destroot.args ${build.args} |
| 71 | destroot.destdir --prefix=${destroot}${prefix} |
| 72 | |
| 73 | set dbdir ${prefix}/var/db/mongodb |
| 74 | set logdir ${prefix}/var/log/mongodb |
| 75 | set mongouser _mongo |
| 76 | add_users ${mongouser} group=${mongouser} realname=MongoDB\ Server |
| 77 | |
| 78 | post-destroot { |
| 79 | xinstall -W ${worksrcpath} mongobridge ${destroot}${prefix}/bin |
| 80 | |
| 81 | xinstall -m 755 -o ${mongouser} -g ${mongouser} -d \ |
| 82 | ${destroot}${dbdir} \ |
| 83 | ${destroot}${logdir} |
| 84 | destroot.keepdirs-append \ |
| 85 | ${destroot}${dbdir} \ |
| 86 | ${destroot}${logdir} |
| 87 | } |
| 88 | |
| 89 | startupitem.create yes |
| 90 | startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend |
| 91 | |
| 92 | if {${os.platform} == "darwin" && ${os.major} < 10} { |
| 93 | depends_build |
| 94 | depends_lib |
| 95 | pre-fetch { |
| 96 | ui_error "${name} ${version} requires OS X 10.6 or greater." |
| 97 | return -code error "incompatible OS X version" |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | livecheck.url ${homepage}downloads |
| 102 | livecheck.regex {mongodb-src-r(\d+\.\d*[02468]\.\d+)\.} |