>From ac0ff2afbbcc63d9b6b7b448877f54b58e975668 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 24 May 2020 10:48:02 +0200 Subject: [PATCH 2/2] gnu: Add mergerfs-tools. * gnu/packages/storage.scm (mergerfs-tools): New variable. --- gnu/packages/storage.scm | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm index b8090c7eaa..ee5967aff6 100644 --- a/gnu/packages/storage.scm +++ b/gnu/packages/storage.scm @@ -24,6 +24,8 @@ #:use-module (guix utils) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system copy) + #:use-module (guix git-download) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages assembly) @@ -46,6 +48,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rsync) #:use-module (gnu packages sphinx) #:use-module (gnu packages tls) #:use-module (gnu packages web) @@ -299,3 +302,53 @@ storage protocols (S3, NFS, and others) through the RADOS gateway.") license:isc ;; imported libfuse code license:gpl2 license:lgpl2.0)))) + +(define-public mergerfs-tools + (let ((commit "c926779d87458d103f3b674603bf97801ae2486d") + (revision "1")) + (package + (name "mergerfs-tools") + ;; unreleased, no version + (version (git-version "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 "Optional tools to help manage data in a mergerfs pool") + (description + "Audit permissions and ownership of files and directories, duplicates + files & directories across branches in a 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)))) -- 2.26.2