source: trunk/dports/databases/rethinkdb/Portfile @ 118733

Last change on this file since 118733 was 114257, checked in by ryandesign@…, 6 years ago

rethinkdb: simplify compiler.blacklist; use correct variable in example port load command

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
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 114257 2013-12-03 21:30:05Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compiler_blacklist_versions 1.0
6
7name                rethinkdb
8version             1.11.1
9categories          databases
10platforms           darwin
11maintainers         nomaintainer
12license             AGPL-3
13
14description         open-source distributed database
15
16long_description    ${name} is an ${description} that has an intuitive query \
17                    language, automatically parallelized queries, and simple \
18                    administration.
19
20homepage            http://www.rethinkdb.com/
21master_sites        http://download.rethinkdb.com/dist/
22extract.suffix      .tgz
23
24checksums           rmd160  e615a2031d0b3597e464d585becf6e25a9b51bdb \
25                    sha256  48941171acd91ba41b97cef38f75fd0d8b8805eca767941f07e4e5c06df4b7a3
26
27depends_build       port:coffee-script
28
29depends_lib         port:boost \
30                    port:v8 \
31                    path:bin/node:nodejs \
32                    port:protobuf-cpp
33
34# nodejs only supports Intel processors and is not universal
35supported_archs     i386 x86_64
36universal_variant   no
37
38# Error: GCC 4.2.2 is too old. At least GCC 4.4.3 is required
39compiler.blacklist-append apple-gcc* gcc-3.3 gcc-4.* *llvm-gcc-4.2 macports-gcc-4.2 macports-gcc-4.3
40
41# Xcode 3.2.x included clang but not clang++, so it used llvm-g++-4.2 instead.
42compiler.blacklist-append {clang < 137}
43
44platform darwin {
45    if {${os.major} < 13} {
46        # When protobuf-cpp and v8 are compiled against libstdc++, don't use
47        # clang, which only supports C++11 (required by rethinkdb) when using
48        # libc++.
49        compiler.blacklist-append   *clang*
50        # without this, no compilers are available at all
51        compiler.fallback-append    macports-gcc-4.8
52    }
53}
54
55# v8 >= 3.21 compatibility from upstream
56patch.pre_args      -p1
57patchfiles          3cf9e7bf13e5f0f364aecf0913e09d704e9688d2.patch
58
59set webresdir       ${prefix}/share/${name}/web
60build.args          DEBUG=0 ALLOW_WARNINGS=1 BUILD_DIR=build WEBRESDIR=${webresdir}
61build.target        build/rethinkdb web-assets
62
63set dbdir             ${prefix}/var/db/${name}/
64set logdir            ${prefix}/var/log/${name}/
65set default_instance  default
66set config_file       ${prefix}/etc/rethinkdb/${default_instance}.conf
67
68set rethinkuser     _${name}
69add_users           ${rethinkuser} group=${rethinkuser} realname=RethinkDB\ Server
70
71destroot.keepdirs   ${destroot}${dbdir} \
72                    ${destroot}${logdir}
73
74post-patch {
75    reinplace "s|# directory=/var/lib/rethinkdb/default|directory=${dbdir}${default_instance}|" \
76        ${worksrcpath}/packaging/assets/config/default.conf.sample
77}
78
79destroot {
80    # TODO: explore using "make install DESTDIR=xxx" instead of copying all files to destroot manually?
81    xinstall ${worksrcpath}/build/rethinkdb ${destroot}${prefix}/bin/
82    xinstall -d ${destroot}${prefix}/etc/rethinkdb
83    xinstall -m 644 ${worksrcpath}/packaging/assets/config/default.conf.sample ${destroot}${config_file}.sample
84    xinstall -d ${destroot}${prefix}/etc/bash_completion.d/
85    xinstall -m 644 ${worksrcpath}/packaging/assets/scripts/rethinkdb.bash ${destroot}${prefix}/etc/bash_completion.d/
86    xinstall -m 644 ${worksrcpath}/packaging/assets/man/rethinkdb.1 ${destroot}${prefix}/share/man/man1/
87    xinstall -d ${destroot}${prefix}/share/${name}/
88    move ${worksrcpath}/build/rethinkdb_web_assets/ ${destroot}${webresdir}
89
90    xinstall -m 755 -o ${rethinkuser} -g ${rethinkuser} -d \
91        ${destroot}${dbdir} \
92        ${destroot}${logdir}
93}
94
95# TODO: create db and default config file in case if they are absent
96notes "You can start rethinkdb as service. For that you need:
97    - create default database: 'sudo -u ${rethinkuser} rethinkdb create -d ${dbdir}${default_instance}'
98    - create and edit config file for the default database: 'cp ${config_file}.sample ${config_file}'
99    - load service:  'sudo port load ${startupitem.name}'"
100
101startupitem.create      yes
102startupitem.executable  sudo -u ${rethinkuser} ${prefix}/bin/rethinkdb serve --config-file ${config_file}
103
104livecheck.type      regex
105livecheck.url       ${master_sites}
106livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.