1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017, 2018, 2019 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 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 Ricardo Wurmus <rekado@elephly.net>
15 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages backup)
33 #:use-module (guix packages)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix git-download)
36 #:use-module (guix download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system go)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages acl)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages base)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages crypto)
48 #:use-module (gnu packages databases)
49 #:use-module (gnu packages datastructures)
50 #:use-module (gnu packages dbm)
51 #:use-module (gnu packages dejagnu)
52 #:use-module (gnu packages ftp)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gnupg)
55 #:use-module (gnu packages golang)
56 #:use-module (gnu packages gperf)
57 #:use-module (gnu packages guile)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages mcrypt)
60 #:use-module (gnu packages nettle)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages python-crypto)
66 #:use-module (gnu packages python-web)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages rsync)
69 #:use-module (gnu packages ssh)
70 #:use-module (gnu packages tls)
71 #:use-module (gnu packages xml))
73 (define-public duplicity
80 (uri (string-append "https://code.launchpad.net/duplicity/"
81 (version-major+minor version)
82 "-series/" version "/+download/duplicity-"
85 (base32 "0j37dgyji36hvb5dbzlmh5rj83jwhni02yq16g6rd3hj8f7qhdn2"))))
86 (build-system python-build-system)
88 `(("util-linux" ,util-linux) ; setsid command, for the tests
89 ("par2cmdline" ,par2cmdline)
90 ("python-pexpect" ,python2-pexpect)
91 ("python-fasteners" ,python2-fasteners)
92 ("mock" ,python2-mock)))
94 `(("lockfile" ,python2-lockfile)
95 ("urllib3" ,python2-urllib3)))
97 `(("librsync" ,librsync-0.9)
99 ("gnupg" ,gnupg) ; gpg executable needed
100 ("util-linux" ,util-linux) ; for setsid
103 `(#:python ,python-2 ; setup assumes Python 2
106 (modify-phases %standard-phases
107 (add-before 'build 'use-store-file-names
108 (lambda* (#:key inputs #:allow-other-keys)
109 (substitute* "duplicity/gpginterface.py"
110 (("self.call = 'gpg'")
111 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
113 (substitute* '("testing/functional/__init__.py"
114 "testing/overrides/bin/lftp")
115 (("/bin/sh") (which "sh")))
117 (add-before 'check 'check-setup
118 (lambda* (#:key inputs #:allow-other-keys)
119 (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME
120 (setenv "TZDIR" ; some timestamp checks need TZDIR
121 (string-append (assoc-ref inputs "tzdata")
124 (home-page "http://duplicity.nongnu.org/index.html")
125 (synopsis "Encrypted backup using rsync algorithm")
127 "Duplicity backs up directories by producing encrypted tar-format volumes
128 and uploading them to a remote or local file server. Because duplicity uses
129 librsync, the incremental archives are space efficient and only record the
130 parts of files that have changed since the last backup. Because duplicity
131 uses GnuPG to encrypt and/or sign these archives, they will be safe from
132 spying and/or modification by the server.")
133 (license license:gpl2+)))
135 (define-public par2cmdline
142 (url "https://github.com/Parchive/par2cmdline.git")
143 (commit (string-append "v" version))))
144 (file-name (git-file-name name version))
147 "0f1jsd5sw2wynjzi7yjqjaf13yhyjfdid91p8yh0jn32y03kjyrz"))))
149 `(("automake" ,automake)
150 ("autoconf" ,autoconf)))
151 (build-system gnu-build-system)
152 (synopsis "File verification and repair tools")
153 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
154 generate and verify PAR2 recovery files. These files can be distributed
155 alongside the source files or stored together with back-ups to protect against
156 transmission errors or @dfn{bit rot}, the degradation of storage media over
158 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
159 damage isn't too extensive (and smaller than the size of the recovery file), it
160 can even repair them.")
161 (home-page "https://github.com/Parchive/par2cmdline")
162 (license license:gpl3+)))
171 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
174 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
175 (build-system gnu-build-system)
176 (native-inputs `(("pkg-config" ,pkg-config)))
186 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
188 (home-page "http://archive.miek.nl/projects/hdup/index.html")
189 (synopsis "Simple incremental backup tool")
191 "Hdup2 is a backup utility, its aim is to make backup really simple. The
192 backup scheduling is done by means of a cron job. It supports an
193 include/exclude mechanism, remote backups, encrypted backups and split
194 backups (called chunks) to allow easy burning to CD/DVD.")
195 (license license:gpl2)))
197 (define-public libarchive
200 (replacement libarchive-3.3.3)
205 (uri (string-append "https://libarchive.org/downloads/libarchive-"
207 (patches (search-patches "libarchive-CVE-2017-14166.patch"
208 "libarchive-CVE-2017-14502.patch"))
211 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
212 (build-system gnu-build-system)
222 (modify-phases %standard-phases
223 (add-before 'build 'patch-pwd
225 (substitute* "Makefile"
226 (("/bin/pwd") (which "pwd")))
230 ;; XXX: The test_owner_parse, test_read_disk, and
231 ;; test_write_disk_lookup tests expect user 'root' to exist, but
232 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
234 ;; The tests allow one to disable tests matching a globbing pattern.
235 (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
236 ;; XXX: This glob disables too much.
237 (invoke "./libarchive_test" "^test_*_disk*")
238 (invoke "./bsdcpio_test" "^test_owner_parse")
239 (invoke "./bsdtar_test")))
240 (add-after 'install 'add--L-in-libarchive-pc
241 (lambda* (#:key inputs outputs #:allow-other-keys)
242 (let* ((out (assoc-ref outputs "out"))
243 (lib (string-append out "/lib"))
244 (nettle (assoc-ref inputs "nettle"))
245 (libxml2 (assoc-ref inputs "libxml2"))
246 (xz (assoc-ref inputs "xz"))
247 (zlib (assoc-ref inputs "zlib"))
248 (bzip2 (assoc-ref inputs "bzip2")))
249 (substitute* (string-append lib "/pkgconfig/libarchive.pc")
251 (string-append "-L" nettle "/lib -lnettle"))
253 (string-append "-L" libxml2 "/lib -lxml2"))
255 (string-append "-L" xz "/lib -llzma"))
257 (string-append "-L" zlib "/lib -lz"))
259 (string-append "-L" bzip2 "/lib -lbz2")))
262 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
263 ;; compiled with C99 or C11 or a gnu variant.
264 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
265 (home-page "https://libarchive.org/")
266 (synopsis "Multi-format archive and compression library")
268 "Libarchive provides a flexible interface for reading and writing
269 archives in various formats such as tar and cpio. Libarchive also supports
270 reading and writing archives compressed using various compression filters such
271 as gzip and bzip2. The library is inherently stream-oriented; readers
272 serially iterate through the archive, writers serially add things to the
273 archive. In particular, note that there is currently no built-in support for
274 random access nor for in-place modification.")
275 (license license:bsd-2)))
277 (define-public libarchive-3.3.3
284 (uri (string-append "https://libarchive.org/downloads/libarchive-"
286 (patches (search-patches "libarchive-CVE-2018-1000877.patch"
287 "libarchive-CVE-2018-1000878.patch"
288 "libarchive-CVE-2018-1000880.patch"))
291 "0bhfncid058p7n1n8v29l6wxm3mhdqfassscihbsxfwz3iwb2zms"))))))
300 (file-name (string-append name "-" version ".tar.gz"))
301 (uri (string-append "https://github.com/miekg/rdup/archive/"
305 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
306 (build-system gnu-build-system)
308 `(("autoconf" ,autoconf)
309 ("automake" ,automake)
310 ("pkg-config" ,pkg-config)
313 ("dejagnu" ,dejagnu)))
317 ("libarchive" ,libarchive)
321 `(#:parallel-build? #f ;race conditions
323 (modify-phases %standard-phases
324 (add-before 'build 'qualify-inputs
325 (lambda* (#:key inputs #:allow-other-keys)
326 ;; This script is full of pitfalls. Fix some that particularly
327 ;; affect Guix users & leave the rest as reader excercises.
328 (substitute* "rdup-simple"
329 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
330 (("([' ])mcrypt " all delimiter)
331 (string-append delimiter (which "mcrypt") " "))
332 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
333 (("which") "command -v"))
335 (add-before 'check 'pre-check
337 (setenv "HOME" (getcwd))
338 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
339 (("/bin/cat") (which "cat")))
341 (home-page "https://github.com/miekg/rdup")
342 (synopsis "Provide a list of files to backup")
344 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
345 Rdup itself does not backup anything, it only print a list of absolute
346 file names to standard output. Auxiliary scripts are needed that act on this
347 list and implement the backup strategy.")
348 (license license:gpl3+)))
357 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
358 "btar-" version ".tar.gz"))
361 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
362 (build-system gnu-build-system)
364 `(("librsync" ,librsync-0.9)))
366 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
368 #:tests? #f ;test input not distributed
370 ;; no configure phase
371 (modify-phases %standard-phases
372 (delete 'configure))))
373 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
374 (synopsis "Tar-compatible archiver")
376 "Btar is a tar-compatible archiver which allows arbitrary compression and
377 ciphering, redundancy, differential backup, indexed extraction, multicore
378 compression, input and output serialisation, and tolerance to partial archive
380 (license license:gpl3+)))
382 (define-public rdiff-backup
384 (name "rdiff-backup")
389 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
393 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
394 (build-system python-build-system)
396 `(("python" ,python-2)
397 ("librsync" ,librsync-0.9)))
401 (home-page "https://www.nongnu.org/rdiff-backup/")
402 (synopsis "Local/remote mirroring+incremental backup")
404 "Rdiff-backup backs up one directory to another, possibly over a network.
405 The target directory ends up a copy of the source directory, but extra reverse
406 diffs are stored in a special subdirectory of that target directory, so you
407 can still recover files lost some time ago. The idea is to combine the best
408 features of a mirror and an incremental backup. Rdiff-backup also preserves
409 subdirectories, hard links, dev files, permissions, uid/gid ownership,
410 modification times, extended attributes, acls, and resource forks. Also,
411 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
412 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
413 to a remote location, and only the differences will be transmitted. Finally,
414 rdiff-backup is easy to use and settings have sensible defaults.")
415 (license license:gpl2+)))
417 (define-public rsnapshot
425 "https://github.com/rsnapshot/rsnapshot/releases/download/"
426 version "/rsnapshot-" version ".tar.gz"))
429 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
430 (build-system gnu-build-system)
433 (modify-phases %standard-phases
436 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
437 "t/backup_exec/conf/backup_exec_fail.conf"
438 "t/backup_exec/conf/backup_exec.conf")
439 (("/bin/true") (which "true"))
440 (("/bin/false") (which "false")))
441 (invoke "make" "test"))))))
445 (home-page "http://rsnapshot.org")
446 (synopsis "Deduplicating snapshot backup utility based on rsync")
447 (description "rsnapshot is a file system snapshot utility based on rsync.
448 rsnapshot makes it easy to make periodic snapshots of local machines, and
449 remote machines over SSH. To reduce the disk space required for each backup,
450 rsnapshot uses hard links to deduplicate identical files.")
451 (license license:gpl2+)))
453 (define-public libchop
459 (uri (string-append "mirror://savannah/libchop/libchop-"
463 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
464 (patches (search-patches "diffutils-gets-undeclared.patch"))))
465 (build-system gnu-build-system)
467 '(#:phases (modify-phases %standard-phases
468 (add-before 'configure 'adjust-configure-script
470 ;; Mimic upstream commit
471 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
472 (substitute* "configure"
473 (("GUILE=(.*)--variable bindir`" _ middle)
474 (string-append "GUILE=" middle
475 "--variable bindir`/guile")))
477 (add-before 'check 'skip-test
479 ;; XXX: This test fails (1) because current GnuTLS no
480 ;; longer supports OpenPGP authentication, and (2) for
481 ;; some obscure reason. Better skip it.
482 (setenv "XFAIL_TESTS" "utils/block-server")
485 `(("guile" ,guile-2.0)
486 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
487 ("pkg-config" ,pkg-config)))
489 `(("guile" ,guile-2.0)
490 ("util-linux" ,util-linux)
495 ("libgcrypt" ,libgcrypt)
499 (home-page "https://nongnu.org/libchop/")
500 (synopsis "Tools & library for data backup and distributed storage")
502 "Libchop is a set of utilities and library for data backup and
503 distributed storage. Its main application is @command{chop-backup}, an
504 encrypted backup program that supports data integrity checks, versioning,
505 distribution among several sites, selective sharing of stored data, adaptive
506 compression, and more. The library itself implements storage techniques such
507 as content-addressable storage, content hash keys, Merkle trees, similarity
508 detection, and lossless compression.")
509 (license license:gpl3+)))
518 (uri (pypi-uri "borgbackup" version))
521 "0x95nhv4h34m8cxycbwc4xdz350saaxlgh727b23bgn4ci7gh3vx"))
522 (modules '((guix build utils)))
525 ;; Delete files generated by Cython. We used to have a regex
526 ;; that created the list of generated files but Borg has
527 ;; added new non-generated C files that cause the regex to
528 ;; generate the wrong list.
529 (for-each delete-file
530 '("src/borg/algorithms/checksums.c"
532 "src/borg/compress.c"
533 "src/borg/crypto/low_level.c"
534 "src/borg/hashindex.c"
536 "src/borg/platform/darwin.c"
537 "src/borg/platform/freebsd.c"
538 "src/borg/platform/linux.c"
539 "src/borg/platform/posix.c"))
540 ;; Remove bundled shared libraries.
541 (with-directory-excursion "src/borg/algorithms"
542 (for-each delete-file-recursively
543 (list "blake2" "lz4" "zstd")))
545 (build-system python-build-system)
547 `(#:modules ((srfi srfi-26) ; for cut
549 (guix build python-build-system))
551 (modify-phases %standard-phases
552 (add-after 'unpack 'set-env
553 (lambda* (#:key inputs #:allow-other-keys)
554 (let ((openssl (assoc-ref inputs "openssl"))
555 (libb2 (assoc-ref inputs "libb2"))
556 (lz4 (assoc-ref inputs "lz4"))
557 (zstd (assoc-ref inputs "zstd")))
558 (setenv "BORG_OPENSSL_PREFIX" openssl)
559 (setenv "BORG_LIBB2_PREFIX" libb2)
560 (setenv "BORG_LIBLZ4_PREFIX" lz4)
561 (setenv "BORG_LIBZSTD_PREFIX" zstd)
562 (setenv "PYTHON_EGG_CACHE" "/tmp")
563 ;; The test 'test_return_codes[python]' fails when
564 ;; HOME=/homeless-shelter.
565 (setenv "HOME" "/tmp")
567 ;; The tests need to be run after Borg is installed.
569 (add-after 'install 'check
570 (lambda* (#:key inputs outputs #:allow-other-keys)
571 ;; Make the installed package available for the test suite.
572 (add-installed-pythonpath inputs outputs)
573 ;; The tests should be run in an empty directory.
575 (with-directory-excursion "tests"
576 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
578 ;; These tests need to write to '/var'.
579 "not test_get_cache_dir "
580 "and not test_get_config_dir "
581 "and not test_get_keys_dir "
582 "and not test_get_security_dir "
583 ;; These tests assume there is a root user in
585 "and not test_access_acl "
586 "and not test_default_acl "
587 "and not test_non_ascii_acl "
588 ;; This test needs the unpackaged pytest-benchmark.
590 ;; These tests assume the kernel supports FUSE.
592 "and not test_fuse_allow_damaged_files "
593 "and not test_mount_hardlinks")))))
594 (add-after 'install 'install-doc
595 (lambda* (#:key inputs outputs #:allow-other-keys)
596 (let* ((out (assoc-ref outputs "out"))
597 (man (string-append out "/share/man/man1"))
598 (misc (string-append out "/share/borg/misc")))
599 (for-each (cut install-file <> misc)
600 '("docs/misc/create_chunker-params.txt"
601 "docs/misc/internals-picture.txt"
602 "docs/misc/prune-example.txt"))
603 (copy-recursively "docs/man" man)
606 `(("python-cython" ,python-cython)
607 ("python-setuptools-scm" ,python-setuptools-scm)
608 ("python-pytest" ,python-pytest)))
614 ("python-llfuse" ,python-llfuse)
615 ;; The Python msgpack library changed its name so Borg requires this
616 ;; transitional package for now:
617 ;; <https://bugs.gnu.org/30662>
618 ("python-msgpack" ,python-msgpack-transitional)
620 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
621 (description "Borg is a deduplicating backup program. Optionally, it
622 supports compression and authenticated encryption. The main goal of Borg is to
623 provide an efficient and secure way to backup data. The data deduplication
624 technique used makes Borg suitable for daily backups since only changes are
625 stored. The authenticated encryption technique makes it suitable for backups
626 to not fully trusted targets. Borg is a fork of Attic.")
627 (home-page "https://www.borgbackup.org/")
628 (license license:bsd-3)))
636 (uri (pypi-uri "Attic" version))
639 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
640 (build-system python-build-system)
642 `(;; The tests assume they are run as root:
643 ;; https://github.com/jborg/attic/issues/7
646 (modify-phases %standard-phases
648 'build 'set-openssl-prefix
649 (lambda* (#:key inputs #:allow-other-keys)
650 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
655 ("python-msgpack" ,python-msgpack)
657 ;; Attic is probably incompatible with llfuse > 0.41.
658 ;; These links are to discussions of llfuse compatibility from
659 ;; the borg project. Borg is a recent fork of attic, and attic
660 ;; has not been updated since the fork, so it's likely that
661 ;; llfuse compatibility requirements are still the same.
662 ;; https://github.com/borgbackup/borg/issues/642
663 ;; https://github.com/borgbackup/borg/issues/643
664 ("python-llfuse" ,python-llfuse-0.41)))
665 (synopsis "Deduplicating backup program")
666 (description "Attic is a deduplicating backup program. The main goal of
667 Attic is to provide an efficient and secure way to backup data. The data
668 deduplication technique used makes Attic suitable for daily backups since only
669 changes are stored.")
670 (home-page "https://attic-backup.org/")
671 (license license:bsd-3)
672 (properties `((superseded . ,borg)))))
674 (define-public wimlib
680 (uri (string-append "https://wimlib.net/downloads/"
681 "wimlib-" version ".tar.gz"))
684 "02wpsxjlw9vysj6x6q7kmvbcdkpvdzw201mmj5x0q670mapjrnai"))))
685 (build-system gnu-build-system)
687 `(("pkg-config" ,pkg-config)))
692 ("openssl" ,openssl)))
694 `(#:configure-flags (list "--enable-test-support")))
695 (home-page "https://wimlib.net/")
696 (synopsis "WIM file manipulation library and utilities")
697 (description "wimlib is a C library and set of command-line utilities for
698 creating, modifying, extracting, and mounting archives in the Windows Imaging
699 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
700 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
701 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
702 ;; LGPL, except those files explicitly marked as being released into the
703 ;; public domain (CC0) in their headers.
704 (license (list license:gpl3+
716 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
717 version ".orig.tar.xz"))
720 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
721 (build-system python-build-system)
725 (modify-phases %standard-phases
728 (substitute* "obnamlib/vfs_local_tests.py"
729 ;; Check for the nobody user instead of root.
730 (("self.fs.get_username\\(0\\), 'root'")
731 "self.fs.get_username(65534), 'nobody'")
732 ;; Disable tests checking for root group.
733 (("self.fs.get_groupname\\(0\\)") "'root'"))
734 (substitute* "obnamlib/vfs_local.py"
735 ;; Don't cover get_groupname function.
736 (("def get_groupname\\(self, gid\\):")
737 "def get_groupname(self, gid): # pragma: no cover"))
738 ;; Can't run network tests.
739 (invoke "./check" "--unit-tests"))))))
741 `(("python2-cliapp" ,python2-cliapp)
742 ("python2-larch" ,python2-larch)
743 ("python2-paramiko" ,python2-paramiko)
744 ("python2-pyaml" ,python2-pyaml)
745 ("python2-tracing" ,python2-tracing)
746 ("python2-ttystatus" ,python2-ttystatus)))
749 ("python2-coverage" ,python2-coverage)
750 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
751 ("python2-pep8" ,python2-pep8)
752 ("python2-pylint" ,python2-pylint)))
753 (home-page "https://obnam.org/")
754 (synopsis "Retired backup program")
756 "Warning: @uref{https://blog.liw.fi/posts/2017/08/13/retiring_obnam/,
757 the Obnam project is retired}. You should use another backup solution instead.
759 Obnam was an easy, secure backup program. Features included snapshot backups,
760 data de-duplication and encrypted backups using GnuPG. Backups can be stored on
761 local hard disks, or online via the SSH SFTP protocol. The backup server, if
762 used, does not require any special software, on top of SSH.")
763 (license license:gpl3+)))
765 (define-public dirvish
769 (build-system gnu-build-system)
773 "http://dirvish.org/dirvish-" version ".tgz"))
776 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
778 `(#:modules ((ice-9 match) (ice-9 rdelim)
779 ,@%gnu-build-system-modules)
781 ;; This mostly mirrors the steps taken in the install.sh that ships
782 ;; with dirvish, but simplified because we aren't prompting interactively
783 (modify-phases %standard-phases
788 (lambda* (#:key inputs outputs #:allow-other-keys)
789 ;; These are mostly the same steps the install.sh that comes with
791 (let* (;; Files we'll be copying
793 '("dirvish" "dirvish-runall"
794 "dirvish-expire" "dirvish-locate"))
796 '(("dirvish" "8") ("dirvish-runall" "8")
797 ("dirvish-expire" "8") ("dirvish-locate" "8")
798 ("dirvish.conf" "5")))
801 (assoc-ref outputs "out"))
803 ;; Just a default... not so useful on guixsd though
804 ;; You probably want to a service with file(s) to point to.
805 (confdir "/etc/dirvish")
807 (perl (string-append (assoc-ref %build-inputs "perl")
809 (loadconfig.pl (call-with-input-file "loadconfig.pl"
813 (define (write-pl filename)
815 (string-append "#!" perl "\n\n"
816 "$CONFDIR = \"" confdir "\";\n\n"))
817 (define input-file-location
818 (string-append filename ".pl"))
819 (define target-file-location
820 (string-append output-dir "/bin/" filename ".pl"))
821 (define text-to-write
822 (string-append pl-header
823 (call-with-input-file input-file-location
826 (with-output-to-file target-file-location
828 (display text-to-write)))
829 (chmod target-file-location #o755)
830 (wrap-program target-file-location
831 `("PERL5LIB" ":" prefix
832 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
833 "/lib/perl5/site_perl"))
834 '("perl-libtime-period"
835 "perl-libtime-parsedate")))))
841 (string-append file-base "." man-num))
843 (string-append output-dir
844 "/share/man/man" man-num
846 (copy-file filename output-path)))))
849 (mkdir-p (string-append output-dir "/bin/"))
850 (mkdir-p (string-append output-dir "/share/man/man8/"))
851 (mkdir-p (string-append output-dir "/share/man/man5/"))
853 ;; Write out executables
854 (for-each write-pl executables)
855 ;; Write out man pages
856 (for-each write-man man-pages)
861 ("perl-libtime-period" ,perl-libtime-period)
862 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
863 (home-page "http://dirvish.org/")
864 (synopsis "Fast, disk based, rotating network backup system")
866 "With dirvish you can maintain a set of complete images of your
867 file systems with unattended creation and expiration. A dirvish backup vault
868 is like a time machine for your data. ")
869 (license (license:fsf-free "file://COPYING"
870 "Open Software License 2.0"))))
872 (define-public restic
876 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
881 "https://github.com/restic/restic/releases/download/"
882 "v" version "/restic-" version ".tar.gz"))
883 (file-name (string-append name "-" version ".tar.gz"))
886 "13ksprq1ia86px8x4lqrmx0l6y9rb1ppg8pnp7lcx0zxnq7skp67"))))
887 (build-system go-build-system)
889 `(#:import-path "github.com/restic/restic"
890 ;; We don't need to install the source code for end-user applications.
893 (modify-phases %standard-phases
895 (lambda* (#:key inputs #:allow-other-keys)
896 (with-directory-excursion "src/github.com/restic/restic"
897 ;; Disable 'restic self-update'. It makes little sense in Guix.
898 (substitute* "build.go" (("selfupdate") ""))
899 (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build
900 (invoke "go" "run" "build.go"))))
904 (with-directory-excursion "src/github.com/restic/restic"
905 ;; Disable FUSE tests.
906 (setenv "RESTIC_TEST_FUSE" "0")
907 (invoke "go" "run" "build.go" "--test"))))
910 (lambda* (#:key outputs #:allow-other-keys)
911 (let ((out (assoc-ref outputs "out"))
912 (src "src/github.com/restic/restic"))
913 (install-file (string-append src "/restic")
914 (string-append out "/bin"))
917 (add-after 'install 'install-docs
918 (lambda* (#:key outputs #:allow-other-keys)
919 (let* ((out (assoc-ref outputs "out"))
921 (man-section (string-append man "/man"))
922 (src "src/github.com/restic/restic/doc/man/"))
923 ;; Install all the man pages to "out".
927 (string-append out man-section
928 (string-take-right file 1))))
929 (find-files src "\\.[1-9]"))
932 (add-after 'install-docs 'install-shell-completion
933 (lambda* (#:key outputs #:allow-other-keys)
934 (let* ((out (assoc-ref outputs "out"))
935 (bin (string-append out "/bin"))
936 (etc (string-append out "/etc"))
937 (share (string-append out "/share")))
940 (let* ((shell-name (symbol->string shell))
941 (dir (string-append "etc/completion/" shell-name)))
943 (invoke (string-append bin "/restic") "generate"
944 (string-append "--" shell-name "-completion")
945 (string-append dir "/"
948 ((zsh) "_restic"))))))
950 (with-directory-excursion "etc/completion"
951 (install-file "bash/restic"
952 (string-append etc "/bash_completion.d"))
953 (install-file "zsh/_restic"
954 (string-append share "/zsh/site-functions")))
956 (home-page "https://restic.net/")
957 (synopsis "Backup program with multiple revisions, encryption and more")
958 (description "Restic is a program that does backups right and was designed
959 with the following principles in mind:
962 @item Easy: Doing backups should be a frictionless process, otherwise you
963 might be tempted to skip it. Restic should be easy to configure and use, so
964 that, in the event of a data loss, you can just restore it. Likewise,
965 restoring data should not be complicated.
967 @item Fast: Backing up your data with restic should only be limited by your
968 network or hard disk bandwidth so that you can backup your files every day.
969 Nobody does backups if it takes too much time. Restoring backups should only
970 transfer data that is needed for the files that are to be restored, so that
971 this process is also fast.
973 @item Verifiable: Much more important than backup is restore, so restic
974 enables you to easily verify that all data can be restored. @item Secure:
975 Restic uses cryptography to guarantee confidentiality and integrity of your
976 data. The location the backup data is stored is assumed not to be a trusted
977 environment (e.g. a shared space where others like system administrators are
978 able to access your backups). Restic is built to secure your data against
981 @item Efficient: With the growth of data, additional snapshots should only
982 take the storage of the actual increment. Even more, duplicate data should be
983 de-duplicated before it is actually written to the storage back end to save
984 precious backup space.
986 (license license:bsd-2)))
994 (uri (string-append "mirror://sourceforge/burp/burp-" version
995 "/burp-" version ".tar.bz2"))
998 "101nn30apcbmy9k0wksdf8d4ccw7sfcqzkasgg17a5y332x2imr9"))))
999 (build-system gnu-build-system)
1001 `(("librsync" ,librsync)
1002 ("openssl" ,openssl)
1007 ("pkg-config" ,pkg-config)))
1008 (home-page "https://burp.grke.org")
1009 (synopsis "Differential backup and restore")
1010 (description "Burp is a network backup and restore program. It attempts
1011 to reduce network traffic and the amount of space that is used by each
1013 (license license:agpl3)))