services: avahi: Add Avahi to the system profile.
[guix.git] / gnu / packages / backup.scm
blob40cfc4ee1443786463aaa5cd362664872b100bd2
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 Leo Famulari <leo@famulari.name>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages backup)
22   #:use-module (guix packages)
23   #:use-module ((guix licenses) #:prefix license:)
24   #:use-module (guix download)
25   #:use-module (guix utils)
26   #:use-module (guix build utils)
27   #:use-module (guix build-system gnu)
28   #:use-module (guix build-system python)
29   #:use-module (gnu packages)
30   #:use-module (gnu packages acl)
31   #:use-module (gnu packages base)
32   #:use-module (gnu packages compression)
33   #:use-module (gnu packages databases)
34   #:use-module (gnu packages dejagnu)
35   #:use-module (gnu packages glib)
36   #:use-module (gnu packages gnupg)
37   #:use-module (gnu packages gperf)
38   #:use-module (gnu packages guile)
39   #:use-module (gnu packages linux)
40   #:use-module (gnu packages mcrypt)
41   #:use-module (gnu packages nettle)
42   #:use-module (gnu packages pcre)
43   #:use-module (gnu packages pkg-config)
44   #:use-module (gnu packages python)
45   #:use-module (gnu packages rsync)
46   #:use-module (gnu packages ssh)
47   #:use-module (gnu packages tls)
48   #:use-module (gnu packages xml))
50 (define-public duplicity
51   (package
52     (name "duplicity")
53     (version "0.6.26")
54     (source
55      (origin
56       (method url-fetch)
57       (uri (string-append "https://code.launchpad.net/duplicity/"
58                           (version-major+minor version)
59                           "-series/" version "/+download/duplicity-"
60                           version ".tar.gz"))
61       (sha256
62        (base32
63         "0jh79syhr8n3l81jxlwsmwm1pklb4d923m2lgqbswyavh1fqmvwb"))
64       (patches (list (search-patch "duplicity-piped-password.patch")
65                      (search-patch "duplicity-test_selection-tmp.patch")))))
66     (build-system python-build-system)
67     (native-inputs
68      `(("python2-setuptools" ,python2-setuptools)
69        ("util-linux" ,util-linux)))     ;setsid command, for the tests
70     (inputs
71      `(("python" ,python-2)
72        ("librsync" ,librsync)
73        ("mock" ,python2-mock)           ;for testing
74        ("lockfile" ,python2-lockfile)
75        ("gnupg" ,gnupg-1)               ;gpg executable needed
76        ("util-linux" ,util-linux)       ;for setsid
77        ("tzdata" ,tzdata)))
78     (arguments
79      `(#:python ,python-2               ;setup assumes Python 2
80        #:test-target "test"
81        #:phases (alist-cons-before
82                  'check 'check-setup
83                  (lambda* (#:key inputs #:allow-other-keys)
84                    (substitute* "testing/functional/__init__.py"
85                      (("/bin/sh") (which "sh")))
86                    (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
87                    (setenv "TZDIR"          ;some timestamp checks need TZDIR
88                            (string-append (assoc-ref inputs "tzdata")
89                                           "/share/zoneinfo")))
90                  %standard-phases)))
91     (home-page "http://duplicity.nongnu.org/index.html")
92     (synopsis "Encrypted backup using rsync algorithm")
93     (description
94      "Duplicity backs up directories by producing encrypted tar-format volumes
95 and uploading them to a remote or local file server.  Because duplicity uses
96 librsync, the incremental archives are space efficient and only record the
97 parts of files that have changed since the last backup.  Because duplicity
98 uses GnuPG to encrypt and/or sign these archives, they will be safe from
99 spying and/or modification by the server.")
100     (license license:gpl2+)))
102 (define-public hdup
103   (package
104     (name "hdup")
105     (version "2.0.14")
106     (source
107      (origin
108       (method url-fetch)
109       ;; Source tarballs are not versioned
110       (uri "http://archive.miek.nl/projects/hdup2/hdup.tar.bz2")
111       (sha256
112        (base32
113         "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
114     (build-system gnu-build-system)
115     (native-inputs `(("pkg-config" ,pkg-config)))
116     (inputs
117      `(("glib" ,glib)
118        ("tar" ,tar)
119        ("lzop" ,lzop)
120        ("mcrypt" ,mcrypt)
121        ("openssh" ,openssh)
122        ("gnupg" ,gnupg-1)))
123     (arguments
124      `(#:configure-flags
125        `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
126        #:tests? #f))
127     (home-page "http://archive.miek.nl/projects/hdup/index.html")
128     (synopsis "Simple incremental backup tool")
129     (description
130      "Hdup2 is a backup utility, its aim is to make backup really simple.  The
131 backup scheduling is done by means of a cron job.  It supports an
132 include/exclude mechanism, remote backups, encrypted backups and split
133 backups (called chunks) to allow easy burning to CD/DVD.")
134     (license license:gpl2)))
136 (define-public libarchive
137   (package
138     (name "libarchive")
139     (version "3.1.2")
140     (source
141      (origin
142        (method url-fetch)
143        (uri (string-append "http://libarchive.org/downloads/libarchive-"
144                            version ".tar.gz"))
145        (sha256
146         (base32
147          "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb"))
148        (patches
149         (list (search-patch "libarchive-mtree-filename-length-fix.patch")
150               (search-patch "libarchive-fix-lzo-test-case.patch")
151               (search-patch "libarchive-CVE-2013-0211.patch")))))
152     (build-system gnu-build-system)
153     ;; TODO: Add -L/path/to/nettle in libarchive.pc.
154     (inputs
155      `(("zlib" ,zlib)
156        ("nettle" ,nettle)
157        ("lzo" ,lzo)
158        ("bzip2" ,bzip2)
159        ("libxml2" ,libxml2)
160        ("xz" ,xz)))
161     (arguments
162      `(#:phases
163        (alist-cons-before
164         'build 'patch-pwd
165         (lambda _
166           (substitute* "Makefile"
167             (("/bin/pwd") (which "pwd"))))
168         (alist-replace
169          'check
170          (lambda _
171            ;; XXX: The test_owner_parse, test_read_disk, and
172            ;; test_write_disk_lookup tests expect user 'root' to exist, but
173            ;; the chroot's /etc/passwd doesn't have it.  Turn off those tests.
174            ;;
175            ;; The tests allow one to disable tests matching a globbing pattern.
176            (and (zero? (system* "make"
177                                 "libarchive_test" "bsdcpio_test" "bsdtar_test"))
178                 ;; XXX: This glob disables too much.
179                 (zero? (system* "./libarchive_test" "^test_*_disk*"))
180                 (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
181                 (zero? (system* "./bsdtar_test"))))
182          %standard-phases))))
183     (home-page "http://libarchive.org/")
184     (synopsis "Multi-format archive and compression library")
185     (description
186      "Libarchive provides a flexible interface for reading and writing
187 archives in various formats such as tar and cpio.  Libarchive also supports
188 reading and writing archives compressed using various compression filters such
189 as gzip and bzip2.  The library is inherently stream-oriented; readers
190 serially iterate through the archive, writers serially add things to the
191 archive.  In particular, note that there is currently no built-in support for
192 random access nor for in-place modification.")
193     (license license:bsd-2)))
195 (define-public rdup
196   (package
197     (name "rdup")
198     (version "1.1.14")
199     (source
200      (origin
201        (method url-fetch)
202        (uri (string-append "http://archive.miek.nl/projects/rdup/rdup-"
203                            version ".tar.bz2"))
204        (sha256
205         (base32
206          "0aklwd9v7ix0m4ayl762sil685f42cwljzx3jz5skrnjaq32npmj"))
207        (modules '((guix build utils)))
208        (snippet
209         ;; Some test scripts are missing shebangs, which cause "could not
210         ;; execute" errors.  Add shebangs.
211         '(for-each
212           (lambda (testscript)
213             (with-atomic-file-replacement
214                 (string-append "testsuite/rdup/" testscript)
215               (lambda (in out)
216                 (begin
217                   (format out "#!/bin/sh\n" )
218                   (dump-port in out)))))
219           '("rdup.hardlink.helper"
220             "rdup.hardlink-strip.helper"
221             "rdup.hardlink-strip2.helper"
222             "rdup.pipeline.helper")))))
223     (build-system gnu-build-system)
224     (native-inputs
225      `(("pkg-config" ,pkg-config)
226        ("dejagnu" ,dejagnu)))
227     (inputs
228      `(("glib" ,glib)
229        ("pcre" ,pcre)
230        ("libarchive" ,libarchive)
231        ("nettle" ,nettle)))
232     (arguments
233      `(#:parallel-build? #f             ;race conditions
234        #:phases (alist-cons-before
235                  'build 'remove-Werror
236                  ;; rdup uses a deprecated function from libarchive
237                  (lambda _
238                    (substitute* "GNUmakefile"
239                      (("^(CFLAGS=.*)-Werror" _ front) front)))
240                  (alist-cons-before
241                   'check 'pre-check
242                   (lambda _
243                     (setenv "HOME" (getcwd))
244                     (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
245                       (("/bin/cat") (which "cat"))))
247                   %standard-phases))))
248     (home-page "http://archive.miek.nl/projects/rdup/index.html")
249     (synopsis "Provide a list of files to backup")
250     (description
251      "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
252 Rdup itself does not backup anything, it only print a list of absolute
253 file names to standard output.  Auxiliary scripts are needed that act on this
254 list and implement the backup strategy.")
255     (license license:gpl3+)))
257 (define-public btar
258   (package
259     (name "btar")
260     (version "1.1.1")
261     (source
262      (origin
263        (method url-fetch)
264        (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
265                            "btar-" version ".tar.gz"))
266        (sha256
267         (base32
268          "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
269     (build-system gnu-build-system)
270     (inputs
271      `(("librsync" ,librsync)))
272     (arguments
273      `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
274                       "CC=gcc")
275        #:tests? #f                      ;test input not distributed
276        #:phases
277        (alist-delete
278         'configure                      ;no configure phase
279         %standard-phases)))
280     (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
281     (synopsis "Tar-compatible archiver")
282     (description
283      "Btar is a tar-compatible archiver which allows arbitrary compression and
284 ciphering, redundancy, differential backup, indexed extraction, multicore
285 compression, input and output serialisation, and tolerance to partial archive
286 errors.")
287     (license license:gpl3+)))
289 (define-public rdiff-backup
290   (package
291     (name "rdiff-backup")
292     (version "1.2.8")
293     (source
294      (origin
295        (method url-fetch)
296        (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
297                            version ".tar.gz"))
298        (sha256
299         (base32
300          "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
301     (build-system python-build-system)
302     (native-inputs
303      `(("python2-setuptools" ,python2-setuptools)))
304     (inputs
305      `(("python" ,python-2)
306        ("librsync" ,librsync)))
307     (arguments
308      `(#:python ,python-2
309        #:tests? #f))
310     (home-page "http://www.nongnu.org/rdiff-backup/")
311     (synopsis "Local/remote mirroring+incremental backup")
312     (description
313      "Rdiff-backup backs up one directory to another, possibly over a network.
314 The target directory ends up a copy of the source directory, but extra reverse
315 diffs are stored in a special subdirectory of that target directory, so you
316 can still recover files lost some time ago.  The idea is to combine the best
317 features of a mirror and an incremental backup.  Rdiff-backup also preserves
318 subdirectories, hard links, dev files, permissions, uid/gid ownership,
319 modification times, extended attributes, acls, and resource forks.  Also,
320 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
321 rsync.  Thus you can use rdiff-backup and ssh to securely back a hard drive up
322 to a remote location, and only the differences will be transmitted.  Finally,
323 rdiff-backup is easy to use and settings have sensible defaults.")
324     (license license:gpl2+)))
326 (define-public attic
327   (package
328     (name "attic")
329     (version "0.16")
330     (source (origin
331               (method url-fetch)
332               (uri (string-append
333                     "https://pypi.python.org/packages/source/A/Attic/Attic-"
334                     version ".tar.gz"))
335               (sha256
336                (base32
337                 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
338     (build-system python-build-system)
339     (arguments
340      `(#:phases
341        (modify-phases %standard-phases
342          (add-before
343           'build 'set-openssl-prefix
344           (lambda* (#:key inputs #:allow-other-keys)
345             (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
346             #t)))))
347     (inputs
348      `(("acl" ,acl)
349        ("openssl" ,openssl)
350        ("python-llfuse" ,python-llfuse)
351        ("python-msgpack" ,python-msgpack)))
352     (synopsis "Deduplicating backup program")
353     (description "Attic is a deduplicating backup program.  The main goal of
354 Attic is to provide an efficient and secure way to backup data.  The data
355 deduplication technique used makes Attic suitable for daily backups since only
356 changes are stored.")
357     (home-page "https://attic-backup.org/")
358     (license license:bsd-3)))
360 (define-public libchop
361   (package
362     (name "libchop")
363     (version "0.5.2")
364     (source (origin
365               (method url-fetch)
366               (uri (string-append "mirror://savannah/libchop/libchop-"
367                                   version ".tar.gz"))
368               (sha256
369                (base32
370                 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
371               (patches
372                (list (search-patch "diffutils-gets-undeclared.patch")))))
373     (build-system gnu-build-system)
374     (native-inputs
375      `(("guile" ,guile-2.0)
376        ("gperf" ,gperf)
377        ("pkg-config" ,pkg-config)))
378     (inputs
379      `(("guile" ,guile-2.0)
380        ("util-linux" ,util-linux)
381        ("gnutls" ,gnutls)
382        ("tdb" ,tdb)
383        ("bdb" ,bdb)
384        ("gdbm" ,gdbm)
385        ("libgcrypt" ,libgcrypt)
386        ("lzo" ,lzo)
387        ("bzip2" ,bzip2)
388        ("zlib" ,zlib)))
389     (home-page "http://nongnu.org/libchop/")
390     (synopsis "Tools & library for data backup and distributed storage")
391     (description
392      "Libchop is a set of utilities and library for data backup and
393 distributed storage.  Its main application is @command{chop-backup}, an
394 encrypted backup program that supports data integrity checks, versioning,
395 distribution among several sites, selective sharing of stored data, adaptive
396 compression, and more.  The library itself implements storage techniques such
397 as content-addressable storage, content hash keys, Merkle trees, similarity
398 detection, and lossless compression.")
399     (license license:gpl3+)))