summaryrefslogtreecommitdiff
path: root/gnu/packages/backup.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/backup.scm')
-rw-r--r--gnu/packages/backup.scm180
1 files changed, 137 insertions, 43 deletions
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 6215541524..895b3b168d 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -6,6 +6,8 @@
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
+;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -184,16 +186,16 @@ backups (called chunks) to allow easy burning to CD/DVD.")
(define-public libarchive
(package
(name "libarchive")
- (replacement libarchive-3.3.2)
- (version "3.3.1")
+ (version "3.3.2")
(source
(origin
(method url-fetch)
(uri (string-append "http://libarchive.org/downloads/libarchive-"
version ".tar.gz"))
+ (patches (search-patches "libarchive-CVE-2017-14166.patch"))
(sha256
(base32
- "1rr40hxlm9vy5z2zb5w7pyfkgd1a4s061qapm83s19accb8mpji9"))))
+ "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
(build-system gnu-build-system)
;; TODO: Add -L/path/to/nettle in libarchive.pc.
(inputs
@@ -205,26 +207,25 @@ backups (called chunks) to allow easy burning to CD/DVD.")
("xz" ,xz)))
(arguments
`(#:phases
- (alist-cons-before
- 'build 'patch-pwd
- (lambda _
- (substitute* "Makefile"
- (("/bin/pwd") (which "pwd"))))
- (alist-replace
- 'check
- (lambda _
- ;; XXX: The test_owner_parse, test_read_disk, and
- ;; test_write_disk_lookup tests expect user 'root' to exist, but
- ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
- ;;
- ;; The tests allow one to disable tests matching a globbing pattern.
- (and (zero? (system* "make"
- "libarchive_test" "bsdcpio_test" "bsdtar_test"))
- ;; XXX: This glob disables too much.
- (zero? (system* "./libarchive_test" "^test_*_disk*"))
- (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
- (zero? (system* "./bsdtar_test"))))
- %standard-phases))
+ (modify-phases %standard-phases
+ (add-before 'build 'patch-pwd
+ (lambda _
+ (substitute* "Makefile"
+ (("/bin/pwd") (which "pwd"))
+ #t)))
+ (replace 'check
+ (lambda _
+ ;; XXX: The test_owner_parse, test_read_disk, and
+ ;; test_write_disk_lookup tests expect user 'root' to exist, but
+ ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
+ ;;
+ ;; The tests allow one to disable tests matching a globbing pattern.
+ (and (zero? (system* "make"
+ "libarchive_test" "bsdcpio_test" "bsdtar_test"))
+ ;; XXX: This glob disables too much.
+ (zero? (system* "./libarchive_test" "^test_*_disk*"))
+ (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
+ (zero? (system* "./bsdtar_test"))))))
;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
;; compiled with C99 or C11 or a gnu variant.
#:configure-flags '("CFLAGS=-O2 -g -std=c99")))
@@ -240,20 +241,6 @@ archive. In particular, note that there is currently no built-in support for
random access nor for in-place modification.")
(license license:bsd-2)))
-(define libarchive-3.3.2
- (package
- (inherit libarchive)
- (version "3.3.2")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://libarchive.org/downloads/libarchive-"
- version ".tar.gz"))
- (patches (search-patches "libarchive-CVE-2017-14166.patch"))
- (sha256
- (base32
- "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))))
-
(define-public rdup
(package
(name "rdup")
@@ -462,13 +449,13 @@ detection, and lossless compression.")
(define-public borg
(package
(name "borg")
- (version "1.1.0")
+ (version "1.1.1")
(source (origin
(method url-fetch)
(uri (pypi-uri "borgbackup" version))
(sha256
(base32
- "0vwyg0b4kxb0rspqwhvgi5c78dzimgkydf03wif27a40qhh1235l"))
+ "0iik5lq349cl87imlwra2pp0j36wjhpn8r1d3778azvvqpyjq2d5"))
(modules '((guix build utils)))
(snippet
'(for-each
@@ -518,7 +505,7 @@ detection, and lossless compression.")
"and not test_fuse "
"and not test_fuse_allow_damaged_files"))))))
(add-after 'install 'install-doc
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(man (string-append out "/share/man/man1"))
(misc (string-append out "/share/borg/misc")))
@@ -526,11 +513,11 @@ detection, and lossless compression.")
'("docs/misc/create_chunker-params.txt"
"docs/misc/internals-picture.txt"
"docs/misc/prune-example.txt"))
+ (add-installed-pythonpath inputs outputs)
(and
- (zero? (system* "python3" "setup.py" "build_ext" "--inplace"))
- (zero? (system* "make" "-C" "docs" "man"))
+ (zero? (system* "python3" "setup.py" "build_man"))
(begin
- (install-file "docs/_build/man/borg.1" man)
+ (copy-recursively "docs/man" man)
#t))))))))
(native-inputs
`(("python-cython" ,python-cython)
@@ -688,3 +675,110 @@ using GnuPG. Backups can be stored on local hard disks, or online via
the SSH SFTP protocol. The backup server, if used, does not require
any special software, on top of SSH.")
(license license:gpl3+)))
+
+(define-public dirvish
+ (package
+ (name "dirvish")
+ (version "1.2.1")
+ (build-system gnu-build-system)
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://dirvish.org/dirvish-" version ".tgz"))
+ (sha256
+ (base32
+ "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
+ (arguments
+ `(#:modules ((ice-9 match) (ice-9 rdelim)
+ ,@%gnu-build-system-modules)
+ #:phases
+ ;; This mostly mirrors the steps taken in the install.sh that ships
+ ;; with dirvish, but simplified because we aren't prompting interactively
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'build)
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; These are mostly the same steps the install.sh that comes with
+ ;; dirvish does
+ (let* (;; Files we'll be copying
+ (executables
+ '("dirvish" "dirvish-runall"
+ "dirvish-expire" "dirvish-locate"))
+ (man-pages
+ '(("dirvish" "8") ("dirvish-runall" "8")
+ ("dirvish-expire" "8") ("dirvish-locate" "8")
+ ("dirvish.conf" "5")))
+
+ (output-dir
+ (assoc-ref outputs "out"))
+
+ ;; Just a default... not so useful on guixsd though
+ ;; You probably want to a service with file(s) to point to.
+ (confdir "/etc/dirvish")
+
+ (perl (string-append (assoc-ref %build-inputs "perl")
+ "/bin/perl"))
+ (loadconfig.pl (call-with-input-file "loadconfig.pl"
+ read-string)))
+
+
+ (define (write-pl filename)
+ (define pl-header
+ (string-append "#!" perl "\n\n"
+ "$CONFDIR = \"" confdir "\";\n\n"))
+ (define input-file-location
+ (string-append filename ".pl"))
+ (define target-file-location
+ (string-append output-dir "/bin/" filename ".pl"))
+ (define text-to-write
+ (string-append pl-header
+ (call-with-input-file input-file-location
+ read-string)
+ "\n" loadconfig.pl))
+ (with-output-to-file target-file-location
+ (lambda ()
+ (display text-to-write)))
+ (chmod target-file-location #o755)
+ (wrap-program target-file-location
+ `("PERL5LIB" ":" prefix
+ ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
+ "/lib/perl5/site_perl"))
+ '("perl-libtime-period"
+ "perl-libtime-parsedate")))))
+
+ (define write-man
+ (match-lambda
+ ((file-base man-num)
+ (let* ((filename
+ (string-append file-base "." man-num))
+ (output-path
+ (string-append output-dir
+ "/share/man/man" man-num
+ "/" filename)))
+ (copy-file filename output-path)))))
+
+ ;; Make directories
+ (mkdir-p (string-append output-dir "/bin/"))
+ (mkdir-p (string-append output-dir "/share/man/man8/"))
+ (mkdir-p (string-append output-dir "/share/man/man5/"))
+
+ ;; Write out executables
+ (for-each write-pl executables)
+ ;; Write out man pages
+ (for-each write-man man-pages)
+ #t))))))
+ (inputs
+ `(("perl" ,perl)
+ ("rsync" ,rsync)
+ ("perl-libtime-period" ,perl-libtime-period)
+ ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
+ (home-page "http://dirvish.org/")
+ (synopsis "Fast, disk based, rotating network backup system")
+ (description
+ "With dirvish you can maintain a set of complete images of your
+filesystems with unattended creation and expiration. A dirvish backup vault
+is like a time machine for your data. ")
+ (license (license:fsf-free "file://COPYING"
+ "Open Software License 2.0"))))