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