Commit | Line | Data |
---|---|---|
d1a5439b | 1 | ;;; GNU Guix --- Functional package management for GNU |
c4a9182e | 2 | ;;; Copyright © 2014, 2015, 2020 Eric Bavier <bavier@posteo.net> |
29a7c98a | 3 | ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> |
d265169b | 4 | ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name> |
22ade268 | 5 | ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
0da4f365 | 6 | ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> |
a2fa9c3d | 7 | ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> |
3c8ba11a | 8 | ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net> |
7d728270 | 9 | ;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il> |
0ff4425c | 10 | ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org> |
44dd001d | 11 | ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com> |
1a3aa5ba | 12 | ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> |
f77886c1 | 13 | ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com> |
4ac39960 | 14 | ;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net> |
c824dedf | 15 | ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com> |
80ba43b5 | 16 | ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com> |
5fd395db | 17 | ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com> |
61fc72d3 | 18 | ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
c1f3382e | 19 | ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl> |
9d6863de | 20 | ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> |
d1a5439b EB |
21 | ;;; |
22 | ;;; This file is part of GNU Guix. | |
23 | ;;; | |
24 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
25 | ;;; under the terms of the GNU General Public License as published by | |
26 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
27 | ;;; your option) any later version. | |
28 | ;;; | |
29 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
30 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
31 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
32 | ;;; GNU General Public License for more details. | |
33 | ;;; | |
34 | ;;; You should have received a copy of the GNU General Public License | |
35 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
36 | ||
37 | (define-module (gnu packages backup) | |
38 | #:use-module (guix packages) | |
b5b73a82 | 39 | #:use-module ((guix licenses) #:prefix license:) |
5cdbdc2b | 40 | #:use-module (guix git-download) |
d1a5439b | 41 | #:use-module (guix download) |
29a7c98a | 42 | #:use-module (guix utils) |
4ac39960 | 43 | #:use-module (guix build-system cmake) |
2d762953 | 44 | #:use-module (guix build-system gnu) |
f77886c1 | 45 | #:use-module (guix build-system go) |
d1a5439b EB |
46 | #:use-module (guix build-system python) |
47 | #:use-module (gnu packages) | |
0c146750 | 48 | #:use-module (gnu packages acl) |
f6875394 | 49 | #:use-module (gnu packages autotools) |
2d762953 | 50 | #:use-module (gnu packages base) |
ac257f12 | 51 | #:use-module (gnu packages check) |
2d762953 | 52 | #:use-module (gnu packages compression) |
19278d8d | 53 | #:use-module (gnu packages crypto) |
362f496d | 54 | #:use-module (gnu packages databases) |
7b9b203a | 55 | #:use-module (gnu packages datastructures) |
255d1bbe | 56 | #:use-module (gnu packages dbm) |
d42e6122 | 57 | #:use-module (gnu packages dejagnu) |
2903ee1e | 58 | #:use-module (gnu packages ftp) |
548d4d81 | 59 | #:use-module (gnu packages gettext) |
2d762953 | 60 | #:use-module (gnu packages glib) |
d1a5439b | 61 | #:use-module (gnu packages gnupg) |
f77886c1 | 62 | #:use-module (gnu packages golang) |
362f496d LC |
63 | #:use-module (gnu packages gperf) |
64 | #:use-module (gnu packages guile) | |
335bc683 | 65 | #:use-module (gnu packages linux) |
2d762953 | 66 | #:use-module (gnu packages mcrypt) |
0b772051 | 67 | #:use-module (gnu packages ncurses) |
d42e6122 | 68 | #:use-module (gnu packages nettle) |
23b39478 | 69 | #:use-module (gnu packages onc-rpc) |
d42e6122 | 70 | #:use-module (gnu packages pcre) |
0da4f365 | 71 | #:use-module (gnu packages perl) |
2d762953 | 72 | #:use-module (gnu packages pkg-config) |
e1742318 | 73 | #:use-module (gnu packages protobuf) |
0c146750 | 74 | #:use-module (gnu packages python) |
cc6f4912 | 75 | #:use-module (gnu packages python-crypto) |
1b2f753d | 76 | #:use-module (gnu packages python-web) |
44d10b1f | 77 | #:use-module (gnu packages python-xyz) |
d1a5439b | 78 | #:use-module (gnu packages rsync) |
2d762953 | 79 | #:use-module (gnu packages ssh) |
0c146750 | 80 | #:use-module (gnu packages tls) |
29a7c98a | 81 | #:use-module (gnu packages xml)) |
d1a5439b EB |
82 | |
83 | (define-public duplicity | |
84 | (package | |
85 | (name "duplicity") | |
aeeb246a | 86 | (version "0.8.17") |
d1a5439b EB |
87 | (source |
88 | (origin | |
89 | (method url-fetch) | |
90 | (uri (string-append "https://code.launchpad.net/duplicity/" | |
29a7c98a | 91 | (version-major+minor version) |
d1a5439b EB |
92 | "-series/" version "/+download/duplicity-" |
93 | version ".tar.gz")) | |
94 | (sha256 | |
aeeb246a | 95 | (base32 "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2")))) |
d1a5439b EB |
96 | (build-system python-build-system) |
97 | (native-inputs | |
fccc0127 | 98 | `(("gettext" ,gettext-minimal) ; for msgfmt |
548d4d81 | 99 | ("util-linux" ,util-linux) ; setsid command, for the tests |
8ef8de79 | 100 | ("par2cmdline" ,par2cmdline) |
548d4d81 EB |
101 | ("python-fasteners" ,python-fasteners) |
102 | ("python-future" ,python-future) ; for tests | |
103 | ("python-pexpect" ,python-pexpect) | |
104 | ("python-pytest" ,python-pytest) | |
105 | ("python-pytest-runner" ,python-pytest-runner) | |
106 | ("python-setuptools-scm" ,python-setuptools-scm) | |
5a8ef3c1 | 107 | ("tzdata" ,tzdata-for-tests) |
548d4d81 | 108 | ("mock" ,python-mock))) |
2903ee1e | 109 | (propagated-inputs |
548d4d81 EB |
110 | `(("lockfile" ,python-lockfile) |
111 | ("urllib3" ,python-urllib3))) | |
d1a5439b | 112 | (inputs |
548d4d81 | 113 | `(("librsync" ,librsync) |
2903ee1e | 114 | ("lftp" ,lftp) |
02489a66 | 115 | ("gnupg" ,gnupg) ; gpg executable needed |
5a8ef3c1 | 116 | ("util-linux" ,util-linux))) ; for setsid |
d1a5439b | 117 | (arguments |
548d4d81 | 118 | `(#:test-target "test" |
ad04bd6b MB |
119 | #:phases |
120 | (modify-phases %standard-phases | |
7bb7920f | 121 | (add-before 'build 'use-store-file-names |
ad04bd6b | 122 | (lambda* (#:key inputs #:allow-other-keys) |
8ef8de79 | 123 | (substitute* "duplicity/gpginterface.py" |
548d4d81 | 124 | (("self.call = u'gpg'") |
8ef8de79 | 125 | (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'"))) |
e61f092c | 126 | |
8ef8de79 MB |
127 | (substitute* '("testing/functional/__init__.py" |
128 | "testing/overrides/bin/lftp") | |
ad04bd6b | 129 | (("/bin/sh") (which "sh"))) |
8ef8de79 MB |
130 | #t)) |
131 | (add-before 'check 'check-setup | |
132 | (lambda* (#:key inputs #:allow-other-keys) | |
02489a66 TGR |
133 | (setenv "HOME" (getcwd)) ; gpg needs to write to $HOME |
134 | (setenv "TZDIR" ; some timestamp checks need TZDIR | |
ad04bd6b MB |
135 | (string-append (assoc-ref inputs "tzdata") |
136 | "/share/zoneinfo")) | |
137 | #t))))) | |
d1a5439b EB |
138 | (home-page "http://duplicity.nongnu.org/index.html") |
139 | (synopsis "Encrypted backup using rsync algorithm") | |
140 | (description | |
141 | "Duplicity backs up directories by producing encrypted tar-format volumes | |
142 | and uploading them to a remote or local file server. Because duplicity uses | |
143 | librsync, the incremental archives are space efficient and only record the | |
144 | parts of files that have changed since the last backup. Because duplicity | |
145 | uses GnuPG to encrypt and/or sign these archives, they will be safe from | |
146 | spying and/or modification by the server.") | |
b0e3635e | 147 | (license license:gpl2+))) |
2d762953 | 148 | |
f6875394 BT |
149 | (define-public par2cmdline |
150 | (package | |
151 | (name "par2cmdline") | |
70a17df6 | 152 | (version "0.8.1") |
f6875394 | 153 | (source (origin |
5cdbdc2b RW |
154 | (method git-fetch) |
155 | (uri (git-reference | |
b0e7b699 | 156 | (url "https://github.com/Parchive/par2cmdline") |
5cdbdc2b RW |
157 | (commit (string-append "v" version)))) |
158 | (file-name (git-file-name name version)) | |
f6875394 BT |
159 | (sha256 |
160 | (base32 | |
70a17df6 | 161 | "11mx8q29cr0sryd11awab7y4mhqgbamb1ss77rffjj6in8pb4hdk")))) |
f6875394 BT |
162 | (native-inputs |
163 | `(("automake" ,automake) | |
164 | ("autoconf" ,autoconf))) | |
165 | (build-system gnu-build-system) | |
f6d59ecf TGR |
166 | (synopsis "File verification and repair tools") |
167 | (description "Par2cmdline uses Reed-Solomon error-correcting codes to | |
168 | generate and verify PAR2 recovery files. These files can be distributed | |
169 | alongside the source files or stored together with back-ups to protect against | |
170 | transmission errors or @dfn{bit rot}, the degradation of storage media over | |
171 | time. | |
172 | Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the | |
a2dd9270 TGR |
173 | damage isn't too extensive (and smaller than the size of the recovery file), it |
174 | can even repair them.") | |
f6875394 BT |
175 | (home-page "https://github.com/Parchive/par2cmdline") |
176 | (license license:gpl3+))) | |
177 | ||
2d762953 EB |
178 | (define-public hdup |
179 | (package | |
180 | (name "hdup") | |
181 | (version "2.0.14") | |
182 | (source | |
183 | (origin | |
184 | (method url-fetch) | |
35d28c60 | 185 | (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2") |
2d762953 EB |
186 | (sha256 |
187 | (base32 | |
188 | "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7")))) | |
189 | (build-system gnu-build-system) | |
190 | (native-inputs `(("pkg-config" ,pkg-config))) | |
191 | (inputs | |
192 | `(("glib" ,glib) | |
193 | ("tar" ,tar) | |
194 | ("lzop" ,lzop) | |
195 | ("mcrypt" ,mcrypt) | |
196 | ("openssh" ,openssh) | |
197 | ("gnupg" ,gnupg-1))) | |
198 | (arguments | |
199 | `(#:configure-flags | |
200 | `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin")) | |
201 | #:tests? #f)) | |
4a635d3d TGR |
202 | (home-page (string-append "http://web.archive.org/web/20150925223424/" |
203 | "http://archive.miek.nl/projects/hdup/index.html")) | |
2d762953 EB |
204 | (synopsis "Simple incremental backup tool") |
205 | (description | |
69b4ffcf | 206 | "Hdup2 is a backup utility, its aim is to make backup really simple. The |
2d762953 EB |
207 | backup scheduling is done by means of a cron job. It supports an |
208 | include/exclude mechanism, remote backups, encrypted backups and split | |
209 | backups (called chunks) to allow easy burning to CD/DVD.") | |
b0e3635e LC |
210 | (license license:gpl2))) |
211 | ||
212 | (define-public libarchive | |
213 | (package | |
214 | (name "libarchive") | |
7e3533a4 | 215 | (version "3.4.2") |
b0e3635e LC |
216 | (source |
217 | (origin | |
218 | (method url-fetch) | |
549f4091 | 219 | (uri (list (string-append "https://libarchive.org/downloads/libarchive-" |
ef2782d7 | 220 | version ".tar.xz") |
549f4091 MB |
221 | (string-append "https://github.com/libarchive/libarchive" |
222 | "/releases/download/v" version "/libarchive-" | |
ef2782d7 | 223 | version ".tar.xz"))) |
b0e3635e LC |
224 | (sha256 |
225 | (base32 | |
7e3533a4 | 226 | "18dd01ahs2hv74xm7axjc3yhq839p0x0s4vssvlmm8fknja09qfq")))) |
b0e3635e LC |
227 | (build-system gnu-build-system) |
228 | (inputs | |
80ba43b5 | 229 | `(("bzip2" ,bzip2) |
b0e3635e | 230 | ("libxml2" ,libxml2) |
80ba43b5 MB |
231 | ("lzo" ,lzo) |
232 | ("nettle" ,nettle) | |
233 | ("xz" ,xz) | |
234 | ("zlib" ,zlib) | |
235 | ("zstd" ,zstd "lib"))) | |
b0e3635e | 236 | (arguments |
f8071e9b MB |
237 | `(#:configure-flags '("--disable-static") |
238 | #:phases | |
4ac8d486 EF |
239 | (modify-phases %standard-phases |
240 | (add-before 'build 'patch-pwd | |
241 | (lambda _ | |
242 | (substitute* "Makefile" | |
6266b8bc EF |
243 | (("/bin/pwd") (which "pwd"))) |
244 | #t)) | |
4ac8d486 | 245 | (replace 'check |
5fd395db MO |
246 | (lambda* (#:key (tests? #t) #:allow-other-keys) |
247 | (if tests? | |
248 | ;; XXX: The test_owner_parse, test_read_disk, and | |
249 | ;; test_write_disk_lookup tests expect user 'root' to | |
250 | ;; exist, but the chroot's /etc/passwd doesn't have | |
251 | ;; it. Turn off those tests. | |
252 | ;; | |
253 | ;; XXX: Adjust test that fails with zstd 1.4.1 | |
254 | ;; because the default options compresses two bytes | |
255 | ;; better than this test expects. | |
256 | ;; https://github.com/libarchive/libarchive/issues/1226 | |
257 | (begin | |
258 | (substitute* "libarchive/test/test_write_filter_zstd.c" | |
259 | (("compression-level\", \"6\"") | |
260 | "compression-level\", \"7\"")) | |
261 | ||
262 | ;; The tests allow one to disable tests matching a globbing pattern. | |
263 | (invoke "make" | |
264 | "libarchive_test" | |
265 | "bsdcpio_test" | |
266 | "bsdtar_test") | |
80ba43b5 | 267 | |
5fd395db MO |
268 | ;; XXX: This glob disables too much. |
269 | (invoke "./libarchive_test" "^test_*_disk*") | |
270 | (invoke "./bsdcpio_test" "^test_owner_parse") | |
271 | (invoke "./bsdtar_test")) | |
272 | ;; Tests may be disabled if cross-compiling. | |
273 | (format #t "Test suite not run.~%")))) | |
5294836d LC |
274 | (add-after 'install 'add--L-in-libarchive-pc |
275 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
276 | (let* ((out (assoc-ref outputs "out")) | |
277 | (lib (string-append out "/lib")) | |
278 | (nettle (assoc-ref inputs "nettle")) | |
279 | (libxml2 (assoc-ref inputs "libxml2")) | |
280 | (xz (assoc-ref inputs "xz")) | |
281 | (zlib (assoc-ref inputs "zlib")) | |
80ba43b5 | 282 | (zstd (assoc-ref inputs "zstd")) |
5294836d | 283 | (bzip2 (assoc-ref inputs "bzip2"))) |
1664e2ab MB |
284 | ;; Embed absolute references to these inputs to avoid propagation. |
285 | (substitute* (list (string-append lib "/pkgconfig/libarchive.pc") | |
286 | (string-append lib "/libarchive.la")) | |
5294836d LC |
287 | (("-lnettle") |
288 | (string-append "-L" nettle "/lib -lnettle")) | |
289 | (("-lxml2") | |
290 | (string-append "-L" libxml2 "/lib -lxml2")) | |
291 | (("-llzma") | |
292 | (string-append "-L" xz "/lib -llzma")) | |
293 | (("-lz") | |
294 | (string-append "-L" zlib "/lib -lz")) | |
80ba43b5 MB |
295 | (("-lzstd") |
296 | (string-append "-L" zstd "/lib -lzstd")) | |
5294836d LC |
297 | (("-lbz2") |
298 | (string-append "-L" bzip2 "/lib -lbz2"))) | |
7ce9139f | 299 | #t)))))) |
c824dedf | 300 | (home-page "https://libarchive.org/") |
b0e3635e LC |
301 | (synopsis "Multi-format archive and compression library") |
302 | (description | |
303 | "Libarchive provides a flexible interface for reading and writing | |
304 | archives in various formats such as tar and cpio. Libarchive also supports | |
305 | reading and writing archives compressed using various compression filters such | |
306 | as gzip and bzip2. The library is inherently stream-oriented; readers | |
307 | serially iterate through the archive, writers serially add things to the | |
35b9e423 | 308 | archive. In particular, note that there is currently no built-in support for |
b0e3635e LC |
309 | random access nor for in-place modification.") |
310 | (license license:bsd-2))) | |
d42e6122 EB |
311 | |
312 | (define-public rdup | |
313 | (package | |
314 | (name "rdup") | |
fbf210cb | 315 | (version "1.1.15") |
d42e6122 EB |
316 | (source |
317 | (origin | |
658ef2ec TGR |
318 | (method git-fetch) |
319 | (uri (git-reference | |
b0e7b699 | 320 | (url "https://github.com/miekg/rdup") |
658ef2ec TGR |
321 | (commit version))) |
322 | (file-name (git-file-name name version)) | |
d42e6122 | 323 | (sha256 |
658ef2ec | 324 | (base32 "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw")))) |
d42e6122 EB |
325 | (build-system gnu-build-system) |
326 | (native-inputs | |
fbf210cb TGR |
327 | `(("autoconf" ,autoconf) |
328 | ("automake" ,automake) | |
329 | ("pkg-config" ,pkg-config) | |
330 | ||
331 | ;; For tests. | |
d42e6122 EB |
332 | ("dejagnu" ,dejagnu))) |
333 | (inputs | |
d939b295 TGR |
334 | ;; XXX Compiling with nettle (encryption) support requires patching out |
335 | ;; -Werror from GNUmakefile.in. Then, rdup-tr-{en,de}crypt tests fail: | |
336 | ;; free(): invalid pointer | |
337 | ;; ** rdup-tr: SIGPIPE received, exiting | |
d42e6122 EB |
338 | `(("glib" ,glib) |
339 | ("pcre" ,pcre) | |
340 | ("libarchive" ,libarchive) | |
d939b295 | 341 | ("mcrypt" ,mcrypt))) |
d42e6122 EB |
342 | (arguments |
343 | `(#:parallel-build? #f ;race conditions | |
dc1d3cde KK |
344 | #:phases |
345 | (modify-phases %standard-phases | |
fbf210cb TGR |
346 | (add-before 'build 'qualify-inputs |
347 | (lambda* (#:key inputs #:allow-other-keys) | |
348 | ;; This script is full of pitfalls. Fix some that particularly | |
349 | ;; affect Guix users & leave the rest as reader excercises. | |
350 | (substitute* "rdup-simple" | |
351 | ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time. | |
352 | (("([' ])mcrypt " all delimiter) | |
353 | (string-append delimiter (which "mcrypt") " ")) | |
354 | ;; Avoid frivolous dependency on ‘which’ with a shell builtin. | |
355 | (("which") "command -v")) | |
dc1d3cde | 356 | #t)) |
d939b295 TGR |
357 | (add-before 'check 'disable-encryption-tests |
358 | (lambda _ | |
359 | (for-each delete-file | |
360 | (list "testsuite/rdup/rdup.rdup-tr-crypt.exp" | |
361 | "testsuite/rdup/rdup.rdup-tr-decrypt.exp" | |
362 | "testsuite/rdup/rdup.rdup-tr-encrypt.exp")) | |
363 | #t)) | |
dc1d3cde KK |
364 | (add-before 'check 'pre-check |
365 | (lambda _ | |
366 | (setenv "HOME" (getcwd)) | |
367 | (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp" | |
368 | (("/bin/cat") (which "cat"))) | |
369 | #t))))) | |
fbf210cb | 370 | (home-page "https://github.com/miekg/rdup") |
d42e6122 EB |
371 | (synopsis "Provide a list of files to backup") |
372 | (description | |
373 | "Rdup is a utility inspired by rsync and the plan9 way of doing backups. | |
374 | Rdup itself does not backup anything, it only print a list of absolute | |
e881752c | 375 | file names to standard output. Auxiliary scripts are needed that act on this |
d42e6122 | 376 | list and implement the backup strategy.") |
b0e3635e | 377 | (license license:gpl3+))) |
22c24621 EB |
378 | |
379 | (define-public btar | |
380 | (package | |
381 | (name "btar") | |
382 | (version "1.1.1") | |
383 | (source | |
384 | (origin | |
385 | (method url-fetch) | |
386 | (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/" | |
387 | "btar-" version ".tar.gz")) | |
388 | (sha256 | |
389 | (base32 | |
390 | "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd")))) | |
391 | (build-system gnu-build-system) | |
392 | (inputs | |
584dbd85 | 393 | `(("librsync" ,librsync-0.9))) |
22c24621 EB |
394 | (arguments |
395 | `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out")) | |
7d728270 | 396 | ,(string-append "CC=" ,(cc-for-target))) |
22c24621 EB |
397 | #:tests? #f ;test input not distributed |
398 | #:phases | |
dc1d3cde KK |
399 | ;; no configure phase |
400 | (modify-phases %standard-phases | |
401 | (delete 'configure)))) | |
22c24621 EB |
402 | (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki") |
403 | (synopsis "Tar-compatible archiver") | |
404 | (description | |
405 | "Btar is a tar-compatible archiver which allows arbitrary compression and | |
406 | ciphering, redundancy, differential backup, indexed extraction, multicore | |
407 | compression, input and output serialisation, and tolerance to partial archive | |
408 | errors.") | |
b0e3635e | 409 | (license license:gpl3+))) |
bd3fc08c EB |
410 | |
411 | (define-public rdiff-backup | |
412 | (package | |
413 | (name "rdiff-backup") | |
0cd02631 | 414 | (version "2.0.5") |
bd3fc08c EB |
415 | (source |
416 | (origin | |
417 | (method url-fetch) | |
c4a9182e EB |
418 | (uri (string-append "https://github.com/rdiff-backup/rdiff-backup/releases/" |
419 | "download/v" version "/rdiff-backup-" version ".tar.gz")) | |
bd3fc08c | 420 | (sha256 |
0cd02631 | 421 | (base32 "11rvjcp77zwgkphz1kyf5yqgr3rlss7dm9xzmvpvc4lp99xq7drb")))) |
bd3fc08c | 422 | (build-system python-build-system) |
c4a9182e EB |
423 | (native-inputs |
424 | `(("python-setuptools-scm" ,python-setuptools-scm))) | |
bd3fc08c | 425 | (inputs |
c4a9182e EB |
426 | `(("python" ,python) |
427 | ("librsync" ,librsync))) | |
bd3fc08c | 428 | (arguments |
c4a9182e EB |
429 | `(#:tests? #f)) ; Tests require root/sudo |
430 | (home-page "https://rdiff-backup.net/") | |
bd3fc08c EB |
431 | (synopsis "Local/remote mirroring+incremental backup") |
432 | (description | |
433 | "Rdiff-backup backs up one directory to another, possibly over a network. | |
434 | The target directory ends up a copy of the source directory, but extra reverse | |
435 | diffs are stored in a special subdirectory of that target directory, so you | |
436 | can still recover files lost some time ago. The idea is to combine the best | |
437 | features of a mirror and an incremental backup. Rdiff-backup also preserves | |
438 | subdirectories, hard links, dev files, permissions, uid/gid ownership, | |
439 | modification times, extended attributes, acls, and resource forks. Also, | |
440 | rdiff-backup can operate in a bandwidth efficient manner over a pipe, like | |
441 | rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up | |
442 | to a remote location, and only the differences will be transmitted. Finally, | |
e881752c | 443 | rdiff-backup is easy to use and settings have sensible defaults.") |
b0e3635e | 444 | (license license:gpl2+))) |
0c146750 | 445 | |
0da4f365 TD |
446 | (define-public rsnapshot |
447 | (package | |
448 | (name "rsnapshot") | |
c57c648b | 449 | (version "1.4.3") |
0da4f365 TD |
450 | (source |
451 | (origin | |
452 | (method url-fetch) | |
453 | (uri (string-append | |
454 | "https://github.com/rsnapshot/rsnapshot/releases/download/" | |
455 | version "/rsnapshot-" version ".tar.gz")) | |
456 | (sha256 | |
c57c648b | 457 | (base32 "1lavqmmsf53pim0nvming7fkng6p0nk2a51k2c2jdq0l7snpl31b")))) |
0da4f365 TD |
458 | (build-system gnu-build-system) |
459 | (arguments | |
460 | `(#:phases | |
461 | (modify-phases %standard-phases | |
462 | (replace 'check | |
463 | (lambda _ | |
464 | (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf" | |
465 | "t/backup_exec/conf/backup_exec_fail.conf" | |
466 | "t/backup_exec/conf/backup_exec.conf") | |
467 | (("/bin/true") (which "true")) | |
468 | (("/bin/false") (which "false"))) | |
c57c648b TGR |
469 | |
470 | ;; Disable a test that tries to connect to localhost on port 22. | |
471 | (delete-file "t/ssh_args/ssh_args.t.in") | |
472 | ||
4ce7c1b3 | 473 | (invoke "make" "test")))))) |
0da4f365 TD |
474 | (inputs |
475 | `(("perl" ,perl) | |
476 | ("rsync" ,rsync))) | |
7969789e | 477 | (home-page "https://rsnapshot.org") |
0da4f365 | 478 | (synopsis "Deduplicating snapshot backup utility based on rsync") |
162a1374 | 479 | (description "rsnapshot is a file system snapshot utility based on rsync. |
0da4f365 TD |
480 | rsnapshot makes it easy to make periodic snapshots of local machines, and |
481 | remote machines over SSH. To reduce the disk space required for each backup, | |
482 | rsnapshot uses hard links to deduplicate identical files.") | |
483 | (license license:gpl2+))) | |
484 | ||
362f496d LC |
485 | (define-public libchop |
486 | (package | |
487 | (name "libchop") | |
488 | (version "0.5.2") | |
489 | (source (origin | |
490 | (method url-fetch) | |
491 | (uri (string-append "mirror://savannah/libchop/libchop-" | |
492 | version ".tar.gz")) | |
493 | (sha256 | |
494 | (base32 | |
495 | "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g")) | |
23b39478 LC |
496 | (patches (search-patches "diffutils-gets-undeclared.patch")) |
497 | (modules '((guix build utils))) | |
498 | (snippet | |
499 | '(begin | |
500 | ;; Include all the libtirpc headers necessary to get the | |
501 | ;; definitions of 'u_int', etc. | |
502 | (substitute* '("src/block-server.c" | |
503 | "include/chop/block-server.h" | |
504 | "utils/chop-block-server.c") | |
505 | (("#include <rpc/(.*)\\.h>" _ header) | |
506 | (string-append "#include <rpc/types.h>\n" | |
507 | "#include <rpc/rpc.h>\n" | |
508 | "#include <rpc/" header ".h>\n"))) | |
509 | #t)))) | |
362f496d | 510 | (build-system gnu-build-system) |
6d1a7ce8 | 511 | (arguments |
23b39478 LC |
512 | '(;; Link against libtirpc. |
513 | #:configure-flags '("LDFLAGS=-ltirpc -Wl,--as-needed") | |
514 | ||
515 | #:phases (modify-phases %standard-phases | |
6d1a7ce8 LC |
516 | (add-before 'configure 'adjust-configure-script |
517 | (lambda _ | |
518 | ;; Mimic upstream commit | |
519 | ;; 25750ab5ef82fd3cfce5205d5f1ef07b47098091. | |
520 | (substitute* "configure" | |
521 | (("GUILE=(.*)--variable bindir`" _ middle) | |
522 | (string-append "GUILE=" middle | |
523 | "--variable bindir`/guile"))) | |
524 | #t)) | |
23b39478 LC |
525 | (add-before 'build 'set-libtirpc-include-path |
526 | (lambda* (#:key inputs #:allow-other-keys) | |
527 | ;; Allow <rpc/rpc.h> & co. to be found. | |
528 | (let ((libtirpc (assoc-ref inputs "libtirpc"))) | |
529 | (setenv "CPATH" | |
530 | (string-append (getenv "CPATH") | |
531 | ":" libtirpc | |
532 | "/include/tirpc")) | |
533 | #t))) | |
6d1a7ce8 LC |
534 | (add-before 'check 'skip-test |
535 | (lambda _ | |
536 | ;; XXX: This test fails (1) because current GnuTLS no | |
537 | ;; longer supports OpenPGP authentication, and (2) for | |
538 | ;; some obscure reason. Better skip it. | |
539 | (setenv "XFAIL_TESTS" "utils/block-server") | |
540 | #t))))) | |
362f496d LC |
541 | (native-inputs |
542 | `(("guile" ,guile-2.0) | |
c9f898cd | 543 | ("gperf" ,gperf-3.0) ;see <https://bugs.gnu.org/32382> |
23b39478 LC |
544 | ("pkg-config" ,pkg-config) |
545 | ("rpcsvc-proto" ,rpcsvc-proto))) ;for 'rpcgen' | |
362f496d LC |
546 | (inputs |
547 | `(("guile" ,guile-2.0) | |
548 | ("util-linux" ,util-linux) | |
23b39478 | 549 | ("libtirpc" ,libtirpc) |
362f496d LC |
550 | ("gnutls" ,gnutls) |
551 | ("tdb" ,tdb) | |
552 | ("bdb" ,bdb) | |
553 | ("gdbm" ,gdbm) | |
554 | ("libgcrypt" ,libgcrypt) | |
555 | ("lzo" ,lzo) | |
556 | ("bzip2" ,bzip2) | |
557 | ("zlib" ,zlib))) | |
340978d7 | 558 | (home-page "https://nongnu.org/libchop/") |
362f496d LC |
559 | (synopsis "Tools & library for data backup and distributed storage") |
560 | (description | |
561 | "Libchop is a set of utilities and library for data backup and | |
562 | distributed storage. Its main application is @command{chop-backup}, an | |
563 | encrypted backup program that supports data integrity checks, versioning, | |
564 | distribution among several sites, selective sharing of stored data, adaptive | |
565 | compression, and more. The library itself implements storage techniques such | |
566 | as content-addressable storage, content hash keys, Merkle trees, similarity | |
567 | detection, and lossless compression.") | |
568 | (license license:gpl3+))) | |
6fc5c11b LF |
569 | |
570 | (define-public borg | |
571 | (package | |
572 | (name "borg") | |
88205d2d | 573 | (version "1.1.15") |
c4556777 TGR |
574 | (source |
575 | (origin | |
576 | (method url-fetch) | |
577 | (uri (pypi-uri "borgbackup" version)) | |
578 | (sha256 | |
88205d2d | 579 | (base32 "1g62sdzcw3zx4ccky125ciwnzx6z9kwyvskvp7ijmqxqk3nrxjs9")) |
c4556777 TGR |
580 | (modules '((guix build utils))) |
581 | (snippet | |
582 | '(begin | |
5a3bf255 LF |
583 | ;; Delete files generated by Cython. We used to have a regex |
584 | ;; that created the list of generated files but Borg has | |
585 | ;; added new non-generated C files that cause the regex to | |
586 | ;; generate the wrong list. | |
c4556777 | 587 | (for-each delete-file |
5a3bf255 LF |
588 | '("src/borg/algorithms/checksums.c" |
589 | "src/borg/chunker.c" | |
590 | "src/borg/compress.c" | |
591 | "src/borg/crypto/low_level.c" | |
592 | "src/borg/hashindex.c" | |
593 | "src/borg/item.c" | |
594 | "src/borg/platform/darwin.c" | |
595 | "src/borg/platform/freebsd.c" | |
596 | "src/borg/platform/linux.c" | |
88205d2d LF |
597 | "src/borg/platform/posix.c" |
598 | "src/borg/platform/syncfilerange.c")) | |
c4556777 TGR |
599 | ;; Remove bundled shared libraries. |
600 | (with-directory-excursion "src/borg/algorithms" | |
601 | (for-each delete-file-recursively | |
d46fc636 TGR |
602 | (list "blake2" "lz4" "msgpack" "zstd"))) |
603 | ;; Purge some msgpack references from setup.py or the resulting | |
604 | ;; sources will be unbuildable. | |
605 | (substitute* "setup.py" | |
606 | ((".*Extension\\('borg\\.algorithms\\.msgpack\\..*") "") | |
607 | (("msgpack_packer_source, msgpack_unpacker_source") "")) | |
6cbee49d | 608 | #t)))) |
6fc5c11b LF |
609 | (build-system python-build-system) |
610 | (arguments | |
7db756f7 | 611 | `(#:modules ((srfi srfi-26) ; for cut |
c21b1a1f LF |
612 | (guix build utils) |
613 | (guix build python-build-system)) | |
614 | #:phases | |
6fc5c11b LF |
615 | (modify-phases %standard-phases |
616 | (add-after 'unpack 'set-env | |
617 | (lambda* (#:key inputs #:allow-other-keys) | |
618 | (let ((openssl (assoc-ref inputs "openssl")) | |
19278d8d | 619 | (libb2 (assoc-ref inputs "libb2")) |
c4556777 TGR |
620 | (lz4 (assoc-ref inputs "lz4")) |
621 | (zstd (assoc-ref inputs "zstd"))) | |
6fc5c11b | 622 | (setenv "BORG_OPENSSL_PREFIX" openssl) |
19278d8d | 623 | (setenv "BORG_LIBB2_PREFIX" libb2) |
c4556777 TGR |
624 | (setenv "BORG_LIBLZ4_PREFIX" lz4) |
625 | (setenv "BORG_LIBZSTD_PREFIX" zstd) | |
6fc5c11b | 626 | (setenv "PYTHON_EGG_CACHE" "/tmp") |
b4f91d0e LF |
627 | ;; The test 'test_return_codes[python]' fails when |
628 | ;; HOME=/homeless-shelter. | |
629 | (setenv "HOME" "/tmp") | |
6fc5c11b | 630 | #t))) |
d46fc636 TGR |
631 | (add-after 'unpack 'use-system-msgpack |
632 | (lambda _ | |
633 | (substitute* "src/borg/helpers.py" | |
634 | (("prefer_system_msgpack = False") | |
635 | "prefer_system_msgpack = True")) | |
636 | #t)) | |
b4f91d0e LF |
637 | ;; The tests need to be run after Borg is installed. |
638 | (delete 'check) | |
639 | (add-after 'install 'check | |
1d60f7c2 LF |
640 | (lambda* (#:key inputs outputs #:allow-other-keys) |
641 | ;; Make the installed package available for the test suite. | |
642 | (add-installed-pythonpath inputs outputs) | |
8cb3e7e7 LF |
643 | ;; The tests should be run in an empty directory. |
644 | (mkdir-p "tests") | |
645 | (with-directory-excursion "tests" | |
e252ec32 TGR |
646 | (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k" |
647 | (string-append | |
648 | ;; These tests need to write to '/var'. | |
649 | "not test_get_cache_dir " | |
650 | "and not test_get_config_dir " | |
651 | "and not test_get_keys_dir " | |
652 | "and not test_get_security_dir " | |
653 | ;; These tests assume there is a root user in | |
654 | ;; '/etc/passwd'. | |
655 | "and not test_access_acl " | |
656 | "and not test_default_acl " | |
657 | "and not test_non_ascii_acl " | |
88205d2d | 658 | "and not test_create_stdin " |
e252ec32 TGR |
659 | ;; This test needs the unpackaged pytest-benchmark. |
660 | "and not benchmark " | |
661 | ;; These tests assume the kernel supports FUSE. | |
662 | "and not test_fuse " | |
663 | "and not test_fuse_allow_damaged_files " | |
14adb59a TGR |
664 | "and not test_mount_hardlinks " |
665 | "and not test_readonly_mount "))))) | |
6fc5c11b | 666 | (add-after 'install 'install-doc |
6ee4fd2a | 667 | (lambda* (#:key inputs outputs #:allow-other-keys) |
6fc5c11b | 668 | (let* ((out (assoc-ref outputs "out")) |
c21b1a1f LF |
669 | (man (string-append out "/share/man/man1")) |
670 | (misc (string-append out "/share/borg/misc"))) | |
671 | (for-each (cut install-file <> misc) | |
672 | '("docs/misc/create_chunker-params.txt" | |
673 | "docs/misc/internals-picture.txt" | |
674 | "docs/misc/prune-example.txt")) | |
e252ec32 | 675 | (copy-recursively "docs/man" man) |
9d6863de MR |
676 | #t))) |
677 | (add-after 'install-docs 'install-shell-completions | |
678 | (lambda* (#:key outputs #:allow-other-keys) | |
679 | (let* ((out (assoc-ref outputs "out")) | |
680 | (etc (string-append out "/etc")) | |
681 | (share (string-append out "/share"))) | |
682 | (with-directory-excursion "scripts/shell_completions" | |
683 | (install-file "bash/borg" | |
684 | (string-append etc "/bash_completion.d")) | |
685 | (install-file "zsh/_borg" | |
686 | (string-append share "/zsh/site-functions")) | |
687 | (install-file "fish/borg.fish" | |
688 | (string-append share "/fish/vendor_completions.d"))) | |
e252ec32 | 689 | #t)))))) |
6fc5c11b | 690 | (native-inputs |
f99cfc19 EF |
691 | `(("python-cython" ,python-cython) |
692 | ("python-setuptools-scm" ,python-setuptools-scm) | |
d4c0053e | 693 | ("python-pytest" ,python-pytest))) |
6fc5c11b LF |
694 | (inputs |
695 | `(("acl" ,acl) | |
19278d8d | 696 | ("libb2" ,libb2) |
6fc5c11b LF |
697 | ("lz4" ,lz4) |
698 | ("openssl" ,openssl) | |
699 | ("python-llfuse" ,python-llfuse) | |
acb59d99 LF |
700 | ;; The Python msgpack library changed its name so Borg requires this |
701 | ;; transitional package for now: | |
702 | ;; <https://bugs.gnu.org/30662> | |
703 | ("python-msgpack" ,python-msgpack-transitional) | |
ec0de9d8 | 704 | ("zstd" ,zstd "lib"))) |
6fc5c11b LF |
705 | (synopsis "Deduplicated, encrypted, authenticated and compressed backups") |
706 | (description "Borg is a deduplicating backup program. Optionally, it | |
707 | supports compression and authenticated encryption. The main goal of Borg is to | |
708 | provide an efficient and secure way to backup data. The data deduplication | |
709 | technique used makes Borg suitable for daily backups since only changes are | |
710 | stored. The authenticated encryption technique makes it suitable for backups | |
711 | to not fully trusted targets. Borg is a fork of Attic.") | |
18533bcf | 712 | (home-page "https://www.borgbackup.org/") |
6fc5c11b | 713 | (license license:bsd-3))) |
b2fe9183 | 714 | |
3b402139 TGR |
715 | (define-public wimlib |
716 | (package | |
717 | (name "wimlib") | |
d0e9a2ed | 718 | (version "1.13.3") |
3b402139 TGR |
719 | (source (origin |
720 | (method url-fetch) | |
721 | (uri (string-append "https://wimlib.net/downloads/" | |
1a05bce2 | 722 | "wimlib-" version ".tar.gz")) |
3b402139 TGR |
723 | (sha256 |
724 | (base32 | |
d0e9a2ed | 725 | "0zpsbl9iicc6y81xfl6kf8farwfsyrl63shc0idp654kgp8421wa")))) |
3b402139 TGR |
726 | (build-system gnu-build-system) |
727 | (native-inputs | |
728 | `(("pkg-config" ,pkg-config))) | |
729 | (inputs | |
730 | `(("fuse" ,fuse) | |
731 | ("libxml2" ,libxml2) | |
732 | ("ntfs-3g" ,ntfs-3g) | |
733 | ("openssl" ,openssl))) | |
734 | (arguments | |
735 | `(#:configure-flags (list "--enable-test-support"))) | |
736 | (home-page "https://wimlib.net/") | |
737 | (synopsis "WIM file manipulation library and utilities") | |
738 | (description "wimlib is a C library and set of command-line utilities for | |
739 | creating, modifying, extracting, and mounting archives in the Windows Imaging | |
740 | Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to | |
741 | NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.") | |
742 | ;; wimlib is dual-licenced under version 3 or later of either the GPL or | |
743 | ;; LGPL, except those files explicitly marked as being released into the | |
744 | ;; public domain (CC0) in their headers. | |
745 | (license (list license:gpl3+ | |
746 | license:lgpl3+ | |
747 | license:cc0)))) | |
a2fa9c3d | 748 | |
0ff4425c CAW |
749 | (define-public dirvish |
750 | (package | |
751 | (name "dirvish") | |
752 | (version "1.2.1") | |
753 | (build-system gnu-build-system) | |
754 | (source (origin | |
755 | (method url-fetch) | |
756 | (uri (string-append | |
757 | "http://dirvish.org/dirvish-" version ".tgz")) | |
758 | (sha256 | |
759 | (base32 | |
760 | "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb")))) | |
761 | (arguments | |
762 | `(#:modules ((ice-9 match) (ice-9 rdelim) | |
763 | ,@%gnu-build-system-modules) | |
764 | #:phases | |
765 | ;; This mostly mirrors the steps taken in the install.sh that ships | |
766 | ;; with dirvish, but simplified because we aren't prompting interactively | |
767 | (modify-phases %standard-phases | |
768 | (delete 'configure) | |
769 | (delete 'build) | |
770 | (delete 'check) | |
771 | (replace 'install | |
772 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
773 | ;; These are mostly the same steps the install.sh that comes with | |
774 | ;; dirvish does | |
775 | (let* (;; Files we'll be copying | |
776 | (executables | |
777 | '("dirvish" "dirvish-runall" | |
778 | "dirvish-expire" "dirvish-locate")) | |
779 | (man-pages | |
780 | '(("dirvish" "8") ("dirvish-runall" "8") | |
781 | ("dirvish-expire" "8") ("dirvish-locate" "8") | |
782 | ("dirvish.conf" "5"))) | |
783 | ||
784 | (output-dir | |
785 | (assoc-ref outputs "out")) | |
786 | ||
787 | ;; Just a default... not so useful on guixsd though | |
788 | ;; You probably want to a service with file(s) to point to. | |
789 | (confdir "/etc/dirvish") | |
790 | ||
791 | (perl (string-append (assoc-ref %build-inputs "perl") | |
792 | "/bin/perl")) | |
793 | (loadconfig.pl (call-with-input-file "loadconfig.pl" | |
794 | read-string))) | |
795 | ||
796 | ||
797 | (define (write-pl filename) | |
798 | (define pl-header | |
799 | (string-append "#!" perl "\n\n" | |
800 | "$CONFDIR = \"" confdir "\";\n\n")) | |
801 | (define input-file-location | |
802 | (string-append filename ".pl")) | |
803 | (define target-file-location | |
804 | (string-append output-dir "/bin/" filename ".pl")) | |
805 | (define text-to-write | |
806 | (string-append pl-header | |
807 | (call-with-input-file input-file-location | |
808 | read-string) | |
809 | "\n" loadconfig.pl)) | |
810 | (with-output-to-file target-file-location | |
811 | (lambda () | |
812 | (display text-to-write))) | |
813 | (chmod target-file-location #o755) | |
814 | (wrap-program target-file-location | |
815 | `("PERL5LIB" ":" prefix | |
816 | ,(map (lambda (l) (string-append (assoc-ref %build-inputs l) | |
817 | "/lib/perl5/site_perl")) | |
818 | '("perl-libtime-period" | |
819 | "perl-libtime-parsedate"))))) | |
820 | ||
821 | (define write-man | |
822 | (match-lambda | |
823 | ((file-base man-num) | |
824 | (let* ((filename | |
825 | (string-append file-base "." man-num)) | |
826 | (output-path | |
827 | (string-append output-dir | |
828 | "/share/man/man" man-num | |
829 | "/" filename))) | |
830 | (copy-file filename output-path))))) | |
831 | ||
832 | ;; Make directories | |
833 | (mkdir-p (string-append output-dir "/bin/")) | |
834 | (mkdir-p (string-append output-dir "/share/man/man8/")) | |
835 | (mkdir-p (string-append output-dir "/share/man/man5/")) | |
836 | ||
837 | ;; Write out executables | |
838 | (for-each write-pl executables) | |
839 | ;; Write out man pages | |
840 | (for-each write-man man-pages) | |
841 | #t)))))) | |
842 | (inputs | |
843 | `(("perl" ,perl) | |
844 | ("rsync" ,rsync) | |
845 | ("perl-libtime-period" ,perl-libtime-period) | |
846 | ("perl-libtime-parsedate" ,perl-libtime-parsedate))) | |
847 | (home-page "http://dirvish.org/") | |
848 | (synopsis "Fast, disk based, rotating network backup system") | |
849 | (description | |
850 | "With dirvish you can maintain a set of complete images of your | |
162a1374 | 851 | file systems with unattended creation and expiration. A dirvish backup vault |
0ff4425c CAW |
852 | is like a time machine for your data. ") |
853 | (license (license:fsf-free "file://COPYING" | |
854 | "Open Software License 2.0")))) | |
f77886c1 | 855 | |
f49d6909 | 856 | (define-public restic |
f77886c1 OP |
857 | (package |
858 | (name "restic") | |
40df1928 | 859 | (version "0.9.6") |
f49d6909 LF |
860 | ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/' |
861 | ;; directory. | |
f77886c1 OP |
862 | (source (origin |
863 | (method url-fetch) | |
864 | (uri (string-append | |
865 | "https://github.com/restic/restic/releases/download/" | |
866 | "v" version "/restic-" version ".tar.gz")) | |
867 | (file-name (string-append name "-" version ".tar.gz")) | |
868 | (sha256 | |
869 | (base32 | |
40df1928 | 870 | "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w")))) |
f77886c1 OP |
871 | (build-system go-build-system) |
872 | (arguments | |
873 | `(#:import-path "github.com/restic/restic" | |
f77886c1 OP |
874 | ;; We don't need to install the source code for end-user applications. |
875 | #:install-source? #f | |
876 | #:phases | |
877 | (modify-phases %standard-phases | |
878 | (replace 'build | |
879 | (lambda* (#:key inputs #:allow-other-keys) | |
fb098182 | 880 | (with-directory-excursion "src/github.com/restic/restic" |
9cac043c TGR |
881 | ;; Disable 'restic self-update'. It makes little sense in Guix. |
882 | (substitute* "build.go" (("selfupdate") "")) | |
15595644 | 883 | (setenv "HOME" (getcwd)) ; for $HOME/.cache/go-build |
f77886c1 OP |
884 | (invoke "go" "run" "build.go")))) |
885 | ||
4976ebdd OP |
886 | (replace 'check |
887 | (lambda _ | |
fb098182 | 888 | (with-directory-excursion "src/github.com/restic/restic" |
77389911 OP |
889 | ;; Disable FUSE tests. |
890 | (setenv "RESTIC_TEST_FUSE" "0") | |
4976ebdd OP |
891 | (invoke "go" "run" "build.go" "--test")))) |
892 | ||
f77886c1 OP |
893 | (replace 'install |
894 | (lambda* (#:key outputs #:allow-other-keys) | |
895 | (let ((out (assoc-ref outputs "out")) | |
fb098182 | 896 | (src "src/github.com/restic/restic")) |
f77886c1 OP |
897 | (install-file (string-append src "/restic") |
898 | (string-append out "/bin")) | |
899 | #t))) | |
900 | ||
901 | (add-after 'install 'install-docs | |
902 | (lambda* (#:key outputs #:allow-other-keys) | |
903 | (let* ((out (assoc-ref outputs "out")) | |
904 | (man "/share/man") | |
905 | (man-section (string-append man "/man")) | |
fb098182 | 906 | (src "src/github.com/restic/restic/doc/man/")) |
f77886c1 OP |
907 | ;; Install all the man pages to "out". |
908 | (for-each | |
909 | (lambda (file) | |
910 | (install-file file | |
911 | (string-append out man-section | |
912 | (string-take-right file 1)))) | |
913 | (find-files src "\\.[1-9]")) | |
914 | #t))) | |
915 | ||
916 | (add-after 'install-docs 'install-shell-completion | |
917 | (lambda* (#:key outputs #:allow-other-keys) | |
918 | (let* ((out (assoc-ref outputs "out")) | |
919 | (bin (string-append out "/bin")) | |
920 | (etc (string-append out "/etc")) | |
921 | (share (string-append out "/share"))) | |
922 | (for-each | |
923 | (lambda (shell) | |
924 | (let* ((shell-name (symbol->string shell)) | |
925 | (dir (string-append "etc/completion/" shell-name))) | |
926 | (mkdir-p dir) | |
927 | (invoke (string-append bin "/restic") "generate" | |
928 | (string-append "--" shell-name "-completion") | |
929 | (string-append dir "/" | |
930 | (case shell | |
931 | ((bash) "restic") | |
932 | ((zsh) "_restic")))))) | |
933 | '(bash zsh)) | |
934 | (with-directory-excursion "etc/completion" | |
935 | (install-file "bash/restic" | |
936 | (string-append etc "/bash_completion.d")) | |
937 | (install-file "zsh/_restic" | |
938 | (string-append share "/zsh/site-functions"))) | |
939 | #t)))))) | |
940 | (home-page "https://restic.net/") | |
941 | (synopsis "Backup program with multiple revisions, encryption and more") | |
942 | (description "Restic is a program that does backups right and was designed | |
943 | with the following principles in mind: | |
944 | ||
945 | @itemize | |
946 | @item Easy: Doing backups should be a frictionless process, otherwise you | |
947 | might be tempted to skip it. Restic should be easy to configure and use, so | |
948 | that, in the event of a data loss, you can just restore it. Likewise, | |
949 | restoring data should not be complicated. | |
950 | ||
951 | @item Fast: Backing up your data with restic should only be limited by your | |
952 | network or hard disk bandwidth so that you can backup your files every day. | |
953 | Nobody does backups if it takes too much time. Restoring backups should only | |
954 | transfer data that is needed for the files that are to be restored, so that | |
955 | this process is also fast. | |
956 | ||
957 | @item Verifiable: Much more important than backup is restore, so restic | |
958 | enables you to easily verify that all data can be restored. @item Secure: | |
959 | Restic uses cryptography to guarantee confidentiality and integrity of your | |
960 | data. The location the backup data is stored is assumed not to be a trusted | |
961 | environment (e.g. a shared space where others like system administrators are | |
962 | able to access your backups). Restic is built to secure your data against | |
963 | such attackers. | |
964 | ||
965 | @item Efficient: With the growth of data, additional snapshots should only | |
966 | take the storage of the actual increment. Even more, duplicate data should be | |
967 | de-duplicated before it is actually written to the storage back end to save | |
968 | precious backup space. | |
969 | @end itemize") | |
970 | (license license:bsd-2))) | |
7b9b203a | 971 | |
61fc72d3 NG |
972 | (define-public zbackup |
973 | (package | |
974 | (name "zbackup") | |
975 | (version "1.4.4") | |
976 | (source | |
977 | (origin | |
978 | (method git-fetch) | |
979 | (uri (git-reference | |
b0e7b699 | 980 | (url "https://github.com/zbackup/zbackup") |
61fc72d3 NG |
981 | (commit version))) |
982 | (file-name (git-file-name name version)) | |
983 | (sha256 | |
984 | (base32 "14l1kyxg7pccpax3d6qcpmdycb70kn3fxp1a59w64hqy2493hngl")))) | |
985 | (build-system cmake-build-system) | |
986 | (arguments | |
987 | `(#:tests? #f)) ;no test | |
988 | (inputs | |
989 | `(("lzo" ,lzo) | |
990 | ("libressl" ,libressl) | |
991 | ("protobuf" ,protobuf) | |
992 | ("xz" ,xz) | |
993 | ("zlib" ,zlib))) | |
994 | (home-page "http://zbackup.org") | |
995 | (synopsis "Versatile deduplicating backup tool") | |
996 | (description | |
997 | "ZBackup is a globally-deduplicating backup tool, based on the | |
998 | ideas found in Rsync. Feed a large @file{.tar} into it, and it will | |
999 | store duplicate regions of it only once, then compress and optionally | |
1000 | encrypt the result. Feed another @file{.tar} file, and it will also | |
1001 | re-use any data found in any previous backups. This way only new | |
1002 | changes are stored, and as long as the files are not very different, | |
1003 | the amount of storage required is very low. Any of the backup files | |
1004 | stored previously can be read back in full at any time. The program | |
1005 | is format-agnostic, so you can feed virtually any files to it.") | |
1006 | (license license:gpl2+))) | |
1007 | ||
c1f3382e MK |
1008 | (define-public dump |
1009 | (package | |
1010 | (name "dump") | |
85243d0d | 1011 | (version "0.4b47") |
c1f3382e MK |
1012 | (source |
1013 | (origin | |
1014 | (method url-fetch) | |
1015 | (uri (string-append "mirror://sourceforge/dump/dump/" | |
1016 | version "/dump-" version ".tar.gz")) | |
1017 | (sha256 | |
1018 | (base32 | |
85243d0d | 1019 | "1l2gzzxyqhinx1yqvj4yn9k8vx3iyqi1965dxf9kvvdv9zgaq8fh")))) |
c1f3382e MK |
1020 | (build-system gnu-build-system) |
1021 | (arguments | |
1022 | `(#:configure-flags | |
1023 | `("--sysconfdir=/etc" | |
1024 | "--disable-readline" | |
1025 | "--disable-rmt"))) | |
1026 | (native-inputs | |
1027 | `(("pkg-config" ,pkg-config))) | |
1028 | (inputs | |
85243d0d | 1029 | `(("openssl" ,openssl) |
c1f3382e MK |
1030 | ("zlib" ,zlib) |
1031 | ("util-linux" ,util-linux "lib") | |
1032 | ("e2fsprogs" ,e2fsprogs))) | |
1033 | (home-page "https://dump.sourceforge.io/") | |
a04deba2 TGR |
1034 | (synopsis "Ext2/3/4 file system dump/restore utilities") |
1035 | (description "Dump examines files in a file system, determines which ones | |
c1f3382e MK |
1036 | need to be backed up, and copies those files to a specified disk, tape or |
1037 | other storage medium. Subsequent incremental backups can then be layered on | |
1038 | top of the full backup. The restore command performs the inverse function of | |
a04deba2 | 1039 | dump; it can restore a full backup of a file system. Single files and |
c1f3382e | 1040 | directory subtrees may also be restored from full or partial backups in |
49478f9d | 1041 | interactive mode.") |
c1f3382e MK |
1042 | (license license:bsd-3))) |
1043 | ||
7b9b203a RW |
1044 | (define-public burp |
1045 | (package | |
1046 | (name "burp") | |
805559ba | 1047 | (version "2.3.38") |
5d26ba7e TGR |
1048 | (source |
1049 | (origin | |
1050 | (method git-fetch) | |
1051 | (uri (git-reference | |
1052 | (url "https://github.com/grke/burp") | |
1053 | (commit version))) | |
1054 | (sha256 | |
805559ba | 1055 | (base32 "0m0s6rrgxn3l6bad45vyhks6iz6bwvd0f3rzdsc7l28gar79wsj6")) |
5d26ba7e | 1056 | (file-name (git-file-name name version)))) |
7b9b203a | 1057 | (build-system gnu-build-system) |
22ade268 TGR |
1058 | (arguments |
1059 | `(#:phases | |
1060 | (modify-phases %standard-phases | |
1061 | (add-before 'check 'extend-test-time-outs | |
1062 | ;; The defaults are far too low for busy boxes & spinning storage. | |
1063 | (lambda _ | |
1064 | (substitute* (find-files "utest" "\\.c$") | |
1065 | (("(tcase_set_timeout\\(tc_core,)[ 0-9]*(\\);.*)$" _ prefix suffix) | |
1066 | (string-append prefix " 3600" suffix "\n"))) | |
1067 | #t))))) | |
7b9b203a | 1068 | (inputs |
9f38cdac TGR |
1069 | `(("acl" ,acl) |
1070 | ("librsync" ,librsync) | |
0b772051 | 1071 | ("ncurses" ,ncurses) ; for the live status monitor |
7b9b203a RW |
1072 | ("openssl" ,openssl) |
1073 | ("uthash" ,uthash) | |
1074 | ("zlib" ,zlib))) | |
1075 | (native-inputs | |
5d26ba7e TGR |
1076 | `(("autoconf" ,autoconf) |
1077 | ("automake" ,automake) | |
e1409c76 | 1078 | ("check" ,check-0.14) |
7b9b203a RW |
1079 | ("pkg-config" ,pkg-config))) |
1080 | (home-page "https://burp.grke.org") | |
1081 | (synopsis "Differential backup and restore") | |
1082 | (description "Burp is a network backup and restore program. It attempts | |
1083 | to reduce network traffic and the amount of space that is used by each | |
1084 | backup.") | |
1085 | (license license:agpl3))) |