gnu: perl-file-pushd: Update to 1.016.
[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, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
11 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages backup)
29 #:use-module (guix packages)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages acl)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages dejagnu)
44 #:use-module (gnu packages ftp)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages guile)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages mcrypt)
51 #:use-module (gnu packages nettle)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-crypto)
57 #:use-module (gnu packages python-web)
58 #:use-module (gnu packages rsync)
59 #:use-module (gnu packages ssh)
60 #:use-module (gnu packages tls)
61 #:use-module (gnu packages xml))
62
63 (define-public duplicity
64 (package
65 (name "duplicity")
66 (version "0.7.12")
67 (source
68 (origin
69 (method url-fetch)
70 (uri (string-append "https://code.launchpad.net/duplicity/"
71 (version-major+minor version)
72 "-series/" version "/+download/duplicity-"
73 version ".tar.gz"))
74 (sha256
75 (base32
76 "1rhgrz2lm9vbfdp2raykrih1c6n2lw5jd572z4dsz488m52avjqi"))))
77 (build-system python-build-system)
78 (native-inputs
79 `(("util-linux" ,util-linux) ;setsid command, for the tests
80 ("par2cmdline" ,par2cmdline)
81 ("python-pexpect" ,python2-pexpect)
82 ("mock" ,python2-mock)))
83 (propagated-inputs
84 `(("lockfile" ,python2-lockfile)
85 ("urllib3" ,python2-urllib3)))
86 (inputs
87 `(("librsync" ,librsync)
88 ("lftp" ,lftp)
89 ("gnupg" ,gnupg) ;gpg executable needed
90 ("util-linux" ,util-linux) ;for setsid
91 ("tzdata" ,tzdata)))
92 (arguments
93 `(#:python ,python-2 ;setup assumes Python 2
94 #:test-target "test"
95 #:phases
96 (modify-phases %standard-phases
97 (add-before 'build 'patch-source
98 (lambda* (#:key inputs #:allow-other-keys)
99 ;; embed gpg store name
100 (substitute* "duplicity/gpginterface.py"
101 (("self.call = 'gpg'")
102 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
103 (substitute* '("testing/functional/__init__.py"
104 "testing/overrides/bin/lftp")
105 (("/bin/sh") (which "sh")))
106 #t))
107 (add-before 'check 'check-setup
108 (lambda* (#:key inputs #:allow-other-keys)
109 (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
110 (setenv "TZDIR" ;some timestamp checks need TZDIR
111 (string-append (assoc-ref inputs "tzdata")
112 "/share/zoneinfo"))
113 #t)))))
114 (home-page "http://duplicity.nongnu.org/index.html")
115 (synopsis "Encrypted backup using rsync algorithm")
116 (description
117 "Duplicity backs up directories by producing encrypted tar-format volumes
118 and uploading them to a remote or local file server. Because duplicity uses
119 librsync, the incremental archives are space efficient and only record the
120 parts of files that have changed since the last backup. Because duplicity
121 uses GnuPG to encrypt and/or sign these archives, they will be safe from
122 spying and/or modification by the server.")
123 (license license:gpl2+)))
124
125 (define-public par2cmdline
126 (package
127 (name "par2cmdline")
128 (version "0.8.0")
129 (source (origin
130 (method url-fetch)
131 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
132 version ".tar.gz"))
133 (file-name (string-append name "-" version ".tar.gz"))
134 (sha256
135 (base32
136 "1jpshmmcr81mxly0md2rr231qz9c8c680bbvcmhh100dg9i4a6s6"))))
137 (native-inputs
138 `(("automake" ,automake)
139 ("autoconf" ,autoconf)))
140 (build-system gnu-build-system)
141 (arguments
142 `(#:phases
143 (modify-phases %standard-phases
144 (add-after 'unpack 'autoreconf
145 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
146 (synopsis "File verification and repair tools")
147 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
148 generate and verify PAR2 recovery files. These files can be distributed
149 alongside the source files or stored together with back-ups to protect against
150 transmission errors or @dfn{bit rot}, the degradation of storage media over
151 time.
152 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
153 damage isn't too extensive (and smaller than the size of the recovery file), it
154 can even repair them.")
155 (home-page "https://github.com/Parchive/par2cmdline")
156 (license license:gpl3+)))
157
158 (define-public hdup
159 (package
160 (name "hdup")
161 (version "2.0.14")
162 (source
163 (origin
164 (method url-fetch)
165 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
166 (sha256
167 (base32
168 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
169 (build-system gnu-build-system)
170 (native-inputs `(("pkg-config" ,pkg-config)))
171 (inputs
172 `(("glib" ,glib)
173 ("tar" ,tar)
174 ("lzop" ,lzop)
175 ("mcrypt" ,mcrypt)
176 ("openssh" ,openssh)
177 ("gnupg" ,gnupg-1)))
178 (arguments
179 `(#:configure-flags
180 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
181 #:tests? #f))
182 (home-page "http://archive.miek.nl/projects/hdup/index.html")
183 (synopsis "Simple incremental backup tool")
184 (description
185 "Hdup2 is a backup utility, its aim is to make backup really simple. The
186 backup scheduling is done by means of a cron job. It supports an
187 include/exclude mechanism, remote backups, encrypted backups and split
188 backups (called chunks) to allow easy burning to CD/DVD.")
189 (license license:gpl2)))
190
191 (define-public libarchive
192 (package
193 (name "libarchive")
194 (version "3.3.2")
195 (source
196 (origin
197 (method url-fetch)
198 (uri (string-append "http://libarchive.org/downloads/libarchive-"
199 version ".tar.gz"))
200 (patches (search-patches "libarchive-CVE-2017-14166.patch"
201 "libarchive-CVE-2017-14502.patch"))
202 (sha256
203 (base32
204 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
205 (build-system gnu-build-system)
206 ;; TODO: Add -L/path/to/nettle in libarchive.pc.
207 (inputs
208 `(("zlib" ,zlib)
209 ("nettle" ,nettle)
210 ("lzo" ,lzo)
211 ("bzip2" ,bzip2)
212 ("libxml2" ,libxml2)
213 ("xz" ,xz)))
214 (arguments
215 `(#:phases
216 (modify-phases %standard-phases
217 (add-before 'build 'patch-pwd
218 (lambda _
219 (substitute* "Makefile"
220 (("/bin/pwd") (which "pwd")))
221 #t))
222 (replace 'check
223 (lambda _
224 ;; XXX: The test_owner_parse, test_read_disk, and
225 ;; test_write_disk_lookup tests expect user 'root' to exist, but
226 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
227 ;;
228 ;; The tests allow one to disable tests matching a globbing pattern.
229 (and (zero? (system* "make"
230 "libarchive_test" "bsdcpio_test" "bsdtar_test"))
231 ;; XXX: This glob disables too much.
232 (zero? (system* "./libarchive_test" "^test_*_disk*"))
233 (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
234 (zero? (system* "./bsdtar_test"))))))
235 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
236 ;; compiled with C99 or C11 or a gnu variant.
237 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
238 (home-page "http://libarchive.org/")
239 (synopsis "Multi-format archive and compression library")
240 (description
241 "Libarchive provides a flexible interface for reading and writing
242 archives in various formats such as tar and cpio. Libarchive also supports
243 reading and writing archives compressed using various compression filters such
244 as gzip and bzip2. The library is inherently stream-oriented; readers
245 serially iterate through the archive, writers serially add things to the
246 archive. In particular, note that there is currently no built-in support for
247 random access nor for in-place modification.")
248 (license license:bsd-2)))
249
250 (define-public rdup
251 (package
252 (name "rdup")
253 (version "1.1.15")
254 (source
255 (origin
256 (method url-fetch)
257 (file-name (string-append name "-" version ".tar.gz"))
258 (uri (string-append "https://github.com/miekg/rdup/archive/"
259 version ".tar.gz"))
260 (sha256
261 (base32
262 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("autoconf" ,autoconf)
266 ("automake" ,automake)
267 ("pkg-config" ,pkg-config)
268
269 ;; For tests.
270 ("dejagnu" ,dejagnu)))
271 (inputs
272 `(("glib" ,glib)
273 ("pcre" ,pcre)
274 ("libarchive" ,libarchive)
275 ("mcrypt" ,mcrypt)
276 ("nettle" ,nettle)))
277 (arguments
278 `(#:parallel-build? #f ;race conditions
279 #:phases
280 (modify-phases %standard-phases
281 (add-after 'unpack 'bootstrap
282 (lambda _
283 (invoke "autoreconf")))
284 (add-before 'build 'qualify-inputs
285 (lambda* (#:key inputs #:allow-other-keys)
286 ;; This script is full of pitfalls. Fix some that particularly
287 ;; affect Guix users & leave the rest as reader excercises.
288 (substitute* "rdup-simple"
289 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
290 (("([' ])mcrypt " all delimiter)
291 (string-append delimiter (which "mcrypt") " "))
292 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
293 (("which") "command -v"))
294 #t))
295 (add-before 'check 'pre-check
296 (lambda _
297 (setenv "HOME" (getcwd))
298 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
299 (("/bin/cat") (which "cat")))
300 #t)))))
301 (home-page "https://github.com/miekg/rdup")
302 (synopsis "Provide a list of files to backup")
303 (description
304 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
305 Rdup itself does not backup anything, it only print a list of absolute
306 file names to standard output. Auxiliary scripts are needed that act on this
307 list and implement the backup strategy.")
308 (license license:gpl3+)))
309
310 (define-public btar
311 (package
312 (name "btar")
313 (version "1.1.1")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
318 "btar-" version ".tar.gz"))
319 (sha256
320 (base32
321 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
322 (build-system gnu-build-system)
323 (inputs
324 `(("librsync" ,librsync)))
325 (arguments
326 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
327 "CC=gcc")
328 #:tests? #f ;test input not distributed
329 #:phases
330 ;; no configure phase
331 (modify-phases %standard-phases
332 (delete 'configure))))
333 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
334 (synopsis "Tar-compatible archiver")
335 (description
336 "Btar is a tar-compatible archiver which allows arbitrary compression and
337 ciphering, redundancy, differential backup, indexed extraction, multicore
338 compression, input and output serialisation, and tolerance to partial archive
339 errors.")
340 (license license:gpl3+)))
341
342 (define-public rdiff-backup
343 (package
344 (name "rdiff-backup")
345 (version "1.2.8")
346 (source
347 (origin
348 (method url-fetch)
349 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
350 version ".tar.gz"))
351 (sha256
352 (base32
353 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
354 (build-system python-build-system)
355 (inputs
356 `(("python" ,python-2)
357 ("librsync" ,librsync)))
358 (arguments
359 `(#:python ,python-2
360 #:tests? #f))
361 (home-page "https://www.nongnu.org/rdiff-backup/")
362 (synopsis "Local/remote mirroring+incremental backup")
363 (description
364 "Rdiff-backup backs up one directory to another, possibly over a network.
365 The target directory ends up a copy of the source directory, but extra reverse
366 diffs are stored in a special subdirectory of that target directory, so you
367 can still recover files lost some time ago. The idea is to combine the best
368 features of a mirror and an incremental backup. Rdiff-backup also preserves
369 subdirectories, hard links, dev files, permissions, uid/gid ownership,
370 modification times, extended attributes, acls, and resource forks. Also,
371 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
372 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
373 to a remote location, and only the differences will be transmitted. Finally,
374 rdiff-backup is easy to use and settings have sensible defaults.")
375 (license license:gpl2+)))
376
377 (define-public rsnapshot
378 (package
379 (name "rsnapshot")
380 (version "1.4.2")
381 (source
382 (origin
383 (method url-fetch)
384 (uri (string-append
385 "https://github.com/rsnapshot/rsnapshot/releases/download/"
386 version "/rsnapshot-" version ".tar.gz"))
387 (sha256
388 (base32
389 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
390 (build-system gnu-build-system)
391 (arguments
392 `(#:phases
393 (modify-phases %standard-phases
394 (replace 'check
395 (lambda _
396 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
397 "t/backup_exec/conf/backup_exec_fail.conf"
398 "t/backup_exec/conf/backup_exec.conf")
399 (("/bin/true") (which "true"))
400 (("/bin/false") (which "false")))
401 (zero? (system* "make" "test")))))))
402 (inputs
403 `(("perl" ,perl)
404 ("rsync" ,rsync)))
405 (home-page "http://rsnapshot.org")
406 (synopsis "Deduplicating snapshot backup utility based on rsync")
407 (description "rsnapshot is a file system snapshot utility based on rsync.
408 rsnapshot makes it easy to make periodic snapshots of local machines, and
409 remote machines over SSH. To reduce the disk space required for each backup,
410 rsnapshot uses hard links to deduplicate identical files.")
411 (license license:gpl2+)))
412
413 (define-public libchop
414 (package
415 (name "libchop")
416 (version "0.5.2")
417 (source (origin
418 (method url-fetch)
419 (uri (string-append "mirror://savannah/libchop/libchop-"
420 version ".tar.gz"))
421 (sha256
422 (base32
423 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
424 (patches (search-patches "diffutils-gets-undeclared.patch"))))
425 (build-system gnu-build-system)
426 (native-inputs
427 `(("guile" ,guile-2.0)
428 ("gperf" ,gperf)
429 ("pkg-config" ,pkg-config)))
430 (inputs
431 `(("guile" ,guile-2.0)
432 ("util-linux" ,util-linux)
433 ("gnutls" ,gnutls)
434 ("tdb" ,tdb)
435 ("bdb" ,bdb)
436 ("gdbm" ,gdbm)
437 ("libgcrypt" ,libgcrypt)
438 ("lzo" ,lzo)
439 ("bzip2" ,bzip2)
440 ("zlib" ,zlib)))
441 (home-page "https://nongnu.org/libchop/")
442 (synopsis "Tools & library for data backup and distributed storage")
443 (description
444 "Libchop is a set of utilities and library for data backup and
445 distributed storage. Its main application is @command{chop-backup}, an
446 encrypted backup program that supports data integrity checks, versioning,
447 distribution among several sites, selective sharing of stored data, adaptive
448 compression, and more. The library itself implements storage techniques such
449 as content-addressable storage, content hash keys, Merkle trees, similarity
450 detection, and lossless compression.")
451 (license license:gpl3+)))
452
453 (define-public borg
454 (package
455 (name "borg")
456 (version "1.1.5")
457 (source
458 (origin
459 (method url-fetch)
460 (uri (pypi-uri "borgbackup" version))
461 (sha256
462 (base32 "0gbdnq7ks46diz6y2pf6wpwkb9hy6hp3immi7jg3h7w72b3ycmj3"))
463 (modules '((guix build utils)))
464 (snippet
465 '(begin
466 (for-each delete-file
467 (find-files "borg" "^(c|h|p).*\\.c$"))
468 ;; Remove bundled shared libraries.
469 (with-directory-excursion "src/borg/algorithms"
470 (for-each delete-file-recursively
471 (list "blake2" "lz4" "zstd")))))))
472 (build-system python-build-system)
473 (arguments
474 `(#:modules ((srfi srfi-26) ; for cut
475 (guix build utils)
476 (guix build python-build-system))
477 #:phases
478 (modify-phases %standard-phases
479 (add-after 'unpack 'set-env
480 (lambda* (#:key inputs #:allow-other-keys)
481 (let ((openssl (assoc-ref inputs "openssl"))
482 (libb2 (assoc-ref inputs "libb2"))
483 (lz4 (assoc-ref inputs "lz4"))
484 (zstd (assoc-ref inputs "zstd")))
485 (setenv "BORG_OPENSSL_PREFIX" openssl)
486 (setenv "BORG_LIBB2_PREFIX" libb2)
487 (setenv "BORG_LIBLZ4_PREFIX" lz4)
488 (setenv "BORG_LIBZSTD_PREFIX" zstd)
489 (setenv "PYTHON_EGG_CACHE" "/tmp")
490 ;; The test 'test_return_codes[python]' fails when
491 ;; HOME=/homeless-shelter.
492 (setenv "HOME" "/tmp")
493 #t)))
494 ;; Later versions of msgpack were disallowed to some warnings and lack
495 ;; of support for Python versions that we don't support anyways. So,
496 ;; it's okay to to keep using more recents versions of msgpack for
497 ;; Borg. Also see the note about msgpack in the list of inputs.
498 ;; https://github.com/borgbackup/borg/issues/3517#issuecomment-357221978
499 (add-before 'build 'adjust-msgpack-dependency
500 (lambda _
501 (substitute* "setup.py"
502 (("msgpack-python>=0.4.6,<0.5.0")
503 "msgpack-python>=0.4.6"))
504 #t))
505 ;; The tests need to be run after Borg is installed.
506 (delete 'check)
507 (add-after 'install 'check
508 (lambda* (#:key inputs outputs #:allow-other-keys)
509 ;; Make the installed package available for the test suite.
510 (add-installed-pythonpath inputs outputs)
511 ;; The tests should be run in an empty directory.
512 (mkdir-p "tests")
513 (with-directory-excursion "tests"
514 (zero?
515 (system* "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
516 (string-append
517 ;; These tests need to write to '/var'.
518 "not test_get_cache_dir "
519 "and not test_get_config_dir "
520 "and not test_get_keys_dir "
521 "and not test_get_security_dir "
522 ;; These tests assume there is a root user in
523 ;; '/etc/passwd'.
524 "and not test_access_acl "
525 "and not test_default_acl "
526 "and not test_non_ascii_acl "
527 ;; This test needs the unpackaged pytest-benchmark.
528 "and not benchmark "
529 ;; These tests assume the kernel supports FUSE.
530 "and not test_fuse "
531 "and not test_fuse_allow_damaged_files "
532 "and not test_mount_hardlinks"))))))
533 (add-after 'install 'install-doc
534 (lambda* (#:key inputs outputs #:allow-other-keys)
535 (let* ((out (assoc-ref outputs "out"))
536 (man (string-append out "/share/man/man1"))
537 (misc (string-append out "/share/borg/misc")))
538 (for-each (cut install-file <> misc)
539 '("docs/misc/create_chunker-params.txt"
540 "docs/misc/internals-picture.txt"
541 "docs/misc/prune-example.txt"))
542 (add-installed-pythonpath inputs outputs)
543 (and
544 (zero? (system* "python3" "setup.py" "build_man"))
545 (begin
546 (copy-recursively "docs/man" man)
547 #t))))))))
548 (native-inputs
549 `(("python-cython" ,python-cython)
550 ("python-setuptools-scm" ,python-setuptools-scm)
551 ("python-pytest" ,python-pytest)
552 ;; For generating the documentation.
553 ("python-sphinx" ,python-sphinx)
554 ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
555 (inputs
556 `(("acl" ,acl)
557 ("libb2" ,libb2)
558 ("lz4" ,lz4)
559 ("openssl" ,openssl)
560 ("python-llfuse" ,python-llfuse)
561 ;; The Python msgpack library changed its name so Borg requires this
562 ;; transitional package for now:
563 ;; <https://bugs.gnu.org/30662>
564 ("python-msgpack" ,python-msgpack-transitional)
565 ("zstd" ,zstd)))
566 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
567 (description "Borg is a deduplicating backup program. Optionally, it
568 supports compression and authenticated encryption. The main goal of Borg is to
569 provide an efficient and secure way to backup data. The data deduplication
570 technique used makes Borg suitable for daily backups since only changes are
571 stored. The authenticated encryption technique makes it suitable for backups
572 to not fully trusted targets. Borg is a fork of Attic.")
573 (home-page "https://www.borgbackup.org/")
574 (license license:bsd-3)))
575
576 (define-public attic
577 (package
578 (name "attic")
579 (version "0.16")
580 (source (origin
581 (method url-fetch)
582 (uri (string-append
583 "https://pypi.python.org/packages/source/A/Attic/Attic-"
584 version ".tar.gz"))
585 (sha256
586 (base32
587 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
588 (build-system python-build-system)
589 (arguments
590 `(;; The tests assume they are run as root:
591 ;; https://github.com/jborg/attic/issues/7
592 #:tests? #f
593 #:phases
594 (modify-phases %standard-phases
595 (add-before
596 'build 'set-openssl-prefix
597 (lambda* (#:key inputs #:allow-other-keys)
598 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
599 #t)))))
600 (inputs
601 `(("acl" ,acl)
602 ("openssl" ,openssl)
603 ("python-msgpack" ,python-msgpack)
604
605 ;; Attic is probably incompatible with llfuse > 0.41.
606 ;; These links are to discussions of llfuse compatibility from
607 ;; the borg project. Borg is a recent fork of attic, and attic
608 ;; has not been updated since the fork, so it's likely that
609 ;; llfuse compatibility requirements are still the same.
610 ;; https://github.com/borgbackup/borg/issues/642
611 ;; https://github.com/borgbackup/borg/issues/643
612 ("python-llfuse" ,python-llfuse-0.41)))
613 (synopsis "Deduplicating backup program")
614 (description "Attic is a deduplicating backup program. The main goal of
615 Attic is to provide an efficient and secure way to backup data. The data
616 deduplication technique used makes Attic suitable for daily backups since only
617 changes are stored.")
618 (home-page "https://attic-backup.org/")
619 (license license:bsd-3)
620 (properties `((superseded . ,borg)))))
621
622 (define-public wimlib
623 (package
624 (name "wimlib")
625 (version "1.12.0")
626 (source (origin
627 (method url-fetch)
628 (uri (string-append "https://wimlib.net/downloads/"
629 name "-" version ".tar.gz"))
630 (sha256
631 (base32
632 "0ks6hq7vwq13ljkzxp3a490bf8dnracgl2azf57rg49ad2fzab45"))))
633 (build-system gnu-build-system)
634 (native-inputs
635 `(("pkg-config" ,pkg-config)))
636 (inputs
637 `(("fuse" ,fuse)
638 ("libxml2" ,libxml2)
639 ("ntfs-3g" ,ntfs-3g)
640 ("openssl" ,openssl)))
641 (arguments
642 `(#:configure-flags (list "--enable-test-support")))
643 (home-page "https://wimlib.net/")
644 (synopsis "WIM file manipulation library and utilities")
645 (description "wimlib is a C library and set of command-line utilities for
646 creating, modifying, extracting, and mounting archives in the Windows Imaging
647 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
648 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
649 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
650 ;; LGPL, except those files explicitly marked as being released into the
651 ;; public domain (CC0) in their headers.
652 (license (list license:gpl3+
653 license:lgpl3+
654 license:cc0))))
655
656 (define-public obnam
657 (package
658 (name "obnam")
659 (version "1.21")
660 (source
661 (origin
662 (method url-fetch)
663 (uri (string-append
664 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
665 version ".orig.tar.xz"))
666 (sha256
667 (base32
668 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
669 (build-system python-build-system)
670 (arguments
671 `(#:python ,python-2
672 #:phases
673 (modify-phases %standard-phases
674 (replace 'check
675 (lambda _
676 (substitute* "obnamlib/vfs_local_tests.py"
677 ;; Check for the nobody user instead of root
678 (("self.fs.get_username\\(0\\), 'root'")
679 "self.fs.get_username(65534), 'nobody'")
680 ;; Disable tests checking for root group
681 (("self.fs.get_groupname\\(0\\)") "'root'"))
682 (substitute* "obnamlib/vfs_local.py"
683 ;; Don't cover get_groupname function
684 (("def get_groupname\\(self, gid\\):")
685 "def get_groupname(self, gid): # pragma: no cover"))
686 ;; Can't run network tests
687 (zero? (system* "./check" "--unit-tests")))))))
688 (inputs
689 `(("python2-cliapp" ,python2-cliapp)
690 ("python2-larch" ,python2-larch)
691 ("python2-paramiko" ,python2-paramiko)
692 ("python2-pyaml" ,python2-pyaml)
693 ("python2-tracing" ,python2-tracing)
694 ("python2-ttystatus" ,python2-ttystatus)))
695 (native-inputs
696 `(("gnupg" ,gnupg)
697 ("python2-coverage" ,python2-coverage)
698 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
699 ("python2-pep8" ,python2-pep8)
700 ("python2-pylint" ,python2-pylint)))
701 (home-page "https://obnam.org/")
702 (synopsis "Easy and secure backup program")
703 (description "Obnam is an easy, secure backup program. Features
704 include snapshot backups, data de-duplication and encrypted backups
705 using GnuPG. Backups can be stored on local hard disks, or online via
706 the SSH SFTP protocol. The backup server, if used, does not require
707 any special software, on top of SSH.")
708 (license license:gpl3+)))
709
710 (define-public dirvish
711 (package
712 (name "dirvish")
713 (version "1.2.1")
714 (build-system gnu-build-system)
715 (source (origin
716 (method url-fetch)
717 (uri (string-append
718 "http://dirvish.org/dirvish-" version ".tgz"))
719 (sha256
720 (base32
721 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
722 (arguments
723 `(#:modules ((ice-9 match) (ice-9 rdelim)
724 ,@%gnu-build-system-modules)
725 #:phases
726 ;; This mostly mirrors the steps taken in the install.sh that ships
727 ;; with dirvish, but simplified because we aren't prompting interactively
728 (modify-phases %standard-phases
729 (delete 'configure)
730 (delete 'build)
731 (delete 'check)
732 (replace 'install
733 (lambda* (#:key inputs outputs #:allow-other-keys)
734 ;; These are mostly the same steps the install.sh that comes with
735 ;; dirvish does
736 (let* (;; Files we'll be copying
737 (executables
738 '("dirvish" "dirvish-runall"
739 "dirvish-expire" "dirvish-locate"))
740 (man-pages
741 '(("dirvish" "8") ("dirvish-runall" "8")
742 ("dirvish-expire" "8") ("dirvish-locate" "8")
743 ("dirvish.conf" "5")))
744
745 (output-dir
746 (assoc-ref outputs "out"))
747
748 ;; Just a default... not so useful on guixsd though
749 ;; You probably want to a service with file(s) to point to.
750 (confdir "/etc/dirvish")
751
752 (perl (string-append (assoc-ref %build-inputs "perl")
753 "/bin/perl"))
754 (loadconfig.pl (call-with-input-file "loadconfig.pl"
755 read-string)))
756
757
758 (define (write-pl filename)
759 (define pl-header
760 (string-append "#!" perl "\n\n"
761 "$CONFDIR = \"" confdir "\";\n\n"))
762 (define input-file-location
763 (string-append filename ".pl"))
764 (define target-file-location
765 (string-append output-dir "/bin/" filename ".pl"))
766 (define text-to-write
767 (string-append pl-header
768 (call-with-input-file input-file-location
769 read-string)
770 "\n" loadconfig.pl))
771 (with-output-to-file target-file-location
772 (lambda ()
773 (display text-to-write)))
774 (chmod target-file-location #o755)
775 (wrap-program target-file-location
776 `("PERL5LIB" ":" prefix
777 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
778 "/lib/perl5/site_perl"))
779 '("perl-libtime-period"
780 "perl-libtime-parsedate")))))
781
782 (define write-man
783 (match-lambda
784 ((file-base man-num)
785 (let* ((filename
786 (string-append file-base "." man-num))
787 (output-path
788 (string-append output-dir
789 "/share/man/man" man-num
790 "/" filename)))
791 (copy-file filename output-path)))))
792
793 ;; Make directories
794 (mkdir-p (string-append output-dir "/bin/"))
795 (mkdir-p (string-append output-dir "/share/man/man8/"))
796 (mkdir-p (string-append output-dir "/share/man/man5/"))
797
798 ;; Write out executables
799 (for-each write-pl executables)
800 ;; Write out man pages
801 (for-each write-man man-pages)
802 #t))))))
803 (inputs
804 `(("perl" ,perl)
805 ("rsync" ,rsync)
806 ("perl-libtime-period" ,perl-libtime-period)
807 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
808 (home-page "http://dirvish.org/")
809 (synopsis "Fast, disk based, rotating network backup system")
810 (description
811 "With dirvish you can maintain a set of complete images of your
812 file systems with unattended creation and expiration. A dirvish backup vault
813 is like a time machine for your data. ")
814 (license (license:fsf-free "file://COPYING"
815 "Open Software License 2.0"))))