1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2020 Eric Bavier <bavier@posteo.net>
3 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
11 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
13 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
14 ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
15 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
16 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
18 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
19 ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
20 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
21 ;;; Copyright © 2021 Timothy Sample <samplet@ngyro.com>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages backup)
39 #:use-module (guix packages)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix git-download)
42 #:use-module (guix download)
43 #:use-module (guix utils)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system go)
47 #:use-module (guix build-system python)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages acl)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages base)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages crypto)
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages datastructures)
57 #:use-module (gnu packages dbm)
58 #:use-module (gnu packages dejagnu)
59 #:use-module (gnu packages ftp)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnupg)
63 #:use-module (gnu packages golang)
64 #:use-module (gnu packages gperf)
65 #:use-module (gnu packages guile)
66 #:use-module (gnu packages guile-xyz)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages mcrypt)
69 #:use-module (gnu packages ncurses)
70 #:use-module (gnu packages nettle)
71 #:use-module (gnu packages onc-rpc)
72 #:use-module (gnu packages pcre)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages protobuf)
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages python-crypto)
78 #:use-module (gnu packages python-web)
79 #:use-module (gnu packages python-xyz)
80 #:use-module (gnu packages rsync)
81 #:use-module (gnu packages ssh)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages xml))
85 (define-public duplicity
92 (uri (string-append "https://code.launchpad.net/duplicity/"
93 (version-major+minor version)
94 "-series/" version "/+download/duplicity-"
97 (base32 "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2"))))
98 (build-system python-build-system)
100 `(("gettext" ,gettext-minimal) ; for msgfmt
101 ("util-linux" ,util-linux) ; setsid command, for the tests
102 ("par2cmdline" ,par2cmdline)
103 ("python-fasteners" ,python-fasteners)
104 ("python-future" ,python-future) ; for tests
105 ("python-pexpect" ,python-pexpect)
106 ("python-pytest" ,python-pytest)
107 ("python-pytest-runner" ,python-pytest-runner)
108 ("python-setuptools-scm" ,python-setuptools-scm)
109 ("tzdata" ,tzdata-for-tests)
110 ("mock" ,python-mock)))
112 `(("lockfile" ,python-lockfile)
113 ("urllib3" ,python-urllib3)))
115 `(("librsync" ,librsync)
117 ("gnupg" ,gnupg) ; gpg executable needed
118 ("util-linux" ,util-linux))) ; for setsid
120 `(#:test-target "test"
122 (modify-phases %standard-phases
123 (add-before 'build 'use-store-file-names
124 (lambda* (#:key inputs #:allow-other-keys)
125 (substitute* "duplicity/gpginterface.py"
126 (("self.call = u'gpg'")
127 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
129 (substitute* '("testing/functional/__init__.py"
130 "testing/overrides/bin/lftp")
131 (("/bin/sh") (which "sh")))
133 (add-before 'check 'check-setup
134 (lambda* (#:key inputs #:allow-other-keys)
135 (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME
136 (setenv "TZDIR" ; some timestamp checks need TZDIR
137 (string-append (assoc-ref inputs "tzdata")
140 (home-page "http://duplicity.nongnu.org/index.html")
141 (synopsis "Encrypted backup using rsync algorithm")
143 "Duplicity backs up directories by producing encrypted tar-format volumes
144 and uploading them to a remote or local file server. Because duplicity uses
145 librsync, the incremental archives are space efficient and only record the
146 parts of files that have changed since the last backup. Because duplicity
147 uses GnuPG to encrypt and/or sign these archives, they will be safe from
148 spying and/or modification by the server.")
149 (license license:gpl2+)))
151 (define-public par2cmdline
158 (url "https://github.com/Parchive/par2cmdline")
159 (commit (string-append "v" version))))
160 (file-name (git-file-name name version))
163 "11mx8q29cr0sryd11awab7y4mhqgbamb1ss77rffjj6in8pb4hdk"))))
165 `(("automake" ,automake)
166 ("autoconf" ,autoconf)))
167 (build-system gnu-build-system)
168 (synopsis "File verification and repair tools")
169 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
170 generate and verify PAR2 recovery files. These files can be distributed
171 alongside the source files or stored together with back-ups to protect against
172 transmission errors or @dfn{bit rot}, the degradation of storage media over
174 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
175 damage isn't too extensive (and smaller than the size of the recovery file), it
176 can even repair them.")
177 (home-page "https://github.com/Parchive/par2cmdline")
178 (license license:gpl3+)))
187 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
190 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
191 (build-system gnu-build-system)
192 (native-inputs `(("pkg-config" ,pkg-config)))
202 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
204 (home-page (string-append "http://web.archive.org/web/20150925223424/"
205 "http://archive.miek.nl/projects/hdup/index.html"))
206 (synopsis "Simple incremental backup tool")
208 "Hdup2 is a backup utility, its aim is to make backup really simple. The
209 backup scheduling is done by means of a cron job. It supports an
210 include/exclude mechanism, remote backups, encrypted backups and split
211 backups (called chunks) to allow easy burning to CD/DVD.")
212 (license license:gpl2)))
214 (define-public libarchive
221 (uri (list (string-append "https://libarchive.org/downloads/libarchive-"
223 (string-append "https://github.com/libarchive/libarchive"
224 "/releases/download/v" version "/libarchive-"
228 "18dd01ahs2hv74xm7axjc3yhq839p0x0s4vssvlmm8fknja09qfq"))))
229 (build-system gnu-build-system)
237 ("zstd" ,zstd "lib")))
239 `(#:configure-flags '("--disable-static")
241 (modify-phases %standard-phases
242 (add-before 'build 'patch-pwd
244 (substitute* "Makefile"
245 (("/bin/pwd") (which "pwd")))
248 (lambda* (#:key (tests? #t) #:allow-other-keys)
250 ;; XXX: The test_owner_parse, test_read_disk, and
251 ;; test_write_disk_lookup tests expect user 'root' to
252 ;; exist, but the chroot's /etc/passwd doesn't have
253 ;; it. Turn off those tests.
255 ;; XXX: Adjust test that fails with zstd 1.4.1
256 ;; because the default options compresses two bytes
257 ;; better than this test expects.
258 ;; https://github.com/libarchive/libarchive/issues/1226
260 (substitute* "libarchive/test/test_write_filter_zstd.c"
261 (("compression-level\", \"6\"")
262 "compression-level\", \"7\""))
264 ;; The tests allow one to disable tests matching a globbing pattern.
270 ;; XXX: This glob disables too much.
271 (invoke "./libarchive_test" "^test_*_disk*")
272 (invoke "./bsdcpio_test" "^test_owner_parse")
273 (invoke "./bsdtar_test"))
274 ;; Tests may be disabled if cross-compiling.
275 (format #t "Test suite not run.~%"))))
276 (add-after 'install 'add--L-in-libarchive-pc
277 (lambda* (#:key inputs outputs #:allow-other-keys)
278 (let* ((out (assoc-ref outputs "out"))
279 (lib (string-append out "/lib"))
280 (nettle (assoc-ref inputs "nettle"))
281 (libxml2 (assoc-ref inputs "libxml2"))
282 (xz (assoc-ref inputs "xz"))
283 (zlib (assoc-ref inputs "zlib"))
284 (zstd (assoc-ref inputs "zstd"))
285 (bzip2 (assoc-ref inputs "bzip2")))
286 ;; Embed absolute references to these inputs to avoid propagation.
287 (substitute* (list (string-append lib "/pkgconfig/libarchive.pc")
288 (string-append lib "/libarchive.la"))
290 (string-append "-L" nettle "/lib -lnettle"))
292 (string-append "-L" libxml2 "/lib -lxml2"))
294 (string-append "-L" xz "/lib -llzma"))
296 (string-append "-L" zlib "/lib -lz"))
298 (string-append "-L" zstd "/lib -lzstd"))
300 (string-append "-L" bzip2 "/lib -lbz2")))
302 (home-page "https://libarchive.org/")
303 (synopsis "Multi-format archive and compression library")
305 "Libarchive provides a flexible interface for reading and writing
306 archives in various formats such as tar and cpio. Libarchive also supports
307 reading and writing archives compressed using various compression filters such
308 as gzip and bzip2. The library is inherently stream-oriented; readers
309 serially iterate through the archive, writers serially add things to the
310 archive. In particular, note that there is currently no built-in support for
311 random access nor for in-place modification.")
312 (license license:bsd-2)))
322 (url "https://github.com/miekg/rdup")
324 (file-name (git-file-name name version))
326 (base32 "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw"))))
327 (build-system gnu-build-system)
329 `(("autoconf" ,autoconf)
330 ("automake" ,automake)
331 ("pkg-config" ,pkg-config)
334 ("dejagnu" ,dejagnu)))
336 ;; XXX Compiling with nettle (encryption) support requires patching out
337 ;; -Werror from GNUmakefile.in. Then, rdup-tr-{en,de}crypt tests fail:
338 ;; free(): invalid pointer
339 ;; ** rdup-tr: SIGPIPE received, exiting
342 ("libarchive" ,libarchive)
345 `(#:parallel-build? #f ;race conditions
347 (modify-phases %standard-phases
348 (add-before 'build 'qualify-inputs
349 (lambda* (#:key inputs #:allow-other-keys)
350 ;; This script is full of pitfalls. Fix some that particularly
351 ;; affect Guix users & leave the rest as reader excercises.
352 (substitute* "rdup-simple"
353 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
354 (("([' ])mcrypt " all delimiter)
355 (string-append delimiter (which "mcrypt") " "))
356 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
357 (("which") "command -v"))
359 (add-before 'check 'disable-encryption-tests
361 (for-each delete-file
362 (list "testsuite/rdup/rdup.rdup-tr-crypt.exp"
363 "testsuite/rdup/rdup.rdup-tr-decrypt.exp"
364 "testsuite/rdup/rdup.rdup-tr-encrypt.exp"))
366 (add-before 'check 'pre-check
368 (setenv "HOME" (getcwd))
369 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
370 (("/bin/cat") (which "cat")))
372 (home-page "https://github.com/miekg/rdup")
373 (synopsis "Provide a list of files to backup")
375 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
376 Rdup itself does not backup anything, it only print a list of absolute
377 file names to standard output. Auxiliary scripts are needed that act on this
378 list and implement the backup strategy.")
379 (license license:gpl3+)))
388 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
389 "btar-" version ".tar.gz"))
392 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
393 (build-system gnu-build-system)
395 `(("librsync" ,librsync-0.9)))
397 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
398 ,(string-append "CC=" ,(cc-for-target)))
399 #:tests? #f ;test input not distributed
401 ;; no configure phase
402 (modify-phases %standard-phases
403 (delete 'configure))))
404 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
405 (synopsis "Tar-compatible archiver")
407 "Btar is a tar-compatible archiver which allows arbitrary compression and
408 ciphering, redundancy, differential backup, indexed extraction, multicore
409 compression, input and output serialisation, and tolerance to partial archive
411 (license license:gpl3+)))
413 (define-public rdiff-backup
415 (name "rdiff-backup")
420 (uri (string-append "https://github.com/rdiff-backup/rdiff-backup/releases/"
421 "download/v" version "/rdiff-backup-" version ".tar.gz"))
423 (base32 "11rvjcp77zwgkphz1kyf5yqgr3rlss7dm9xzmvpvc4lp99xq7drb"))))
424 (build-system python-build-system)
426 `(("python-setuptools-scm" ,python-setuptools-scm)))
429 ("librsync" ,librsync)))
431 `(#:tests? #f)) ; Tests require root/sudo
432 (home-page "https://rdiff-backup.net/")
433 (synopsis "Local/remote mirroring+incremental backup")
435 "Rdiff-backup backs up one directory to another, possibly over a network.
436 The target directory ends up a copy of the source directory, but extra reverse
437 diffs are stored in a special subdirectory of that target directory, so you
438 can still recover files lost some time ago. The idea is to combine the best
439 features of a mirror and an incremental backup. Rdiff-backup also preserves
440 subdirectories, hard links, dev files, permissions, uid/gid ownership,
441 modification times, extended attributes, acls, and resource forks. Also,
442 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
443 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
444 to a remote location, and only the differences will be transmitted. Finally,
445 rdiff-backup is easy to use and settings have sensible defaults.")
446 (license license:gpl2+)))
448 (define-public rsnapshot
456 "https://github.com/rsnapshot/rsnapshot/releases/download/"
457 version "/rsnapshot-" version ".tar.gz"))
459 (base32 "1lavqmmsf53pim0nvming7fkng6p0nk2a51k2c2jdq0l7snpl31b"))))
460 (build-system gnu-build-system)
463 (modify-phases %standard-phases
466 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
467 "t/backup_exec/conf/backup_exec_fail.conf"
468 "t/backup_exec/conf/backup_exec.conf")
469 (("/bin/true") (which "true"))
470 (("/bin/false") (which "false")))
472 ;; Disable a test that tries to connect to localhost on port 22.
473 (delete-file "t/ssh_args/ssh_args.t.in")
475 (invoke "make" "test"))))))
479 (home-page "https://rsnapshot.org")
480 (synopsis "Deduplicating snapshot backup utility based on rsync")
481 (description "rsnapshot is a file system snapshot utility based on rsync.
482 rsnapshot makes it easy to make periodic snapshots of local machines, and
483 remote machines over SSH. To reduce the disk space required for each backup,
484 rsnapshot uses hard links to deduplicate identical files.")
485 (license license:gpl2+)))
487 (define-public libchop
493 (uri (string-append "mirror://savannah/libchop/libchop-"
497 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
498 (patches (search-patches "diffutils-gets-undeclared.patch"))
499 (modules '((guix build utils)))
502 ;; Include all the libtirpc headers necessary to get the
503 ;; definitions of 'u_int', etc.
504 (substitute* '("src/block-server.c"
505 "include/chop/block-server.h"
506 "utils/chop-block-server.c")
507 (("#include <rpc/(.*)\\.h>" _ header)
508 (string-append "#include <rpc/types.h>\n"
509 "#include <rpc/rpc.h>\n"
510 "#include <rpc/" header ".h>\n")))
512 (build-system gnu-build-system)
514 '(;; Link against libtirpc.
515 #:configure-flags '("LDFLAGS=-ltirpc -Wl,--as-needed")
517 #:phases (modify-phases %standard-phases
518 (add-before 'configure 'adjust-configure-script
520 ;; Mimic upstream commit
521 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
522 (substitute* "configure"
523 (("GUILE=(.*)--variable bindir`" _ middle)
524 (string-append "GUILE=" middle
525 "--variable bindir`/guile")))
527 (add-before 'build 'set-libtirpc-include-path
528 (lambda* (#:key inputs #:allow-other-keys)
529 ;; Allow <rpc/rpc.h> & co. to be found.
530 (let ((libtirpc (assoc-ref inputs "libtirpc")))
532 (string-append (getenv "CPATH")
536 (add-before 'check 'skip-test
538 ;; XXX: This test fails (1) because current GnuTLS no
539 ;; longer supports OpenPGP authentication, and (2) for
540 ;; some obscure reason. Better skip it.
541 (setenv "XFAIL_TESTS" "utils/block-server")
544 `(("guile" ,guile-2.0)
545 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
546 ("pkg-config" ,pkg-config)
547 ("rpcsvc-proto" ,rpcsvc-proto))) ;for 'rpcgen'
549 `(("guile" ,guile-2.0)
550 ("util-linux" ,util-linux)
551 ("libtirpc" ,libtirpc)
556 ("libgcrypt" ,libgcrypt)
560 (home-page "https://nongnu.org/libchop/")
561 (synopsis "Tools & library for data backup and distributed storage")
563 "Libchop is a set of utilities and library for data backup and
564 distributed storage. Its main application is @command{chop-backup}, an
565 encrypted backup program that supports data integrity checks, versioning,
566 distribution among several sites, selective sharing of stored data, adaptive
567 compression, and more. The library itself implements storage techniques such
568 as content-addressable storage, content hash keys, Merkle trees, similarity
569 detection, and lossless compression.")
570 (license license:gpl3+)))
579 (uri (pypi-uri "borgbackup" version))
581 (base32 "0l1dqfwrd9l34rg30cmzmq5bs6yha6kg4vy313jq611jsqj94mmw"))
582 (modules '((guix build utils)))
585 ;; Delete files generated by Cython. We used to have a regex
586 ;; that created the list of generated files but Borg has
587 ;; added new non-generated C files that cause the regex to
588 ;; generate the wrong list.
589 (for-each delete-file
590 '("src/borg/algorithms/checksums.c"
591 "src/borg/algorithms/msgpack/_packer.cpp"
592 "src/borg/algorithms/msgpack/_unpacker.cpp"
594 "src/borg/compress.c"
595 "src/borg/crypto/low_level.c"
596 "src/borg/hashindex.c"
598 "src/borg/platform/darwin.c"
599 "src/borg/platform/freebsd.c"
600 "src/borg/platform/linux.c"
601 "src/borg/platform/posix.c"
602 "src/borg/platform/syncfilerange.c"))
603 ;; Remove bundled shared libraries.
604 (with-directory-excursion "src/borg/algorithms"
605 (for-each delete-file-recursively
606 (list "blake2" "lz4" "msgpack" "zstd")))
607 ;; Purge some msgpack references from setup.py or the resulting
608 ;; sources will be unbuildable.
609 (substitute* "setup.py"
610 ((".*Extension\\('borg\\.algorithms\\.msgpack\\..*") "")
611 (("msgpack_packer_source, msgpack_unpacker_source") ""))
613 (build-system python-build-system)
615 `(#:modules ((srfi srfi-26) ; for cut
617 (guix build python-build-system))
619 (modify-phases %standard-phases
620 (add-after 'unpack 'set-env
621 (lambda* (#:key inputs #:allow-other-keys)
622 (let ((openssl (assoc-ref inputs "openssl"))
623 (libb2 (assoc-ref inputs "libb2"))
624 (lz4 (assoc-ref inputs "lz4"))
625 (zstd (assoc-ref inputs "zstd")))
626 (setenv "BORG_OPENSSL_PREFIX" openssl)
627 (setenv "BORG_LIBB2_PREFIX" libb2)
628 (setenv "BORG_LIBLZ4_PREFIX" lz4)
629 (setenv "BORG_LIBZSTD_PREFIX" zstd)
630 (setenv "PYTHON_EGG_CACHE" "/tmp")
631 ;; The test 'test_return_codes[python]' fails when
632 ;; HOME=/homeless-shelter.
633 (setenv "HOME" "/tmp")
635 (add-after 'unpack 'use-system-msgpack
637 (substitute* "src/borg/helpers.py"
638 (("prefer_system_msgpack = False")
639 "prefer_system_msgpack = True"))
641 ;; The tests need to be run after Borg is installed.
643 (add-after 'install 'check
644 (lambda* (#:key inputs outputs #:allow-other-keys)
645 ;; Make the installed package available for the test suite.
646 (add-installed-pythonpath inputs outputs)
647 ;; The tests should be run in an empty directory.
649 (with-directory-excursion "tests"
650 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
652 ;; These tests need to write to '/var'.
653 "not test_get_cache_dir "
654 "and not test_get_config_dir "
655 "and not test_get_keys_dir "
656 "and not test_get_security_dir "
657 ;; These tests assume there is a root user in
659 "and not test_access_acl "
660 "and not test_default_acl "
661 "and not test_non_ascii_acl "
662 "and not test_create_stdin "
663 ;; This test needs the unpackaged pytest-benchmark.
665 ;; These tests assume the kernel supports FUSE.
667 "and not test_fuse_allow_damaged_files "
668 "and not test_mount_hardlinks "
669 "and not test_readonly_mount ")))))
670 (add-after 'install 'install-doc
671 (lambda* (#:key inputs outputs #:allow-other-keys)
672 (let* ((out (assoc-ref outputs "out"))
673 (man (string-append out "/share/man/man1"))
674 (misc (string-append out "/share/borg/misc")))
675 (for-each (cut install-file <> misc)
676 '("docs/misc/create_chunker-params.txt"
677 "docs/misc/internals-picture.txt"
678 "docs/misc/prune-example.txt"))
679 (copy-recursively "docs/man" man)
681 (add-after 'install-docs 'install-shell-completions
682 (lambda* (#:key outputs #:allow-other-keys)
683 (let* ((out (assoc-ref outputs "out"))
684 (etc (string-append out "/etc"))
685 (share (string-append out "/share")))
686 (with-directory-excursion "scripts/shell_completions"
687 (install-file "bash/borg"
688 (string-append etc "/bash_completion.d"))
689 (install-file "zsh/_borg"
690 (string-append share "/zsh/site-functions"))
691 (install-file "fish/borg.fish"
692 (string-append share "/fish/vendor_completions.d")))
695 `(("python-cython" ,python-cython)
696 ("python-setuptools-scm" ,python-setuptools-scm)
697 ("python-pytest" ,python-pytest)))
703 ("python-llfuse" ,python-llfuse)
704 ;; The Python msgpack library changed its name so Borg requires this
705 ;; transitional package for now:
706 ;; <https://bugs.gnu.org/30662>
707 ("python-msgpack" ,python-msgpack-transitional)
708 ("zstd" ,zstd "lib")))
709 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
710 (description "Borg is a deduplicating backup program. Optionally, it
711 supports compression and authenticated encryption. The main goal of Borg is to
712 provide an efficient and secure way to backup data. The data deduplication
713 technique used makes Borg suitable for daily backups since only changes are
714 stored. The authenticated encryption technique makes it suitable for backups
715 to not fully trusted targets. Borg is a fork of Attic.")
716 (home-page "https://www.borgbackup.org/")
717 (license license:bsd-3)))
719 (define-public wimlib
725 (uri (string-append "https://wimlib.net/downloads/"
726 "wimlib-" version ".tar.gz"))
729 "04ny5s5z05gk6davbwkjkraan781k2xzw6kjwp75h6ncv45dv1sb"))))
730 (build-system gnu-build-system)
732 `(("pkg-config" ,pkg-config)))
737 ("openssl" ,openssl)))
740 (list "--disable-static"
741 "--enable-test-support")))
742 (home-page "https://wimlib.net/")
743 (synopsis "WIM file manipulation library and utilities")
744 (description "wimlib is a C library and set of command-line utilities for
745 creating, modifying, extracting, and mounting archives in the Windows Imaging
746 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
747 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
748 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
749 ;; LGPL, except those files explicitly marked as being released into the
750 ;; public domain (CC0) in their headers.
751 (license (list license:gpl3+
755 (define-public dirvish
759 (build-system gnu-build-system)
763 "http://dirvish.org/dirvish-" version ".tgz"))
766 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
768 `(#:modules ((ice-9 match) (ice-9 rdelim)
769 ,@%gnu-build-system-modules)
771 ;; This mostly mirrors the steps taken in the install.sh that ships
772 ;; with dirvish, but simplified because we aren't prompting interactively
773 (modify-phases %standard-phases
778 (lambda* (#:key inputs outputs #:allow-other-keys)
779 ;; These are mostly the same steps the install.sh that comes with
781 (let* (;; Files we'll be copying
783 '("dirvish" "dirvish-runall"
784 "dirvish-expire" "dirvish-locate"))
786 '(("dirvish" "8") ("dirvish-runall" "8")
787 ("dirvish-expire" "8") ("dirvish-locate" "8")
788 ("dirvish.conf" "5")))
791 (assoc-ref outputs "out"))
793 ;; Just a default... not so useful on guixsd though
794 ;; You probably want to a service with file(s) to point to.
795 (confdir "/etc/dirvish")
797 (perl (string-append (assoc-ref %build-inputs "perl")
799 (loadconfig.pl (call-with-input-file "loadconfig.pl"
803 (define (write-pl filename)
805 (string-append "#!" perl "\n\n"
806 "$CONFDIR = \"" confdir "\";\n\n"))
807 (define input-file-location
808 (string-append filename ".pl"))
809 (define target-file-location
810 (string-append output-dir "/bin/" filename ".pl"))
811 (define text-to-write
812 (string-append pl-header
813 (call-with-input-file input-file-location
816 (with-output-to-file target-file-location
818 (display text-to-write)))
819 (chmod target-file-location #o755)
820 (wrap-program target-file-location
821 `("PERL5LIB" ":" prefix
822 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
823 "/lib/perl5/site_perl"))
824 '("perl-libtime-period"
825 "perl-libtime-parsedate")))))
831 (string-append file-base "." man-num))
833 (string-append output-dir
834 "/share/man/man" man-num
836 (copy-file filename output-path)))))
839 (mkdir-p (string-append output-dir "/bin/"))
840 (mkdir-p (string-append output-dir "/share/man/man8/"))
841 (mkdir-p (string-append output-dir "/share/man/man5/"))
843 ;; Write out executables
844 (for-each write-pl executables)
845 ;; Write out man pages
846 (for-each write-man man-pages)
851 ("perl-libtime-period" ,perl-libtime-period)
852 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
853 (home-page "http://dirvish.org/")
854 (synopsis "Fast, disk based, rotating network backup system")
856 "With dirvish you can maintain a set of complete images of your
857 file systems with unattended creation and expiration. A dirvish backup vault
858 is like a time machine for your data. ")
859 (license (license:fsf-free "file://COPYING"
860 "Open Software License 2.0"))))
862 (define-public restic
866 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
871 "https://github.com/restic/restic/releases/download/"
872 "v" version "/restic-" version ".tar.gz"))
873 (file-name (string-append name "-" version ".tar.gz"))
876 "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
877 (build-system go-build-system)
879 `(#:import-path "github.com/restic/restic"
880 ;; We don't need to install the source code for end-user applications.
883 (modify-phases %standard-phases
885 (lambda* (#:key inputs #:allow-other-keys)
886 (with-directory-excursion "src/github.com/restic/restic"
887 ;; Disable 'restic self-update'. It makes little sense in Guix.
888 (substitute* "build.go" (("selfupdate") ""))
889 (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build
890 (invoke "go" "run" "build.go"))))
894 (with-directory-excursion "src/github.com/restic/restic"
895 ;; Disable FUSE tests.
896 (setenv "RESTIC_TEST_FUSE" "0")
897 (invoke "go" "run" "build.go" "--test"))))
900 (lambda* (#:key outputs #:allow-other-keys)
901 (let ((out (assoc-ref outputs "out"))
902 (src "src/github.com/restic/restic"))
903 (install-file (string-append src "/restic")
904 (string-append out "/bin"))
907 (add-after 'install 'install-docs
908 (lambda* (#:key outputs #:allow-other-keys)
909 (let* ((out (assoc-ref outputs "out"))
911 (man-section (string-append man "/man"))
912 (src "src/github.com/restic/restic/doc/man/"))
913 ;; Install all the man pages to "out".
917 (string-append out man-section
918 (string-take-right file 1))))
919 (find-files src "\\.[1-9]"))
922 (add-after 'install-docs 'install-shell-completion
923 (lambda* (#:key outputs #:allow-other-keys)
924 (let* ((out (assoc-ref outputs "out"))
925 (bin (string-append out "/bin"))
926 (etc (string-append out "/etc"))
927 (share (string-append out "/share")))
930 (let* ((shell-name (symbol->string shell))
931 (dir (string-append "etc/completion/" shell-name)))
933 (invoke (string-append bin "/restic") "generate"
934 (string-append "--" shell-name "-completion")
935 (string-append dir "/"
938 ((zsh) "_restic"))))))
940 (with-directory-excursion "etc/completion"
941 (install-file "bash/restic"
942 (string-append etc "/bash_completion.d"))
943 (install-file "zsh/_restic"
944 (string-append share "/zsh/site-functions")))
946 (home-page "https://restic.net/")
947 (synopsis "Backup program with multiple revisions, encryption and more")
948 (description "Restic is a program that does backups right and was designed
949 with the following principles in mind:
952 @item Easy: Doing backups should be a frictionless process, otherwise you
953 might be tempted to skip it. Restic should be easy to configure and use, so
954 that, in the event of a data loss, you can just restore it. Likewise,
955 restoring data should not be complicated.
957 @item Fast: Backing up your data with restic should only be limited by your
958 network or hard disk bandwidth so that you can backup your files every day.
959 Nobody does backups if it takes too much time. Restoring backups should only
960 transfer data that is needed for the files that are to be restored, so that
961 this process is also fast.
963 @item Verifiable: Much more important than backup is restore, so restic
964 enables you to easily verify that all data can be restored. @item Secure:
965 Restic uses cryptography to guarantee confidentiality and integrity of your
966 data. The location the backup data is stored is assumed not to be a trusted
967 environment (e.g. a shared space where others like system administrators are
968 able to access your backups). Restic is built to secure your data against
971 @item Efficient: With the growth of data, additional snapshots should only
972 take the storage of the actual increment. Even more, duplicate data should be
973 de-duplicated before it is actually written to the storage back end to save
974 precious backup space.
976 (license license:bsd-2)))
978 (define-public zbackup
986 (url "https://github.com/zbackup/zbackup")
988 (file-name (git-file-name name version))
990 (base32 "14l1kyxg7pccpax3d6qcpmdycb70kn3fxp1a59w64hqy2493hngl"))))
991 (build-system cmake-build-system)
993 `(#:tests? #f)) ;no test
996 ("libressl" ,libressl)
997 ("protobuf" ,protobuf)
1000 (home-page "http://zbackup.org")
1001 (synopsis "Versatile deduplicating backup tool")
1003 "ZBackup is a globally-deduplicating backup tool, based on the
1004 ideas found in Rsync. Feed a large @file{.tar} into it, and it will
1005 store duplicate regions of it only once, then compress and optionally
1006 encrypt the result. Feed another @file{.tar} file, and it will also
1007 re-use any data found in any previous backups. This way only new
1008 changes are stored, and as long as the files are not very different,
1009 the amount of storage required is very low. Any of the backup files
1010 stored previously can be read back in full at any time. The program
1011 is format-agnostic, so you can feed virtually any files to it.")
1012 (license license:gpl2+)))
1021 (uri (string-append "mirror://sourceforge/dump/dump/"
1022 version "/dump-" version ".tar.gz"))
1025 "1l2gzzxyqhinx1yqvj4yn9k8vx3iyqi1965dxf9kvvdv9zgaq8fh"))))
1026 (build-system gnu-build-system)
1029 `("--sysconfdir=/etc"
1030 "--disable-readline"
1033 `(("pkg-config" ,pkg-config)))
1035 `(("openssl" ,openssl)
1037 ("util-linux" ,util-linux "lib")
1038 ("e2fsprogs" ,e2fsprogs)))
1039 (home-page "https://dump.sourceforge.io/")
1040 (synopsis "Ext2/3/4 file system dump/restore utilities")
1041 (description "Dump examines files in a file system, determines which ones
1042 need to be backed up, and copies those files to a specified disk, tape or
1043 other storage medium. Subsequent incremental backups can then be layered on
1044 top of the full backup. The restore command performs the inverse function of
1045 dump; it can restore a full backup of a file system. Single files and
1046 directory subtrees may also be restored from full or partial backups in
1048 (license license:bsd-3)))
1058 (url "https://github.com/grke/burp")
1061 (base32 "0m0s6rrgxn3l6bad45vyhks6iz6bwvd0f3rzdsc7l28gar79wsj6"))
1062 (file-name (git-file-name name version))))
1063 (build-system gnu-build-system)
1066 (modify-phases %standard-phases
1067 (add-before 'check 'extend-test-time-outs
1068 ;; The defaults are far too low for busy boxes & spinning storage.
1070 (substitute* (find-files "utest" "\\.c$")
1071 (("(tcase_set_timeout\\(tc_core,)[ 0-9]*(\\);.*)$" _ prefix suffix)
1072 (string-append prefix " 3600" suffix "\n")))
1076 ("librsync" ,librsync)
1077 ("ncurses" ,ncurses) ; for the live status monitor
1078 ("openssl" ,openssl)
1082 `(("autoconf" ,autoconf)
1083 ("automake" ,automake)
1084 ("check" ,check-0.14)
1085 ("pkg-config" ,pkg-config)))
1086 (home-page "https://burp.grke.org")
1087 (synopsis "Differential backup and restore")
1088 (description "Burp is a network backup and restore program. It attempts
1089 to reduce network traffic and the amount of space that is used by each
1091 (license license:agpl3)))
1093 (define-public disarchive
1099 (uri (string-append "https://files.ngyro.com/disarchive/"
1100 "disarchive-" version ".tar.gz"))
1103 "12d4r4i7vi8fxilr2aww6kzq56jax5ymhjfm3cpgx26vj4c70kb6"))))
1104 (build-system gnu-build-system)
1106 `(("autoconf" ,autoconf)
1107 ("automake" ,automake)
1108 ("pkg-config" ,pkg-config)
1109 ("guile-quickcheck" ,guile-quickcheck)))
1111 `(("guile" ,guile-3.0)
1114 `(("guile-gcrypt" ,guile-gcrypt)))
1115 (home-page "https://ngyro.com/software/disarchive.html")
1116 (synopsis "Software archive disassembler")
1117 (description "Disarchive can disassemble software archives into data
1118 and metadata. The goal is to create a small amount of metadata that
1119 can be used to recreate a software archive bit-for-bit from the
1120 original files. For example, a software archive made using tar and
1121 Gzip will need to describe the order of files in the tarball and the
1122 compression parameters used by Gzip.")
1123 (license license:gpl3+)))