New port proposal: Tools for MongoDB 4.x
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237352
PATCH:
https://raw.githubusercontent.com/ashevchuk/mongodb40-tools-freebsd-port/master/mongodb40-tools.patch
Actually, the patch itself (feel free to make the necessary
corrections, if the Makefile needs changes):
--[cut]
Index: databases/Makefile
===
--- databases/Makefile (revision 499215)
+++ databases/Makefile (working copy)
@@ -201,6 +201,7 @@
SUBDIR += mongodb36
SUBDIR += mongodb36-tools
SUBDIR += mongodb40
+SUBDIR += mongodb40-tools
SUBDIR += mroonga
SUBDIR += mrtg-mysql-load
SUBDIR += mtools-mongodb
Index: databases/mongodb40-tools/Makefile
===
--- databases/mongodb40-tools/Makefile (nonexistent)
+++ databases/mongodb40-tools/Makefile (working copy)
@@ -0,0 +1,116 @@
+# $FreeBSD$
+
+PORTNAME= mongodb40-tools
+DISTVERSIONPREFIX= r
+DISTVERSION= 4.0.8
+CATEGORIES= databases
+
+MAINTAINER= dev.ashevc...@gmail.com
+COMMENT= Tools for MongoDB
+
+LICENSE= APACHE20
+
+ONLY_FOR_ARCHS= amd64 i386
+ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than i386 and amd64"
+
+BUILD_DEPENDS= go>=${GO_LANG_VERSION}:lang/go${GO_LANG_VERSION_PATH_STR}
+
+USES= compiler:c++14-lang localbase go
+
+GO_LANG_VERSION= 1.4
+GO_LANG_VER_PATH_STR= ${GO_LANG_VERSION:S/.//}
+
+GO_LANG_PATH_DIR= .gopath
+
+SSL_USE= my_tags=ssl
+SSL_USES= ssl
+
+SASL_USE= my_tags=sasl
+SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
+
+CONFLICTS_INSTALL= mongodb3[46] mongodb3[46]-tools
+
+USE_LDCONFIG= yes
+
+CC= clang
+
+USE_GITHUB= yes
+GH_ACCOUNT= mongodb
+GH_PROJECT= mongo-tools
+GH_TAG= 5db0b4a18cc1366ebd368eed8e7c4d426d851f13
+
+OPTIONS_SUB= yes
+NO_OPTIONS_SORT= yes
+
+OPTIONS_DEFINE= DOCS
+OPTIONS_DEFAULT= SSL SASL MONGOFILES MONGOEXPORT MONGOIMPORT
MONGORESTORE MONGODUMP
+
+OPTIONS_MULTI= TOOLS SECURITY
+OPTIONS_MULTI_TOOLS= BSONDUMP MONGOSTAT MONGOFILES MONGOEXPORT
MONGOIMPORT MONGORESTORE MONGODUMP MONGOTOP MONGOREPLAY
+OPTIONS_MULTI_SECURITY=SSL SASL
+
+BSONDUMP_DESC= BSON files into human-readable formats
+MONGOSTAT_DESC= Status of a running mongod or mongos instance
+MONGOFILES_DESC= Interface to GridFS in a MongoDB instance
+MONGOEXPORT_DESC= JSON or CSV export of MongoDB instance data
+MONGOIMPORT_DESC= Importing JSON, CSV, or TSV into a MongoDB instance
+MONGORESTORE_DESC= BSON data to a MongoDB instance
+MONGODUMP_DESC= BSON data from the contents of a MongoDB instance
+MONGOTOP_DESC= Track the amount of data I/O time
+MONGOREPLAY_DESC= Traffic capture and replay tool
+
+BSONDUMP_VARS= tool_build+=bsondump
+MONGOSTAT_VARS= tool_build+=mongostat
+MONGOFILES_VARS= tool_build+=mongofiles
+MONGOEXPORT_VARS= tool_build+=mongoexport
+MONGOIMPORT_VARS= tool_build+=mongoimport
+MONGORESTORE_VARS= tool_build+=mongorestore
+MONGODUMP_VARS= tool_build+=mongodump
+MONGOTOP_VARS= tool_build+=mongotop
+MONGOREPLAY_VARS= tool_build+=mongoreplay
+
+MAKE_CMD= ${LOCALBASE}/go${GO_LANG_VER_PATH_STR}/bin/go build
+
+MY_TAGS= -tags "${USE_MY_TAGS}"
+
+.include
+
+post-patch:
+ @${ECHO_MSG} "Preparing hierarchy"
+ ${MKDIR} ${WRKSRC}/${GO_LANG_PATH_DIR} && \
+ ${LN} -sf ${WRKSRC}/vendor ${WRKSRC}/${GO_LANG_PATH_DIR}/src && \
+ ${MKDIR} ${WRKSRC}/${GO_LANG_PATH_DIR}/src/github.com/${GH_ACCOUNT} && \
+ ${LN} -sf ${WRKSRC}
${WRKSRC}/${GO_LANG_PATH_DIR}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}
+
+do-build:
+.for TOOL in ${TOOL_BUILD}
+ @${ECHO_MSG} "Building ${TOOL}"
+ ${SETENV} ${MAKE_ENV} \
+ GOPATH="${WRKSRC}/${GO_LANG_PATH_DIR}:${WRKSRC}/vendor" \
+ CGO_CPPFLAGS="-isystem ${LOCALBASE}/include" \
+ CGO_LDFLAGS="-L${LOCALBASE}/lib" \
+ ${MAKE_CMD} \
+ -o ${WRKSRC}/bin/${TOOL} \
+ ${MY_TAGS} \
+ ${WRKSRC}/${TOOL}/main/${TOOL}.go
+.endfor
+
+do-install:
+.for TOOL in ${TOOL_BUILD}
+ @${ECHO_MSG} "Installing ${TOOL}"
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/${TOOL} ${STAGEDIR}${PREFIX}/bin/
+.endfor
+
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for DOC in README.md CONTRIBUTING.md LICENSE.md THIRD-PARTY-NOTICES
+ @${ECHO_MSG} "Installing ${DOC}"
+ ${INSTALL_MAN} ${WRKSRC}/${DOC} ${STAGEDIR}${DOCSDIR}
+.endfor
+
+post-install:
+.for TOOL in ${TOOL_BUILD}
+ @${ECHO_MSG} "Stripping ${TOOL}"
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${TOOL}
+.endfor
+
+.include
Index: databases/mongodb40-tools/distinfo
===
--- databases/mongodb40-tools/distinfo (nonexistent)
+++ databases/mongodb40-tools/distinfo (working copy)
@@ -0,0 +1,3 @@
+TIMESTAMP = 139033
+SHA256 (mongodb-mongo-tools-r4.0.8_GH0.tar.gz) =
c224df31f85476c0f651c4b5d70871b581f14bf16a8595a4aa7717e66ad07c5c
+SIZE (mongodb-mongo-tools-r4.0.8_GH0.tar.gz) = 11134459
Index: databases/mongodb40-tools/files/patch-common_util_file.go
===
--- databases/mongodb40-