1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018 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 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages file-systems)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system linux-module)
31 #:use-module (guix build-system trivial)
32 #:use-module (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages acl)
35 #:use-module (gnu packages attr)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages datastructures)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages docbook)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages libffi)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages nfs)
49 #:use-module (gnu packages onc-rpc)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages sqlite)
54 #:use-module (gnu packages tls)
55 #:use-module (gnu packages xml))
57 (define-public httpfs2
64 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
65 "httpfs2-" version ".tar.gz"))
68 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
69 (build-system gnu-build-system)
71 `(("asciidoc" ,asciidoc)
72 ("docbook-xml" ,docbook-xml)
75 ("pkg-config" ,pkg-config)))
81 (modify-phases %standard-phases
82 (delete 'configure) ; no configure script
84 ;; There's no ‘install’ target. Install all variants manually.
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let* ((out (assoc-ref outputs "out"))
87 (bin (string-append out "/bin"))
88 (man1 (string-append out "/share/man/man1")))
93 (let ((man1-page (string-append variant ".1")))
94 (install-file variant bin)
95 (install-file man1-page man1)))
101 #:make-flags (list "CC=gcc")
102 #:parallel-build? #f ; can result in missing man pages
103 #:tests? #f)) ; no tests
104 (home-page "https://sourceforge.net/projects/httpfs/")
105 (synopsis "Mount remote files over HTTP")
106 (description "httpfs2 is a @code{fuse} file system for mounting any
107 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
108 arbitrary bytes from the web server, without needing to download the entire
109 file. This is particularly useful with large archives such as ZIP files and
110 ISO images when you only need to inspect their contents or extract specific
111 files. Since the HTTP protocol itself has no notion of directories, only a
112 single file can be mounted.")
113 (license license:gpl2+)))
115 (define-public jfsutils
122 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
125 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
126 (patches (search-patches "jfsutils-add-sysmacros.patch"
127 "jfsutils-include-systypes.patch"))))
128 (build-system gnu-build-system)
130 `(("util-linux" ,util-linux "lib")))
131 (home-page "http://jfs.sourceforge.net/home.html")
132 (synopsis "Utilities for managing JFS file systems")
134 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
135 Journaled File System}, a 64-bit journaling file system created by IBM and later
136 ported to the kernel Linux. The following commands are available:
138 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
140 @item @command{logdump}: dump the JFS journal log.
141 @item @command{logredo}: replay the JFS journal log.
142 @item @command{mkfs.jfs}: create a new JFS file system.
143 @item @command{xchklog}: save a JFS fsck log to a file.
144 @item @command{xchkdmp}: dump the contents of such a log file.
145 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
147 (license license:gpl3+))) ; no explicit version given
149 (define-public jfsutils/static
153 (name "jfsutils-static")
155 `(("util-linux:static" ,util-linux "static")
156 ,@(package-inputs jfsutils))))))
158 (define-public jfs_fsck/static
160 (name "jfs_fsck-static")
161 (version (package-version jfsutils))
163 (build-system trivial-build-system)
165 `(#:modules ((guix build utils))
168 (use-modules (guix build utils)
171 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
173 (out (assoc-ref %outputs "out"))
174 (sbin (string-append out "/sbin")))
176 (with-directory-excursion sbin
177 (install-file (string-append jfsutils "/sbin/" fsck)
179 (remove-store-references fsck)
183 `(("jfsutils" ,jfsutils/static)))
184 (home-page (package-home-page jfsutils))
185 (synopsis "Statically-linked jfs_fsck command from jfsutils")
186 (description "This package provides statically-linked jfs_fsck command taken
187 from the jfsutils package. It is meant to be used in initrds.")
188 (license (package-license jfsutils))))
190 (define-public disorderfs
198 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
200 (file-name (git-file-name name version))
203 "1zn2ydap8k9fwjl3ivgrg6l32s5p4ik6ca6j1idp7c77znlv6cpp"))))
204 (build-system gnu-build-system)
206 `(("pkg-config" ,pkg-config)))
211 `(#:phases (modify-phases %standard-phases
212 (delete 'configure)) ; no configure script
213 #:make-flags (let ((out (assoc-ref %outputs "out")))
214 (list (string-append "PREFIX=" out)))
216 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
218 (home-page "https://github.com/ReproducibleBuilds/disorderfs")
219 (synopsis "FUSE file system that introduces non-determinism")
221 "An overlay FUSE file system that introduces non-determinism
222 into file system metadata. For example, it can randomize the order
223 in which directory entries are read. This is useful for detecting
224 non-determinism in the build process.")
225 (license license:gpl3+)))
227 (define-public glusterfs
234 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
235 (version-major version) "/"
236 (version-major+minor version) "/"
237 "glusterfs-" version ".tar.gz"))
240 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
241 (build-system gnu-build-system)
244 (let ((out (assoc-ref %outputs "out"))
245 (p2 (assoc-ref %build-inputs "python-2")))
246 (list (string-append "PYTHON=" p2 "/bin/python")
247 (string-append "--with-initdir=" out "/etc/init.d")
248 (string-append "--with-mountutildir=" out "/sbin")
249 "--enable-cmocka" ; unit tests
250 ;; "--enable-debug" ; debug build options
251 ;; "--enable-asan" ; Address Sanitizer
252 ;; "--enable-tsan" ; ThreadSanitizer
255 (modify-phases %standard-phases
256 (add-before 'configure 'autogen
257 (lambda _ (invoke "./autogen.sh"))))))
259 `(("pkg-config" ,pkg-config)
260 ("libtirpc", libtirpc)
261 ("rpcsvc-proto", rpcsvc-proto)
262 ("python-2" ,python-2) ; must be version 2
266 ("autoconf" ,autoconf)
267 ("automake" ,automake)
274 ("libuuid" ,util-linux "lib")
276 ("readline" ,readline)
279 ("rdma-core", rdma-core)))
280 (home-page "https://www.gluster.org")
281 (synopsis "Distributed file system")
282 (description "GlusterFS is a distributed scalable network file system
283 suitable for data-intensive tasks such as cloud storage and media streaming.
284 It allows rapid provisioning of additional storage based on your storage
285 consumption needs. It incorporates automatic failover as a primary feature.
286 All of this is accomplished without a centralized metadata server.")
287 ;; The user may choose either LGPLv3+ or GPLv2 only.
288 (license (list license:lgpl3+ license:gpl2+))))
290 (define-public curlftpfs
297 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
298 "/curlftpfs-" version ".tar.gz"))
301 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
302 (build-system gnu-build-system)
305 (modify-phases %standard-phases
306 (add-after 'unpack 'fix-test
308 ;; One of the 512-Byte block counts is definitely wrong.
309 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
310 (substitute* "tests/ftpfs-ls_unittest.c"
311 (("4426192") "12814800"))
318 `(("pkg-config" ,pkg-config)))
319 (home-page "http://curlftpfs.sourceforge.net/")
320 (synopsis "Mount remote file systems over FTP")
322 "This is a file system client based on the FTP File Transfer Protocol.")
323 (license license:gpl2+)))
325 (define-public libnfs
332 (url "https://github.com/sahlberg/libnfs.git")
333 (commit (string-append "libnfs-" version))))
334 (file-name (git-file-name name version))
337 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
338 (build-system gnu-build-system)
339 (home-page "https://github.com/sahlberg/libnfs")
341 `(("autoconf" ,autoconf)
342 ("automake" ,automake)
344 ("pkg-config" ,pkg-config)))
345 (synopsis "Client library for accessing NFS shares")
346 (description "LIBNFS is a client library for accessing NFS shares over a
347 network. LIBNFS offers three different APIs, for different use :
350 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
351 API provides very flexible and precise control of the RPC issued.
352 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
353 @item NFS SYNC, a synchronous library for high level vfs functions.
355 (license (list license:lgpl2.1+ ; library
356 license:gpl3+ ; tests
357 license:bsd-3 ; copied nsf4 files
360 (define-public apfs-fuse
361 (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
365 (version (git-version "0.0.0" revision commit))
369 (url "https://github.com/sgan81/apfs-fuse")
370 (recursive? #t) ; for lzfse
374 "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
375 (file-name (git-file-name name version))))
376 (build-system cmake-build-system)
378 `(#:tests? #f ; No test suite
380 (modify-phases %standard-phases
381 ;; No 'install' target in CMakeLists.txt
383 (lambda* (#:key outputs #:allow-other-keys)
384 (let* ((out (assoc-ref outputs "out"))
385 (bin (string-append out "/bin"))
386 (lib (string-append out "/lib"))
387 (doc (string-append out "/share/doc/"
388 (string-append ,name "-" ,version))))
389 (install-file "apfs-dump" bin)
390 (install-file "apfs-dump-quick" bin)
391 (install-file "apfs-fuse" bin)
392 (install-file "libapfs.a" lib)
398 (synopsis "Read-only FUSE driver for the APFS file system")
399 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
400 System} (APFS). It is currently in an experimental state — it may not be able
401 to read all files, and it does not support all the compression methods in
403 (home-page "https://github.com/sgan81/apfs-fuse")
404 (license license:gpl2+))))
410 (outputs '("out" "module" "src"))
414 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
415 "/download/zfs-" version
416 "/zfs-" version ".tar.gz"))
419 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
420 (build-system linux-module-build-system)
422 `(;; The ZFS kernel module should not be downloaded since the license
423 ;; terms don't allow for distributing it, only building it locally.
425 ;; Tests cannot run in an unprivileged build environment.
428 (modify-phases %standard-phases
429 (add-after 'configure 'really-configure
430 (lambda* (#:key outputs inputs #:allow-other-keys)
431 (let ((out (assoc-ref outputs "out")))
432 (substitute* "configure"
433 (("-/bin/sh") (string-append "-" (which "sh")))
434 ((" /bin/sh") (string-append " " (which "sh"))))
435 (invoke "./configure"
437 (string-append "--prefix=" out)
438 (string-append "--with-dracutdir=" out "/lib/dracut")
439 (string-append "--with-udevdir=" out "/lib/udev")
440 (string-append "--with-mounthelperdir=" out "/sbin")
441 (string-append "--with-linux="
442 (assoc-ref inputs "linux-module-builder")
443 "/lib/modules/build")))))
444 (add-after 'unpack 'patch-source
445 (lambda* (#:key inputs outputs #:allow-other-keys)
446 (let ((out (assoc-ref outputs "out"))
447 (src (assoc-ref outputs "src"))
448 (util-linux (assoc-ref inputs "util-linux"))
449 (nfs-utils (assoc-ref inputs "nfs-utils")))
450 (substitute* "module/zfs/zfs_ctldir.c"
451 (("/usr/bin/env\", \"umount")
452 (string-append util-linux "/bin/umount\", \"-n"))
453 (("/usr/bin/env\", \"mount")
454 (string-append util-linux "/bin/mount\", \"-n")))
455 (substitute* "lib/libzfs/libzfs_mount.c"
456 (("/bin/mount") (string-append util-linux "/bin/mount"))
457 (("/bin/umount") (string-append util-linux "/bin/umount")))
458 (substitute* "lib/libshare/nfs.c"
459 (("/usr/sbin/exportfs")
460 (string-append nfs-utils "/sbin/exportfs")))
461 (substitute* "config/zfs-build.m4"
462 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
463 (substitute* '("etc/zfs/Makefile.am"
464 "cmd/zed/Makefile.am")
465 (("\\$\\(sysconfdir)") (string-append out "/etc")))
466 (substitute* "cmd/vdev_id/vdev_id"
467 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
468 (string-append "PATH="
469 (dirname (which "chmod")) ":"
470 (dirname (which "grep")) ":"
471 (dirname (which "sed")) ":"
472 (dirname (which "gawk")))))
473 (substitute* "contrib/pyzfs/Makefile.in"
474 ((".*install-lib.*") ""))
475 (substitute* '("Makefile.am" "Makefile.in")
476 (("\\$\\(prefix)/src") (string-append src "/src"))))
479 (lambda _ (invoke "make")))
481 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
482 (let* ((out (assoc-ref outputs "out"))
483 (moddir (assoc-ref outputs "module"))
484 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
485 (invoke "make" "install"
486 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
487 (string-append "DEPMOD=" kmod "/bin/depmod")
488 (string-append "INSTALL_PATH=" out)
489 (string-append "INSTALL_MOD_PATH=" moddir)
490 "INSTALL_MOD_STRIP=1")
491 (install-file "contrib/bash_completion.d/zfs"
492 (string-append out "/share/bash-completion/completions"))
493 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
497 ("pkg-config" ,pkg-config)))
501 ("libtirpc" ,libtirpc)
502 ("nfs-utils" ,nfs-utils)
505 ("python-cffi" ,python-cffi)
506 ("util-linux" ,util-linux "lib")
508 (home-page "https://zfsonlinux.org/")
509 (synopsis "Native ZFS on Linux")
511 "ZFS on Linux is an advanced file system and volume manager which was
512 originally developed for Solaris and is now maintained by the OpenZFS
514 (license license:cddl1.0)))