[86082] trunk/dports/databases/mongodb/Portfile

jmr at macports.org jmr at macports.org
Tue Oct 18 23:20:07 PDT 2011


Revision: 86082
          http://trac.macports.org/changeset/86082
Author:   jmr at macports.org
Date:     2011-10-18 23:20:00 -0700 (Tue, 18 Oct 2011)
Log Message:
-----------
mongodb: add startupitem (#27456)

Modified Paths:
--------------
    trunk/dports/databases/mongodb/Portfile

Modified: trunk/dports/databases/mongodb/Portfile
===================================================================
--- trunk/dports/databases/mongodb/Portfile	2011-10-19 02:06:02 UTC (rev 86081)
+++ trunk/dports/databases/mongodb/Portfile	2011-10-19 06:20:00 UTC (rev 86082)
@@ -51,10 +51,29 @@
 destroot.args       ${build.args}
 destroot.destdir    --prefix=${destroot}${prefix}
 
+set dbdir           ${prefix}/var/db/mongodb
+set logdir          ${prefix}/var/log/mongodb
+if {"darwin" == ${os.platform} && ${os.major} > 8} {
+    set mongouser       _mongo
+} else {
+    set mongouser       mongo
+}
+add_users           ${mongouser} group=${mongouser} realname=MongoDB\ Server
+
 post-destroot {
     xinstall -W ${worksrcpath} mongobridge ${destroot}${prefix}/bin
+
+    xinstall -m 755 -o ${mongouser} -g ${mongouser} -d \
+        ${destroot}${dbdir} \
+        ${destroot}${logdir}
+    destroot.keepdirs-append  \
+        ${destroot}${dbdir} \
+        ${destroot}${logdir}
 }
 
+startupitem.create      yes
+startupitem.executable  sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend
+
 platform darwin 11 {
     patchfiles-append lion.patch
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111018/95adc518/attachment.html>


More information about the macports-changes mailing list