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