gnu: whois: Update to 5.5.0.
[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")
8a859781 76 (version "0.7.19")
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
8a859781 85 (base32 "0ag9dknslxlasslwfjhqgcqbkb1mvzzx93ry7lch2lfzcdd91am6"))))
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))
4a635d3d
TGR
188 (home-page (string-append "http://web.archive.org/web/20150925223424/"
189 "http://archive.miek.nl/projects/hdup/index.html"))
2d762953
EB
190 (synopsis "Simple incremental backup tool")
191 (description
69b4ffcf 192 "Hdup2 is a backup utility, its aim is to make backup really simple. The
2d762953
EB
193backup scheduling is done by means of a cron job. It supports an
194include/exclude mechanism, remote backups, encrypted backups and split
195backups (called chunks) to allow easy burning to CD/DVD.")
b0e3635e
LC
196 (license license:gpl2)))
197
198(define-public libarchive
199 (package
200 (name "libarchive")
c824dedf 201 (replacement libarchive-3.3.3)
7095760c 202 (version "3.3.2")
b0e3635e
LC
203 (source
204 (origin
205 (method url-fetch)
c824dedf 206 (uri (string-append "https://libarchive.org/downloads/libarchive-"
b0e3635e 207 version ".tar.gz"))
f76fc968
LF
208 (patches (search-patches "libarchive-CVE-2017-14166.patch"
209 "libarchive-CVE-2017-14502.patch"))
b0e3635e
LC
210 (sha256
211 (base32
7095760c 212 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
b0e3635e
LC
213 (build-system gnu-build-system)
214 (inputs
215 `(("zlib" ,zlib)
216 ("nettle" ,nettle)
217 ("lzo" ,lzo)
218 ("bzip2" ,bzip2)
219 ("libxml2" ,libxml2)
220 ("xz" ,xz)))
221 (arguments
222 `(#:phases
4ac8d486
EF
223 (modify-phases %standard-phases
224 (add-before 'build 'patch-pwd
225 (lambda _
226 (substitute* "Makefile"
6266b8bc
EF
227 (("/bin/pwd") (which "pwd")))
228 #t))
4ac8d486
EF
229 (replace 'check
230 (lambda _
231 ;; XXX: The test_owner_parse, test_read_disk, and
232 ;; test_write_disk_lookup tests expect user 'root' to exist, but
233 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
234 ;;
235 ;; The tests allow one to disable tests matching a globbing pattern.
1a3aa5ba
MW
236 (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
237 ;; XXX: This glob disables too much.
238 (invoke "./libarchive_test" "^test_*_disk*")
239 (invoke "./bsdcpio_test" "^test_owner_parse")
5294836d
LC
240 (invoke "./bsdtar_test")))
241 (add-after 'install 'add--L-in-libarchive-pc
242 (lambda* (#:key inputs outputs #:allow-other-keys)
243 (let* ((out (assoc-ref outputs "out"))
244 (lib (string-append out "/lib"))
245 (nettle (assoc-ref inputs "nettle"))
246 (libxml2 (assoc-ref inputs "libxml2"))
247 (xz (assoc-ref inputs "xz"))
248 (zlib (assoc-ref inputs "zlib"))
249 (bzip2 (assoc-ref inputs "bzip2")))
250 (substitute* (string-append lib "/pkgconfig/libarchive.pc")
251 (("-lnettle")
252 (string-append "-L" nettle "/lib -lnettle"))
253 (("-lxml2")
254 (string-append "-L" libxml2 "/lib -lxml2"))
255 (("-llzma")
256 (string-append "-L" xz "/lib -llzma"))
257 (("-lz")
258 (string-append "-L" zlib "/lib -lz"))
259 (("-lbz2")
260 (string-append "-L" bzip2 "/lib -lbz2")))
261 #t))))
262
09cbd53c
EF
263 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
264 ;; compiled with C99 or C11 or a gnu variant.
265 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
c824dedf 266 (home-page "https://libarchive.org/")
b0e3635e
LC
267 (synopsis "Multi-format archive and compression library")
268 (description
269 "Libarchive provides a flexible interface for reading and writing
270archives in various formats such as tar and cpio. Libarchive also supports
271reading and writing archives compressed using various compression filters such
272as gzip and bzip2. The library is inherently stream-oriented; readers
273serially iterate through the archive, writers serially add things to the
35b9e423 274archive. In particular, note that there is currently no built-in support for
b0e3635e
LC
275random access nor for in-place modification.")
276 (license license:bsd-2)))
d42e6122 277
c824dedf
AV
278(define-public libarchive-3.3.3
279 (package
280 (inherit libarchive)
281 (version "3.3.3")
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "https://libarchive.org/downloads/libarchive-"
286 version ".tar.gz"))
287 (patches (search-patches "libarchive-CVE-2018-1000877.patch"
288 "libarchive-CVE-2018-1000878.patch"
289 "libarchive-CVE-2018-1000880.patch"))
290 (sha256
291 (base32
292 "0bhfncid058p7n1n8v29l6wxm3mhdqfassscihbsxfwz3iwb2zms"))))))
293
d42e6122
EB
294(define-public rdup
295 (package
296 (name "rdup")
fbf210cb 297 (version "1.1.15")
d42e6122
EB
298 (source
299 (origin
300 (method url-fetch)
fbf210cb
TGR
301 (file-name (string-append name "-" version ".tar.gz"))
302 (uri (string-append "https://github.com/miekg/rdup/archive/"
303 version ".tar.gz"))
d42e6122
EB
304 (sha256
305 (base32
fbf210cb 306 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
d42e6122
EB
307 (build-system gnu-build-system)
308 (native-inputs
fbf210cb
TGR
309 `(("autoconf" ,autoconf)
310 ("automake" ,automake)
311 ("pkg-config" ,pkg-config)
312
313 ;; For tests.
d42e6122
EB
314 ("dejagnu" ,dejagnu)))
315 (inputs
316 `(("glib" ,glib)
317 ("pcre" ,pcre)
318 ("libarchive" ,libarchive)
fbf210cb 319 ("mcrypt" ,mcrypt)
d42e6122
EB
320 ("nettle" ,nettle)))
321 (arguments
322 `(#:parallel-build? #f ;race conditions
dc1d3cde
KK
323 #:phases
324 (modify-phases %standard-phases
fbf210cb
TGR
325 (add-before 'build 'qualify-inputs
326 (lambda* (#:key inputs #:allow-other-keys)
327 ;; This script is full of pitfalls. Fix some that particularly
328 ;; affect Guix users & leave the rest as reader excercises.
329 (substitute* "rdup-simple"
330 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
331 (("([' ])mcrypt " all delimiter)
332 (string-append delimiter (which "mcrypt") " "))
333 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
334 (("which") "command -v"))
dc1d3cde
KK
335 #t))
336 (add-before 'check 'pre-check
337 (lambda _
338 (setenv "HOME" (getcwd))
339 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
340 (("/bin/cat") (which "cat")))
341 #t)))))
fbf210cb 342 (home-page "https://github.com/miekg/rdup")
d42e6122
EB
343 (synopsis "Provide a list of files to backup")
344 (description
345 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
346Rdup itself does not backup anything, it only print a list of absolute
e881752c 347file names to standard output. Auxiliary scripts are needed that act on this
d42e6122 348list and implement the backup strategy.")
b0e3635e 349 (license license:gpl3+)))
22c24621
EB
350
351(define-public btar
352 (package
353 (name "btar")
354 (version "1.1.1")
355 (source
356 (origin
357 (method url-fetch)
358 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
359 "btar-" version ".tar.gz"))
360 (sha256
361 (base32
362 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
363 (build-system gnu-build-system)
364 (inputs
584dbd85 365 `(("librsync" ,librsync-0.9)))
22c24621
EB
366 (arguments
367 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
368 "CC=gcc")
369 #:tests? #f ;test input not distributed
370 #:phases
dc1d3cde
KK
371 ;; no configure phase
372 (modify-phases %standard-phases
373 (delete 'configure))))
22c24621
EB
374 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
375 (synopsis "Tar-compatible archiver")
376 (description
377 "Btar is a tar-compatible archiver which allows arbitrary compression and
378ciphering, redundancy, differential backup, indexed extraction, multicore
379compression, input and output serialisation, and tolerance to partial archive
380errors.")
b0e3635e 381 (license license:gpl3+)))
bd3fc08c
EB
382
383(define-public rdiff-backup
384 (package
385 (name "rdiff-backup")
386 (version "1.2.8")
387 (source
388 (origin
389 (method url-fetch)
390 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
391 version ".tar.gz"))
392 (sha256
393 (base32
394 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
395 (build-system python-build-system)
bd3fc08c
EB
396 (inputs
397 `(("python" ,python-2)
584dbd85 398 ("librsync" ,librsync-0.9)))
bd3fc08c
EB
399 (arguments
400 `(#:python ,python-2
401 #:tests? #f))
340978d7 402 (home-page "https://www.nongnu.org/rdiff-backup/")
bd3fc08c
EB
403 (synopsis "Local/remote mirroring+incremental backup")
404 (description
405 "Rdiff-backup backs up one directory to another, possibly over a network.
406The target directory ends up a copy of the source directory, but extra reverse
407diffs are stored in a special subdirectory of that target directory, so you
408can still recover files lost some time ago. The idea is to combine the best
409features of a mirror and an incremental backup. Rdiff-backup also preserves
410subdirectories, hard links, dev files, permissions, uid/gid ownership,
411modification times, extended attributes, acls, and resource forks. Also,
412rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
413rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
414to a remote location, and only the differences will be transmitted. Finally,
e881752c 415rdiff-backup is easy to use and settings have sensible defaults.")
b0e3635e 416 (license license:gpl2+)))
0c146750 417
0da4f365
TD
418(define-public rsnapshot
419 (package
420 (name "rsnapshot")
421 (version "1.4.2")
422 (source
423 (origin
424 (method url-fetch)
425 (uri (string-append
426 "https://github.com/rsnapshot/rsnapshot/releases/download/"
427 version "/rsnapshot-" version ".tar.gz"))
428 (sha256
429 (base32
430 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
431 (build-system gnu-build-system)
432 (arguments
433 `(#:phases
434 (modify-phases %standard-phases
435 (replace 'check
436 (lambda _
437 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
438 "t/backup_exec/conf/backup_exec_fail.conf"
439 "t/backup_exec/conf/backup_exec.conf")
440 (("/bin/true") (which "true"))
441 (("/bin/false") (which "false")))
4ce7c1b3 442 (invoke "make" "test"))))))
0da4f365
TD
443 (inputs
444 `(("perl" ,perl)
445 ("rsync" ,rsync)))
446 (home-page "http://rsnapshot.org")
447 (synopsis "Deduplicating snapshot backup utility based on rsync")
162a1374 448 (description "rsnapshot is a file system snapshot utility based on rsync.
0da4f365
TD
449rsnapshot makes it easy to make periodic snapshots of local machines, and
450remote machines over SSH. To reduce the disk space required for each backup,
451rsnapshot uses hard links to deduplicate identical files.")
452 (license license:gpl2+)))
453
362f496d
LC
454(define-public libchop
455 (package
456 (name "libchop")
457 (version "0.5.2")
458 (source (origin
459 (method url-fetch)
460 (uri (string-append "mirror://savannah/libchop/libchop-"
461 version ".tar.gz"))
462 (sha256
463 (base32
464 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
fc1adab1 465 (patches (search-patches "diffutils-gets-undeclared.patch"))))
362f496d 466 (build-system gnu-build-system)
6d1a7ce8
LC
467 (arguments
468 '(#:phases (modify-phases %standard-phases
469 (add-before 'configure 'adjust-configure-script
470 (lambda _
471 ;; Mimic upstream commit
472 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
473 (substitute* "configure"
474 (("GUILE=(.*)--variable bindir`" _ middle)
475 (string-append "GUILE=" middle
476 "--variable bindir`/guile")))
477 #t))
478 (add-before 'check 'skip-test
479 (lambda _
480 ;; XXX: This test fails (1) because current GnuTLS no
481 ;; longer supports OpenPGP authentication, and (2) for
482 ;; some obscure reason. Better skip it.
483 (setenv "XFAIL_TESTS" "utils/block-server")
484 #t)))))
362f496d
LC
485 (native-inputs
486 `(("guile" ,guile-2.0)
c9f898cd 487 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
362f496d
LC
488 ("pkg-config" ,pkg-config)))
489 (inputs
490 `(("guile" ,guile-2.0)
491 ("util-linux" ,util-linux)
492 ("gnutls" ,gnutls)
493 ("tdb" ,tdb)
494 ("bdb" ,bdb)
495 ("gdbm" ,gdbm)
496 ("libgcrypt" ,libgcrypt)
497 ("lzo" ,lzo)
498 ("bzip2" ,bzip2)
499 ("zlib" ,zlib)))
340978d7 500 (home-page "https://nongnu.org/libchop/")
362f496d
LC
501 (synopsis "Tools & library for data backup and distributed storage")
502 (description
503 "Libchop is a set of utilities and library for data backup and
504distributed storage. Its main application is @command{chop-backup}, an
505encrypted backup program that supports data integrity checks, versioning,
506distribution among several sites, selective sharing of stored data, adaptive
507compression, and more. The library itself implements storage techniques such
508as content-addressable storage, content hash keys, Merkle trees, similarity
509detection, and lossless compression.")
510 (license license:gpl3+)))
6fc5c11b
LF
511
512(define-public borg
513 (package
514 (name "borg")
d46fc636 515 (version "1.1.10")
c4556777
TGR
516 (source
517 (origin
518 (method url-fetch)
519 (uri (pypi-uri "borgbackup" version))
520 (sha256
d46fc636 521 (base32 "1pp70p4n5kamvcbl4d8021ggrxhyykmg9isjg4yd3wags8b19d7g"))
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
d46fc636
TGR
543 (list "blake2" "lz4" "msgpack" "zstd")))
544 ;; Purge some msgpack references from setup.py or the resulting
545 ;; sources will be unbuildable.
546 (substitute* "setup.py"
547 ((".*Extension\\('borg\\.algorithms\\.msgpack\\..*") "")
548 (("msgpack_packer_source, msgpack_unpacker_source") ""))
6cbee49d 549 #t))))
6fc5c11b
LF
550 (build-system python-build-system)
551 (arguments
c21b1a1f
LF
552 `(#:modules ((srfi srfi-26) ; for cut
553 (guix build utils)
554 (guix build python-build-system))
555 #:phases
6fc5c11b
LF
556 (modify-phases %standard-phases
557 (add-after 'unpack 'set-env
558 (lambda* (#:key inputs #:allow-other-keys)
559 (let ((openssl (assoc-ref inputs "openssl"))
19278d8d 560 (libb2 (assoc-ref inputs "libb2"))
c4556777
TGR
561 (lz4 (assoc-ref inputs "lz4"))
562 (zstd (assoc-ref inputs "zstd")))
6fc5c11b 563 (setenv "BORG_OPENSSL_PREFIX" openssl)
19278d8d 564 (setenv "BORG_LIBB2_PREFIX" libb2)
c4556777
TGR
565 (setenv "BORG_LIBLZ4_PREFIX" lz4)
566 (setenv "BORG_LIBZSTD_PREFIX" zstd)
6fc5c11b 567 (setenv "PYTHON_EGG_CACHE" "/tmp")
b4f91d0e
LF
568 ;; The test 'test_return_codes[python]' fails when
569 ;; HOME=/homeless-shelter.
570 (setenv "HOME" "/tmp")
6fc5c11b 571 #t)))
d46fc636
TGR
572 (add-after 'unpack 'use-system-msgpack
573 (lambda _
574 (substitute* "src/borg/helpers.py"
575 (("prefer_system_msgpack = False")
576 "prefer_system_msgpack = True"))
577 #t))
b4f91d0e
LF
578 ;; The tests need to be run after Borg is installed.
579 (delete 'check)
580 (add-after 'install 'check
1d60f7c2
LF
581 (lambda* (#:key inputs outputs #:allow-other-keys)
582 ;; Make the installed package available for the test suite.
583 (add-installed-pythonpath inputs outputs)
8cb3e7e7
LF
584 ;; The tests should be run in an empty directory.
585 (mkdir-p "tests")
586 (with-directory-excursion "tests"
e252ec32
TGR
587 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
588 (string-append
589 ;; These tests need to write to '/var'.
590 "not test_get_cache_dir "
591 "and not test_get_config_dir "
592 "and not test_get_keys_dir "
593 "and not test_get_security_dir "
594 ;; These tests assume there is a root user in
595 ;; '/etc/passwd'.
596 "and not test_access_acl "
597 "and not test_default_acl "
598 "and not test_non_ascii_acl "
599 ;; This test needs the unpackaged pytest-benchmark.
600 "and not benchmark "
601 ;; These tests assume the kernel supports FUSE.
602 "and not test_fuse "
603 "and not test_fuse_allow_damaged_files "
604 "and not test_mount_hardlinks")))))
6fc5c11b 605 (add-after 'install 'install-doc
6ee4fd2a 606 (lambda* (#:key inputs outputs #:allow-other-keys)
6fc5c11b 607 (let* ((out (assoc-ref outputs "out"))
c21b1a1f
LF
608 (man (string-append out "/share/man/man1"))
609 (misc (string-append out "/share/borg/misc")))
610 (for-each (cut install-file <> misc)
611 '("docs/misc/create_chunker-params.txt"
612 "docs/misc/internals-picture.txt"
613 "docs/misc/prune-example.txt"))
e252ec32
TGR
614 (copy-recursively "docs/man" man)
615 #t))))))
6fc5c11b 616 (native-inputs
f99cfc19
EF
617 `(("python-cython" ,python-cython)
618 ("python-setuptools-scm" ,python-setuptools-scm)
d4c0053e 619 ("python-pytest" ,python-pytest)))
6fc5c11b
LF
620 (inputs
621 `(("acl" ,acl)
19278d8d 622 ("libb2" ,libb2)
6fc5c11b
LF
623 ("lz4" ,lz4)
624 ("openssl" ,openssl)
625 ("python-llfuse" ,python-llfuse)
acb59d99
LF
626 ;; The Python msgpack library changed its name so Borg requires this
627 ;; transitional package for now:
628 ;; <https://bugs.gnu.org/30662>
629 ("python-msgpack" ,python-msgpack-transitional)
c4556777 630 ("zstd" ,zstd)))
6fc5c11b
LF
631 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
632 (description "Borg is a deduplicating backup program. Optionally, it
633supports compression and authenticated encryption. The main goal of Borg is to
634provide an efficient and secure way to backup data. The data deduplication
635technique used makes Borg suitable for daily backups since only changes are
636stored. The authenticated encryption technique makes it suitable for backups
637to not fully trusted targets. Borg is a fork of Attic.")
18533bcf 638 (home-page "https://www.borgbackup.org/")
6fc5c11b 639 (license license:bsd-3)))
b2fe9183
LF
640
641(define-public attic
642 (package
643 (name "attic")
644 (version "0.16")
645 (source (origin
646 (method url-fetch)
99d17446 647 (uri (pypi-uri "Attic" version))
b2fe9183
LF
648 (sha256
649 (base32
650 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
651 (build-system python-build-system)
652 (arguments
1df6d73b
LF
653 `(;; The tests assume they are run as root:
654 ;; https://github.com/jborg/attic/issues/7
655 #:tests? #f
656 #:phases
b2fe9183
LF
657 (modify-phases %standard-phases
658 (add-before
659 'build 'set-openssl-prefix
660 (lambda* (#:key inputs #:allow-other-keys)
661 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
662 #t)))))
663 (inputs
664 `(("acl" ,acl)
665 ("openssl" ,openssl)
666 ("python-msgpack" ,python-msgpack)
667
668 ;; Attic is probably incompatible with llfuse > 0.41.
669 ;; These links are to discussions of llfuse compatibility from
670 ;; the borg project. Borg is a recent fork of attic, and attic
671 ;; has not been updated since the fork, so it's likely that
672 ;; llfuse compatibility requirements are still the same.
673 ;; https://github.com/borgbackup/borg/issues/642
674 ;; https://github.com/borgbackup/borg/issues/643
675 ("python-llfuse" ,python-llfuse-0.41)))
676 (synopsis "Deduplicating backup program")
677 (description "Attic is a deduplicating backup program. The main goal of
678Attic is to provide an efficient and secure way to backup data. The data
679deduplication technique used makes Attic suitable for daily backups since only
680changes are stored.")
681 (home-page "https://attic-backup.org/")
682 (license license:bsd-3)
683 (properties `((superseded . ,borg)))))
3b402139
TGR
684
685(define-public wimlib
686 (package
687 (name "wimlib")
558d36e6 688 (version "1.13.1")
3b402139
TGR
689 (source (origin
690 (method url-fetch)
691 (uri (string-append "https://wimlib.net/downloads/"
1a05bce2 692 "wimlib-" version ".tar.gz"))
3b402139
TGR
693 (sha256
694 (base32
558d36e6 695 "0pxgrpr3dr81rcf2jh71aiiq3v4anc5sj1nld18f2vhvbijbrx27"))))
3b402139
TGR
696 (build-system gnu-build-system)
697 (native-inputs
698 `(("pkg-config" ,pkg-config)))
699 (inputs
700 `(("fuse" ,fuse)
701 ("libxml2" ,libxml2)
702 ("ntfs-3g" ,ntfs-3g)
703 ("openssl" ,openssl)))
704 (arguments
705 `(#:configure-flags (list "--enable-test-support")))
706 (home-page "https://wimlib.net/")
707 (synopsis "WIM file manipulation library and utilities")
708 (description "wimlib is a C library and set of command-line utilities for
709creating, modifying, extracting, and mounting archives in the Windows Imaging
710Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
711NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
712 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
713 ;; LGPL, except those files explicitly marked as being released into the
714 ;; public domain (CC0) in their headers.
715 (license (list license:gpl3+
716 license:lgpl3+
717 license:cc0))))
a2fa9c3d
AI
718
719(define-public obnam
720 (package
721 (name "obnam")
722 (version "1.21")
723 (source
724 (origin
725 (method url-fetch)
726 (uri (string-append
727 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
728 version ".orig.tar.xz"))
729 (sha256
730 (base32
731 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
732 (build-system python-build-system)
733 (arguments
f75b1400
AI
734 `(#:python ,python-2
735 #:phases
736 (modify-phases %standard-phases
737 (replace 'check
738 (lambda _
739 (substitute* "obnamlib/vfs_local_tests.py"
f32a1803 740 ;; Check for the nobody user instead of root.
f75b1400
AI
741 (("self.fs.get_username\\(0\\), 'root'")
742 "self.fs.get_username(65534), 'nobody'")
f32a1803 743 ;; Disable tests checking for root group.
f75b1400
AI
744 (("self.fs.get_groupname\\(0\\)") "'root'"))
745 (substitute* "obnamlib/vfs_local.py"
f32a1803 746 ;; Don't cover get_groupname function.
f75b1400
AI
747 (("def get_groupname\\(self, gid\\):")
748 "def get_groupname(self, gid): # pragma: no cover"))
f32a1803
TGR
749 ;; Can't run network tests.
750 (invoke "./check" "--unit-tests"))))))
a2fa9c3d
AI
751 (inputs
752 `(("python2-cliapp" ,python2-cliapp)
753 ("python2-larch" ,python2-larch)
754 ("python2-paramiko" ,python2-paramiko)
755 ("python2-pyaml" ,python2-pyaml)
756 ("python2-tracing" ,python2-tracing)
757 ("python2-ttystatus" ,python2-ttystatus)))
f75b1400
AI
758 (native-inputs
759 `(("gnupg" ,gnupg)
760 ("python2-coverage" ,python2-coverage)
761 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
762 ("python2-pep8" ,python2-pep8)
763 ("python2-pylint" ,python2-pylint)))
a2fa9c3d 764 (home-page "https://obnam.org/")
a93de1ae
TGR
765 (synopsis "Retired backup program")
766 (description
767 "Warning: @uref{https://blog.liw.fi/posts/2017/08/13/retiring_obnam/,
768the Obnam project is retired}. You should use another backup solution instead.
769
770Obnam was an easy, secure backup program. Features included snapshot backups,
771data de-duplication and encrypted backups using GnuPG. Backups can be stored on
772local hard disks, or online via the SSH SFTP protocol. The backup server, if
773used, does not require any special software, on top of SSH.")
a2fa9c3d 774 (license license:gpl3+)))
0ff4425c
CAW
775
776(define-public dirvish
777 (package
778 (name "dirvish")
779 (version "1.2.1")
780 (build-system gnu-build-system)
781 (source (origin
782 (method url-fetch)
783 (uri (string-append
784 "http://dirvish.org/dirvish-" version ".tgz"))
785 (sha256
786 (base32
787 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
788 (arguments
789 `(#:modules ((ice-9 match) (ice-9 rdelim)
790 ,@%gnu-build-system-modules)
791 #:phases
792 ;; This mostly mirrors the steps taken in the install.sh that ships
793 ;; with dirvish, but simplified because we aren't prompting interactively
794 (modify-phases %standard-phases
795 (delete 'configure)
796 (delete 'build)
797 (delete 'check)
798 (replace 'install
799 (lambda* (#:key inputs outputs #:allow-other-keys)
800 ;; These are mostly the same steps the install.sh that comes with
801 ;; dirvish does
802 (let* (;; Files we'll be copying
803 (executables
804 '("dirvish" "dirvish-runall"
805 "dirvish-expire" "dirvish-locate"))
806 (man-pages
807 '(("dirvish" "8") ("dirvish-runall" "8")
808 ("dirvish-expire" "8") ("dirvish-locate" "8")
809 ("dirvish.conf" "5")))
810
811 (output-dir
812 (assoc-ref outputs "out"))
813
814 ;; Just a default... not so useful on guixsd though
815 ;; You probably want to a service with file(s) to point to.
816 (confdir "/etc/dirvish")
817
818 (perl (string-append (assoc-ref %build-inputs "perl")
819 "/bin/perl"))
820 (loadconfig.pl (call-with-input-file "loadconfig.pl"
821 read-string)))
822
823
824 (define (write-pl filename)
825 (define pl-header
826 (string-append "#!" perl "\n\n"
827 "$CONFDIR = \"" confdir "\";\n\n"))
828 (define input-file-location
829 (string-append filename ".pl"))
830 (define target-file-location
831 (string-append output-dir "/bin/" filename ".pl"))
832 (define text-to-write
833 (string-append pl-header
834 (call-with-input-file input-file-location
835 read-string)
836 "\n" loadconfig.pl))
837 (with-output-to-file target-file-location
838 (lambda ()
839 (display text-to-write)))
840 (chmod target-file-location #o755)
841 (wrap-program target-file-location
842 `("PERL5LIB" ":" prefix
843 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
844 "/lib/perl5/site_perl"))
845 '("perl-libtime-period"
846 "perl-libtime-parsedate")))))
847
848 (define write-man
849 (match-lambda
850 ((file-base man-num)
851 (let* ((filename
852 (string-append file-base "." man-num))
853 (output-path
854 (string-append output-dir
855 "/share/man/man" man-num
856 "/" filename)))
857 (copy-file filename output-path)))))
858
859 ;; Make directories
860 (mkdir-p (string-append output-dir "/bin/"))
861 (mkdir-p (string-append output-dir "/share/man/man8/"))
862 (mkdir-p (string-append output-dir "/share/man/man5/"))
863
864 ;; Write out executables
865 (for-each write-pl executables)
866 ;; Write out man pages
867 (for-each write-man man-pages)
868 #t))))))
869 (inputs
870 `(("perl" ,perl)
871 ("rsync" ,rsync)
872 ("perl-libtime-period" ,perl-libtime-period)
873 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
874 (home-page "http://dirvish.org/")
875 (synopsis "Fast, disk based, rotating network backup system")
876 (description
877 "With dirvish you can maintain a set of complete images of your
162a1374 878file systems with unattended creation and expiration. A dirvish backup vault
0ff4425c
CAW
879is like a time machine for your data. ")
880 (license (license:fsf-free "file://COPYING"
881 "Open Software License 2.0"))))
f77886c1 882
f49d6909 883(define-public restic
f77886c1
OP
884 (package
885 (name "restic")
dd5fbf61 886 (version "0.9.5")
f49d6909
LF
887 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
888 ;; directory.
f77886c1
OP
889 (source (origin
890 (method url-fetch)
891 (uri (string-append
892 "https://github.com/restic/restic/releases/download/"
893 "v" version "/restic-" version ".tar.gz"))
894 (file-name (string-append name "-" version ".tar.gz"))
895 (sha256
896 (base32
dd5fbf61 897 "0afl3dv7gzwdc9klikk3fsb57d0px2fwihb0xxb7zq7d8vlhh8p2"))))
f77886c1
OP
898 (build-system go-build-system)
899 (arguments
900 `(#:import-path "github.com/restic/restic"
f77886c1
OP
901 ;; We don't need to install the source code for end-user applications.
902 #:install-source? #f
903 #:phases
904 (modify-phases %standard-phases
905 (replace 'build
906 (lambda* (#:key inputs #:allow-other-keys)
fb098182 907 (with-directory-excursion "src/github.com/restic/restic"
9cac043c
TGR
908 ;; Disable 'restic self-update'. It makes little sense in Guix.
909 (substitute* "build.go" (("selfupdate") ""))
15595644 910 (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build
f77886c1
OP
911 (invoke "go" "run" "build.go"))))
912
4976ebdd
OP
913 (replace 'check
914 (lambda _
fb098182 915 (with-directory-excursion "src/github.com/restic/restic"
77389911
OP
916 ;; Disable FUSE tests.
917 (setenv "RESTIC_TEST_FUSE" "0")
4976ebdd
OP
918 (invoke "go" "run" "build.go" "--test"))))
919
f77886c1
OP
920 (replace 'install
921 (lambda* (#:key outputs #:allow-other-keys)
922 (let ((out (assoc-ref outputs "out"))
fb098182 923 (src "src/github.com/restic/restic"))
f77886c1
OP
924 (install-file (string-append src "/restic")
925 (string-append out "/bin"))
926 #t)))
927
928 (add-after 'install 'install-docs
929 (lambda* (#:key outputs #:allow-other-keys)
930 (let* ((out (assoc-ref outputs "out"))
931 (man "/share/man")
932 (man-section (string-append man "/man"))
fb098182 933 (src "src/github.com/restic/restic/doc/man/"))
f77886c1
OP
934 ;; Install all the man pages to "out".
935 (for-each
936 (lambda (file)
937 (install-file file
938 (string-append out man-section
939 (string-take-right file 1))))
940 (find-files src "\\.[1-9]"))
941 #t)))
942
943 (add-after 'install-docs 'install-shell-completion
944 (lambda* (#:key outputs #:allow-other-keys)
945 (let* ((out (assoc-ref outputs "out"))
946 (bin (string-append out "/bin"))
947 (etc (string-append out "/etc"))
948 (share (string-append out "/share")))
949 (for-each
950 (lambda (shell)
951 (let* ((shell-name (symbol->string shell))
952 (dir (string-append "etc/completion/" shell-name)))
953 (mkdir-p dir)
954 (invoke (string-append bin "/restic") "generate"
955 (string-append "--" shell-name "-completion")
956 (string-append dir "/"
957 (case shell
958 ((bash) "restic")
959 ((zsh) "_restic"))))))
960 '(bash zsh))
961 (with-directory-excursion "etc/completion"
962 (install-file "bash/restic"
963 (string-append etc "/bash_completion.d"))
964 (install-file "zsh/_restic"
965 (string-append share "/zsh/site-functions")))
966 #t))))))
967 (home-page "https://restic.net/")
968 (synopsis "Backup program with multiple revisions, encryption and more")
969 (description "Restic is a program that does backups right and was designed
970with the following principles in mind:
971
972@itemize
973@item Easy: Doing backups should be a frictionless process, otherwise you
974might be tempted to skip it. Restic should be easy to configure and use, so
975that, in the event of a data loss, you can just restore it. Likewise,
976restoring data should not be complicated.
977
978@item Fast: Backing up your data with restic should only be limited by your
979network or hard disk bandwidth so that you can backup your files every day.
980Nobody does backups if it takes too much time. Restoring backups should only
981transfer data that is needed for the files that are to be restored, so that
982this process is also fast.
983
984@item Verifiable: Much more important than backup is restore, so restic
985enables you to easily verify that all data can be restored. @item Secure:
986Restic uses cryptography to guarantee confidentiality and integrity of your
987data. The location the backup data is stored is assumed not to be a trusted
988environment (e.g. a shared space where others like system administrators are
989able to access your backups). Restic is built to secure your data against
990such attackers.
991
992@item Efficient: With the growth of data, additional snapshots should only
993take the storage of the actual increment. Even more, duplicate data should be
994de-duplicated before it is actually written to the storage back end to save
995precious backup space.
996@end itemize")
997 (license license:bsd-2)))
7b9b203a
RW
998
999(define-public burp
1000 (package
1001 (name "burp")
46ca002d 1002 (version "2.3.6")
7b9b203a
RW
1003 (source (origin
1004 (method url-fetch)
1005 (uri (string-append "mirror://sourceforge/burp/burp-" version
1006 "/burp-" version ".tar.bz2"))
1007 (sha256
1008 (base32
46ca002d 1009 "101nn30apcbmy9k0wksdf8d4ccw7sfcqzkasgg17a5y332x2imr9"))))
7b9b203a
RW
1010 (build-system gnu-build-system)
1011 (inputs
1012 `(("librsync" ,librsync)
1013 ("openssl" ,openssl)
1014 ("uthash" ,uthash)
1015 ("zlib" ,zlib)))
1016 (native-inputs
1017 `(("check" ,check)
1018 ("pkg-config" ,pkg-config)))
1019 (home-page "https://burp.grke.org")
1020 (synopsis "Differential backup and restore")
1021 (description "Burp is a network backup and restore program. It attempts
1022to reduce network traffic and the amount of space that is used by each
1023backup.")
1024 (license license:agpl3)))