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