gnu: libical: Correct zoneinfo search path.
[jackhill/guix/guix.git] / gnu / packages / backup.scm
index 40cfc4e..a7b48f1 100644 (file)
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
-;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,8 +61,8 @@
       (sha256
        (base32
         "0jh79syhr8n3l81jxlwsmwm1pklb4d923m2lgqbswyavh1fqmvwb"))
-      (patches (list (search-patch "duplicity-piped-password.patch")
-                     (search-patch "duplicity-test_selection-tmp.patch")))))
+      (patches (search-patches "duplicity-piped-password.patch"
+                               "duplicity-test_selection-tmp.patch"))))
     (build-system python-build-system)
     (native-inputs
      `(("python2-setuptools" ,python2-setuptools)
@@ -146,9 +146,10 @@ backups (called chunks) to allow easy burning to CD/DVD.")
         (base32
          "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb"))
        (patches
-        (list (search-patch "libarchive-mtree-filename-length-fix.patch")
-              (search-patch "libarchive-fix-lzo-test-case.patch")
-              (search-patch "libarchive-CVE-2013-0211.patch")))))
+        (search-patches "libarchive-mtree-filename-length-fix.patch"
+                        "libarchive-fix-lzo-test-case.patch"
+                        "libarchive-CVE-2013-0211.patch"
+                        "libarchive-bsdtar-test.patch"))))
     (build-system gnu-build-system)
     ;; TODO: Add -L/path/to/nettle in libarchive.pc.
     (inputs
@@ -347,8 +348,16 @@ rdiff-backup is easy to use and settings have sensible defaults.")
     (inputs
      `(("acl" ,acl)
        ("openssl" ,openssl)
-       ("python-llfuse" ,python-llfuse)
-       ("python-msgpack" ,python-msgpack)))
+       ("python-msgpack" ,python-msgpack)
+
+       ;; Attic is probably incompatible with llfuse > 0.41.
+       ;; These links are to discussions of llfuse compatibility from
+       ;; the borg project. Borg is a recent fork of attic, and attic
+       ;; has not been updated since the fork, so it's likely that
+       ;; llfuse compatibility requirements are still the same.
+       ;; https://github.com/borgbackup/borg/issues/642
+       ;; https://github.com/borgbackup/borg/issues/643
+       ("python-llfuse" ,python-llfuse-0.41)))
     (synopsis "Deduplicating backup program")
     (description "Attic is a deduplicating backup program.  The main goal of
 Attic is to provide an efficient and secure way to backup data.  The data
@@ -368,8 +377,7 @@ changes are stored.")
               (sha256
                (base32
                 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
-              (patches
-               (list (search-patch "diffutils-gets-undeclared.patch")))))
+              (patches (search-patches "diffutils-gets-undeclared.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("guile" ,guile-2.0)
@@ -397,3 +405,56 @@ compression, and more.  The library itself implements storage techniques such
 as content-addressable storage, content hash keys, Merkle trees, similarity
 detection, and lossless compression.")
     (license license:gpl3+)))
+
+(define-public borg
+  (package
+    (name "borg")
+    (version "1.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "borgbackup" version))
+              (sha256
+               (base32
+                "1myz10pwxnac9z59gw1w3xjhz6ghx03vngpl97ca527pj0r39shi"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'set-env
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((openssl (assoc-ref inputs "openssl"))
+                   (lz4 (assoc-ref inputs "lz4")))
+               (setenv "BORG_OPENSSL_PREFIX" openssl)
+               (setenv "BORG_LZ4_PREFIX" lz4)
+               (setenv "PYTHON_EGG_CACHE" "/tmp")
+               #t)))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1")))
+               (and
+                 (zero? (system* "python3" "setup.py" "build_ext" "--inplace"))
+                 (zero? (system* "make" "-C" "docs" "man"))
+                 (begin
+                   (install-file "docs/_build/man/borg.1" man)
+                   #t))))))))
+    (native-inputs
+     `(("python-setuptools-scm" ,python-setuptools-scm)
+       ;; For generating the documentation.
+       ("python-sphinx" ,python-sphinx)
+       ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
+    (inputs
+     `(("acl" ,acl)
+       ("lz4" ,lz4)
+       ("openssl" ,openssl)
+       ("python-llfuse" ,python-llfuse)
+       ("python-msgpack" ,python-msgpack)))
+    (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
+    (description "Borg is a deduplicating backup program.  Optionally, it
+supports compression and authenticated encryption.  The main goal of Borg is to
+provide an efficient and secure way to backup data.  The data deduplication
+technique used makes Borg suitable for daily backups since only changes are
+stored.  The authenticated encryption technique makes it suitable for backups
+to not fully trusted targets.  Borg is a fork of Attic.")
+    (home-page "https://borgbackup.github.io/borgbackup/")
+    (license license:bsd-3)))