summary refs log tree commit diff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2020-05-30 19:10:55 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-03 18:05:56 +0200
commit4960a955f8f77cc4c35d0db749cd6f3de8787bff (patch)
treea29cedafc74deec63eaa1d02413acbe8c402e4d4
parent639bcf205d55c7a0c6d0894b4e7a814a86d3b9a9 (diff)
downloadguix-4960a955f8f77cc4c35d0db749cd6f3de8787bff.tar.gz
gnu: Add mergerfs-tools.
* gnu/packages/storage.scm (mergerfs-tools): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/file-systems.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index bb435d7ac0..ca02a1e593 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -27,6 +27,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system linux-module)
   #:use-module (guix build-system trivial)
@@ -53,7 +54,9 @@
   #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages rsync)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages valgrind)
@@ -729,3 +732,53 @@ is similar to mhddfs, unionfs, and aufs.")
               license:isc                   ; mergerfs
               license:gpl2 license:lgpl2.0  ; Imported libfuse code.
               ))))
+
+(define-public mergerfs-tools
+  (let ((commit "c926779d87458d103f3b674603bf97801ae2486d")
+        (revision "1"))
+    (package
+      (name "mergerfs-tools")
+      ;; No released version exists.
+      (version (git-version "0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/trapexit/mergerfs-tools.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "04hhwcib0xv4cf1mkj8zrp2aqpxkncml9iqg4m1mz6a5zhzsk0vm"))))
+      (build-system copy-build-system)
+      (inputs
+       `(("python" ,python)
+         ("python-xattr" ,python-xattr)
+         ("rsync" ,rsync)))
+      (arguments
+       '(#:install-plan
+         '(("src/" "bin/"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* (find-files "src" "^mergerfs\\.")
+                 (("'rsync'")
+                  (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
+                 (("'rm'")
+                  (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
+               (substitute* "src/mergerfs.mktrash"
+                 (("xattr")
+                  (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
+                 (("mkdir")
+                  (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
+               #t)))))
+      (synopsis "Tools to help manage data in a mergerfs pool")
+      (description "mergerfs-tools is a suite of programs that can audit
+permissions and ownership of files and directories on a mergerfs volume,
+duplicates files and directories across branches in its pool, find and remove
+duplicate files, balance pool drives, consolidate files in a single mergerfs
+directory onto a single drive and create FreeDesktop.org Trash specification
+compatible directories.")
+      (home-page "https://github.com/trapexit/mergerfs-tools")
+      (license license:isc))))