Ticket #38497: rethinkdb_update.diff

File rethinkdb_update.diff, 3.8 KB (added by anatol (Anatol Pomozov), 12 years ago)
  • Portfile

     
    55PortGroup           compiler_blacklist_versions 1.0
    66
    77name                rethinkdb
    8 version             1.4.0
     8version             1.4.1
    99categories          databases
    1010platforms           darwin
    1111maintainers         nomaintainer
     
    2121master_sites        http://download.rethinkdb.com/dist/
    2222extract.suffix      .tgz
    2323
    24 checksums           rmd160  4b6a7ca9ac167848ba3b0877b9a94a8a92535440 \
    25                     sha256  da40ac64a0eac9d6b76452bed4ab9189eaa960c143479d862170d564253fdc5a
     24checksums           rmd160  b23443ce118056e4a2217c786f41028ec8f58d44 \
     25                    sha256  ba5da17b59df9055b4384f015965efd55c05bcd443526dc766a92516e6411ed7
    2626
     27depends_build       port:coffee-script
     28
    2729depends_lib         port:boost \
    2830                    port:v8 \
    2931                    path:bin/node:nodejs \
    30                     port:protobuf-cpp \
    31                     port:coffee-script
     32                    port:protobuf-cpp
    3233
    3334# nodejs only supports Intel processors and is not universal
    3435supported_archs     i386 x86_64
     
    6364build.args          DEBUG=0 ALLOW_WARNINGS=1 BUILD_DIR=build WEBRESDIR=${webresdir}
    6465build.target        build/rethinkdb web-assets
    6566
    66 destroot.keepdirs   ${destroot}${prefix}/var/lib/rethinkdb/
     67set dbdir             ${prefix}/var/db/${name}/
     68set logdir            ${prefix}/var/log/${name}/
     69set default_instance  default
     70set config_file       ${prefix}/etc/rethinkdb/${default_instance}.conf
    6771
     72set rethinkuser     _${name}
     73add_users           ${rethinkuser} group=${rethinkuser} realname=RethinkDB\ Server
     74
     75destroot.keepdirs   ${destroot}${dbdir} \
     76                    ${destroot}${logdir}
     77
     78post-patch {
     79    reinplace "s|# directory=/var/lib/rethinkdb/default|directory=${dbdir}${default_instance}|" \
     80        ${worksrcpath}/packaging/assets/config/default.conf.sample
     81}
     82
    6883destroot {
     84    # TODO: explore using "make install DESTDIR=xxx" instead of copying all files to destroot manually?
    6985    xinstall ${worksrcpath}/build/rethinkdb ${destroot}${prefix}/bin/
    70     xinstall -m 644 ${worksrcpath}/packaging/assets/man/rethinkdb.1 ${destroot}${prefix}/share/man/man1/
    71     xinstall -d ${destroot}${prefix}/etc/rethinkdb/instances.d/
    72     xinstall -m 644 ${worksrcpath}/packaging/assets/config/default.conf.sample ${destroot}${prefix}/etc/rethinkdb/
     86    xinstall -d ${destroot}${prefix}/etc/rethinkdb
     87    xinstall -m 644 ${worksrcpath}/packaging/assets/config/default.conf.sample ${destroot}${config_file}.sample
    7388    xinstall -d ${destroot}${prefix}/etc/bash_completion.d/
    7489    xinstall -m 644 ${worksrcpath}/packaging/assets/scripts/rethinkdb.bash ${destroot}${prefix}/etc/bash_completion.d/
     90    xinstall -m 644 ${worksrcpath}/packaging/assets/man/rethinkdb.1 ${destroot}${prefix}/share/man/man1/
    7591    xinstall -d ${destroot}${prefix}/share/${name}/
    7692    move ${worksrcpath}/build/rethinkdb_web_assets/ ${destroot}${webresdir}
    7793
    78     # startup script ?
     94    xinstall -m 755 -o ${rethinkuser} -g ${rethinkuser} -d \
     95        ${destroot}${dbdir} \
     96        ${destroot}${logdir}
    7997}
    8098
     99# TODO: create db and default config file in case if they are absent
     100notes "You can start rethinkdb as service. For that you need:
     101    - create default database: 'sudo -u ${rethinkuser} rethinkdb create -d ${dbdir}${default_instance}'
     102    - create and edit config file for the default database: 'cp ${config_file}.sample ${config_file}'
     103    - load service:  'sudo port load ${name}'"
     104
     105startupitem.create      yes
     106startupitem.executable  sudo -u ${rethinkuser} ${prefix}/bin/rethinkdb serve --config-file ${config_file}
     107
    81108livecheck.type      regex
    82109livecheck.url       ${master_sites}
    83110livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}