blob: 5e3c6b2923602448606f114897b7be3f1888a755 [file] [log] [blame]
Alexander Afanasyev7009a6b2013-04-23 13:50:51 -07001# -*- 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
4PortSystem 1.0
5PortGroup compiler_blacklist_versions 1.0
6
7name mongodb
8epoch 1
9version 2.4.2
10license AGPL-3
11categories databases
12maintainers ryandesign
13
14description High-performance, schema-free document-oriented database
15long_description ${description}
16
17platforms darwin
18
19homepage http://www.mongodb.org/
20master_sites http://downloads.mongodb.org/src/
21distname ${name}-src-r${version}
22
23checksums rmd160 896884f72ae94caee1405df658bd7878ef5c5fbb \
24 sha256 d0a26fef7f425a6652ebfc3addbc7e1b01a10be65c9d68e464730687bd6721c3
25
26depends_build port:scons
27
28depends_lib port:libpcap \
29 port:pcre \
30 port:snappy \
31 port:v8
32
33license_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
38patchfiles patch-SConstruct.diff \
39 patch-distsrc-client-SConstruct.diff \
40 patch-src-SConscript.client.diff \
41 patch-src-mongo-util-compress.cpp.diff
42
43post-patch {
44 reinplace "s|@@PREFIX@@|${prefix}|g" \
45 ${worksrcpath}/distsrc/client/SConstruct
46}
47
48use_configure no
49
50variant universal {}
51
52compiler.blacklist gcc-4.0 {clang < 318.0.45}
53
54build.env TERM=xterm \
55 ARCHFLAGS="[get_canonical_archflags]" \
56 CPPFLAGS="${configure.cppflags}" \
57 LDFLAGS="${configure.ldflags}"
58
59build.cmd ${prefix}/bin/scons
60build.target all mongobridge mongosniff
61build.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
69eval destroot.env [option build.env]
70destroot.args ${build.args}
71destroot.destdir --prefix=${destroot}${prefix}
72
73set dbdir ${prefix}/var/db/mongodb
74set logdir ${prefix}/var/log/mongodb
75set mongouser _mongo
76add_users ${mongouser} group=${mongouser} realname=MongoDB\ Server
77
78post-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
89startupitem.create yes
90startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend
91
92if {${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
101livecheck.url ${homepage}downloads
102livecheck.regex {mongodb-src-r(\d+\.\d*[02468]\.\d+)\.}