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