gnu: quilt: Update to 0.66.
[jackhill/guix/guix.git] / gnu / packages / backup.scm
CommitLineData
d1a5439b 1;;; GNU Guix --- Functional package management for GNU
aa90f2cd 2;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
29a7c98a 3;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
d265169b 4;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
fb6112e9 5;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
0da4f365 6;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
a2fa9c3d 7;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
3c8ba11a 8;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
4ac8d486 9;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
0ff4425c 10;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
44dd001d 11;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
1a3aa5ba 12;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
f77886c1 13;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
1e957fab 14;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
c824dedf 15;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
d1a5439b
EB
16;;;
17;;; This file is part of GNU Guix.
18;;;
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.
23;;;
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.
28;;;
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/>.
31
32(define-module (gnu packages backup)
33 #:use-module (guix packages)
b5b73a82 34 #:use-module ((guix licenses) #:prefix license:)
5cdbdc2b 35 #:use-module (guix git-download)
d1a5439b 36 #:use-module (guix download)
29a7c98a 37 #:use-module (guix utils)
2d762953 38 #:use-module (guix build-system gnu)
f77886c1 39 #:use-module (guix build-system go)
d1a5439b
EB
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages)
0c146750 42 #:use-module (gnu packages acl)
f6875394 43 #:use-module (gnu packages autotools)
2d762953 44 #:use-module (gnu packages base)
ac257f12 45 #:use-module (gnu packages check)
2d762953 46 #:use-module (gnu packages compression)
19278d8d 47 #:use-module (gnu packages crypto)
362f496d 48 #:use-module (gnu packages databases)
7b9b203a 49 #:use-module (gnu packages datastructures)
255d1bbe 50 #:use-module (gnu packages dbm)
d42e6122 51 #:use-module (gnu packages dejagnu)
2903ee1e 52 #:use-module (gnu packages ftp)
2d762953 53 #:use-module (gnu packages glib)
d1a5439b 54 #:use-module (gnu packages gnupg)
f77886c1 55 #:use-module (gnu packages golang)
362f496d
LC
56 #:use-module (gnu packages gperf)
57 #:use-module (gnu packages guile)
335bc683 58 #:use-module (gnu packages linux)
2d762953 59 #:use-module (gnu packages mcrypt)
d42e6122
EB
60 #:use-module (gnu packages nettle)
61 #:use-module (gnu packages pcre)
0da4f365 62 #:use-module (gnu packages perl)
2d762953 63 #:use-module (gnu packages pkg-config)
0c146750 64 #:use-module (gnu packages python)
cc6f4912 65 #:use-module (gnu packages python-crypto)
1b2f753d 66 #:use-module (gnu packages python-web)
44d10b1f 67 #:use-module (gnu packages python-xyz)
d1a5439b 68 #:use-module (gnu packages rsync)
2d762953 69 #:use-module (gnu packages ssh)
0c146750 70 #:use-module (gnu packages tls)
29a7c98a 71 #:use-module (gnu packages xml))
d1a5439b
EB
72
73(define-public duplicity
74 (package
75 (name "duplicity")
2188eb76 76 (version "0.7.18.2")
d1a5439b
EB
77 (source
78 (origin
79 (method url-fetch)
80 (uri (string-append "https://code.launchpad.net/duplicity/"
29a7c98a 81 (version-major+minor version)
d1a5439b
EB
82 "-series/" version "/+download/duplicity-"
83 version ".tar.gz"))
84 (sha256
2188eb76 85 (base32 "0j37dgyji36hvb5dbzlmh5rj83jwhni02yq16g6rd3hj8f7qhdn2"))))
d1a5439b
EB
86 (build-system python-build-system)
87 (native-inputs
02489a66 88 `(("util-linux" ,util-linux) ; setsid command, for the tests
8ef8de79 89 ("par2cmdline" ,par2cmdline)
2903ee1e 90 ("python-pexpect" ,python2-pexpect)
2dfb9bbf 91 ("python-fasteners" ,python2-fasteners)
2903ee1e
TD
92 ("mock" ,python2-mock)))
93 (propagated-inputs
94 `(("lockfile" ,python2-lockfile)
95 ("urllib3" ,python2-urllib3)))
d1a5439b 96 (inputs
584dbd85 97 `(("librsync" ,librsync-0.9)
2903ee1e 98 ("lftp" ,lftp)
02489a66
TGR
99 ("gnupg" ,gnupg) ; gpg executable needed
100 ("util-linux" ,util-linux) ; for setsid
335bc683 101 ("tzdata" ,tzdata)))
d1a5439b 102 (arguments
02489a66 103 `(#:python ,python-2 ; setup assumes Python 2
d1a5439b 104 #:test-target "test"
ad04bd6b
MB
105 #:phases
106 (modify-phases %standard-phases
7bb7920f 107 (add-before 'build 'use-store-file-names
ad04bd6b 108 (lambda* (#:key inputs #:allow-other-keys)
8ef8de79
MB
109 (substitute* "duplicity/gpginterface.py"
110 (("self.call = 'gpg'")
111 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
e61f092c 112
8ef8de79
MB
113 (substitute* '("testing/functional/__init__.py"
114 "testing/overrides/bin/lftp")
ad04bd6b 115 (("/bin/sh") (which "sh")))
8ef8de79
MB
116 #t))
117 (add-before 'check 'check-setup
118 (lambda* (#:key inputs #:allow-other-keys)
02489a66
TGR
119 (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME
120 (setenv "TZDIR" ; some timestamp checks need TZDIR
ad04bd6b
MB
121 (string-append (assoc-ref inputs "tzdata")
122 "/share/zoneinfo"))
123 #t)))))
d1a5439b
EB
124 (home-page "http://duplicity.nongnu.org/index.html")
125 (synopsis "Encrypted backup using rsync algorithm")
126 (description
127 "Duplicity backs up directories by producing encrypted tar-format volumes
128and uploading them to a remote or local file server. Because duplicity uses
129librsync, the incremental archives are space efficient and only record the
130parts of files that have changed since the last backup. Because duplicity
131uses GnuPG to encrypt and/or sign these archives, they will be safe from
132spying and/or modification by the server.")
b0e3635e 133 (license license:gpl2+)))
2d762953 134
f6875394
BT
135(define-public par2cmdline
136 (package
137 (name "par2cmdline")
44dd001d 138 (version "0.8.0")
f6875394 139 (source (origin
5cdbdc2b
RW
140 (method git-fetch)
141 (uri (git-reference
142 (url "https://github.com/Parchive/par2cmdline.git")
143 (commit (string-append "v" version))))
144 (file-name (git-file-name name version))
f6875394
BT
145 (sha256
146 (base32
5cdbdc2b 147 "0f1jsd5sw2wynjzi7yjqjaf13yhyjfdid91p8yh0jn32y03kjyrz"))))
f6875394
BT
148 (native-inputs
149 `(("automake" ,automake)
150 ("autoconf" ,autoconf)))
151 (build-system gnu-build-system)
f6d59ecf
TGR
152 (synopsis "File verification and repair tools")
153 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
154generate and verify PAR2 recovery files. These files can be distributed
155alongside the source files or stored together with back-ups to protect against
156transmission errors or @dfn{bit rot}, the degradation of storage media over
157time.
158Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
a2dd9270
TGR
159damage isn't too extensive (and smaller than the size of the recovery file), it
160can even repair them.")
f6875394
BT
161 (home-page "https://github.com/Parchive/par2cmdline")
162 (license license:gpl3+)))
163
2d762953
EB
164(define-public hdup
165 (package
166 (name "hdup")
167 (version "2.0.14")
168 (source
169 (origin
170 (method url-fetch)
35d28c60 171 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
2d762953
EB
172 (sha256
173 (base32
174 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
175 (build-system gnu-build-system)
176 (native-inputs `(("pkg-config" ,pkg-config)))
177 (inputs
178 `(("glib" ,glib)
179 ("tar" ,tar)
180 ("lzop" ,lzop)
181 ("mcrypt" ,mcrypt)
182 ("openssh" ,openssh)
183 ("gnupg" ,gnupg-1)))
184 (arguments
185 `(#:configure-flags
186 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
187 #:tests? #f))
188 (home-page "http://archive.miek.nl/projects/hdup/index.html")
189 (synopsis "Simple incremental backup tool")
190 (description
69b4ffcf 191 "Hdup2 is a backup utility, its aim is to make backup really simple. The
2d762953
EB
192backup scheduling is done by means of a cron job. It supports an
193include/exclude mechanism, remote backups, encrypted backups and split
194backups (called chunks) to allow easy burning to CD/DVD.")
b0e3635e
LC
195 (license license:gpl2)))
196
197(define-public libarchive
198 (package
199 (name "libarchive")
c824dedf 200 (replacement libarchive-3.3.3)
7095760c 201 (version "3.3.2")
b0e3635e
LC
202 (source
203 (origin
204 (method url-fetch)
c824dedf 205 (uri (string-append "https://libarchive.org/downloads/libarchive-"
b0e3635e 206 version ".tar.gz"))
f76fc968
LF
207 (patches (search-patches "libarchive-CVE-2017-14166.patch"
208 "libarchive-CVE-2017-14502.patch"))
b0e3635e
LC
209 (sha256
210 (base32
7095760c 211 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
b0e3635e
LC
212 (build-system gnu-build-system)
213 (inputs
214 `(("zlib" ,zlib)
215 ("nettle" ,nettle)
216 ("lzo" ,lzo)
217 ("bzip2" ,bzip2)
218 ("libxml2" ,libxml2)
219 ("xz" ,xz)))
220 (arguments
221 `(#:phases
4ac8d486
EF
222 (modify-phases %standard-phases
223 (add-before 'build 'patch-pwd
224 (lambda _
225 (substitute* "Makefile"
6266b8bc
EF
226 (("/bin/pwd") (which "pwd")))
227 #t))
4ac8d486
EF
228 (replace 'check
229 (lambda _
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.
233 ;;
234 ;; The tests allow one to disable tests matching a globbing pattern.
1a3aa5ba
MW
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")
5294836d
LC
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")
250 (("-lnettle")
251 (string-append "-L" nettle "/lib -lnettle"))
252 (("-lxml2")
253 (string-append "-L" libxml2 "/lib -lxml2"))
254 (("-llzma")
255 (string-append "-L" xz "/lib -llzma"))
256 (("-lz")
257 (string-append "-L" zlib "/lib -lz"))
258 (("-lbz2")
259 (string-append "-L" bzip2 "/lib -lbz2")))
260 #t))))
261
09cbd53c
EF
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")))
c824dedf 265 (home-page "https://libarchive.org/")
b0e3635e
LC
266 (synopsis "Multi-format archive and compression library")
267 (description
268 "Libarchive provides a flexible interface for reading and writing
269archives in various formats such as tar and cpio. Libarchive also supports
270reading and writing archives compressed using various compression filters such
271as gzip and bzip2. The library is inherently stream-oriented; readers
272serially iterate through the archive, writers serially add things to the
35b9e423 273archive. In particular, note that there is currently no built-in support for
b0e3635e
LC
274random access nor for in-place modification.")
275 (license license:bsd-2)))
d42e6122 276
c824dedf
AV
277(define-public libarchive-3.3.3
278 (package
279 (inherit libarchive)
280 (version "3.3.3")
281 (source
282 (origin
283 (method url-fetch)
284 (uri (string-append "https://libarchive.org/downloads/libarchive-"
285 version ".tar.gz"))
286 (patches (search-patches "libarchive-CVE-2018-1000877.patch"
287 "libarchive-CVE-2018-1000878.patch"
288 "libarchive-CVE-2018-1000880.patch"))
289 (sha256
290 (base32
291 "0bhfncid058p7n1n8v29l6wxm3mhdqfassscihbsxfwz3iwb2zms"))))))
292
d42e6122
EB
293(define-public rdup
294 (package
295 (name "rdup")
fbf210cb 296 (version "1.1.15")
d42e6122
EB
297 (source
298 (origin
299 (method url-fetch)
fbf210cb
TGR
300 (file-name (string-append name "-" version ".tar.gz"))
301 (uri (string-append "https://github.com/miekg/rdup/archive/"
302 version ".tar.gz"))
d42e6122
EB
303 (sha256
304 (base32
fbf210cb 305 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
d42e6122
EB
306 (build-system gnu-build-system)
307 (native-inputs
fbf210cb
TGR
308 `(("autoconf" ,autoconf)
309 ("automake" ,automake)
310 ("pkg-config" ,pkg-config)
311
312 ;; For tests.
d42e6122
EB
313 ("dejagnu" ,dejagnu)))
314 (inputs
315 `(("glib" ,glib)
316 ("pcre" ,pcre)
317 ("libarchive" ,libarchive)
fbf210cb 318 ("mcrypt" ,mcrypt)
d42e6122
EB
319 ("nettle" ,nettle)))
320 (arguments
321 `(#:parallel-build? #f ;race conditions
dc1d3cde
KK
322 #:phases
323 (modify-phases %standard-phases
fbf210cb
TGR
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"))
dc1d3cde
KK
334 #t))
335 (add-before 'check 'pre-check
336 (lambda _
337 (setenv "HOME" (getcwd))
338 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
339 (("/bin/cat") (which "cat")))
340 #t)))))
fbf210cb 341 (home-page "https://github.com/miekg/rdup")
d42e6122
EB
342 (synopsis "Provide a list of files to backup")
343 (description
344 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
345Rdup itself does not backup anything, it only print a list of absolute
e881752c 346file names to standard output. Auxiliary scripts are needed that act on this
d42e6122 347list and implement the backup strategy.")
b0e3635e 348 (license license:gpl3+)))
22c24621
EB
349
350(define-public btar
351 (package
352 (name "btar")
353 (version "1.1.1")
354 (source
355 (origin
356 (method url-fetch)
357 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
358 "btar-" version ".tar.gz"))
359 (sha256
360 (base32
361 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
362 (build-system gnu-build-system)
363 (inputs
584dbd85 364 `(("librsync" ,librsync-0.9)))
22c24621
EB
365 (arguments
366 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
367 "CC=gcc")
368 #:tests? #f ;test input not distributed
369 #:phases
dc1d3cde
KK
370 ;; no configure phase
371 (modify-phases %standard-phases
372 (delete 'configure))))
22c24621
EB
373 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
374 (synopsis "Tar-compatible archiver")
375 (description
376 "Btar is a tar-compatible archiver which allows arbitrary compression and
377ciphering, redundancy, differential backup, indexed extraction, multicore
378compression, input and output serialisation, and tolerance to partial archive
379errors.")
b0e3635e 380 (license license:gpl3+)))
bd3fc08c
EB
381
382(define-public rdiff-backup
383 (package
384 (name "rdiff-backup")
385 (version "1.2.8")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
390 version ".tar.gz"))
391 (sha256
392 (base32
393 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
394 (build-system python-build-system)
bd3fc08c
EB
395 (inputs
396 `(("python" ,python-2)
584dbd85 397 ("librsync" ,librsync-0.9)))
bd3fc08c
EB
398 (arguments
399 `(#:python ,python-2
400 #:tests? #f))
340978d7 401 (home-page "https://www.nongnu.org/rdiff-backup/")
bd3fc08c
EB
402 (synopsis "Local/remote mirroring+incremental backup")
403 (description
404 "Rdiff-backup backs up one directory to another, possibly over a network.
405The target directory ends up a copy of the source directory, but extra reverse
406diffs are stored in a special subdirectory of that target directory, so you
407can still recover files lost some time ago. The idea is to combine the best
408features of a mirror and an incremental backup. Rdiff-backup also preserves
409subdirectories, hard links, dev files, permissions, uid/gid ownership,
410modification times, extended attributes, acls, and resource forks. Also,
411rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
412rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
413to a remote location, and only the differences will be transmitted. Finally,
e881752c 414rdiff-backup is easy to use and settings have sensible defaults.")
b0e3635e 415 (license license:gpl2+)))
0c146750 416
0da4f365
TD
417(define-public rsnapshot
418 (package
419 (name "rsnapshot")
420 (version "1.4.2")
421 (source
422 (origin
423 (method url-fetch)
424 (uri (string-append
425 "https://github.com/rsnapshot/rsnapshot/releases/download/"
426 version "/rsnapshot-" version ".tar.gz"))
427 (sha256
428 (base32
429 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
430 (build-system gnu-build-system)
431 (arguments
432 `(#:phases
433 (modify-phases %standard-phases
434 (replace 'check
435 (lambda _
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")))
4ce7c1b3 441 (invoke "make" "test"))))))
0da4f365
TD
442 (inputs
443 `(("perl" ,perl)
444 ("rsync" ,rsync)))
445 (home-page "http://rsnapshot.org")
446 (synopsis "Deduplicating snapshot backup utility based on rsync")
162a1374 447 (description "rsnapshot is a file system snapshot utility based on rsync.
0da4f365
TD
448rsnapshot makes it easy to make periodic snapshots of local machines, and
449remote machines over SSH. To reduce the disk space required for each backup,
450rsnapshot uses hard links to deduplicate identical files.")
451 (license license:gpl2+)))
452
362f496d
LC
453(define-public libchop
454 (package
455 (name "libchop")
456 (version "0.5.2")
457 (source (origin
458 (method url-fetch)
459 (uri (string-append "mirror://savannah/libchop/libchop-"
460 version ".tar.gz"))
461 (sha256
462 (base32
463 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
fc1adab1 464 (patches (search-patches "diffutils-gets-undeclared.patch"))))
362f496d 465 (build-system gnu-build-system)
6d1a7ce8
LC
466 (arguments
467 '(#:phases (modify-phases %standard-phases
468 (add-before 'configure 'adjust-configure-script
469 (lambda _
470 ;; Mimic upstream commit
471 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
472 (substitute* "configure"
473 (("GUILE=(.*)--variable bindir`" _ middle)
474 (string-append "GUILE=" middle
475 "--variable bindir`/guile")))
476 #t))
477 (add-before 'check 'skip-test
478 (lambda _
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")
483 #t)))))
362f496d
LC
484 (native-inputs
485 `(("guile" ,guile-2.0)
c9f898cd 486 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
362f496d
LC
487 ("pkg-config" ,pkg-config)))
488 (inputs
489 `(("guile" ,guile-2.0)
490 ("util-linux" ,util-linux)
491 ("gnutls" ,gnutls)
492 ("tdb" ,tdb)
493 ("bdb" ,bdb)
494 ("gdbm" ,gdbm)
495 ("libgcrypt" ,libgcrypt)
496 ("lzo" ,lzo)
497 ("bzip2" ,bzip2)
498 ("zlib" ,zlib)))
340978d7 499 (home-page "https://nongnu.org/libchop/")
362f496d
LC
500 (synopsis "Tools & library for data backup and distributed storage")
501 (description
502 "Libchop is a set of utilities and library for data backup and
503distributed storage. Its main application is @command{chop-backup}, an
504encrypted backup program that supports data integrity checks, versioning,
505distribution among several sites, selective sharing of stored data, adaptive
506compression, and more. The library itself implements storage techniques such
507as content-addressable storage, content hash keys, Merkle trees, similarity
508detection, and lossless compression.")
509 (license license:gpl3+)))
6fc5c11b
LF
510
511(define-public borg
512 (package
513 (name "borg")
e191e848 514 (version "1.1.9")
c4556777
TGR
515 (source
516 (origin
517 (method url-fetch)
518 (uri (pypi-uri "borgbackup" version))
519 (sha256
5a0696b2 520 (base32
e191e848 521 "0x95nhv4h34m8cxycbwc4xdz350saaxlgh727b23bgn4ci7gh3vx"))
c4556777
TGR
522 (modules '((guix build utils)))
523 (snippet
524 '(begin
5a3bf255
LF
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.
c4556777 529 (for-each delete-file
5a3bf255
LF
530 '("src/borg/algorithms/checksums.c"
531 "src/borg/chunker.c"
532 "src/borg/compress.c"
533 "src/borg/crypto/low_level.c"
534 "src/borg/hashindex.c"
535 "src/borg/item.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"))
c4556777
TGR
540 ;; Remove bundled shared libraries.
541 (with-directory-excursion "src/borg/algorithms"
542 (for-each delete-file-recursively
6cbee49d
MW
543 (list "blake2" "lz4" "zstd")))
544 #t))))
6fc5c11b
LF
545 (build-system python-build-system)
546 (arguments
c21b1a1f
LF
547 `(#:modules ((srfi srfi-26) ; for cut
548 (guix build utils)
549 (guix build python-build-system))
550 #:phases
6fc5c11b
LF
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"))
19278d8d 555 (libb2 (assoc-ref inputs "libb2"))
c4556777
TGR
556 (lz4 (assoc-ref inputs "lz4"))
557 (zstd (assoc-ref inputs "zstd")))
6fc5c11b 558 (setenv "BORG_OPENSSL_PREFIX" openssl)
19278d8d 559 (setenv "BORG_LIBB2_PREFIX" libb2)
c4556777
TGR
560 (setenv "BORG_LIBLZ4_PREFIX" lz4)
561 (setenv "BORG_LIBZSTD_PREFIX" zstd)
6fc5c11b 562 (setenv "PYTHON_EGG_CACHE" "/tmp")
b4f91d0e
LF
563 ;; The test 'test_return_codes[python]' fails when
564 ;; HOME=/homeless-shelter.
565 (setenv "HOME" "/tmp")
6fc5c11b 566 #t)))
b4f91d0e
LF
567 ;; The tests need to be run after Borg is installed.
568 (delete 'check)
569 (add-after 'install 'check
1d60f7c2
LF
570 (lambda* (#:key inputs outputs #:allow-other-keys)
571 ;; Make the installed package available for the test suite.
572 (add-installed-pythonpath inputs outputs)
8cb3e7e7
LF
573 ;; The tests should be run in an empty directory.
574 (mkdir-p "tests")
575 (with-directory-excursion "tests"
e252ec32
TGR
576 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
577 (string-append
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
584 ;; '/etc/passwd'.
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.
589 "and not benchmark "
590 ;; These tests assume the kernel supports FUSE.
591 "and not test_fuse "
592 "and not test_fuse_allow_damaged_files "
593 "and not test_mount_hardlinks")))))
6fc5c11b 594 (add-after 'install 'install-doc
6ee4fd2a 595 (lambda* (#:key inputs outputs #:allow-other-keys)
6fc5c11b 596 (let* ((out (assoc-ref outputs "out"))
c21b1a1f
LF
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"))
e252ec32
TGR
603 (copy-recursively "docs/man" man)
604 #t))))))
6fc5c11b 605 (native-inputs
f99cfc19
EF
606 `(("python-cython" ,python-cython)
607 ("python-setuptools-scm" ,python-setuptools-scm)
d4c0053e 608 ("python-pytest" ,python-pytest)))
6fc5c11b
LF
609 (inputs
610 `(("acl" ,acl)
19278d8d 611 ("libb2" ,libb2)
6fc5c11b
LF
612 ("lz4" ,lz4)
613 ("openssl" ,openssl)
614 ("python-llfuse" ,python-llfuse)
acb59d99
LF
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)
c4556777 619 ("zstd" ,zstd)))
6fc5c11b
LF
620 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
621 (description "Borg is a deduplicating backup program. Optionally, it
622supports compression and authenticated encryption. The main goal of Borg is to
623provide an efficient and secure way to backup data. The data deduplication
624technique used makes Borg suitable for daily backups since only changes are
625stored. The authenticated encryption technique makes it suitable for backups
626to not fully trusted targets. Borg is a fork of Attic.")
18533bcf 627 (home-page "https://www.borgbackup.org/")
6fc5c11b 628 (license license:bsd-3)))
b2fe9183
LF
629
630(define-public attic
631 (package
632 (name "attic")
633 (version "0.16")
634 (source (origin
635 (method url-fetch)
99d17446 636 (uri (pypi-uri "Attic" version))
b2fe9183
LF
637 (sha256
638 (base32
639 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
640 (build-system python-build-system)
641 (arguments
1df6d73b
LF
642 `(;; The tests assume they are run as root:
643 ;; https://github.com/jborg/attic/issues/7
644 #:tests? #f
645 #:phases
b2fe9183
LF
646 (modify-phases %standard-phases
647 (add-before
648 'build 'set-openssl-prefix
649 (lambda* (#:key inputs #:allow-other-keys)
650 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
651 #t)))))
652 (inputs
653 `(("acl" ,acl)
654 ("openssl" ,openssl)
655 ("python-msgpack" ,python-msgpack)
656
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
667Attic is to provide an efficient and secure way to backup data. The data
668deduplication technique used makes Attic suitable for daily backups since only
669changes are stored.")
670 (home-page "https://attic-backup.org/")
671 (license license:bsd-3)
672 (properties `((superseded . ,borg)))))
3b402139
TGR
673
674(define-public wimlib
675 (package
676 (name "wimlib")
fb6112e9 677 (version "1.13.0")
3b402139
TGR
678 (source (origin
679 (method url-fetch)
680 (uri (string-append "https://wimlib.net/downloads/"
1a05bce2 681 "wimlib-" version ".tar.gz"))
3b402139
TGR
682 (sha256
683 (base32
fb6112e9 684 "02wpsxjlw9vysj6x6q7kmvbcdkpvdzw201mmj5x0q670mapjrnai"))))
3b402139
TGR
685 (build-system gnu-build-system)
686 (native-inputs
687 `(("pkg-config" ,pkg-config)))
688 (inputs
689 `(("fuse" ,fuse)
690 ("libxml2" ,libxml2)
691 ("ntfs-3g" ,ntfs-3g)
692 ("openssl" ,openssl)))
693 (arguments
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
698creating, modifying, extracting, and mounting archives in the Windows Imaging
699Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
700NTFS 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+
705 license:lgpl3+
706 license:cc0))))
a2fa9c3d
AI
707
708(define-public obnam
709 (package
710 (name "obnam")
711 (version "1.21")
712 (source
713 (origin
714 (method url-fetch)
715 (uri (string-append
716 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
717 version ".orig.tar.xz"))
718 (sha256
719 (base32
720 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
721 (build-system python-build-system)
722 (arguments
f75b1400
AI
723 `(#:python ,python-2
724 #:phases
725 (modify-phases %standard-phases
726 (replace 'check
727 (lambda _
728 (substitute* "obnamlib/vfs_local_tests.py"
f32a1803 729 ;; Check for the nobody user instead of root.
f75b1400
AI
730 (("self.fs.get_username\\(0\\), 'root'")
731 "self.fs.get_username(65534), 'nobody'")
f32a1803 732 ;; Disable tests checking for root group.
f75b1400
AI
733 (("self.fs.get_groupname\\(0\\)") "'root'"))
734 (substitute* "obnamlib/vfs_local.py"
f32a1803 735 ;; Don't cover get_groupname function.
f75b1400
AI
736 (("def get_groupname\\(self, gid\\):")
737 "def get_groupname(self, gid): # pragma: no cover"))
f32a1803
TGR
738 ;; Can't run network tests.
739 (invoke "./check" "--unit-tests"))))))
a2fa9c3d
AI
740 (inputs
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)))
f75b1400
AI
747 (native-inputs
748 `(("gnupg" ,gnupg)
749 ("python2-coverage" ,python2-coverage)
750 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
751 ("python2-pep8" ,python2-pep8)
752 ("python2-pylint" ,python2-pylint)))
a2fa9c3d 753 (home-page "https://obnam.org/")
a93de1ae
TGR
754 (synopsis "Retired backup program")
755 (description
756 "Warning: @uref{https://blog.liw.fi/posts/2017/08/13/retiring_obnam/,
757the Obnam project is retired}. You should use another backup solution instead.
758
759Obnam was an easy, secure backup program. Features included snapshot backups,
760data de-duplication and encrypted backups using GnuPG. Backups can be stored on
761local hard disks, or online via the SSH SFTP protocol. The backup server, if
762used, does not require any special software, on top of SSH.")
a2fa9c3d 763 (license license:gpl3+)))
0ff4425c
CAW
764
765(define-public dirvish
766 (package
767 (name "dirvish")
768 (version "1.2.1")
769 (build-system gnu-build-system)
770 (source (origin
771 (method url-fetch)
772 (uri (string-append
773 "http://dirvish.org/dirvish-" version ".tgz"))
774 (sha256
775 (base32
776 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
777 (arguments
778 `(#:modules ((ice-9 match) (ice-9 rdelim)
779 ,@%gnu-build-system-modules)
780 #:phases
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
784 (delete 'configure)
785 (delete 'build)
786 (delete 'check)
787 (replace 'install
788 (lambda* (#:key inputs outputs #:allow-other-keys)
789 ;; These are mostly the same steps the install.sh that comes with
790 ;; dirvish does
791 (let* (;; Files we'll be copying
792 (executables
793 '("dirvish" "dirvish-runall"
794 "dirvish-expire" "dirvish-locate"))
795 (man-pages
796 '(("dirvish" "8") ("dirvish-runall" "8")
797 ("dirvish-expire" "8") ("dirvish-locate" "8")
798 ("dirvish.conf" "5")))
799
800 (output-dir
801 (assoc-ref outputs "out"))
802
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")
806
807 (perl (string-append (assoc-ref %build-inputs "perl")
808 "/bin/perl"))
809 (loadconfig.pl (call-with-input-file "loadconfig.pl"
810 read-string)))
811
812
813 (define (write-pl filename)
814 (define pl-header
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
824 read-string)
825 "\n" loadconfig.pl))
826 (with-output-to-file target-file-location
827 (lambda ()
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")))))
836
837 (define write-man
838 (match-lambda
839 ((file-base man-num)
840 (let* ((filename
841 (string-append file-base "." man-num))
842 (output-path
843 (string-append output-dir
844 "/share/man/man" man-num
845 "/" filename)))
846 (copy-file filename output-path)))))
847
848 ;; Make directories
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/"))
852
853 ;; Write out executables
854 (for-each write-pl executables)
855 ;; Write out man pages
856 (for-each write-man man-pages)
857 #t))))))
858 (inputs
859 `(("perl" ,perl)
860 ("rsync" ,rsync)
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")
865 (description
866 "With dirvish you can maintain a set of complete images of your
162a1374 867file systems with unattended creation and expiration. A dirvish backup vault
0ff4425c
CAW
868is like a time machine for your data. ")
869 (license (license:fsf-free "file://COPYING"
870 "Open Software License 2.0"))))
f77886c1 871
f49d6909 872(define-public restic
f77886c1
OP
873 (package
874 (name "restic")
0e296c06 875 (version "0.9.4")
f49d6909
LF
876 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
877 ;; directory.
f77886c1
OP
878 (source (origin
879 (method url-fetch)
880 (uri (string-append
881 "https://github.com/restic/restic/releases/download/"
882 "v" version "/restic-" version ".tar.gz"))
883 (file-name (string-append name "-" version ".tar.gz"))
884 (sha256
885 (base32
0e296c06 886 "13ksprq1ia86px8x4lqrmx0l6y9rb1ppg8pnp7lcx0zxnq7skp67"))))
f77886c1
OP
887 (build-system go-build-system)
888 (arguments
889 `(#:import-path "github.com/restic/restic"
890 #:unpack-path "github.com/restic"
891 ;; We don't need to install the source code for end-user applications.
892 #:install-source? #f
893 #:phases
894 (modify-phases %standard-phases
895 (replace 'build
896 (lambda* (#:key inputs #:allow-other-keys)
897 (with-directory-excursion (string-append
898 "src/github.com/restic/restic-"
899 ,version)
9cac043c
TGR
900 ;; Disable 'restic self-update'. It makes little sense in Guix.
901 (substitute* "build.go" (("selfupdate") ""))
15595644 902 (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build
f77886c1
OP
903 (invoke "go" "run" "build.go"))))
904
4976ebdd
OP
905 (replace 'check
906 (lambda _
907 (with-directory-excursion (string-append
908 "src/github.com/restic/restic-"
909 ,version)
77389911
OP
910 ;; Disable FUSE tests.
911 (setenv "RESTIC_TEST_FUSE" "0")
4976ebdd
OP
912 (invoke "go" "run" "build.go" "--test"))))
913
f77886c1
OP
914 (replace 'install
915 (lambda* (#:key outputs #:allow-other-keys)
916 (let ((out (assoc-ref outputs "out"))
917 (src (string-append "src/github.com/restic/restic-"
918 ,version)))
919 (install-file (string-append src "/restic")
920 (string-append out "/bin"))
921 #t)))
922
923 (add-after 'install 'install-docs
924 (lambda* (#:key outputs #:allow-other-keys)
925 (let* ((out (assoc-ref outputs "out"))
926 (man "/share/man")
927 (man-section (string-append man "/man"))
928 (src (string-append "src/github.com/restic/restic-"
929 ,version "/doc/man/")))
930 ;; Install all the man pages to "out".
931 (for-each
932 (lambda (file)
933 (install-file file
934 (string-append out man-section
935 (string-take-right file 1))))
936 (find-files src "\\.[1-9]"))
937 #t)))
938
939 (add-after 'install-docs 'install-shell-completion
940 (lambda* (#:key outputs #:allow-other-keys)
941 (let* ((out (assoc-ref outputs "out"))
942 (bin (string-append out "/bin"))
943 (etc (string-append out "/etc"))
944 (share (string-append out "/share")))
945 (for-each
946 (lambda (shell)
947 (let* ((shell-name (symbol->string shell))
948 (dir (string-append "etc/completion/" shell-name)))
949 (mkdir-p dir)
950 (invoke (string-append bin "/restic") "generate"
951 (string-append "--" shell-name "-completion")
952 (string-append dir "/"
953 (case shell
954 ((bash) "restic")
955 ((zsh) "_restic"))))))
956 '(bash zsh))
957 (with-directory-excursion "etc/completion"
958 (install-file "bash/restic"
959 (string-append etc "/bash_completion.d"))
960 (install-file "zsh/_restic"
961 (string-append share "/zsh/site-functions")))
962 #t))))))
963 (home-page "https://restic.net/")
964 (synopsis "Backup program with multiple revisions, encryption and more")
965 (description "Restic is a program that does backups right and was designed
966with the following principles in mind:
967
968@itemize
969@item Easy: Doing backups should be a frictionless process, otherwise you
970might be tempted to skip it. Restic should be easy to configure and use, so
971that, in the event of a data loss, you can just restore it. Likewise,
972restoring data should not be complicated.
973
974@item Fast: Backing up your data with restic should only be limited by your
975network or hard disk bandwidth so that you can backup your files every day.
976Nobody does backups if it takes too much time. Restoring backups should only
977transfer data that is needed for the files that are to be restored, so that
978this process is also fast.
979
980@item Verifiable: Much more important than backup is restore, so restic
981enables you to easily verify that all data can be restored. @item Secure:
982Restic uses cryptography to guarantee confidentiality and integrity of your
983data. The location the backup data is stored is assumed not to be a trusted
984environment (e.g. a shared space where others like system administrators are
985able to access your backups). Restic is built to secure your data against
986such attackers.
987
988@item Efficient: With the growth of data, additional snapshots should only
989take the storage of the actual increment. Even more, duplicate data should be
990de-duplicated before it is actually written to the storage back end to save
991precious backup space.
992@end itemize")
993 (license license:bsd-2)))
7b9b203a
RW
994
995(define-public burp
996 (package
997 (name "burp")
8ce7520d 998 (version "2.3.4")
7b9b203a
RW
999 (source (origin
1000 (method url-fetch)
1001 (uri (string-append "mirror://sourceforge/burp/burp-" version
1002 "/burp-" version ".tar.bz2"))
1003 (sha256
1004 (base32
8ce7520d 1005 "0r82mmfjm57yr4f34za3x3rkgc5z2c7nwbnsjjki16qfc9kjyai3"))))
7b9b203a
RW
1006 (build-system gnu-build-system)
1007 (inputs
1008 `(("librsync" ,librsync)
1009 ("openssl" ,openssl)
1010 ("uthash" ,uthash)
1011 ("zlib" ,zlib)))
1012 (native-inputs
1013 `(("check" ,check)
1014 ("pkg-config" ,pkg-config)))
1015 (home-page "https://burp.grke.org")
1016 (synopsis "Differential backup and restore")
1017 (description "Burp is a network backup and restore program. It attempts
1018to reduce network traffic and the amount of space that is used by each
1019backup.")
1020 (license license:agpl3)))