+(define-public autofs
+ (package
+ (name "autofs")
+ (version "5.1.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://kernel.org/linux/daemons/autofs/"
+ "v" (version-major version) "/"
+ "autofs-" version ".tar.xz"))
+ (sha256
+ (base32 "1vya21mb4izj3khcr3flibv7xc15vvx2v0rjfk5yd31qnzcy7pnx"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "--enable-ignore-busy" ; during shutdown
+ "--enable-sloppy-mount" ; support mount(8) -s
+ "--with-libtirpc"
+ (string-append "--with-openldap="
+ (assoc-ref %build-inputs "openldap"))
+ (string-append "--with-sasl="
+ (assoc-ref %build-inputs "cyrus-sasl"))
+ "HAVE_SSS_AUTOFS=1" ; required to make sssldir click
+ (string-append "sssldir="
+ (assoc-ref %build-inputs "sssd")
+ "/lib/sssd/modules"))
+ #:tests? #f ; no test suite
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'fix-hard-coded-search-path
+ (lambda _
+ (substitute* "configure"
+ (("^searchpath=\".*\"")
+ "searchpath=\"$PATH\""))
+ #t))
+ (add-before 'install 'omit-obsolete-lookup_nis.so-link
+ ;; Building lookup_yp.so depends on $(YPCLNT) but this doesn't,
+ ;; leading to a make error. Since it's broken, comment it out.
+ (lambda _
+ (substitute* "modules/Makefile"
+ (("ln -fs lookup_yp.so" match)
+ (string-append "# " match)))
+ #t)))))
+ (native-inputs
+ `(("bison" ,bison)
+ ("flex" ,flex)
+ ("pkg-config" ,pkg-config)
+ ("rpcsvc-proto" ,rpcsvc-proto)))
+ (inputs
+ `(("cyrus-sasl" ,cyrus-sasl)
+ ("e2fsprogs" ,e2fsprogs) ; for e[234]fsck
+ ("libtirpc" ,libtirpc)
+ ("libxml2" ,libxml2) ; needed for LDAP, SASL
+ ("mit-krb5" ,mit-krb5) ; needed for LDAP, SASL
+ ("nfs-utils" ,nfs-utils) ; for mount.nfs
+ ("openldap" ,openldap)
+ ("openssl" ,openssl) ; needed for SASL
+ ("sssd" ,sssd)
+ ("util-linux" ,util-linux))) ; for mount, umount
+ ;; XXX A directory index is the closest thing this has to a home page.
+ (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
+ (synopsis "Kernel-based automounter for Linux")
+ (description
+ "Autofs is a kernel-based automounter for use with the Linux autofs4
+module. It automatically mounts selected file systems when they are used and
+unmounts them after a set period of inactivity. This provides
+centrally-managed, consistent file names for users and applications, even in a
+large and/or frequently changing (network) environment.")
+ ;; fedfs/ is GPL-2-only but not built.
+ (license (list license:bsd-3 ; modules/cyrus-sasl.c
+ license:gpl2+)))) ; the rest
+
+(define-public bindfs
+ (package
+ (name "bindfs")
+ (version "1.14.8")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://bindfs.org/downloads/bindfs-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "15y4brlcrqhxl6z73785m0dr1vp2q3wc6xss08x9jjr0apzmmjp5"))))
+ (build-system gnu-build-system)
+ (arguments
+ ;; XXX: The tests have no hope of passing until there is a "nogroup"
+ ;; entry (or at least some group to which the guix builder does
+ ;; not belong) in the /etc/group file of the build environment.
+ ;; Currently we do not have such a group. Disable tests for now.
+ '(#:tests? #f))
+ (native-inputs
+ ;; Native inputs to run the tests
+ ;; ("ruby" ,ruby)
+ ;; ("valgrind" ,valgrind)
+ ;; ("which" ,which)
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("fuse" ,fuse)))
+ (home-page "https://bindfs.org")
+ (synopsis "Bind mount a directory and alter permission bits")
+ (description
+ "@command{bindfs} is a FUSE filesystem for mounting a directory to
+another location, similar to @command{mount --bind}. It can be used for:
+@itemize
+@item Making a directory read-only.
+@item Making all executables non-executable.
+@item Sharing a directory with a list of users (or groups).
+@item Modifying permission bits using rules with chmod-like syntax.
+@item Changing the permissions with which files are created.
+@end itemize ")
+ (license license:gpl2+)))
+
+(define-public davfs2
+ (package
+ (name "davfs2")
+ (version "1.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://download.savannah.nongnu.org/releases/"
+ "davfs2/davfs2-" version ".tar.gz"))
+ (sha256
+ (base32 "0l1vnv5lfigciwg17p10zxwhzj4qw2d9kw30prr7g4dxhmb6fsrf"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "--sysconfdir=/etc" ; so man pages & binaries contain /etc
+ (string-append "--docdir=" (assoc-ref %outputs "out")
+ "/share/doc/" ,name "-" ,version)
+ (string-append "ssbindir=" (assoc-ref %outputs "out") "/sbin")
+ ;; The default ‘davfs2’ user and group don't exist on most systems.
+ "dav_user=nobody"
+ "dav_group=nogroup")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'omit-redundancy
+ ;; Don't install redundant copies of /etc examples into /share.
+ (lambda _
+ (substitute* "etc/Makefile.in"
+ (("(dist_pkgdata_DATA =.*) davfs2.conf secrets(.*)"
+ _ prefix suffix)
+ (string-append prefix suffix)))
+ #t))
+ (add-after 'unpack 'patch-file-names
+ (lambda _
+ ;; Don't auto-load the FUSE kernel module. That's up to root.
+ ;; XXX If/when we restore the previous behaviour, make sure not
+ ;; to introduce a security hole when mount.davfs is setuid.
+ (substitute* "src/kernel_interface.c"
+ (("/sbin/modprobe") "/modprobe/disabled"))
+ #t))
+ (replace 'install
+ (lambda* (#:key make-flags outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (apply invoke "make" "install"
+ (string-append "pkgsysconfdir=" out "/etc")
+ make-flags)))))))
+ (inputs
+ `(("neon" ,neon)
+
+ ;; Neon requires but doesn't propagate zlib, nor would we want that.
+ ;; XZ as well, but that's already present in the build environment.
+ ("zlib" ,zlib)))
+ (home-page "https://savannah.nongnu.org/projects/davfs2")
+ (synopsis "Mount remote WebDAV resources in the local file system")
+ (description
+ "The @acronym{WebDAV, Web Distributed Authoring and Versioning} extension
+to the HTTP protocol defines a standard way to author resources on a remote Web
+server. Davfs2 exposes such resources as a typical filesystem which can be used
+by standard applications with no built-in support for WebDAV, such as the GNU
+coreutils (@command{cp}, @command{mv}, etc.) or a graphical word processor.
+
+Davfs2 works with most WebDAV servers with no or little configuration. It
+supports TLS (HTTPS), HTTP proxies, HTTP basic and digest authentication, and
+client certificates. It performs extensive caching to avoid unnecessary network
+traffic, stay responsive even over slow or unreliable connections, and prevent
+data loss. It aims to make use by unprivileged users as easy and secure as
+possible.
+
+However, davfs2 is not a full-featured WebDAV client. The file system interface
+and the WebDAV protocol are quite different. Translating between the two is not
+always possible.")
+ (license (list license:bsd-2 ; src/fuse_kernel.h
+ license:gpl3+)))) ; everything else
+
+(define-public fsarchiver
+ (package
+ (name "fsarchiver")
+ (version "0.8.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/fdupoux/fsarchiver")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1rvwq5v3rl14bqxjm1ibfapyicf0sa44nw7451v10kx39lp56ylp"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("pkg-config" ,pkg-config)))
+ (inputs
+ `(("bzip2" ,bzip2)
+ ("e2fsprogs" ,e2fsprogs)
+ ("libgcrypt" ,libgcrypt)
+ ("lz4" ,lz4)
+ ("lzo" ,lzo)
+ ("util-linux" ,util-linux "lib")
+ ("xz" ,xz)
+ ("zlib" ,zlib)
+ ("zstd:lib" ,zstd "lib")))
+ (synopsis "File system back-up, deployment, and migration tool")
+ (description
+ "FSArchiver saves the contents of a file system to a compressed archive
+file, and restores it to a different file system and/or partition. This
+partition can be of a different size than the original and FSArchiver will
+create a new file system if none exists.
+
+All standard file attributes supported by the kernel are preserved, including
+file permissions, timestamps, symbolic and hard links, and extended attributes.
+
+Each file in the archive is protected by a checksum. If part of the archive
+is corrupted you'll lose the affected file(s) but not the whole back-up.")
+ (home-page "https://www.fsarchiver.org/")
+ (license license:gpl2)))
+
+(define-public gphotofs
+ (package
+ (name "gphotofs")
+ (version "0.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "mirror://sourceforge/gphoto/gphotofs/" version
+ "/gphotofs-0.5.tar.gz"))
+ (sha256
+ (base32
+ "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("fuse" ,fuse)
+ ("glib" ,glib)
+ ("libgphoto2" ,libgphoto2)))
+ (synopsis "Virtual file system for libgphoto2 using FUSE")
+ (description "GPhotoFS is a FUSE file system module to mount your camera as
+a file system on Linux. This allow using your camera with any tool able to read
+from a mounted file system.")
+ (home-page "http://www.gphoto.org/proj/gphotofs/")
+ (license license:gpl2+)))
+
+(define-public bcachefs-tools
+ (let ((commit "db931a4571817d7d61be6bce306f1d42f7cd3398")
+ (revision "2"))
+ (package
+ (name "bcachefs-tools")
+ (version (git-version "0.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://evilpiepirate.org/git/bcachefs-tools.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1zl8lda6ni6rhsmsng6smrcjihy2irjf03h1m7nvkqmkhq44j80s"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list ,(string-append "VERSION=" version) ; bogus vX.Y-nogit otherwise
+ (string-append "PREFIX=" (assoc-ref %outputs "out"))
+ "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
+ "CC=gcc"
+ "PYTEST=pytest")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (add-after 'install 'promote-mount.bcachefs.sh
+ ;; XXX The (optional) mount.bcachefs helper requires rust:cargo.
+ ;; This alternative shell script does the job well enough for now.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (with-directory-excursion (string-append out "/sbin")
+ (rename-file "mount.bcachefs.sh" "mount.bcachefs")
+ ;; WRAP-SCRIPT causes bogus ‘Insufficient arguments’ errors.
+ (wrap-program "mount.bcachefs"
+ `("PATH" ":" prefix
+ ,(cons (string-append out "/sbin")
+ (map (lambda (input)
+ (string-append (assoc-ref inputs input)
+ "/bin"))
+ (list "coreutils"
+ "gawk"
+ "util-linux"))))))))))
+ #:tests? #f)) ; XXX 6 valgrind tests fail
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+
+ ;; For tests.
+ ("python-pytest" ,python-pytest)
+ ("valgrind" ,valgrind)))
+ (inputs
+ `(("eudev" ,eudev)
+ ("keyutils" ,keyutils)
+ ("libaio" ,libaio)
+ ("libscrypt" ,libscrypt)
+ ("libsodium" ,libsodium)
+ ("liburcu" ,liburcu)
+ ("util-linux:lib" ,util-linux "lib") ; lib{blkid,uuid}
+ ("lz4" ,lz4)
+ ("zlib" ,zlib)
+ ("zstd:lib" ,zstd "lib")
+
+ ;; Only for mount.bcachefs.sh.
+ ("coreutils" ,coreutils-minimal)
+ ("gawk" ,gawk)
+ ("util-linux" ,util-linux)))
+ (home-page "https://bcachefs.org/")
+ (synopsis "Tools to create and manage bcachefs file systems")
+ (description
+ "The bcachefs-tools are command-line utilities for creating, checking,
+and otherwise managing bcachefs file systems.
+
+Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
+encryption, compression, snapshots, and (meta)data checksums. It can use
+multiple block devices for replication and/or performance, similar to RAID.
+
+In addition, bcachefs provides all the functionality of bcache, a block-layer
+caching system, and lets you assign different roles to each device based on its
+performance and other characteristics.")
+ (license license:gpl2+))))
+
+(define-public bcachefs-tools/static
+ (package
+ (inherit bcachefs-tools)
+ (name "bcachefs-tools-static")
+ (arguments
+ (substitute-keyword-arguments (package-arguments bcachefs-tools)
+ ((#:make-flags make-flags)
+ `(append ,make-flags
+ (list "LDFLAGS=-static")))))
+ (inputs
+ `(("eudev:static" ,eudev "static")
+ ("libscrypt:static" ,libscrypt "static")
+ ("lz4:static" ,lz4 "static")
+ ("util-linux:static" ,util-linux "static") ; lib{blkid,uuid}
+ ("zlib" ,zlib "static")
+ ("zstd:static" ,zstd "static")
+ ,@(package-inputs bcachefs-tools)))))
+
+(define-public bcachefs/static
+ (package
+ (name "bcachefs-static")
+ (version (package-version bcachefs-tools))
+ (build-system trivial-build-system)
+ (source #f)
+ (inputs
+ `(("bcachefs-tools" ,bcachefs-tools/static)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils)
+ (ice-9 ftw)
+ (srfi srfi-26))
+ (let* ((bcachefs-tools (assoc-ref %build-inputs "bcachefs-tools"))
+ (out (assoc-ref %outputs "out")))
+ (mkdir-p out)
+ (with-directory-excursion out
+ (install-file (string-append bcachefs-tools
+ "/sbin/bcachefs")
+ "sbin")
+ (remove-store-references "sbin/bcachefs")
+ (invoke "sbin/bcachefs" "version") ; test suite
+ #t)))))
+ (home-page (package-home-page bcachefs-tools))
+ (synopsis "Statically-linked bcachefs command from bcachefs-tools")
+ (description "This package provides the statically-linked @command{bcachefs}
+from the bcachefs-tools package. It is meant to be used in initrds.")
+ (license (package-license bcachefs-tools))))
+
+(define-public exfatprogs
+ (package
+ (name "exfatprogs")
+ (version "1.0.4")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/exfatprogs/exfatprogs")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1braffz1wc4ki3nb42q85l5zg2dl2hwjr64rk27nc85wcsrbavnl"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "--disable-static")))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)
+ ("pkg-config" ,pkg-config)))
+ (home-page "https://github.com/exfatprogs/exfatprogs")
+ (synopsis "Tools to create, check, and repair exFAT file systems")
+ (description
+ "These are command-line user space tools for the @acronym{exFAT,
+Extensible File Allocation Table} file systems. Included are
+@command{mkfs.exfat} to create (format) new exFAT file systems, and
+@command{fsck.exfat} to check their consistency and repair them.")
+ (license license:gpl2+)))
+