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