gnu: perl-xml-feed: Update to 0.55.
[jackhill/guix/guix.git] / gnu / packages / backup.scm
CommitLineData
d1a5439b 1;;; GNU Guix --- Functional package management for GNU
aa90f2cd 2;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
29a7c98a 3;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
d265169b 4;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
19278d8d 5;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
0da4f365 6;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
a2fa9c3d 7;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
3c8ba11a 8;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
4ac8d486 9;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
0ff4425c 10;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
44dd001d 11;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
1a3aa5ba 12;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
f77886c1 13;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
d1a5439b
EB
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages backup)
31 #:use-module (guix packages)
b5b73a82 32 #:use-module ((guix licenses) #:prefix license:)
d1a5439b 33 #:use-module (guix download)
29a7c98a 34 #:use-module (guix utils)
2d762953 35 #:use-module (guix build-system gnu)
f77886c1 36 #:use-module (guix build-system go)
d1a5439b
EB
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages)
0c146750 39 #:use-module (gnu packages acl)
f6875394 40 #:use-module (gnu packages autotools)
2d762953 41 #:use-module (gnu packages base)
ac257f12 42 #:use-module (gnu packages check)
2d762953 43 #:use-module (gnu packages compression)
19278d8d 44 #:use-module (gnu packages crypto)
362f496d 45 #:use-module (gnu packages databases)
d42e6122 46 #:use-module (gnu packages dejagnu)
2903ee1e 47 #:use-module (gnu packages ftp)
2d762953 48 #:use-module (gnu packages glib)
d1a5439b 49 #:use-module (gnu packages gnupg)
f77886c1 50 #:use-module (gnu packages golang)
362f496d
LC
51 #:use-module (gnu packages gperf)
52 #:use-module (gnu packages guile)
335bc683 53 #:use-module (gnu packages linux)
2d762953 54 #:use-module (gnu packages mcrypt)
d42e6122
EB
55 #:use-module (gnu packages nettle)
56 #:use-module (gnu packages pcre)
0da4f365 57 #:use-module (gnu packages perl)
2d762953 58 #:use-module (gnu packages pkg-config)
0c146750 59 #:use-module (gnu packages python)
cc6f4912 60 #:use-module (gnu packages python-crypto)
1b2f753d 61 #:use-module (gnu packages python-web)
d1a5439b 62 #:use-module (gnu packages rsync)
2d762953 63 #:use-module (gnu packages ssh)
0c146750 64 #:use-module (gnu packages tls)
29a7c98a 65 #:use-module (gnu packages xml))
d1a5439b
EB
66
67(define-public duplicity
68 (package
69 (name "duplicity")
7bb7920f 70 (version "0.7.18.1")
d1a5439b
EB
71 (source
72 (origin
73 (method url-fetch)
74 (uri (string-append "https://code.launchpad.net/duplicity/"
29a7c98a 75 (version-major+minor version)
d1a5439b
EB
76 "-series/" version "/+download/duplicity-"
77 version ".tar.gz"))
78 (sha256
79 (base32
7bb7920f 80 "17c0203y5qz9w8iyhs26l44qf6a1vp26b5ykz1ypdr2kv6g02df9"))))
d1a5439b
EB
81 (build-system python-build-system)
82 (native-inputs
02489a66 83 `(("util-linux" ,util-linux) ; setsid command, for the tests
8ef8de79 84 ("par2cmdline" ,par2cmdline)
2903ee1e 85 ("python-pexpect" ,python2-pexpect)
2dfb9bbf 86 ("python-fasteners" ,python2-fasteners)
2903ee1e
TD
87 ("mock" ,python2-mock)))
88 (propagated-inputs
89 `(("lockfile" ,python2-lockfile)
90 ("urllib3" ,python2-urllib3)))
d1a5439b 91 (inputs
2903ee1e
TD
92 `(("librsync" ,librsync)
93 ("lftp" ,lftp)
02489a66
TGR
94 ("gnupg" ,gnupg) ; gpg executable needed
95 ("util-linux" ,util-linux) ; for setsid
335bc683 96 ("tzdata" ,tzdata)))
d1a5439b 97 (arguments
02489a66 98 `(#:python ,python-2 ; setup assumes Python 2
d1a5439b 99 #:test-target "test"
ad04bd6b
MB
100 #:phases
101 (modify-phases %standard-phases
7bb7920f 102 (add-before 'build 'use-store-file-names
ad04bd6b 103 (lambda* (#:key inputs #:allow-other-keys)
8ef8de79
MB
104 (substitute* "duplicity/gpginterface.py"
105 (("self.call = 'gpg'")
106 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
e61f092c 107
8ef8de79
MB
108 (substitute* '("testing/functional/__init__.py"
109 "testing/overrides/bin/lftp")
ad04bd6b 110 (("/bin/sh") (which "sh")))
8ef8de79
MB
111 #t))
112 (add-before 'check 'check-setup
113 (lambda* (#:key inputs #:allow-other-keys)
02489a66
TGR
114 (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME
115 (setenv "TZDIR" ; some timestamp checks need TZDIR
ad04bd6b
MB
116 (string-append (assoc-ref inputs "tzdata")
117 "/share/zoneinfo"))
118 #t)))))
d1a5439b
EB
119 (home-page "http://duplicity.nongnu.org/index.html")
120 (synopsis "Encrypted backup using rsync algorithm")
121 (description
122 "Duplicity backs up directories by producing encrypted tar-format volumes
123and uploading them to a remote or local file server. Because duplicity uses
124librsync, the incremental archives are space efficient and only record the
125parts of files that have changed since the last backup. Because duplicity
126uses GnuPG to encrypt and/or sign these archives, they will be safe from
127spying and/or modification by the server.")
b0e3635e 128 (license license:gpl2+)))
2d762953 129
f6875394
BT
130(define-public par2cmdline
131 (package
132 (name "par2cmdline")
44dd001d 133 (version "0.8.0")
f6875394
BT
134 (source (origin
135 (method url-fetch)
136 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
137 version ".tar.gz"))
138 (file-name (string-append name "-" version ".tar.gz"))
139 (sha256
140 (base32
44dd001d 141 "1jpshmmcr81mxly0md2rr231qz9c8c680bbvcmhh100dg9i4a6s6"))))
f6875394
BT
142 (native-inputs
143 `(("automake" ,automake)
144 ("autoconf" ,autoconf)))
145 (build-system gnu-build-system)
146 (arguments
7359cffa 147 `(#:phases
f6875394
BT
148 (modify-phases %standard-phases
149 (add-after 'unpack 'autoreconf
f4f46fc3 150 (lambda _ (invoke "autoreconf" "-vfi"))))))
f6d59ecf
TGR
151 (synopsis "File verification and repair tools")
152 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
153generate and verify PAR2 recovery files. These files can be distributed
154alongside the source files or stored together with back-ups to protect against
155transmission errors or @dfn{bit rot}, the degradation of storage media over
156time.
157Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
a2dd9270
TGR
158damage isn't too extensive (and smaller than the size of the recovery file), it
159can even repair them.")
f6875394
BT
160 (home-page "https://github.com/Parchive/par2cmdline")
161 (license license:gpl3+)))
162
2d762953
EB
163(define-public hdup
164 (package
165 (name "hdup")
166 (version "2.0.14")
167 (source
168 (origin
169 (method url-fetch)
35d28c60 170 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
2d762953
EB
171 (sha256
172 (base32
173 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
174 (build-system gnu-build-system)
175 (native-inputs `(("pkg-config" ,pkg-config)))
176 (inputs
177 `(("glib" ,glib)
178 ("tar" ,tar)
179 ("lzop" ,lzop)
180 ("mcrypt" ,mcrypt)
181 ("openssh" ,openssh)
182 ("gnupg" ,gnupg-1)))
183 (arguments
184 `(#:configure-flags
185 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
186 #:tests? #f))
187 (home-page "http://archive.miek.nl/projects/hdup/index.html")
188 (synopsis "Simple incremental backup tool")
189 (description
69b4ffcf 190 "Hdup2 is a backup utility, its aim is to make backup really simple. The
2d762953
EB
191backup scheduling is done by means of a cron job. It supports an
192include/exclude mechanism, remote backups, encrypted backups and split
193backups (called chunks) to allow easy burning to CD/DVD.")
b0e3635e
LC
194 (license license:gpl2)))
195
196(define-public libarchive
197 (package
198 (name "libarchive")
7095760c 199 (version "3.3.2")
b0e3635e
LC
200 (source
201 (origin
202 (method url-fetch)
203 (uri (string-append "http://libarchive.org/downloads/libarchive-"
204 version ".tar.gz"))
f76fc968
LF
205 (patches (search-patches "libarchive-CVE-2017-14166.patch"
206 "libarchive-CVE-2017-14502.patch"))
b0e3635e
LC
207 (sha256
208 (base32
7095760c 209 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
b0e3635e
LC
210 (build-system gnu-build-system)
211 (inputs
212 `(("zlib" ,zlib)
213 ("nettle" ,nettle)
214 ("lzo" ,lzo)
215 ("bzip2" ,bzip2)
216 ("libxml2" ,libxml2)
217 ("xz" ,xz)))
218 (arguments
219 `(#:phases
4ac8d486
EF
220 (modify-phases %standard-phases
221 (add-before 'build 'patch-pwd
222 (lambda _
223 (substitute* "Makefile"
6266b8bc
EF
224 (("/bin/pwd") (which "pwd")))
225 #t))
4ac8d486
EF
226 (replace 'check
227 (lambda _
228 ;; XXX: The test_owner_parse, test_read_disk, and
229 ;; test_write_disk_lookup tests expect user 'root' to exist, but
230 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
231 ;;
232 ;; The tests allow one to disable tests matching a globbing pattern.
1a3aa5ba
MW
233 (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
234 ;; XXX: This glob disables too much.
235 (invoke "./libarchive_test" "^test_*_disk*")
236 (invoke "./bsdcpio_test" "^test_owner_parse")
5294836d
LC
237 (invoke "./bsdtar_test")))
238 (add-after 'install 'add--L-in-libarchive-pc
239 (lambda* (#:key inputs outputs #:allow-other-keys)
240 (let* ((out (assoc-ref outputs "out"))
241 (lib (string-append out "/lib"))
242 (nettle (assoc-ref inputs "nettle"))
243 (libxml2 (assoc-ref inputs "libxml2"))
244 (xz (assoc-ref inputs "xz"))
245 (zlib (assoc-ref inputs "zlib"))
246 (bzip2 (assoc-ref inputs "bzip2")))
247 (substitute* (string-append lib "/pkgconfig/libarchive.pc")
248 (("-lnettle")
249 (string-append "-L" nettle "/lib -lnettle"))
250 (("-lxml2")
251 (string-append "-L" libxml2 "/lib -lxml2"))
252 (("-llzma")
253 (string-append "-L" xz "/lib -llzma"))
254 (("-lz")
255 (string-append "-L" zlib "/lib -lz"))
256 (("-lbz2")
257 (string-append "-L" bzip2 "/lib -lbz2")))
258 #t))))
259
09cbd53c
EF
260 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
261 ;; compiled with C99 or C11 or a gnu variant.
262 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
b0e3635e
LC
263 (home-page "http://libarchive.org/")
264 (synopsis "Multi-format archive and compression library")
265 (description
266 "Libarchive provides a flexible interface for reading and writing
267archives in various formats such as tar and cpio. Libarchive also supports
268reading and writing archives compressed using various compression filters such
269as gzip and bzip2. The library is inherently stream-oriented; readers
270serially iterate through the archive, writers serially add things to the
35b9e423 271archive. In particular, note that there is currently no built-in support for
b0e3635e
LC
272random access nor for in-place modification.")
273 (license license:bsd-2)))
d42e6122
EB
274
275(define-public rdup
276 (package
277 (name "rdup")
fbf210cb 278 (version "1.1.15")
d42e6122
EB
279 (source
280 (origin
281 (method url-fetch)
fbf210cb
TGR
282 (file-name (string-append name "-" version ".tar.gz"))
283 (uri (string-append "https://github.com/miekg/rdup/archive/"
284 version ".tar.gz"))
d42e6122
EB
285 (sha256
286 (base32
fbf210cb 287 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
d42e6122
EB
288 (build-system gnu-build-system)
289 (native-inputs
fbf210cb
TGR
290 `(("autoconf" ,autoconf)
291 ("automake" ,automake)
292 ("pkg-config" ,pkg-config)
293
294 ;; For tests.
d42e6122
EB
295 ("dejagnu" ,dejagnu)))
296 (inputs
297 `(("glib" ,glib)
298 ("pcre" ,pcre)
299 ("libarchive" ,libarchive)
fbf210cb 300 ("mcrypt" ,mcrypt)
d42e6122
EB
301 ("nettle" ,nettle)))
302 (arguments
303 `(#:parallel-build? #f ;race conditions
dc1d3cde
KK
304 #:phases
305 (modify-phases %standard-phases
fbf210cb
TGR
306 (add-before 'build 'qualify-inputs
307 (lambda* (#:key inputs #:allow-other-keys)
308 ;; This script is full of pitfalls. Fix some that particularly
309 ;; affect Guix users & leave the rest as reader excercises.
310 (substitute* "rdup-simple"
311 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
312 (("([' ])mcrypt " all delimiter)
313 (string-append delimiter (which "mcrypt") " "))
314 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
315 (("which") "command -v"))
dc1d3cde
KK
316 #t))
317 (add-before 'check 'pre-check
318 (lambda _
319 (setenv "HOME" (getcwd))
320 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
321 (("/bin/cat") (which "cat")))
322 #t)))))
fbf210cb 323 (home-page "https://github.com/miekg/rdup")
d42e6122
EB
324 (synopsis "Provide a list of files to backup")
325 (description
326 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
327Rdup itself does not backup anything, it only print a list of absolute
e881752c 328file names to standard output. Auxiliary scripts are needed that act on this
d42e6122 329list and implement the backup strategy.")
b0e3635e 330 (license license:gpl3+)))
22c24621
EB
331
332(define-public btar
333 (package
334 (name "btar")
335 (version "1.1.1")
336 (source
337 (origin
338 (method url-fetch)
339 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
340 "btar-" version ".tar.gz"))
341 (sha256
342 (base32
343 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
344 (build-system gnu-build-system)
345 (inputs
346 `(("librsync" ,librsync)))
347 (arguments
348 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
349 "CC=gcc")
350 #:tests? #f ;test input not distributed
351 #:phases
dc1d3cde
KK
352 ;; no configure phase
353 (modify-phases %standard-phases
354 (delete 'configure))))
22c24621
EB
355 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
356 (synopsis "Tar-compatible archiver")
357 (description
358 "Btar is a tar-compatible archiver which allows arbitrary compression and
359ciphering, redundancy, differential backup, indexed extraction, multicore
360compression, input and output serialisation, and tolerance to partial archive
361errors.")
b0e3635e 362 (license license:gpl3+)))
bd3fc08c
EB
363
364(define-public rdiff-backup
365 (package
366 (name "rdiff-backup")
367 (version "1.2.8")
368 (source
369 (origin
370 (method url-fetch)
371 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
372 version ".tar.gz"))
373 (sha256
374 (base32
375 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
376 (build-system python-build-system)
bd3fc08c
EB
377 (inputs
378 `(("python" ,python-2)
379 ("librsync" ,librsync)))
380 (arguments
381 `(#:python ,python-2
382 #:tests? #f))
340978d7 383 (home-page "https://www.nongnu.org/rdiff-backup/")
bd3fc08c
EB
384 (synopsis "Local/remote mirroring+incremental backup")
385 (description
386 "Rdiff-backup backs up one directory to another, possibly over a network.
387The target directory ends up a copy of the source directory, but extra reverse
388diffs are stored in a special subdirectory of that target directory, so you
389can still recover files lost some time ago. The idea is to combine the best
390features of a mirror and an incremental backup. Rdiff-backup also preserves
391subdirectories, hard links, dev files, permissions, uid/gid ownership,
392modification times, extended attributes, acls, and resource forks. Also,
393rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
394rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
395to a remote location, and only the differences will be transmitted. Finally,
e881752c 396rdiff-backup is easy to use and settings have sensible defaults.")
b0e3635e 397 (license license:gpl2+)))
0c146750 398
0da4f365
TD
399(define-public rsnapshot
400 (package
401 (name "rsnapshot")
402 (version "1.4.2")
403 (source
404 (origin
405 (method url-fetch)
406 (uri (string-append
407 "https://github.com/rsnapshot/rsnapshot/releases/download/"
408 version "/rsnapshot-" version ".tar.gz"))
409 (sha256
410 (base32
411 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
412 (build-system gnu-build-system)
413 (arguments
414 `(#:phases
415 (modify-phases %standard-phases
416 (replace 'check
417 (lambda _
418 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
419 "t/backup_exec/conf/backup_exec_fail.conf"
420 "t/backup_exec/conf/backup_exec.conf")
421 (("/bin/true") (which "true"))
422 (("/bin/false") (which "false")))
4ce7c1b3 423 (invoke "make" "test"))))))
0da4f365
TD
424 (inputs
425 `(("perl" ,perl)
426 ("rsync" ,rsync)))
427 (home-page "http://rsnapshot.org")
428 (synopsis "Deduplicating snapshot backup utility based on rsync")
162a1374 429 (description "rsnapshot is a file system snapshot utility based on rsync.
0da4f365
TD
430rsnapshot makes it easy to make periodic snapshots of local machines, and
431remote machines over SSH. To reduce the disk space required for each backup,
432rsnapshot uses hard links to deduplicate identical files.")
433 (license license:gpl2+)))
434
362f496d
LC
435(define-public libchop
436 (package
437 (name "libchop")
438 (version "0.5.2")
439 (source (origin
440 (method url-fetch)
441 (uri (string-append "mirror://savannah/libchop/libchop-"
442 version ".tar.gz"))
443 (sha256
444 (base32
445 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
fc1adab1 446 (patches (search-patches "diffutils-gets-undeclared.patch"))))
362f496d 447 (build-system gnu-build-system)
6d1a7ce8
LC
448 (arguments
449 '(#:phases (modify-phases %standard-phases
450 (add-before 'configure 'adjust-configure-script
451 (lambda _
452 ;; Mimic upstream commit
453 ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091.
454 (substitute* "configure"
455 (("GUILE=(.*)--variable bindir`" _ middle)
456 (string-append "GUILE=" middle
457 "--variable bindir`/guile")))
458 #t))
459 (add-before 'check 'skip-test
460 (lambda _
461 ;; XXX: This test fails (1) because current GnuTLS no
462 ;; longer supports OpenPGP authentication, and (2) for
463 ;; some obscure reason. Better skip it.
464 (setenv "XFAIL_TESTS" "utils/block-server")
465 #t)))))
362f496d
LC
466 (native-inputs
467 `(("guile" ,guile-2.0)
c9f898cd 468 ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382>
362f496d
LC
469 ("pkg-config" ,pkg-config)))
470 (inputs
471 `(("guile" ,guile-2.0)
472 ("util-linux" ,util-linux)
473 ("gnutls" ,gnutls)
474 ("tdb" ,tdb)
475 ("bdb" ,bdb)
476 ("gdbm" ,gdbm)
477 ("libgcrypt" ,libgcrypt)
478 ("lzo" ,lzo)
479 ("bzip2" ,bzip2)
480 ("zlib" ,zlib)))
340978d7 481 (home-page "https://nongnu.org/libchop/")
362f496d
LC
482 (synopsis "Tools & library for data backup and distributed storage")
483 (description
484 "Libchop is a set of utilities and library for data backup and
485distributed storage. Its main application is @command{chop-backup}, an
486encrypted backup program that supports data integrity checks, versioning,
487distribution among several sites, selective sharing of stored data, adaptive
488compression, and more. The library itself implements storage techniques such
489as content-addressable storage, content hash keys, Merkle trees, similarity
490detection, and lossless compression.")
491 (license license:gpl3+)))
6fc5c11b
LF
492
493(define-public borg
494 (package
495 (name "borg")
5a0696b2 496 (version "1.1.7")
c4556777
TGR
497 (source
498 (origin
499 (method url-fetch)
500 (uri (pypi-uri "borgbackup" version))
247537da 501 (patches (search-patches "borg-respect-storage-quota.patch"))
c4556777 502 (sha256
5a0696b2
LF
503 (base32
504 "1p3zia62vyg9vadkdjzzkzbj4dmgijr7ix5lmhfbxpwy5q9imdgp"))
c4556777
TGR
505 (modules '((guix build utils)))
506 (snippet
507 '(begin
5a3bf255
LF
508 ;; Delete files generated by Cython. We used to have a regex
509 ;; that created the list of generated files but Borg has
510 ;; added new non-generated C files that cause the regex to
511 ;; generate the wrong list.
c4556777 512 (for-each delete-file
5a3bf255
LF
513 '("src/borg/algorithms/checksums.c"
514 "src/borg/chunker.c"
515 "src/borg/compress.c"
516 "src/borg/crypto/low_level.c"
517 "src/borg/hashindex.c"
518 "src/borg/item.c"
519 "src/borg/platform/darwin.c"
520 "src/borg/platform/freebsd.c"
521 "src/borg/platform/linux.c"
522 "src/borg/platform/posix.c"))
c4556777
TGR
523 ;; Remove bundled shared libraries.
524 (with-directory-excursion "src/borg/algorithms"
525 (for-each delete-file-recursively
6cbee49d
MW
526 (list "blake2" "lz4" "zstd")))
527 #t))))
6fc5c11b
LF
528 (build-system python-build-system)
529 (arguments
c21b1a1f
LF
530 `(#:modules ((srfi srfi-26) ; for cut
531 (guix build utils)
532 (guix build python-build-system))
533 #:phases
6fc5c11b
LF
534 (modify-phases %standard-phases
535 (add-after 'unpack 'set-env
536 (lambda* (#:key inputs #:allow-other-keys)
537 (let ((openssl (assoc-ref inputs "openssl"))
19278d8d 538 (libb2 (assoc-ref inputs "libb2"))
c4556777
TGR
539 (lz4 (assoc-ref inputs "lz4"))
540 (zstd (assoc-ref inputs "zstd")))
6fc5c11b 541 (setenv "BORG_OPENSSL_PREFIX" openssl)
19278d8d 542 (setenv "BORG_LIBB2_PREFIX" libb2)
c4556777
TGR
543 (setenv "BORG_LIBLZ4_PREFIX" lz4)
544 (setenv "BORG_LIBZSTD_PREFIX" zstd)
6fc5c11b 545 (setenv "PYTHON_EGG_CACHE" "/tmp")
b4f91d0e
LF
546 ;; The test 'test_return_codes[python]' fails when
547 ;; HOME=/homeless-shelter.
548 (setenv "HOME" "/tmp")
6fc5c11b 549 #t)))
b4f91d0e
LF
550 ;; The tests need to be run after Borg is installed.
551 (delete 'check)
552 (add-after 'install 'check
1d60f7c2
LF
553 (lambda* (#:key inputs outputs #:allow-other-keys)
554 ;; Make the installed package available for the test suite.
555 (add-installed-pythonpath inputs outputs)
8cb3e7e7
LF
556 ;; The tests should be run in an empty directory.
557 (mkdir-p "tests")
558 (with-directory-excursion "tests"
e252ec32
TGR
559 (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
560 (string-append
561 ;; These tests need to write to '/var'.
562 "not test_get_cache_dir "
563 "and not test_get_config_dir "
564 "and not test_get_keys_dir "
565 "and not test_get_security_dir "
566 ;; These tests assume there is a root user in
567 ;; '/etc/passwd'.
568 "and not test_access_acl "
569 "and not test_default_acl "
570 "and not test_non_ascii_acl "
571 ;; This test needs the unpackaged pytest-benchmark.
572 "and not benchmark "
573 ;; These tests assume the kernel supports FUSE.
574 "and not test_fuse "
575 "and not test_fuse_allow_damaged_files "
576 "and not test_mount_hardlinks")))))
6fc5c11b 577 (add-after 'install 'install-doc
6ee4fd2a 578 (lambda* (#:key inputs outputs #:allow-other-keys)
6fc5c11b 579 (let* ((out (assoc-ref outputs "out"))
c21b1a1f
LF
580 (man (string-append out "/share/man/man1"))
581 (misc (string-append out "/share/borg/misc")))
582 (for-each (cut install-file <> misc)
583 '("docs/misc/create_chunker-params.txt"
584 "docs/misc/internals-picture.txt"
585 "docs/misc/prune-example.txt"))
6ee4fd2a 586 (add-installed-pythonpath inputs outputs)
e252ec32
TGR
587 (invoke "python3" "setup.py" "build_man")
588 (copy-recursively "docs/man" man)
589 #t))))))
6fc5c11b 590 (native-inputs
f99cfc19
EF
591 `(("python-cython" ,python-cython)
592 ("python-setuptools-scm" ,python-setuptools-scm)
928da609 593 ("python-pytest" ,python-pytest)
6fc5c11b
LF
594 ;; For generating the documentation.
595 ("python-sphinx" ,python-sphinx)
d265169b 596 ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
6fc5c11b
LF
597 (inputs
598 `(("acl" ,acl)
19278d8d 599 ("libb2" ,libb2)
6fc5c11b
LF
600 ("lz4" ,lz4)
601 ("openssl" ,openssl)
602 ("python-llfuse" ,python-llfuse)
acb59d99
LF
603 ;; The Python msgpack library changed its name so Borg requires this
604 ;; transitional package for now:
605 ;; <https://bugs.gnu.org/30662>
606 ("python-msgpack" ,python-msgpack-transitional)
c4556777 607 ("zstd" ,zstd)))
6fc5c11b
LF
608 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
609 (description "Borg is a deduplicating backup program. Optionally, it
610supports compression and authenticated encryption. The main goal of Borg is to
611provide an efficient and secure way to backup data. The data deduplication
612technique used makes Borg suitable for daily backups since only changes are
613stored. The authenticated encryption technique makes it suitable for backups
614to not fully trusted targets. Borg is a fork of Attic.")
18533bcf 615 (home-page "https://www.borgbackup.org/")
6fc5c11b 616 (license license:bsd-3)))
b2fe9183
LF
617
618(define-public attic
619 (package
620 (name "attic")
621 (version "0.16")
622 (source (origin
623 (method url-fetch)
624 (uri (string-append
625 "https://pypi.python.org/packages/source/A/Attic/Attic-"
626 version ".tar.gz"))
627 (sha256
628 (base32
629 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
630 (build-system python-build-system)
631 (arguments
1df6d73b
LF
632 `(;; The tests assume they are run as root:
633 ;; https://github.com/jborg/attic/issues/7
634 #:tests? #f
635 #:phases
b2fe9183
LF
636 (modify-phases %standard-phases
637 (add-before
638 'build 'set-openssl-prefix
639 (lambda* (#:key inputs #:allow-other-keys)
640 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
641 #t)))))
642 (inputs
643 `(("acl" ,acl)
644 ("openssl" ,openssl)
645 ("python-msgpack" ,python-msgpack)
646
647 ;; Attic is probably incompatible with llfuse > 0.41.
648 ;; These links are to discussions of llfuse compatibility from
649 ;; the borg project. Borg is a recent fork of attic, and attic
650 ;; has not been updated since the fork, so it's likely that
651 ;; llfuse compatibility requirements are still the same.
652 ;; https://github.com/borgbackup/borg/issues/642
653 ;; https://github.com/borgbackup/borg/issues/643
654 ("python-llfuse" ,python-llfuse-0.41)))
655 (synopsis "Deduplicating backup program")
656 (description "Attic is a deduplicating backup program. The main goal of
657Attic is to provide an efficient and secure way to backup data. The data
658deduplication technique used makes Attic suitable for daily backups since only
659changes are stored.")
660 (home-page "https://attic-backup.org/")
661 (license license:bsd-3)
662 (properties `((superseded . ,borg)))))
3b402139
TGR
663
664(define-public wimlib
665 (package
666 (name "wimlib")
ea94aff7 667 (version "1.12.0")
3b402139
TGR
668 (source (origin
669 (method url-fetch)
670 (uri (string-append "https://wimlib.net/downloads/"
671 name "-" version ".tar.gz"))
672 (sha256
673 (base32
ea94aff7 674 "0ks6hq7vwq13ljkzxp3a490bf8dnracgl2azf57rg49ad2fzab45"))))
3b402139
TGR
675 (build-system gnu-build-system)
676 (native-inputs
677 `(("pkg-config" ,pkg-config)))
678 (inputs
679 `(("fuse" ,fuse)
680 ("libxml2" ,libxml2)
681 ("ntfs-3g" ,ntfs-3g)
682 ("openssl" ,openssl)))
683 (arguments
684 `(#:configure-flags (list "--enable-test-support")))
685 (home-page "https://wimlib.net/")
686 (synopsis "WIM file manipulation library and utilities")
687 (description "wimlib is a C library and set of command-line utilities for
688creating, modifying, extracting, and mounting archives in the Windows Imaging
689Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
690NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
691 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
692 ;; LGPL, except those files explicitly marked as being released into the
693 ;; public domain (CC0) in their headers.
694 (license (list license:gpl3+
695 license:lgpl3+
696 license:cc0))))
a2fa9c3d
AI
697
698(define-public obnam
699 (package
700 (name "obnam")
701 (version "1.21")
702 (source
703 (origin
704 (method url-fetch)
705 (uri (string-append
706 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
707 version ".orig.tar.xz"))
708 (sha256
709 (base32
710 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
711 (build-system python-build-system)
712 (arguments
f75b1400
AI
713 `(#:python ,python-2
714 #:phases
715 (modify-phases %standard-phases
716 (replace 'check
717 (lambda _
718 (substitute* "obnamlib/vfs_local_tests.py"
f32a1803 719 ;; Check for the nobody user instead of root.
f75b1400
AI
720 (("self.fs.get_username\\(0\\), 'root'")
721 "self.fs.get_username(65534), 'nobody'")
f32a1803 722 ;; Disable tests checking for root group.
f75b1400
AI
723 (("self.fs.get_groupname\\(0\\)") "'root'"))
724 (substitute* "obnamlib/vfs_local.py"
f32a1803 725 ;; Don't cover get_groupname function.
f75b1400
AI
726 (("def get_groupname\\(self, gid\\):")
727 "def get_groupname(self, gid): # pragma: no cover"))
f32a1803
TGR
728 ;; Can't run network tests.
729 (invoke "./check" "--unit-tests"))))))
a2fa9c3d
AI
730 (inputs
731 `(("python2-cliapp" ,python2-cliapp)
732 ("python2-larch" ,python2-larch)
733 ("python2-paramiko" ,python2-paramiko)
734 ("python2-pyaml" ,python2-pyaml)
735 ("python2-tracing" ,python2-tracing)
736 ("python2-ttystatus" ,python2-ttystatus)))
f75b1400
AI
737 (native-inputs
738 `(("gnupg" ,gnupg)
739 ("python2-coverage" ,python2-coverage)
740 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
741 ("python2-pep8" ,python2-pep8)
742 ("python2-pylint" ,python2-pylint)))
a2fa9c3d 743 (home-page "https://obnam.org/")
a93de1ae
TGR
744 (synopsis "Retired backup program")
745 (description
746 "Warning: @uref{https://blog.liw.fi/posts/2017/08/13/retiring_obnam/,
747the Obnam project is retired}. You should use another backup solution instead.
748
749Obnam was an easy, secure backup program. Features included snapshot backups,
750data de-duplication and encrypted backups using GnuPG. Backups can be stored on
751local hard disks, or online via the SSH SFTP protocol. The backup server, if
752used, does not require any special software, on top of SSH.")
a2fa9c3d 753 (license license:gpl3+)))
0ff4425c
CAW
754
755(define-public dirvish
756 (package
757 (name "dirvish")
758 (version "1.2.1")
759 (build-system gnu-build-system)
760 (source (origin
761 (method url-fetch)
762 (uri (string-append
763 "http://dirvish.org/dirvish-" version ".tgz"))
764 (sha256
765 (base32
766 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
767 (arguments
768 `(#:modules ((ice-9 match) (ice-9 rdelim)
769 ,@%gnu-build-system-modules)
770 #:phases
771 ;; This mostly mirrors the steps taken in the install.sh that ships
772 ;; with dirvish, but simplified because we aren't prompting interactively
773 (modify-phases %standard-phases
774 (delete 'configure)
775 (delete 'build)
776 (delete 'check)
777 (replace 'install
778 (lambda* (#:key inputs outputs #:allow-other-keys)
779 ;; These are mostly the same steps the install.sh that comes with
780 ;; dirvish does
781 (let* (;; Files we'll be copying
782 (executables
783 '("dirvish" "dirvish-runall"
784 "dirvish-expire" "dirvish-locate"))
785 (man-pages
786 '(("dirvish" "8") ("dirvish-runall" "8")
787 ("dirvish-expire" "8") ("dirvish-locate" "8")
788 ("dirvish.conf" "5")))
789
790 (output-dir
791 (assoc-ref outputs "out"))
792
793 ;; Just a default... not so useful on guixsd though
794 ;; You probably want to a service with file(s) to point to.
795 (confdir "/etc/dirvish")
796
797 (perl (string-append (assoc-ref %build-inputs "perl")
798 "/bin/perl"))
799 (loadconfig.pl (call-with-input-file "loadconfig.pl"
800 read-string)))
801
802
803 (define (write-pl filename)
804 (define pl-header
805 (string-append "#!" perl "\n\n"
806 "$CONFDIR = \"" confdir "\";\n\n"))
807 (define input-file-location
808 (string-append filename ".pl"))
809 (define target-file-location
810 (string-append output-dir "/bin/" filename ".pl"))
811 (define text-to-write
812 (string-append pl-header
813 (call-with-input-file input-file-location
814 read-string)
815 "\n" loadconfig.pl))
816 (with-output-to-file target-file-location
817 (lambda ()
818 (display text-to-write)))
819 (chmod target-file-location #o755)
820 (wrap-program target-file-location
821 `("PERL5LIB" ":" prefix
822 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
823 "/lib/perl5/site_perl"))
824 '("perl-libtime-period"
825 "perl-libtime-parsedate")))))
826
827 (define write-man
828 (match-lambda
829 ((file-base man-num)
830 (let* ((filename
831 (string-append file-base "." man-num))
832 (output-path
833 (string-append output-dir
834 "/share/man/man" man-num
835 "/" filename)))
836 (copy-file filename output-path)))))
837
838 ;; Make directories
839 (mkdir-p (string-append output-dir "/bin/"))
840 (mkdir-p (string-append output-dir "/share/man/man8/"))
841 (mkdir-p (string-append output-dir "/share/man/man5/"))
842
843 ;; Write out executables
844 (for-each write-pl executables)
845 ;; Write out man pages
846 (for-each write-man man-pages)
847 #t))))))
848 (inputs
849 `(("perl" ,perl)
850 ("rsync" ,rsync)
851 ("perl-libtime-period" ,perl-libtime-period)
852 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
853 (home-page "http://dirvish.org/")
854 (synopsis "Fast, disk based, rotating network backup system")
855 (description
856 "With dirvish you can maintain a set of complete images of your
162a1374 857file systems with unattended creation and expiration. A dirvish backup vault
0ff4425c
CAW
858is like a time machine for your data. ")
859 (license (license:fsf-free "file://COPYING"
860 "Open Software License 2.0"))))
f77886c1 861
f49d6909 862(define-public restic
f77886c1
OP
863 (package
864 (name "restic")
64140c95 865 (version "0.9.2")
f49d6909
LF
866 ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
867 ;; directory.
f77886c1
OP
868 (source (origin
869 (method url-fetch)
870 (uri (string-append
871 "https://github.com/restic/restic/releases/download/"
872 "v" version "/restic-" version ".tar.gz"))
873 (file-name (string-append name "-" version ".tar.gz"))
874 (sha256
875 (base32
64140c95 876 "15bwkydxcg4xhrnqxvxji8wacrsndb1a6frj98wggfaijqzfx3lg"))))
f77886c1
OP
877 (build-system go-build-system)
878 (arguments
879 `(#:import-path "github.com/restic/restic"
880 #:unpack-path "github.com/restic"
881 ;; We don't need to install the source code for end-user applications.
882 #:install-source? #f
883 #:phases
884 (modify-phases %standard-phases
885 (replace 'build
886 (lambda* (#:key inputs #:allow-other-keys)
887 (with-directory-excursion (string-append
888 "src/github.com/restic/restic-"
889 ,version)
890 (invoke "go" "run" "build.go"))))
891
4976ebdd
OP
892 (replace 'check
893 (lambda _
894 (with-directory-excursion (string-append
895 "src/github.com/restic/restic-"
896 ,version)
77389911
OP
897 ;; Disable FUSE tests.
898 (setenv "RESTIC_TEST_FUSE" "0")
4976ebdd
OP
899 (invoke "go" "run" "build.go" "--test"))))
900
f77886c1
OP
901 (replace 'install
902 (lambda* (#:key outputs #:allow-other-keys)
903 (let ((out (assoc-ref outputs "out"))
904 (src (string-append "src/github.com/restic/restic-"
905 ,version)))
906 (install-file (string-append src "/restic")
907 (string-append out "/bin"))
908 #t)))
909
910 (add-after 'install 'install-docs
911 (lambda* (#:key outputs #:allow-other-keys)
912 (let* ((out (assoc-ref outputs "out"))
913 (man "/share/man")
914 (man-section (string-append man "/man"))
915 (src (string-append "src/github.com/restic/restic-"
916 ,version "/doc/man/")))
917 ;; Install all the man pages to "out".
918 (for-each
919 (lambda (file)
920 (install-file file
921 (string-append out man-section
922 (string-take-right file 1))))
923 (find-files src "\\.[1-9]"))
924 #t)))
925
926 (add-after 'install-docs 'install-shell-completion
927 (lambda* (#:key outputs #:allow-other-keys)
928 (let* ((out (assoc-ref outputs "out"))
929 (bin (string-append out "/bin"))
930 (etc (string-append out "/etc"))
931 (share (string-append out "/share")))
932 (for-each
933 (lambda (shell)
934 (let* ((shell-name (symbol->string shell))
935 (dir (string-append "etc/completion/" shell-name)))
936 (mkdir-p dir)
937 (invoke (string-append bin "/restic") "generate"
938 (string-append "--" shell-name "-completion")
939 (string-append dir "/"
940 (case shell
941 ((bash) "restic")
942 ((zsh) "_restic"))))))
943 '(bash zsh))
944 (with-directory-excursion "etc/completion"
945 (install-file "bash/restic"
946 (string-append etc "/bash_completion.d"))
947 (install-file "zsh/_restic"
948 (string-append share "/zsh/site-functions")))
949 #t))))))
950 (home-page "https://restic.net/")
951 (synopsis "Backup program with multiple revisions, encryption and more")
952 (description "Restic is a program that does backups right and was designed
953with the following principles in mind:
954
955@itemize
956@item Easy: Doing backups should be a frictionless process, otherwise you
957might be tempted to skip it. Restic should be easy to configure and use, so
958that, in the event of a data loss, you can just restore it. Likewise,
959restoring data should not be complicated.
960
961@item Fast: Backing up your data with restic should only be limited by your
962network or hard disk bandwidth so that you can backup your files every day.
963Nobody does backups if it takes too much time. Restoring backups should only
964transfer data that is needed for the files that are to be restored, so that
965this process is also fast.
966
967@item Verifiable: Much more important than backup is restore, so restic
968enables you to easily verify that all data can be restored. @item Secure:
969Restic uses cryptography to guarantee confidentiality and integrity of your
970data. The location the backup data is stored is assumed not to be a trusted
971environment (e.g. a shared space where others like system administrators are
972able to access your backups). Restic is built to secure your data against
973such attackers.
974
975@item Efficient: With the growth of data, additional snapshots should only
976take the storage of the actual increment. Even more, duplicate data should be
977de-duplicated before it is actually written to the storage back end to save
978precious backup space.
979@end itemize")
980 (license license:bsd-2)))