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 utils)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages acl)
34 #:use-module (gnu packages attr)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages bison)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages curl)
40 #:use-module (gnu packages datastructures)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages docbook)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages libffi)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages nfs)
48 #:use-module (gnu packages onc-rpc)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages readline)
52 #:use-module (gnu packages sqlite)
53 #:use-module (gnu packages tls)
54 #:use-module (gnu packages xml))
56 (define-public httpfs2
63 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
64 "httpfs2-" version ".tar.gz"))
67 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
68 (build-system gnu-build-system)
70 `(("asciidoc" ,asciidoc)
71 ("docbook-xml" ,docbook-xml)
74 ("pkg-config" ,pkg-config)))
80 (modify-phases %standard-phases
81 (delete 'configure) ; no configure script
83 ;; There's no ‘install’ target. Install all variants manually.
84 (lambda* (#:key outputs #:allow-other-keys)
85 (let* ((out (assoc-ref outputs "out"))
86 (bin (string-append out "/bin"))
87 (man1 (string-append out "/share/man/man1")))
92 (let ((man1-page (string-append variant ".1")))
93 (install-file variant bin)
94 (install-file man1-page man1)))
100 #:make-flags (list "CC=gcc")
101 #:parallel-build? #f ; can result in missing man pages
102 #:tests? #f)) ; no tests
103 (home-page "https://sourceforge.net/projects/httpfs/")
104 (synopsis "Mount remote files over HTTP")
105 (description "httpfs2 is a @code{fuse} file system for mounting any
106 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
107 arbitrary bytes from the web server, without needing to download the entire
108 file. This is particularly useful with large archives such as ZIP files and
109 ISO images when you only need to inspect their contents or extract specific
110 files. Since the HTTP protocol itself has no notion of directories, only a
111 single file can be mounted.")
112 (license license:gpl2+)))
114 (define-public jfsutils
121 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
124 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
125 (patches (search-patches "jfsutils-add-sysmacros.patch"
126 "jfsutils-include-systypes.patch"))))
127 (build-system gnu-build-system)
129 `(("util-linux" ,util-linux)))
130 (home-page "http://jfs.sourceforge.net/home.html")
131 (synopsis "Utilities for managing JFS file systems")
133 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
134 Journaled File System}, a 64-bit journaling file system created by IBM and later
135 ported to the kernel Linux. The following commands are available:
137 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
139 @item @command{logdump}: dump the JFS journal log.
140 @item @command{logredo}: replay the JFS journal log.
141 @item @command{mkfs.jfs}: create a new JFS file system.
142 @item @command{xchklog}: save a JFS fsck log to a file.
143 @item @command{xchkdmp}: dump the contents of such a log file.
144 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
146 (license license:gpl3+))) ; no explicit version given
148 (define-public disorderfs
156 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
158 (file-name (git-file-name name version))
161 "1zn2ydap8k9fwjl3ivgrg6l32s5p4ik6ca6j1idp7c77znlv6cpp"))))
162 (build-system gnu-build-system)
164 `(("pkg-config" ,pkg-config)))
169 `(#:phases (modify-phases %standard-phases
170 (delete 'configure)) ; no configure script
171 #:make-flags (let ((out (assoc-ref %outputs "out")))
172 (list (string-append "PREFIX=" out)))
174 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
176 (home-page "https://github.com/ReproducibleBuilds/disorderfs")
177 (synopsis "FUSE file system that introduces non-determinism")
179 "An overlay FUSE file system that introduces non-determinism
180 into file system metadata. For example, it can randomize the order
181 in which directory entries are read. This is useful for detecting
182 non-determinism in the build process.")
183 (license license:gpl3+)))
185 (define-public glusterfs
192 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
193 (version-major version) "/"
194 (version-major+minor version) "/"
195 "glusterfs-" version ".tar.gz"))
198 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
199 (build-system gnu-build-system)
202 (let ((out (assoc-ref %outputs "out"))
203 (p2 (assoc-ref %build-inputs "python-2")))
204 (list (string-append "PYTHON=" p2 "/bin/python")
205 (string-append "--with-initdir=" out "/etc/init.d")
206 (string-append "--with-mountutildir=" out "/sbin")
207 "--enable-cmocka" ; unit tests
208 ;; "--enable-debug" ; debug build options
209 ;; "--enable-asan" ; Address Sanitizer
210 ;; "--enable-tsan" ; ThreadSanitizer
213 (modify-phases %standard-phases
214 (add-before 'configure 'autogen
215 (lambda _ (invoke "./autogen.sh"))))))
217 `(("pkg-config" ,pkg-config)
218 ("libtirpc", libtirpc)
219 ("rpcsvc-proto", rpcsvc-proto)
220 ("python-2" ,python-2) ; must be version 2
224 ("autoconf" ,autoconf)
225 ("automake" ,automake)
232 ("libuuid" ,util-linux)
234 ("readline" ,readline)
237 ("rdma-core", rdma-core)))
238 (home-page "https://www.gluster.org")
239 (synopsis "Distributed file system")
240 (description "GlusterFS is a distributed scalable network file system
241 suitable for data-intensive tasks such as cloud storage and media streaming.
242 It allows rapid provisioning of additional storage based on your storage
243 consumption needs. It incorporates automatic failover as a primary feature.
244 All of this is accomplished without a centralized metadata server.")
245 ;; The user may choose either LGPLv3+ or GPLv2 only.
246 (license (list license:lgpl3+ license:gpl2+))))
248 (define-public curlftpfs
255 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
256 "/curlftpfs-" version ".tar.gz"))
259 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
260 (build-system gnu-build-system)
263 (modify-phases %standard-phases
264 (add-after 'unpack 'fix-test
266 ;; One of the 512-Byte block counts is definitely wrong.
267 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
268 (substitute* "tests/ftpfs-ls_unittest.c"
269 (("4426192") "12814800"))
276 `(("pkg-config" ,pkg-config)))
277 (home-page "http://curlftpfs.sourceforge.net/")
278 (synopsis "Mount remote file systems over FTP")
280 "This is a file system client based on the FTP File Transfer Protocol.")
281 (license license:gpl2+)))
283 (define-public libnfs
290 (url "https://github.com/sahlberg/libnfs.git")
291 (commit (string-append "libnfs-" version))))
292 (file-name (git-file-name name version))
295 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
296 (build-system gnu-build-system)
297 (home-page "https://github.com/sahlberg/libnfs")
299 `(("autoconf" ,autoconf)
300 ("automake" ,automake)
302 ("pkg-config" ,pkg-config)))
303 (synopsis "Client library for accessing NFS shares")
304 (description "LIBNFS is a client library for accessing NFS shares over a
305 network. LIBNFS offers three different APIs, for different use :
308 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
309 API provides very flexible and precise control of the RPC issued.
310 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
311 @item NFS SYNC, a synchronous library for high level vfs functions.
313 (license (list license:lgpl2.1+ ; library
314 license:gpl3+ ; tests
315 license:bsd-3 ; copied nsf4 files
318 (define-public apfs-fuse
319 (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
323 (version (git-version "0.0.0" revision commit))
327 (url "https://github.com/sgan81/apfs-fuse")
328 (recursive? #t) ; for lzfse
332 "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
333 (file-name (git-file-name name version))))
334 (build-system cmake-build-system)
336 `(#:tests? #f ; No test suite
338 (modify-phases %standard-phases
339 ;; No 'install' target in CMakeLists.txt
341 (lambda* (#:key outputs #:allow-other-keys)
342 (let* ((out (assoc-ref outputs "out"))
343 (bin (string-append out "/bin"))
344 (lib (string-append out "/lib"))
345 (doc (string-append out "/share/doc/"
346 (string-append ,name "-" ,version))))
347 (install-file "apfs-dump" bin)
348 (install-file "apfs-dump-quick" bin)
349 (install-file "apfs-fuse" bin)
350 (install-file "libapfs.a" lib)
356 (synopsis "Read-only FUSE driver for the APFS file system")
357 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
358 System} (APFS). It is currently in an experimental state — it may not be able
359 to read all files, and it does not support all the compression methods in
361 (home-page "https://github.com/sgan81/apfs-fuse")
362 (license license:gpl2+))))
368 (outputs '("out" "module" "src"))
372 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
373 "/download/zfs-" version
374 "/zfs-" version ".tar.gz"))
377 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
378 (build-system linux-module-build-system)
380 `(;; The ZFS kernel module should not be downloaded since the license
381 ;; terms don't allow for distributing it, only building it locally.
383 ;; Tests cannot run in an unprivileged build environment.
386 (modify-phases %standard-phases
387 (add-after 'configure 'really-configure
388 (lambda* (#:key outputs inputs #:allow-other-keys)
389 (let ((out (assoc-ref outputs "out")))
390 (substitute* "configure"
391 (("-/bin/sh") (string-append "-" (which "sh")))
392 ((" /bin/sh") (string-append " " (which "sh"))))
393 (invoke "./configure"
395 (string-append "--prefix=" out)
396 (string-append "--with-dracutdir=" out "/lib/dracut")
397 (string-append "--with-udevdir=" out "/lib/udev")
398 (string-append "--with-mounthelperdir=" out "/sbin")
399 (string-append "--with-linux="
400 (assoc-ref inputs "linux-module-builder")
401 "/lib/modules/build")))))
402 (add-after 'unpack 'patch-source
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 (let ((out (assoc-ref outputs "out"))
405 (src (assoc-ref outputs "src"))
406 (util-linux (assoc-ref inputs "util-linux"))
407 (nfs-utils (assoc-ref inputs "nfs-utils")))
408 (substitute* "module/zfs/zfs_ctldir.c"
409 (("/usr/bin/env\", \"umount")
410 (string-append util-linux "/bin/umount\", \"-n"))
411 (("/usr/bin/env\", \"mount")
412 (string-append util-linux "/bin/mount\", \"-n")))
413 (substitute* "lib/libzfs/libzfs_mount.c"
414 (("/bin/mount") (string-append util-linux "/bin/mount"))
415 (("/bin/umount") (string-append util-linux "/bin/umount")))
416 (substitute* "lib/libshare/nfs.c"
417 (("/usr/sbin/exportfs")
418 (string-append nfs-utils "/sbin/exportfs")))
419 (substitute* "config/zfs-build.m4"
420 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
421 (substitute* '("etc/zfs/Makefile.am"
422 "cmd/zed/Makefile.am")
423 (("\\$\\(sysconfdir)") (string-append out "/etc")))
424 (substitute* "cmd/vdev_id/vdev_id"
425 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
426 (string-append "PATH="
427 (dirname (which "chmod")) ":"
428 (dirname (which "grep")) ":"
429 (dirname (which "sed")) ":"
430 (dirname (which "gawk")))))
431 (substitute* "contrib/pyzfs/Makefile.in"
432 ((".*install-lib.*") ""))
433 (substitute* '("Makefile.am" "Makefile.in")
434 (("\\$\\(prefix)/src") (string-append src "/src"))))
437 (lambda _ (invoke "make")))
439 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
440 (let* ((out (assoc-ref outputs "out"))
441 (moddir (assoc-ref outputs "module"))
442 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
443 (invoke "make" "install"
444 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
445 (string-append "DEPMOD=" kmod "/bin/depmod")
446 (string-append "INSTALL_PATH=" out)
447 (string-append "INSTALL_MOD_PATH=" moddir)
448 "INSTALL_MOD_STRIP=1")
449 (install-file "contrib/bash_completion.d/zfs"
450 (string-append out "/share/bash-completion/completions"))
451 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
455 ("pkg-config" ,pkg-config)))
459 ("libtirpc" ,libtirpc)
460 ("nfs-utils" ,nfs-utils)
463 ("python-cffi" ,python-cffi)
464 ("util-linux" ,util-linux)
466 (home-page "https://zfsonlinux.org/")
467 (synopsis "Native ZFS on Linux")
469 "ZFS on Linux is an advanced file system and volume manager which was
470 originally developed for Solaris and is now maintained by the OpenZFS
472 (license license:cddl1.0)))