This patch adds a port for the MongoDB utilities that used to be
included in the core MongoDB source package, but were split out into
their own project:

- bsondump
- mongodump
- mongoexport
- mongofiles
- mongoimport
- mongooplog
- mongorestore
- mongostat
- mongotop

I've tested several, and they seem to work, with the following caveats:

* mongostat "vsize" and "res" columns are nonsense,
* no TLS support in this initial release, since one of the
  dependencies will require some patching to support libressl.

Open to any feedback/suggestions/changes, of course!

Thanks,
Andrew Aldridge
Index: mongo-tools/Makefile
===================================================================
RCS file: mongo-tools/Makefile
diff -N mongo-tools/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mongo-tools/Makefile	11 Jan 2017 21:22:56 -0000
@@ -0,0 +1,39 @@
+# $OpenBSD$
+COMMENT =		Tools for working with the MongoDB database
+
+V =			3.2.11
+DISTNAME =		mongo-tools-${V}
+PKGNAME =		${DISTNAME:S/_r/./}
+
+GH_ACCOUNT =		mongodb
+GH_PROJECT =		mongo-tools
+GH_TAGNAME =		r${V}
+
+CATEGORIES =		databases
+
+HOMEPAGE =		https://github.com/mongodb/mongo-tools
+MAINTAINER = 		Andrew Aldridge <i80...@foxquill.com>
+
+# Apache License v2.0
+PERMIT_PACKAGE_CDROM =	Yes
+
+WANTLIB =		c pthread
+MODULES =		lang/go
+NO_TEST =		Yes
+SEPARATE_BUILD =	Yes
+MODGO_ENV =		PATH="${PORTPATH}"
+
+PROGRAMS=bsondump mongoimport mongoexport mongodump mongorestore mongostat \
+         mongofiles mongooplog mongotop
+
+pre-configure:
+	cd ${WRKSRC}/vendor && ln -s src/* .
+	mkdir ${MODGO_WORKSPACE}/bin
+
+do-build:
+.for bin in ${PROGRAMS}
+	${MODGO_CMD} build -o ${MODGO_WORKSPACE}/bin/${bin} \
+	  github.com/${GH_ACCOUNT}/${GH_PROJECT}/${bin}/main
+.endfor
+
+.include <bsd.port.mk>
Index: mongo-tools/distinfo
===================================================================
RCS file: mongo-tools/distinfo
diff -N mongo-tools/distinfo
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mongo-tools/distinfo	11 Jan 2017 19:11:07 -0000
@@ -0,0 +1,2 @@
+SHA256 (mongo-tools-3.2.11.tar.gz) = mS6fuU32vtSeaGhK/uCW8Rk9yc/KjOi8xMkSmWu6Nlw=
+SIZE (mongo-tools-3.2.11.tar.gz) = 2712014
Index: mongo-tools/pkg/DESCR
===================================================================
RCS file: mongo-tools/pkg/DESCR
diff -N mongo-tools/pkg/DESCR
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mongo-tools/pkg/DESCR	15 Nov 2016 21:18:05 -0000
@@ -0,0 +1,6 @@
+MongoDB (from "humongous") is an open source, high-performance,
+schema-free, document-oriented database written in the C++ programming
+language.
+
+This package provides administrative utilities for working with MongoDB
+databases.
Index: mongo-tools/pkg/PLIST
===================================================================
RCS file: mongo-tools/pkg/PLIST
diff -N mongo-tools/pkg/PLIST
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mongo-tools/pkg/PLIST	12 Nov 2016 00:52:53 -0000
@@ -0,0 +1,10 @@
+@comment $OpenBSD$
+@bin bin/bsondump
+@bin bin/mongodump
+@bin bin/mongoexport
+@bin bin/mongofiles
+@bin bin/mongoimport
+@bin bin/mongooplog
+@bin bin/mongorestore
+@bin bin/mongostat
+@bin bin/mongotop

Reply via email to