gnu: fsarchiver: Use HTTPS home page URI.
[jackhill/guix/guix.git] / gnu / packages / file-systems.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
4 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages file-systems)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system copy)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system linux-module)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages acl)
37 #:use-module (gnu packages attr)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages bison)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages crypto)
43 #:use-module (gnu packages curl)
44 #:use-module (gnu packages datastructures)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages docbook)
47 #:use-module (gnu packages flex)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages libffi)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages nfs)
53 #:use-module (gnu packages onc-rpc)
54 #:use-module (gnu packages photo)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages python-xyz)
58 #:use-module (gnu packages readline)
59 #:use-module (gnu packages rsync)
60 #:use-module (gnu packages sqlite)
61 #:use-module (gnu packages tls)
62 #:use-module (gnu packages valgrind)
63 #:use-module (gnu packages xml))
64
65 (define-public fsarchiver
66 (package
67 (name "fsarchiver")
68 (version "0.8.5")
69 (source
70 (origin
71 (method git-fetch)
72 (uri
73 (git-reference
74 (url "https://github.com/fdupoux/fsarchiver.git")
75 (commit version)))
76 (file-name (git-file-name name version))
77 (sha256
78 (base32 "1rvwq5v3rl14bqxjm1ibfapyicf0sa44nw7451v10kx39lp56ylp"))))
79 (build-system gnu-build-system)
80 (native-inputs
81 `(("autoconf" ,autoconf)
82 ("automake" ,automake)
83 ("pkg-config" ,pkg-config)))
84 (inputs
85 `(("bzip2" ,bzip2)
86 ("e2fsprogs" ,e2fsprogs)
87 ("libgcrypt" ,libgcrypt)
88 ("lz4" ,lz4)
89 ("lzo" ,lzo)
90 ("util-linux" ,util-linux "lib")
91 ("xz" ,xz)
92 ("zlib" ,zlib)
93 ("zstd:lib" ,zstd "lib")))
94 (synopsis "File system back-up, deployment, and migration tool")
95 (description
96 "FSArchiver saves the contents of a file system to a compressed archive
97 file, and restores it to a different file system and/or partition. This
98 partition can be of a different size than the original and FSArchiver will
99 create a new file system if none exists.
100
101 All standard file attributes supported by the kernel are preserved, including
102 file permissions, timestamps, symbolic and hard links, and extended attributes.
103
104 Each file in the archive is protected by a checksum. If part of the archive
105 is corrupted you'll lose the affected file(s) but not the whole back-up.")
106 (home-page "https://www.fsarchiver.org/")
107 (license license:gpl2)))
108
109 (define-public gphotofs
110 (package
111 (name "gphotofs")
112 (version "0.5.0")
113 (source
114 (origin
115 (method url-fetch)
116 (uri
117 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
118 "/gphotofs-0.5.tar.gz"))
119 (sha256
120 (base32
121 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
122 (build-system gnu-build-system)
123 (native-inputs
124 `(("pkg-config" ,pkg-config)))
125 (inputs
126 `(("fuse" ,fuse)
127 ("glib" ,glib)
128 ("libgphoto2" ,libgphoto2)))
129 (synopsis "Virtual filesystem for libgphoto2 using FUSE")
130 (description "GPhotoFS is a FUSE filesystem module to mount your camera as
131 a filesystem on Linux. This allow using your camera with any tool able to read
132 from a mounted filesystem.")
133 (home-page "http://www.gphoto.org/proj/gphotofs/")
134 (license license:gpl2+)))
135
136 (define-public bcachefs-tools
137 (let ((commit "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
138 (revision "0"))
139 (package
140 (name "bcachefs-tools")
141 (version (git-version "0.1" revision commit))
142 (source
143 (origin
144 (method git-fetch)
145 (uri (git-reference
146 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
147 (commit commit)))
148 (file-name (git-file-name name version))
149 (sha256
150 (base32 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
151 (build-system gnu-build-system)
152 (arguments
153 `(#:make-flags
154 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
155 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
156 "CC=gcc"
157 "PYTEST=pytest")
158 #:phases
159 (modify-phases %standard-phases
160 (delete 'configure)) ; no configure script
161 #:tests? #f)) ; XXX 6 valgrind tests fail
162 (native-inputs
163 `(("pkg-config" ,pkg-config)
164
165 ;; For tests.
166 ("python-pytest" ,python-pytest)
167 ("valgrind" ,valgrind)))
168 (inputs
169 `(("keyutils" ,keyutils)
170 ("libaio" ,libaio)
171 ("libscrypt" ,libscrypt)
172 ("libsodium" ,libsodium)
173 ("liburcu" ,liburcu)
174 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
175 ("lz4" ,lz4)
176 ("zlib" ,zlib)
177 ("zstd:lib" ,zstd "lib")))
178 (home-page "https://bcachefs.org/")
179 (synopsis "Tools to create and manage bcachefs file systems")
180 (description
181 "The bcachefs-tools are command-line utilities for creating, checking,
182 and otherwise managing bcachefs file systems.
183
184 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
185 encryption, compression, snapshots, and (meta)data checksums. It can use
186 multiple block devices for replication and/or performance, similar to RAID.
187
188 In addition, bcachefs provides all the functionality of bcache, a block-layer
189 caching system, and lets you assign different roles to each device based on its
190 performance and other characteristics.")
191 (license license:gpl2+))))
192
193 (define-public exfatprogs
194 (package
195 (name "exfatprogs")
196 (version "1.0.3")
197 (source
198 (origin
199 (method git-fetch)
200 (uri (git-reference
201 (url "https://github.com/exfatprogs/exfatprogs")
202 (commit version)))
203 (file-name (git-file-name name version))
204 (sha256
205 (base32
206 "1s47qvhr702z5c19wfqz8cwl9ammmincs7a8vjc6p974wnnjg77y"))))
207 (build-system gnu-build-system)
208 (arguments
209 `(#:configure-flags
210 (list "--disable-static")))
211 (native-inputs
212 `(("autoconf" ,autoconf)
213 ("automake" ,automake)
214 ("libtool" ,libtool)
215 ("pkg-config" ,pkg-config)))
216 (home-page "https://github.com/exfatprogs/exfatprogs")
217 (synopsis "Tools to create, check, and repair exFAT file systems")
218 (description
219 "These are command-line user space tools for the @acronym{exFAT,
220 Extensible File Allocation Table} file systems. Included are
221 @command{mkfs.exfat} to create (format) new exFAT file systems, and
222 @command{fsck.exfat} to check their consistency and repair them.")
223 (license license:gpl2+)))
224
225 (define-public httpfs2
226 (package
227 (name "httpfs2")
228 (version "0.1.5")
229 (source
230 (origin
231 (method url-fetch)
232 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
233 "httpfs2-" version ".tar.gz"))
234 (sha256
235 (base32
236 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
237 (build-system gnu-build-system)
238 (native-inputs
239 `(("asciidoc" ,asciidoc)
240 ("docbook-xml" ,docbook-xml)
241 ("libxml2" ,libxml2)
242 ("libxslt" ,libxslt)
243 ("pkg-config" ,pkg-config)))
244 (inputs
245 `(("fuse" ,fuse)
246 ("gnutls" ,gnutls)))
247 (arguments
248 `(#:phases
249 (modify-phases %standard-phases
250 (delete 'configure) ; no configure script
251 (replace 'install
252 ;; There's no ‘install’ target. Install all variants manually.
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let* ((out (assoc-ref outputs "out"))
255 (bin (string-append out "/bin"))
256 (man1 (string-append out "/share/man/man1")))
257 (mkdir-p bin)
258 (mkdir-p man1)
259 (for-each
260 (lambda (variant)
261 (let ((man1-page (string-append variant ".1")))
262 (install-file variant bin)
263 (install-file man1-page man1)))
264 (list "httpfs2"
265 "httpfs2-mt"
266 "httpfs2-ssl"
267 "httpfs2-ssl-mt")))
268 #t)))
269 #:make-flags (list "CC=gcc")
270 #:parallel-build? #f ; can result in missing man pages
271 #:tests? #f)) ; no tests
272 (home-page "https://sourceforge.net/projects/httpfs/")
273 (synopsis "Mount remote files over HTTP")
274 (description "httpfs2 is a @code{fuse} file system for mounting any
275 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
276 arbitrary bytes from the web server, without needing to download the entire
277 file. This is particularly useful with large archives such as ZIP files and
278 ISO images when you only need to inspect their contents or extract specific
279 files. Since the HTTP protocol itself has no notion of directories, only a
280 single file can be mounted.")
281 (license license:gpl2+)))
282
283 (define-public jfsutils
284 (package
285 (name "jfsutils")
286 (version "1.1.15")
287 (source
288 (origin
289 (method url-fetch)
290 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
291 version ".tar.gz"))
292 (sha256
293 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
294 (patches (search-patches "jfsutils-add-sysmacros.patch"
295 "jfsutils-include-systypes.patch"))))
296 (build-system gnu-build-system)
297 (inputs
298 `(("util-linux" ,util-linux "lib")))
299 (home-page "http://jfs.sourceforge.net/home.html")
300 (synopsis "Utilities for managing JFS file systems")
301 (description
302 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
303 Journaled File System}, a 64-bit journaling file system created by IBM and later
304 ported to the kernel Linux. The following commands are available:
305 @enumerate
306 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
307 transaction log.
308 @item @command{logdump}: dump the JFS journal log.
309 @item @command{logredo}: replay the JFS journal log.
310 @item @command{mkfs.jfs}: create a new JFS file system.
311 @item @command{xchklog}: save a JFS fsck log to a file.
312 @item @command{xchkdmp}: dump the contents of such a log file.
313 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
314 @end enumerate\n")
315 (license license:gpl3+))) ; no explicit version given
316
317 (define-public jfsutils/static
318 (static-package
319 (package
320 (inherit jfsutils)
321 (name "jfsutils-static")
322 (inputs
323 `(("util-linux:static" ,util-linux "static")
324 ,@(package-inputs jfsutils))))))
325
326 (define-public jfs_fsck/static
327 (package
328 (name "jfs_fsck-static")
329 (version (package-version jfsutils))
330 (source #f)
331 (build-system trivial-build-system)
332 (arguments
333 `(#:modules ((guix build utils))
334 #:builder
335 (begin
336 (use-modules (guix build utils)
337 (ice-9 ftw)
338 (srfi srfi-26))
339 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
340 (fsck "jfs_fsck")
341 (out (assoc-ref %outputs "out"))
342 (sbin (string-append out "/sbin")))
343 (mkdir-p sbin)
344 (with-directory-excursion sbin
345 (install-file (string-append jfsutils "/sbin/" fsck)
346 ".")
347 (remove-store-references fsck)
348 (chmod fsck #o555))
349 #t))))
350 (inputs
351 `(("jfsutils" ,jfsutils/static)))
352 (home-page (package-home-page jfsutils))
353 (synopsis "Statically-linked jfs_fsck command from jfsutils")
354 (description "This package provides statically-linked jfs_fsck command taken
355 from the jfsutils package. It is meant to be used in initrds.")
356 (license (package-license jfsutils))))
357
358 (define-public disorderfs
359 (package
360 (name "disorderfs")
361 (version "0.5.10")
362 (source
363 (origin
364 (method git-fetch)
365 (uri (git-reference
366 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
367 (commit version)))
368 (file-name (git-file-name name version))
369 (sha256
370 (base32
371 "0lsisx5118k0qk0b5klbxl03rvhycnznyfx05yxmjawh85bfhmlh"))))
372 (build-system gnu-build-system)
373 (native-inputs
374 `(("pkg-config" ,pkg-config)))
375 (inputs
376 `(("fuse" ,fuse)
377 ("attr" ,attr)))
378 (arguments
379 `(#:phases (modify-phases %standard-phases
380 (delete 'configure)) ; no configure script
381 #:make-flags (let ((out (assoc-ref %outputs "out")))
382 (list (string-append "PREFIX=" out)))
383 #:test-target "test"
384 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
385 #:tests? #f))
386 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
387 (synopsis "FUSE file system that introduces non-determinism")
388 (description
389 "An overlay FUSE file system that introduces non-determinism
390 into file system metadata. For example, it can randomize the order
391 in which directory entries are read. This is useful for detecting
392 non-determinism in the build process.")
393 (license license:gpl3+)))
394
395 (define-public glusterfs
396 (package
397 (name "glusterfs")
398 (version "7.0")
399 (source
400 (origin
401 (method url-fetch)
402 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
403 (version-major version) "/"
404 (version-major+minor version) "/"
405 "glusterfs-" version ".tar.gz"))
406 (sha256
407 (base32
408 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
409 (build-system gnu-build-system)
410 (arguments
411 `(#:configure-flags
412 (let ((out (assoc-ref %outputs "out"))
413 (p2 (assoc-ref %build-inputs "python-2")))
414 (list (string-append "PYTHON=" p2 "/bin/python")
415 (string-append "--with-initdir=" out "/etc/init.d")
416 (string-append "--with-mountutildir=" out "/sbin")
417 "--enable-cmocka" ; unit tests
418 ;; "--enable-debug" ; debug build options
419 ;; "--enable-asan" ; Address Sanitizer
420 ;; "--enable-tsan" ; ThreadSanitizer
421 ))
422 #:phases
423 (modify-phases %standard-phases
424 (add-before 'configure 'autogen
425 (lambda _ (invoke "./autogen.sh"))))))
426 (native-inputs
427 `(("pkg-config" ,pkg-config)
428 ("libtirpc", libtirpc)
429 ("rpcsvc-proto", rpcsvc-proto)
430 ("python-2" ,python-2) ; must be version 2
431 ("flex" ,flex)
432 ("bison" ,bison)
433 ("libtool" ,libtool)
434 ("autoconf" ,autoconf)
435 ("automake" ,automake)
436 ("cmocka" ,cmocka)))
437 (inputs
438 `(("acl" ,acl)
439 ("fuse", fuse)
440 ("openssl" ,openssl)
441 ("liburcu" ,liburcu)
442 ("libuuid" ,util-linux "lib")
443 ("libxml2" ,libxml2)
444 ("readline" ,readline)
445 ("zlib" ,zlib)
446 ("libaio", libaio)
447 ("rdma-core", rdma-core)))
448 (home-page "https://www.gluster.org")
449 (synopsis "Distributed file system")
450 (description "GlusterFS is a distributed scalable network file system
451 suitable for data-intensive tasks such as cloud storage and media streaming.
452 It allows rapid provisioning of additional storage based on your storage
453 consumption needs. It incorporates automatic failover as a primary feature.
454 All of this is accomplished without a centralized metadata server.")
455 ;; The user may choose either LGPLv3+ or GPLv2 only.
456 (license (list license:lgpl3+ license:gpl2+))))
457
458 (define-public curlftpfs
459 (package
460 (name "curlftpfs")
461 (version "0.9.2")
462 (source
463 (origin
464 (method url-fetch)
465 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
466 "/curlftpfs-" version ".tar.gz"))
467 (sha256
468 (base32
469 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
470 (build-system gnu-build-system)
471 (arguments
472 `(#:phases
473 (modify-phases %standard-phases
474 (add-after 'unpack 'fix-test
475 (lambda _
476 ;; One of the 512-Byte block counts is definitely wrong.
477 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
478 (substitute* "tests/ftpfs-ls_unittest.c"
479 (("4426192") "12814800"))
480 #t)))))
481 (inputs
482 `(("curl" ,curl)
483 ("glib" ,glib)
484 ("fuse" ,fuse)))
485 (native-inputs
486 `(("pkg-config" ,pkg-config)))
487 (home-page "http://curlftpfs.sourceforge.net/")
488 (synopsis "Mount remote file systems over FTP")
489 (description
490 "This is a file system client based on the FTP File Transfer Protocol.")
491 (license license:gpl2+)))
492
493 (define-public libnfs
494 (package
495 (name "libnfs")
496 (version "3.0.0")
497 (source (origin
498 (method git-fetch)
499 (uri (git-reference
500 (url "https://github.com/sahlberg/libnfs.git")
501 (commit (string-append "libnfs-" version))))
502 (file-name (git-file-name name version))
503 (sha256
504 (base32
505 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
506 (build-system gnu-build-system)
507 (home-page "https://github.com/sahlberg/libnfs")
508 (native-inputs
509 `(("autoconf" ,autoconf)
510 ("automake" ,automake)
511 ("libtool" ,libtool)
512 ("pkg-config" ,pkg-config)))
513 (synopsis "Client library for accessing NFS shares")
514 (description "LIBNFS is a client library for accessing NFS shares over a
515 network. LIBNFS offers three different APIs, for different use :
516
517 @enumerate
518 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
519 API provides very flexible and precise control of the RPC issued.
520 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
521 @item NFS SYNC, a synchronous library for high level vfs functions.
522 @end enumerate\n")
523 (license (list license:lgpl2.1+ ; library
524 license:gpl3+ ; tests
525 license:bsd-3 ; copied nsf4 files
526 ))))
527
528 (define-public apfs-fuse
529 ;; Later versions require FUSE 3.
530 (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
531 (revision "1"))
532 (package
533 (name "apfs-fuse")
534 (version (git-version "0.0.0" revision commit))
535 (source (origin
536 (method git-fetch)
537 (uri (git-reference
538 (url "https://github.com/sgan81/apfs-fuse")
539 (recursive? #t) ; for lzfse
540 (commit commit)))
541 (sha256
542 (base32
543 "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
544 (file-name (git-file-name name version))))
545 (build-system cmake-build-system)
546 (arguments
547 `(#:tests? #f ; No test suite
548 #:configure-flags
549 '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
550 #:phases
551 (modify-phases %standard-phases
552 ;; No 'install' target in CMakeLists.txt
553 (replace 'install
554 (lambda* (#:key outputs #:allow-other-keys)
555 (let* ((out (assoc-ref outputs "out"))
556 (bin (string-append out "/bin"))
557 (lib (string-append out "/lib"))
558 (doc (string-append out "/share/doc/"
559 (string-append ,name "-" ,version))))
560 (install-file "apfs-dump" bin)
561 (install-file "apfs-dump-quick" bin)
562 (install-file "apfs-fuse" bin)
563 (install-file "libapfs.a" lib)
564 (install-file "../source/README.md" doc)
565 #t))))))
566 (inputs
567 `(("bzip2" ,bzip2)
568 ("fuse" ,fuse)
569 ("zlib" ,zlib)))
570 (synopsis "Read-only FUSE driver for the APFS file system")
571 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
572 System} (APFS). It is currently in an experimental state — it may not be able
573 to read all files, and it does not support all the compression methods in
574 APFS.")
575 (home-page "https://github.com/sgan81/apfs-fuse")
576 (license license:gpl2+))))
577
578 (define-public zfs
579 (package
580 (name "zfs")
581 (version "0.8.2")
582 (outputs '("out" "module" "src"))
583 (source
584 (origin
585 (method url-fetch)
586 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
587 "/download/zfs-" version
588 "/zfs-" version ".tar.gz"))
589 (sha256
590 (base32
591 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
592 (build-system linux-module-build-system)
593 (arguments
594 `(;; The ZFS kernel module should not be downloaded since the license
595 ;; terms don't allow for distributing it, only building it locally.
596 #:substitutable? #f
597 ;; Tests cannot run in an unprivileged build environment.
598 #:tests? #f
599 #:phases
600 (modify-phases %standard-phases
601 (add-after 'configure 'really-configure
602 (lambda* (#:key outputs inputs #:allow-other-keys)
603 (let ((out (assoc-ref outputs "out")))
604 (substitute* "configure"
605 (("-/bin/sh") (string-append "-" (which "sh")))
606 ((" /bin/sh") (string-append " " (which "sh"))))
607 (invoke "./configure"
608 "--with-config=all"
609 (string-append "--prefix=" out)
610 (string-append "--with-dracutdir=" out "/lib/dracut")
611 (string-append "--with-udevdir=" out "/lib/udev")
612 (string-append "--with-mounthelperdir=" out "/sbin")
613 (string-append "--with-linux="
614 (assoc-ref inputs "linux-module-builder")
615 "/lib/modules/build")))))
616 (add-after 'unpack 'patch-source
617 (lambda* (#:key inputs outputs #:allow-other-keys)
618 (let ((out (assoc-ref outputs "out"))
619 (src (assoc-ref outputs "src"))
620 (util-linux (assoc-ref inputs "util-linux"))
621 (nfs-utils (assoc-ref inputs "nfs-utils")))
622 (substitute* "module/zfs/zfs_ctldir.c"
623 (("/usr/bin/env\", \"umount")
624 (string-append util-linux "/bin/umount\", \"-n"))
625 (("/usr/bin/env\", \"mount")
626 (string-append util-linux "/bin/mount\", \"-n")))
627 (substitute* "lib/libzfs/libzfs_mount.c"
628 (("/bin/mount") (string-append util-linux "/bin/mount"))
629 (("/bin/umount") (string-append util-linux "/bin/umount")))
630 (substitute* "lib/libshare/nfs.c"
631 (("/usr/sbin/exportfs")
632 (string-append nfs-utils "/sbin/exportfs")))
633 (substitute* "config/zfs-build.m4"
634 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
635 (substitute* '("etc/zfs/Makefile.am"
636 "cmd/zed/Makefile.am")
637 (("\\$\\(sysconfdir)") (string-append out "/etc")))
638 (substitute* "cmd/vdev_id/vdev_id"
639 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
640 (string-append "PATH="
641 (dirname (which "chmod")) ":"
642 (dirname (which "grep")) ":"
643 (dirname (which "sed")) ":"
644 (dirname (which "gawk")))))
645 (substitute* "contrib/pyzfs/Makefile.in"
646 ((".*install-lib.*") ""))
647 (substitute* '("Makefile.am" "Makefile.in")
648 (("\\$\\(prefix)/src") (string-append src "/src"))))
649 #t))
650 (replace 'build
651 (lambda _ (invoke "make")))
652 (replace 'install
653 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
654 (let* ((out (assoc-ref outputs "out"))
655 (moddir (assoc-ref outputs "module"))
656 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
657 (invoke "make" "install"
658 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
659 (string-append "DEPMOD=" kmod "/bin/depmod")
660 (string-append "INSTALL_PATH=" out)
661 (string-append "INSTALL_MOD_PATH=" moddir)
662 "INSTALL_MOD_STRIP=1")
663 (install-file "contrib/bash_completion.d/zfs"
664 (string-append out "/share/bash-completion/completions"))
665 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
666 #t))))))
667 (native-inputs
668 `(("attr" ,attr)
669 ("kmod" ,kmod)
670 ("pkg-config" ,pkg-config)))
671 (inputs
672 `(("eudev" ,eudev)
673 ("libaio" ,libaio)
674 ("libtirpc" ,libtirpc)
675 ("nfs-utils" ,nfs-utils)
676 ("openssl" ,openssl)
677 ("python" ,python)
678 ("python-cffi" ,python-cffi)
679 ("util-linux" ,util-linux "lib")
680 ("zlib" ,zlib)))
681 (home-page "https://zfsonlinux.org/")
682 (synopsis "Native ZFS on Linux")
683 (description
684 "ZFS on Linux is an advanced file system and volume manager which was
685 originally developed for Solaris and is now maintained by the OpenZFS
686 community.")
687 (license license:cddl1.0)))
688
689 (define-public mergerfs
690 (package
691 (name "mergerfs")
692 (version "2.29.0")
693 (source
694 (origin
695 (method url-fetch)
696 (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
697 version "/mergerfs-" version ".tar.gz"))
698 (sha256
699 (base32
700 "17gizw4vgbqqjd2ykkfpp276942jb5qclp0lkiwkmq1yjgyjqfmk"))))
701 (build-system gnu-build-system)
702 (arguments
703 `(#:tests? #f ; No tests exist.
704 #:phases
705 (modify-phases %standard-phases
706 (delete 'configure)
707 (add-after 'unpack 'fix-paths
708 (lambda* (#:key inputs outputs #:allow-other-keys)
709 (setenv "CC" "gcc")
710 ;; These were copied from the package libfuse.
711 (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
712 (("/bin/(u?)mount" _ maybe-u)
713 (string-append (assoc-ref inputs "util-linux")
714 "/bin/" maybe-u "mount")))
715 (substitute* '("libfuse/util/mount.mergerfs.c")
716 (("/bin/sh")
717 (which "sh")))
718 ;; The Makefile does not allow overriding PREFIX via make variables.
719 (substitute* '("Makefile" "libfuse/Makefile")
720 (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
721 ;; cannot chown as build user
722 (("chown root:root") "true"))
723 #t)))))
724 ;; mergerfs bundles a heavily modified copy of libfuse.
725 (inputs `(("util-linux" ,util-linux)))
726 (home-page "https://github.com/trapexit/mergerfs")
727 (synopsis "Featureful union filesystem")
728 (description "mergerfs is a union filesystem geared towards simplifying
729 storage and management of files across numerous commodity storage devices. It
730 is similar to mhddfs, unionfs, and aufs.")
731 (license (list
732 license:isc ; mergerfs
733 license:gpl2 license:lgpl2.0 ; Imported libfuse code.
734 ))))
735
736 (define-public mergerfs-tools
737 (let ((commit "c926779d87458d103f3b674603bf97801ae2486d")
738 (revision "1"))
739 (package
740 (name "mergerfs-tools")
741 ;; No released version exists.
742 (version (git-version "0.0" revision commit))
743 (source
744 (origin
745 (method git-fetch)
746 (uri (git-reference
747 (url "https://github.com/trapexit/mergerfs-tools.git")
748 (commit commit)))
749 (file-name (git-file-name name version))
750 (sha256
751 (base32
752 "04hhwcib0xv4cf1mkj8zrp2aqpxkncml9iqg4m1mz6a5zhzsk0vm"))))
753 (build-system copy-build-system)
754 (inputs
755 `(("python" ,python)
756 ("python-xattr" ,python-xattr)
757 ("rsync" ,rsync)))
758 (arguments
759 '(#:install-plan
760 '(("src/" "bin/"))
761 #:phases
762 (modify-phases %standard-phases
763 (add-after 'unpack 'patch-paths
764 (lambda* (#:key inputs #:allow-other-keys)
765 (substitute* (find-files "src" "^mergerfs\\.")
766 (("'rsync'")
767 (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
768 (("'rm'")
769 (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
770 (substitute* "src/mergerfs.mktrash"
771 (("xattr")
772 (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
773 (("mkdir")
774 (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
775 #t)))))
776 (synopsis "Tools to help manage data in a mergerfs pool")
777 (description "mergerfs-tools is a suite of programs that can audit
778 permissions and ownership of files and directories on a mergerfs volume,
779 duplicates files and directories across branches in its pool, find and remove
780 duplicate files, balance pool drives, consolidate files in a single mergerfs
781 directory onto a single drive and create FreeDesktop.org Trash specification
782 compatible directories.")
783 (home-page "https://github.com/trapexit/mergerfs-tools")
784 (license license:isc))))