diff options
-rw-r--r-- | databases/Makefile | 1 | ||||
-rw-r--r-- | databases/mongodb-devel/Makefile | 62 | ||||
-rw-r--r-- | databases/mongodb-devel/distinfo | 3 | ||||
-rw-r--r-- | databases/mongodb-devel/files/mongod.in | 39 | ||||
-rw-r--r-- | databases/mongodb-devel/pkg-deinstall | 15 | ||||
-rw-r--r-- | databases/mongodb-devel/pkg-descr | 5 | ||||
-rw-r--r-- | databases/mongodb-devel/pkg-install | 43 | ||||
-rw-r--r-- | databases/mongodb-devel/pkg-plist | 12 |
8 files changed, 180 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile index 9b17b87625c9..7d66348a1000 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -172,6 +172,7 @@ SUBDIR += metakit SUBDIR += mird SUBDIR += mongodb + SUBDIR += mongodb-devel SUBDIR += mrtg-mysql-load SUBDIR += msql SUBDIR += msql3 diff --git a/databases/mongodb-devel/Makefile b/databases/mongodb-devel/Makefile new file mode 100644 index 000000000000..97981d2792be --- /dev/null +++ b/databases/mongodb-devel/Makefile @@ -0,0 +1,62 @@ +# New ports collection makefile for: mongodb-devel +# Date created: 3 November 2009 +# Whom: ivoras +# +# $FreeBSD$ +# + +PORTNAME= mongodb +PORTVERSION= 1.1.3 +CATEGORIES= databases net +MASTER_SITES= http://download.github.com/ \ + http://people.freebsd.org/~ivoras/distfiles/ +PKGNAMESUFFIX= -devel +DISTFILES= mongodb-mongo-aa8b12e.tar.gz + +MAINTAINER= ivoras@FreeBSD.org +COMMENT= A NOSQL distributed document-oriented database + +LIB_DEPENDS= boost_system:${PORTSDIR}/devel/boost-libs \ + js:${PORTSDIR}/lang/spidermonkey \ + pcre:${PORTSDIR}/devel/pcre \ + nspr4:${PORTSDIR}/devel/nspr \ + execinfo.1:${PORTSDIR}/devel/libexecinfo + +CONFLICTS= mongodb-[0-9]* + +USE_SCONS= yes +SCONS_TARGET= all +USE_RC_SUBR= mongod +WRKSRC= ${WRKDIR}/mongodb-mongo-aa8b12e + +.include <bsd.port.pre.mk> +.if ${OSVERSION} < 700042 +BROKEN= Does not build +.endif + +post-patch: + @${REINPLACE_CMD} -E -e 's|elif "freebsd7" == os.sys.platform|elif os.sys.platform.startswith("freebsd")|' \ + ${WRKSRC}/SConstruct + + @${REINPLACE_CMD} -e 's#/usr/local#${PREFIX}#g' ${WRKSRC}/SConstruct + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/mongo ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongod ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongodump ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongoexport ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongofiles ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongoimport ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongorestore ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongos ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/mongosniff ${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/libmongoclient.a ${PREFIX}/lib + +post-install: + @if [ ! -f ${PREFIX}/etc/mongodb.conf ]; then \ + ${TOUCH} ${PREFIX}/etc/mongodb.conf ; \ + fi + + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + +.include <bsd.port.post.mk> diff --git a/databases/mongodb-devel/distinfo b/databases/mongodb-devel/distinfo new file mode 100644 index 000000000000..5e7feeb411b0 --- /dev/null +++ b/databases/mongodb-devel/distinfo @@ -0,0 +1,3 @@ +MD5 (mongodb-mongo-aa8b12e.tar.gz) = 51d6df82e219bdf89e3c05056366078d +SHA256 (mongodb-mongo-aa8b12e.tar.gz) = 30a03520a0509ec2c84220fe50e9aca6c2e3b557353253a1bc9e4a700a5ee00f +SIZE (mongodb-mongo-aa8b12e.tar.gz) = 3852411 diff --git a/databases/mongodb-devel/files/mongod.in b/databases/mongodb-devel/files/mongod.in new file mode 100644 index 000000000000..ddfd1d5400ea --- /dev/null +++ b/databases/mongodb-devel/files/mongod.in @@ -0,0 +1,39 @@ +#!/bin/sh + +# PROVIDE: mongod +# REQUIRE: NETWORK +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# mongod_enable (bool): Set to NO by default. +# Set it to YES to enable mongod. +# +# Additional configurable variables: +# mongod_config (path): Set to %%PREFIX%%/etc/mongod.conf +# by default. Additional configuration. You +# can also use mongod_flags for additional +# command line arguments. +# mongod_dbpath (path): Set to /var/db/mongod by default +# mongod_user (username): Set to "mongod" by default + +. %%RC_SUBR%% + +name="mongod" +rcvar=${name}_enable + +command=%%PREFIX%%/bin/${name} + +load_rc_config $name + +: ${mongod_enable="NO"} +: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"} +: ${mongod_dbpath="/var/db/mongodb"} +: ${mongod_user="mongodb"} + +command_args="-f $mongod_config --dbpath $mongod_dbpath --logappend --logpath $mongod_dbpath/mongod.log --fork" + +required_dirs=${mongod_dbpath} + +run_rc_command "$1" + diff --git a/databases/mongodb-devel/pkg-deinstall b/databases/mongodb-devel/pkg-deinstall new file mode 100644 index 000000000000..1c7a5bf2805d --- /dev/null +++ b/databases/mongodb-devel/pkg-deinstall @@ -0,0 +1,15 @@ +#!/bin/sh +# $FreeBSD$ +# + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +USER=mongodb + +if pw usershow "${USER}" 2>/dev/null 1>&2; then + echo "To delete mongodb user permanently, use 'pw userdel ${USER}'" +fi + +exit 0 diff --git a/databases/mongodb-devel/pkg-descr b/databases/mongodb-devel/pkg-descr new file mode 100644 index 000000000000..24f53e80363b --- /dev/null +++ b/databases/mongodb-devel/pkg-descr @@ -0,0 +1,5 @@ +Mongo (from "humongous") is a high-performance, open source, +schema-free, document-oriented database. A common name in the +"NOSQL" community. + +WWW: http://www.mongodb.org/ diff --git a/databases/mongodb-devel/pkg-install b/databases/mongodb-devel/pkg-install new file mode 100644 index 000000000000..3faf828e0b3c --- /dev/null +++ b/databases/mongodb-devel/pkg-install @@ -0,0 +1,43 @@ +#!/bin/sh +# $FreeBSD$ +# + +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +USER=mongodb +GROUP=${USER} +UID=922 +GID=${UID} +DBDIR=/var/db/mongodb + +#touch ${PREFIX}/etc/mongodb.conf + +if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi +fi + +if ! pw usershow "${USER}" 2>/dev/null 1>&2; then + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/bin/sh" -d "/var/db/mongodb" \ + -c "mongodb pseudo-user"; \ + then + echo "Added user \"${USER}\"." + if [ ! -d ${DBDIR} ] + then + echo "Creating \"${DBDIR}\"." + mkdir ${DBDIR} + chown ${USER}:${GROUP} ${DBDIR} + fi + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi +fi +exit 0 diff --git a/databases/mongodb-devel/pkg-plist b/databases/mongodb-devel/pkg-plist new file mode 100644 index 000000000000..76df6ff964ee --- /dev/null +++ b/databases/mongodb-devel/pkg-plist @@ -0,0 +1,12 @@ +@unexec if [ ! -s %D/etc/mongodb.conf ]; then /bin/rm -f %D/etc/mongodb.conf; fi +bin/mongo +bin/mongod +bin/mongodump +bin/mongoexport +bin/mongofiles +bin/mongoimport +bin/mongorestore +bin/mongos +bin/mongosniff +lib/libmongoclient.a +@exec if [ ! -f %D/etc/mongodb.conf ]; then /usr/bin/touch %D/etc/mongodb.conf; fi |