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