[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/10: gnu: Add mongo-tools.
From: |
Christopher Baines |
Subject: |
10/10: gnu: Add mongo-tools. |
Date: |
Tue, 30 Jan 2018 02:45:05 -0500 (EST) |
cbaines pushed a commit to branch master
in repository guix.
commit 33c88fcb2588e5b74f8f2f7a78227950e5199a3c
Author: Christopher Baines <address@hidden>
Date: Sun Jan 21 11:00:56 2018 +0000
gnu: Add mongo-tools.
* gnu/packages/databases.scm (mongo-tools): New variable.
---
gnu/packages/databases.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index f3af590..79dac20 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -68,6 +68,7 @@
#:use-module (gnu packages gnupg)
#:use-module (gnu packages guile)
#:use-module (gnu packages time)
+ #:use-module (gnu packages golang)
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages language)
#:use-module (gnu packages libevent)
@@ -87,6 +88,8 @@
#:use-module (gnu packages serialization)
#:use-module (gnu packages statistics)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages terminals)
+ #:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
#:use-module (gnu packages valgrind)
#:use-module (gnu packages xml)
@@ -2601,3 +2604,86 @@ transforms idiomatic python function calls to
well-formed SQL queries.")
(define-public python2-sql
(package-with-python2 python-sql))
+
+(define-public mongo-tools
+ (package
+ (name "mongo-tools")
+ (version "3.4.0")
+ (source
+ (origin (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mongodb/mongo-tools")
+ (commit (string-append "r" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "095nc57k4m4iyim0x3fgpw681qba123iyl4qz7xysbv5ngbr19mc"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:unpack-path "github.com/mongodb"
+ #:import-path "github.com/mongodb/mongo-tools"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'delete-bundled-source-code
+ (lambda _
+ (delete-file-recursively
+ "src/github.com/mongodb/mongo-tools/vendor")
+ #t))
+
+ ;; We don't need to install the source code for end-user application
+ (delete 'install-source)
+
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let build ((tools
+ '("bsondump" "mongodump" "mongoexport" "mongofiles"
+ "mongoimport" "mongooplog" "mongorestore"
+ "mongostat" "mongotop")))
+ (if (null? tools)
+ #t
+ (if (let* ((tool (car tools))
+ (command
+ `("go" "install" "-v"
+ "-tags=\"ssl sasl\""
+ "-ldflags"
+ "-extldflags=-Wl,-z,now,-z,relro"
+ ,(string-append
+ "src/github.com/mongodb/mongo-tools/"
+ tool "/main/" tool ".go"))))
+ (simple-format #t "build: running ~A\n"
+ (string-join command))
+ (zero? (apply system* command)))
+ (build (cdr tools))
+ #f))))))))
+ (native-inputs
+ `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
+ ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
+ ("go-golang.org-x-crypto-ssh-terminal"
,go-golang.org-x-crypto-ssh-terminal)
+ ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
+ ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
+ ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)))
+ (home-page "https://github.com/mongodb/mongo-tools")
+ (synopsis "Various tools for interacting with MongoDB and BSON")
+ (description
+ "This package includes a collection of tools related to MongoDB.
address@hidden @code
address@hidden bsondump
+Display BSON files in a human-readable format
address@hidden mongoimport
+Convert data from JSON, TSV or CSV and insert them into a collection
address@hidden mongoexport
+Write an existing collection to CSV or JSON format
address@hidden mongodump/mongorestore
+Dump MongoDB backups to disk in the BSON format
address@hidden mongorestore
+Read MongoDB backups in the BSON format, and restore them to a live database
address@hidden mongostat
+Monitor live MongoDB servers, replica sets, or sharded clusters
address@hidden mongofiles
+Read, write, delete, or update files in GridFS
address@hidden mongooplog
+Replay oplog entries between MongoDB servers
address@hidden mongotop
+Monitor read/write activity on a mongo server
address@hidden table")
+ (license license:asl2.0)))
- branch master updated (be88eb2 -> 33c88fc), Christopher Baines, 2018/01/30
- 05/10: gnu: Add daemontools., Christopher Baines, 2018/01/30
- 08/10: gnu: Add go-github.com-mattn-go-runewidth., Christopher Baines, 2018/01/30
- 02/10: gnu: Add go-github.com-howeyc-gopass., Christopher Baines, 2018/01/30
- 07/10: gnu: Add go-gopkg.in-tomb.v2., Christopher Baines, 2018/01/30
- 09/10: gnu: Add go-github.com-nsf-termbox-go., Christopher Baines, 2018/01/30
- 04/10: gnu: Add go-gopkg.in-check.v1., Christopher Baines, 2018/01/30
- 06/10: gnu: Add go-gopkg.in-mgo.v2., Christopher Baines, 2018/01/30
- 03/10: gnu: Add go-github.com-jessevdk-go-flags., Christopher Baines, 2018/01/30
- 10/10: gnu: Add mongo-tools.,
Christopher Baines <=
- 01/10: gnu: Add go-golang.org-x-crypto-ssh-terminal., Christopher Baines, 2018/01/30