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