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>
6 ;;; This file is part of GNU Guix.
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.
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.
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
57 (uri (string-append "https://code.launchpad.net/duplicity/"
58 (version-major+minor version)
59 "-series/" version "/+download/duplicity-"
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)
68 `(("python2-setuptools" ,python2-setuptools)
69 ("util-linux" ,util-linux))) ;setsid command, for the tests
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
79 `(#:python ,python-2 ;setup assumes Python 2
81 #:phases (alist-cons-before
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")
91 (home-page "http://duplicity.nongnu.org/index.html")
92 (synopsis "Encrypted backup using rsync algorithm")
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+)))
109 ;; Source tarballs are not versioned
110 (uri "http://archive.miek.nl/projects/hdup2/hdup.tar.bz2")
113 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
114 (build-system gnu-build-system)
115 (native-inputs `(("pkg-config" ,pkg-config)))
125 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
127 (home-page "http://archive.miek.nl/projects/hdup/index.html")
128 (synopsis "Simple incremental backup tool")
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
143 (uri (string-append "http://libarchive.org/downloads/libarchive-"
147 "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb"))
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.
166 (substitute* "Makefile"
167 (("/bin/pwd") (which "pwd"))))
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.
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"))))
183 (home-page "http://libarchive.org/")
184 (synopsis "Multi-format archive and compression library")
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)))
202 (uri (string-append "http://archive.miek.nl/projects/rdup/rdup-"
206 "0aklwd9v7ix0m4ayl762sil685f42cwljzx3jz5skrnjaq32npmj"))
207 (modules '((guix build utils)))
209 ;; Some test scripts are missing shebangs, which cause "could not
210 ;; execute" errors. Add shebangs.
213 (with-atomic-file-replacement
214 (string-append "testsuite/rdup/" testscript)
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)
225 `(("pkg-config" ,pkg-config)
226 ("dejagnu" ,dejagnu)))
230 ("libarchive" ,libarchive)
233 `(#:parallel-build? #f ;race conditions
234 #:phases (alist-cons-before
235 'build 'remove-Werror
236 ;; rdup uses a deprecated function from libarchive
238 (substitute* "GNUmakefile"
239 (("^(CFLAGS=.*)-Werror" _ front) front)))
243 (setenv "HOME" (getcwd))
244 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
245 (("/bin/cat") (which "cat"))))
248 (home-page "http://archive.miek.nl/projects/rdup/index.html")
249 (synopsis "Provide a list of files to backup")
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+)))
264 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
265 "btar-" version ".tar.gz"))
268 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
269 (build-system gnu-build-system)
271 `(("librsync" ,librsync)))
273 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
275 #:tests? #f ;test input not distributed
278 'configure ;no configure phase
280 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
281 (synopsis "Tar-compatible archiver")
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
287 (license license:gpl3+)))
289 (define-public rdiff-backup
291 (name "rdiff-backup")
296 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
300 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
301 (build-system python-build-system)
303 `(("python2-setuptools" ,python2-setuptools)))
305 `(("python" ,python-2)
306 ("librsync" ,librsync)))
310 (home-page "http://www.nongnu.org/rdiff-backup/")
311 (synopsis "Local/remote mirroring+incremental backup")
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+)))
333 "https://pypi.python.org/packages/source/A/Attic/Attic-"
337 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
338 (build-system python-build-system)
341 (modify-phases %standard-phases
343 'build 'set-openssl-prefix
344 (lambda* (#:key inputs #:allow-other-keys)
345 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "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
366 (uri (string-append "mirror://savannah/libchop/libchop-"
370 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
372 (list (search-patch "diffutils-gets-undeclared.patch")))))
373 (build-system gnu-build-system)
375 `(("guile" ,guile-2.0)
377 ("pkg-config" ,pkg-config)))
379 `(("guile" ,guile-2.0)
380 ("util-linux" ,util-linux)
385 ("libgcrypt" ,libgcrypt)
389 (home-page "http://nongnu.org/libchop/")
390 (synopsis "Tools & library for data backup and distributed storage")
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+)))