source: trunk/dports/databases/mongodb/Portfile @ 97033

Last change on this file since 97033 was 97033, checked in by ryandesign@…, 8 years ago

mongodb: add note explaining how to install mongodb without upgrading dependencies (#35118)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1# $Id: Portfile 97033 2012-08-24 20:55:00Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                mongodb
6epoch               1
7version             2.0.7
8license             AGPL-3
9categories          databases
10maintainers         ryandesign
11
12description         High-performance, schema-free document-oriented database
13long_description    ${description}
14
15platforms           darwin
16
17homepage            http://www.mongodb.org/
18master_sites        http://downloads.mongodb.org/src/
19distname            ${name}-src-r${version}
20
21checksums           rmd160  7a80f463ea2f7f1de80972fcded3fbe982e6f8f0 \
22                    sha256  b204d94bc912692bdc154402fbfc2e5c4bd60b09dcbe244f3b2b7657f0a82736
23
24depends_build       port:scons
25
26depends_lib         port:boost \
27                    port:pcre \
28                    port:spidermonkey \
29                    port:libpcap \
30                    port:snappy
31
32patchfiles          patch-SConstruct.diff \
33                    patch-distsrc-client-SConstruct.diff \
34                    patch-util-compress.cpp.diff
35
36post-patch {
37    reinplace "s|@@PREFIX@@|${prefix}|g" \
38        ${worksrcpath}/SConstruct \
39        ${worksrcpath}/distsrc/client/SConstruct
40}
41
42use_configure       no
43
44variant universal {}
45
46if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.3] < 0} {
47    configure.compiler llvm-gcc-4.2
48}
49
50pre-configure {
51    # https://trac.macports.org/ticket/35118
52    # https://jira.mongodb.org/browse/SERVER-4314
53    set boost_version_int [exec awk {/#define BOOST_VERSION/ {print $3}} ${prefix}/include/boost/version.hpp]
54    scan ${boost_version_int} {%1d%3d%2d} boost_major boost_minor boost_patch
55    set boost_version "${boost_major}.${boost_minor}.${boost_patch}"
56    if {[vercmp ${boost_version} 1.50] >= 0} {
57        ui_error "mongodb ${version} requires boost 1.49.0 or older but you have boost ${boost_version}."
58        ui_error "To downgrade boost, see https://trac.macports.org/wiki/howto/InstallingOlderPort"
59        ui_error "or more specifically https://trac.macports.org/ticket/35118#comment:12"
60        ui_error "After installing boost 1.49.0, install mongodb without upgrading dependencies, i.e.:"
61        ui_error "    sudo port -n install mongodb"
62        return -code error "boost ${boost_version} is too new"
63    }
64}
65
66build.env           TERM=xterm \
67                    CFLAGS="[get_canonical_archflags cc]" \
68                    CPPFLAGS="-I${prefix}/include/js" \
69                    CXXFLAGS="[get_canonical_archflags cxx]" \
70                    LINKFLAGS="[get_canonical_archflags ld] -lpcre"
71
72build.cmd           scons
73build.target        all mongobridge mongosniff
74build.args          --cxx=${configure.cxx} \
75                    --full \
76                    --use-system-all \
77                    --usesm
78
79eval destroot.env   [option build.env]
80destroot.args       ${build.args}
81destroot.destdir    --prefix=${destroot}${prefix}
82
83set dbdir           ${prefix}/var/db/mongodb
84set logdir          ${prefix}/var/log/mongodb
85if {"darwin" == ${os.platform} && ${os.major} > 8} {
86    set mongouser       _mongo
87} else {
88    set mongouser       mongo
89}
90add_users           ${mongouser} group=${mongouser} realname=MongoDB\ Server
91
92post-destroot {
93    xinstall -W ${worksrcpath} mongobridge ${destroot}${prefix}/bin
94
95    xinstall -m 755 -o ${mongouser} -g ${mongouser} -d \
96        ${destroot}${dbdir} \
97        ${destroot}${logdir}
98    destroot.keepdirs-append  \
99        ${destroot}${dbdir} \
100        ${destroot}${logdir}
101}
102
103startupitem.create      yes
104startupitem.executable  sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend
105
106livecheck.url       ${homepage}downloads
107livecheck.regex     {mongodb-src-r(\d+\.\d*[02468]\.\d+)\.}
Note: See TracBrowser for help on using the repository browser.