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