gnu: nss, nss-certs: Update to 3.27.2.
[jackhill/guix/guix.git] / gnu / packages / backup.scm
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 Leo Famulari <leo@famulari.name>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages backup)
22 #:use-module (guix packages)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module (guix build utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages acl)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages dejagnu)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages gperf)
39 #:use-module (gnu packages guile)
40 #:use-module (gnu packages linux)
41 #:use-module (gnu packages mcrypt)
42 #:use-module (gnu packages nettle)
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages rsync)
47 #:use-module (gnu packages ssh)
48 #:use-module (gnu packages tls)
49 #:use-module (gnu packages xml))
50
51 (define-public duplicity
52 (package
53 (name "duplicity")
54 (version "0.6.26")
55 (source
56 (origin
57 (method url-fetch)
58 (uri (string-append "https://code.launchpad.net/duplicity/"
59 (version-major+minor version)
60 "-series/" version "/+download/duplicity-"
61 version ".tar.gz"))
62 (sha256
63 (base32
64 "0jh79syhr8n3l81jxlwsmwm1pklb4d923m2lgqbswyavh1fqmvwb"))
65 (patches (search-patches "duplicity-piped-password.patch"
66 "duplicity-test_selection-tmp.patch"))))
67 (build-system python-build-system)
68 (native-inputs
69 `(("util-linux" ,util-linux))) ;setsid command, for the tests
70 (inputs
71 `(("python" ,python-2)
72 ("librsync" ,librsync)
73 ("mock" ,python2-mock) ;for testing
74 ("lockfile" ,python2-lockfile)
75 ("gnupg" ,gnupg-1) ;gpg executable needed
76 ("util-linux" ,util-linux) ;for setsid
77 ("tzdata" ,tzdata)))
78 (arguments
79 `(#:python ,python-2 ;setup assumes Python 2
80 #:test-target "test"
81 #:phases
82 (modify-phases %standard-phases
83 (add-before 'check 'check-setup
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "testing/functional/__init__.py"
86 (("/bin/sh") (which "sh")))
87 (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
88 (setenv "TZDIR" ;some timestamp checks need TZDIR
89 (string-append (assoc-ref inputs "tzdata")
90 "/share/zoneinfo"))
91 #t)))))
92 (home-page "http://duplicity.nongnu.org/index.html")
93 (synopsis "Encrypted backup using rsync algorithm")
94 (description
95 "Duplicity backs up directories by producing encrypted tar-format volumes
96 and uploading them to a remote or local file server. Because duplicity uses
97 librsync, the incremental archives are space efficient and only record the
98 parts of files that have changed since the last backup. Because duplicity
99 uses GnuPG to encrypt and/or sign these archives, they will be safe from
100 spying and/or modification by the server.")
101 (license license:gpl2+)))
102
103 (define-public par2cmdline
104 (package
105 (name "par2cmdline")
106 (version "0.6.14")
107 (source (origin
108 (method url-fetch)
109 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
110 version ".tar.gz"))
111 (file-name (string-append name "-" version ".tar.gz"))
112 (sha256
113 (base32
114 "0ykfb7ar0x0flfdgf6i8xphyv5b93dalbjj2jb6hx7sdjax33n1g"))
115 ;; This test merely needs a file to test recovery on, but
116 ;; /dev/random is essentially /dev/urandom plus minimum entropy
117 ;; locking, making the test hang indefinitely. This change is
118 ;; already upstream: remove on upgrade to future 0.6.15.
119 ;; https://github.com/Parchive/par2cmdline/commit/27723a678f780da82c79b98592592009c779a4fb
120 (modules '((guix build utils)))
121 (snippet
122 '(substitute* "tests/test20" (("if=/dev/random") "if=/dev/urandom")))))
123 (native-inputs
124 `(("automake" ,automake)
125 ("autoconf" ,autoconf)))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:phases
129 (modify-phases %standard-phases
130 (add-after 'unpack 'autoreconf
131 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
132 (synopsis "File verification and repair tool")
133 (description "Par2cmdline is a tool for generating RAID-like PAR2 recovery
134 files using Reed-Solomon coding. PAR2 files can be stored along side backups
135 or distributed files for recovering from bitrot.")
136 (home-page "https://github.com/Parchive/par2cmdline")
137 (license license:gpl3+)))
138
139 (define-public hdup
140 (package
141 (name "hdup")
142 (version "2.0.14")
143 (source
144 (origin
145 (method url-fetch)
146 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
147 (sha256
148 (base32
149 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
150 (build-system gnu-build-system)
151 (native-inputs `(("pkg-config" ,pkg-config)))
152 (inputs
153 `(("glib" ,glib)
154 ("tar" ,tar)
155 ("lzop" ,lzop)
156 ("mcrypt" ,mcrypt)
157 ("openssh" ,openssh)
158 ("gnupg" ,gnupg-1)))
159 (arguments
160 `(#:configure-flags
161 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
162 #:tests? #f))
163 (home-page "http://archive.miek.nl/projects/hdup/index.html")
164 (synopsis "Simple incremental backup tool")
165 (description
166 "Hdup2 is a backup utility, its aim is to make backup really simple. The
167 backup scheduling is done by means of a cron job. It supports an
168 include/exclude mechanism, remote backups, encrypted backups and split
169 backups (called chunks) to allow easy burning to CD/DVD.")
170 (license license:gpl2)))
171
172 (define-public libarchive
173 (package
174 (name "libarchive")
175 (version "3.2.1")
176 (source
177 (origin
178 (method url-fetch)
179 (uri (string-append "http://libarchive.org/downloads/libarchive-"
180 version ".tar.gz"))
181 (patches (search-patches
182 "libarchive-7zip-heap-overflow.patch"
183 "libarchive-fix-symlink-check.patch"
184 "libarchive-fix-filesystem-attacks.patch"
185 "libarchive-safe_fprintf-buffer-overflow.patch"))
186 (sha256
187 (base32
188 "1lngng84k1kkljl74q0cdqc3s82vn2kimfm02dgm4d6m7x71mvkj"))))
189 (build-system gnu-build-system)
190 ;; TODO: Add -L/path/to/nettle in libarchive.pc.
191 (inputs
192 `(("zlib" ,zlib)
193 ("nettle" ,nettle)
194 ("lzo" ,lzo)
195 ("bzip2" ,bzip2)
196 ("libxml2" ,libxml2)
197 ("xz" ,xz)))
198 (arguments
199 `(#:phases
200 (alist-cons-before
201 'build 'patch-pwd
202 (lambda _
203 (substitute* "Makefile"
204 (("/bin/pwd") (which "pwd"))))
205 (alist-replace
206 'check
207 (lambda _
208 ;; XXX: The test_owner_parse, test_read_disk, and
209 ;; test_write_disk_lookup tests expect user 'root' to exist, but
210 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
211 ;;
212 ;; The tests allow one to disable tests matching a globbing pattern.
213 (and (zero? (system* "make"
214 "libarchive_test" "bsdcpio_test" "bsdtar_test"))
215 ;; XXX: This glob disables too much.
216 (zero? (system* "./libarchive_test" "^test_*_disk*"))
217 (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
218 (zero? (system* "./bsdtar_test"))))
219 %standard-phases))
220 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
221 ;; compiled with C99 or C11 or a gnu variant.
222 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
223 (home-page "http://libarchive.org/")
224 (synopsis "Multi-format archive and compression library")
225 (description
226 "Libarchive provides a flexible interface for reading and writing
227 archives in various formats such as tar and cpio. Libarchive also supports
228 reading and writing archives compressed using various compression filters such
229 as gzip and bzip2. The library is inherently stream-oriented; readers
230 serially iterate through the archive, writers serially add things to the
231 archive. In particular, note that there is currently no built-in support for
232 random access nor for in-place modification.")
233 (license license:bsd-2)))
234
235 (define-public rdup
236 (package
237 (name "rdup")
238 (version "1.1.14")
239 (source
240 (origin
241 (method url-fetch)
242 (uri (string-append "http://archive.miek.nl/projects/rdup/rdup-"
243 version ".tar.bz2"))
244 (sha256
245 (base32
246 "0aklwd9v7ix0m4ayl762sil685f42cwljzx3jz5skrnjaq32npmj"))
247 (modules '((guix build utils)))
248 (snippet
249 ;; Some test scripts are missing shebangs, which cause "could not
250 ;; execute" errors. Add shebangs.
251 '(for-each
252 (lambda (testscript)
253 (with-atomic-file-replacement
254 (string-append "testsuite/rdup/" testscript)
255 (lambda (in out)
256 (begin
257 (format out "#!/bin/sh\n" )
258 (dump-port in out)))))
259 '("rdup.hardlink.helper"
260 "rdup.hardlink-strip.helper"
261 "rdup.hardlink-strip2.helper"
262 "rdup.pipeline.helper")))))
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("pkg-config" ,pkg-config)
266 ("dejagnu" ,dejagnu)))
267 (inputs
268 `(("glib" ,glib)
269 ("pcre" ,pcre)
270 ("libarchive" ,libarchive)
271 ("nettle" ,nettle)))
272 (arguments
273 `(#:parallel-build? #f ;race conditions
274 #:phases (alist-cons-before
275 'build 'remove-Werror
276 ;; rdup uses a deprecated function from libarchive
277 (lambda _
278 (substitute* "GNUmakefile"
279 (("^(CFLAGS=.*)-Werror" _ front) front)))
280 (alist-cons-before
281 'check 'pre-check
282 (lambda _
283 (setenv "HOME" (getcwd))
284 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
285 (("/bin/cat") (which "cat"))))
286
287 %standard-phases))))
288 (home-page "http://archive.miek.nl/projects/rdup/index.html")
289 (synopsis "Provide a list of files to backup")
290 (description
291 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
292 Rdup itself does not backup anything, it only print a list of absolute
293 file names to standard output. Auxiliary scripts are needed that act on this
294 list and implement the backup strategy.")
295 (license license:gpl3+)))
296
297 (define-public btar
298 (package
299 (name "btar")
300 (version "1.1.1")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
305 "btar-" version ".tar.gz"))
306 (sha256
307 (base32
308 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
309 (build-system gnu-build-system)
310 (inputs
311 `(("librsync" ,librsync)))
312 (arguments
313 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
314 "CC=gcc")
315 #:tests? #f ;test input not distributed
316 #:phases
317 (alist-delete
318 'configure ;no configure phase
319 %standard-phases)))
320 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
321 (synopsis "Tar-compatible archiver")
322 (description
323 "Btar is a tar-compatible archiver which allows arbitrary compression and
324 ciphering, redundancy, differential backup, indexed extraction, multicore
325 compression, input and output serialisation, and tolerance to partial archive
326 errors.")
327 (license license:gpl3+)))
328
329 (define-public rdiff-backup
330 (package
331 (name "rdiff-backup")
332 (version "1.2.8")
333 (source
334 (origin
335 (method url-fetch)
336 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
337 version ".tar.gz"))
338 (sha256
339 (base32
340 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
341 (build-system python-build-system)
342 (inputs
343 `(("python" ,python-2)
344 ("librsync" ,librsync)))
345 (arguments
346 `(#:python ,python-2
347 #:tests? #f))
348 (home-page "http://www.nongnu.org/rdiff-backup/")
349 (synopsis "Local/remote mirroring+incremental backup")
350 (description
351 "Rdiff-backup backs up one directory to another, possibly over a network.
352 The target directory ends up a copy of the source directory, but extra reverse
353 diffs are stored in a special subdirectory of that target directory, so you
354 can still recover files lost some time ago. The idea is to combine the best
355 features of a mirror and an incremental backup. Rdiff-backup also preserves
356 subdirectories, hard links, dev files, permissions, uid/gid ownership,
357 modification times, extended attributes, acls, and resource forks. Also,
358 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
359 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
360 to a remote location, and only the differences will be transmitted. Finally,
361 rdiff-backup is easy to use and settings have sensible defaults.")
362 (license license:gpl2+)))
363
364 (define-public libchop
365 (package
366 (name "libchop")
367 (version "0.5.2")
368 (source (origin
369 (method url-fetch)
370 (uri (string-append "mirror://savannah/libchop/libchop-"
371 version ".tar.gz"))
372 (sha256
373 (base32
374 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
375 (patches (search-patches "diffutils-gets-undeclared.patch"))))
376 (build-system gnu-build-system)
377 (native-inputs
378 `(("guile" ,guile-2.0)
379 ("gperf" ,gperf)
380 ("pkg-config" ,pkg-config)))
381 (inputs
382 `(("guile" ,guile-2.0)
383 ("util-linux" ,util-linux)
384 ("gnutls" ,gnutls)
385 ("tdb" ,tdb)
386 ("bdb" ,bdb)
387 ("gdbm" ,gdbm)
388 ("libgcrypt" ,libgcrypt)
389 ("lzo" ,lzo)
390 ("bzip2" ,bzip2)
391 ("zlib" ,zlib)))
392 (home-page "http://nongnu.org/libchop/")
393 (synopsis "Tools & library for data backup and distributed storage")
394 (description
395 "Libchop is a set of utilities and library for data backup and
396 distributed storage. Its main application is @command{chop-backup}, an
397 encrypted backup program that supports data integrity checks, versioning,
398 distribution among several sites, selective sharing of stored data, adaptive
399 compression, and more. The library itself implements storage techniques such
400 as content-addressable storage, content hash keys, Merkle trees, similarity
401 detection, and lossless compression.")
402 (license license:gpl3+)))
403
404 (define-public borg
405 (package
406 (name "borg")
407 (version "1.0.8")
408 (source (origin
409 (method url-fetch)
410 (uri (pypi-uri "borgbackup" version))
411 (sha256
412 (base32
413 "1fdfi0yzzdrrlml6780n4fh61sqm7pw6fcd1y67kfkvw8hy5c0k9"))
414 (modules '((guix build utils)))
415 (snippet
416 '(for-each
417 delete-file (find-files "borg" "^(c|h|p).*\\.c$")))))
418 (build-system python-build-system)
419 (arguments
420 `(#:modules ((srfi srfi-26) ; for cut
421 (guix build utils)
422 (guix build python-build-system))
423 #:phases
424 (modify-phases %standard-phases
425 (add-after 'unpack 'set-env
426 (lambda* (#:key inputs #:allow-other-keys)
427 (let ((openssl (assoc-ref inputs "openssl"))
428 (lz4 (assoc-ref inputs "lz4")))
429 (setenv "BORG_OPENSSL_PREFIX" openssl)
430 (setenv "BORG_LZ4_PREFIX" lz4)
431 (setenv "PYTHON_EGG_CACHE" "/tmp")
432 ;; The test 'test_return_codes[python]' fails when
433 ;; HOME=/homeless-shelter.
434 (setenv "HOME" "/tmp")
435 #t)))
436 ;; The tests need to be run after Borg is installed.
437 (delete 'check)
438 (add-after 'install 'check
439 (lambda* (#:key inputs outputs #:allow-other-keys)
440 ;; Make the installed package available for the test suite.
441 (add-installed-pythonpath inputs outputs)
442 (zero?
443 (system* "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
444 (string-append
445 ;; These tests need to write to '/var'.
446 "not test_get_cache_dir "
447 "and not test_get_keys_dir "
448 ;; These tests assume there is a root user in
449 ;; '/etc/passwd'.
450 "and not test_access_acl "
451 "and not test_default_acl "
452 "and not test_non_ascii_acl "
453 ;; This test needs the unpackaged pytest-benchmark.
454 "and not benchmark "
455 ;; These tests assume the kernel supports FUSE. They
456 ;; were skipped using the "old" Python build system,
457 ;; before commit
458 ;; 7db40bce58e149ecb541d295e01cfbfe953d39a3.
459 "and not test_fuse "
460 "and not test_fuse_allow_damaged_files")))))
461 (add-after 'install 'install-doc
462 (lambda* (#:key outputs #:allow-other-keys)
463 (let* ((out (assoc-ref outputs "out"))
464 (man (string-append out "/share/man/man1"))
465 (misc (string-append out "/share/borg/misc")))
466 (for-each (cut install-file <> misc)
467 '("docs/misc/create_chunker-params.txt"
468 "docs/misc/internals-picture.txt"
469 "docs/misc/prune-example.txt"))
470 (and
471 (zero? (system* "python3" "setup.py" "build_ext" "--inplace"))
472 (zero? (system* "make" "-C" "docs" "man"))
473 (begin
474 (install-file "docs/_build/man/borg.1" man)
475 #t))))))))
476 (native-inputs
477 `(("python-cython" ,python-cython)
478 ("python-setuptools-scm" ,python-setuptools-scm)
479 ;; Borg 1.0.8's test suite uses 'tmpdir_factory', which was introduced in
480 ;; pytest 2.8.
481 ("python-pytest" ,python-pytest-2.9.2)
482 ;; For generating the documentation.
483 ("python-sphinx" ,python-sphinx)
484 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
485 (inputs
486 `(("acl" ,acl)
487 ("lz4" ,lz4)
488 ("openssl" ,openssl)
489 ("python-llfuse" ,python-llfuse)
490 ("python-msgpack" ,python-msgpack)))
491 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
492 (description "Borg is a deduplicating backup program. Optionally, it
493 supports compression and authenticated encryption. The main goal of Borg is to
494 provide an efficient and secure way to backup data. The data deduplication
495 technique used makes Borg suitable for daily backups since only changes are
496 stored. The authenticated encryption technique makes it suitable for backups
497 to not fully trusted targets. Borg is a fork of Attic.")
498 (home-page "https://borgbackup.github.io/borgbackup/")
499 (license license:bsd-3)))
500
501 (define-public attic
502 (package
503 (name "attic")
504 (version "0.16")
505 (source (origin
506 (method url-fetch)
507 (uri (string-append
508 "https://pypi.python.org/packages/source/A/Attic/Attic-"
509 version ".tar.gz"))
510 (sha256
511 (base32
512 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
513 (build-system python-build-system)
514 (arguments
515 `(;; The tests assume they are run as root:
516 ;; https://github.com/jborg/attic/issues/7
517 #:tests? #f
518 #:phases
519 (modify-phases %standard-phases
520 (add-before
521 'build 'set-openssl-prefix
522 (lambda* (#:key inputs #:allow-other-keys)
523 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
524 #t)))))
525 (inputs
526 `(("acl" ,acl)
527 ("openssl" ,openssl)
528 ("python-msgpack" ,python-msgpack)
529
530 ;; Attic is probably incompatible with llfuse > 0.41.
531 ;; These links are to discussions of llfuse compatibility from
532 ;; the borg project. Borg is a recent fork of attic, and attic
533 ;; has not been updated since the fork, so it's likely that
534 ;; llfuse compatibility requirements are still the same.
535 ;; https://github.com/borgbackup/borg/issues/642
536 ;; https://github.com/borgbackup/borg/issues/643
537 ("python-llfuse" ,python-llfuse-0.41)))
538 (synopsis "Deduplicating backup program")
539 (description "Attic is a deduplicating backup program. The main goal of
540 Attic is to provide an efficient and secure way to backup data. The data
541 deduplication technique used makes Attic suitable for daily backups since only
542 changes are stored.")
543 (home-page "https://attic-backup.org/")
544 (license license:bsd-3)
545 (properties `((superseded . ,borg)))))