1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
11 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages backup)
29 #:use-module (guix packages)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages acl)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages dejagnu)
44 #:use-module (gnu packages ftp)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages guile)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages mcrypt)
51 #:use-module (gnu packages nettle)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-crypto)
57 #:use-module (gnu packages python-web)
58 #:use-module (gnu packages rsync)
59 #:use-module (gnu packages ssh)
60 #:use-module (gnu packages tls)
61 #:use-module (gnu packages xml))
63 (define-public duplicity
70 (uri (string-append "https://code.launchpad.net/duplicity/"
71 (version-major+minor version)
72 "-series/" version "/+download/duplicity-"
76 "1rhgrz2lm9vbfdp2raykrih1c6n2lw5jd572z4dsz488m52avjqi"))))
77 (build-system python-build-system)
79 `(("util-linux" ,util-linux) ;setsid command, for the tests
80 ("par2cmdline" ,par2cmdline)
81 ("python-pexpect" ,python2-pexpect)
82 ("mock" ,python2-mock)))
84 `(("lockfile" ,python2-lockfile)
85 ("urllib3" ,python2-urllib3)))
87 `(("librsync" ,librsync)
89 ("gnupg" ,gnupg) ;gpg executable needed
90 ("util-linux" ,util-linux) ;for setsid
93 `(#:python ,python-2 ;setup assumes Python 2
96 (modify-phases %standard-phases
97 (add-before 'build 'patch-source
98 (lambda* (#:key inputs #:allow-other-keys)
99 ;; embed gpg store name
100 (substitute* "duplicity/gpginterface.py"
101 (("self.call = 'gpg'")
102 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
103 (substitute* '("testing/functional/__init__.py"
104 "testing/overrides/bin/lftp")
105 (("/bin/sh") (which "sh")))
107 (add-before 'check 'check-setup
108 (lambda* (#:key inputs #:allow-other-keys)
109 (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
110 (setenv "TZDIR" ;some timestamp checks need TZDIR
111 (string-append (assoc-ref inputs "tzdata")
114 (home-page "http://duplicity.nongnu.org/index.html")
115 (synopsis "Encrypted backup using rsync algorithm")
117 "Duplicity backs up directories by producing encrypted tar-format volumes
118 and uploading them to a remote or local file server. Because duplicity uses
119 librsync, the incremental archives are space efficient and only record the
120 parts of files that have changed since the last backup. Because duplicity
121 uses GnuPG to encrypt and/or sign these archives, they will be safe from
122 spying and/or modification by the server.")
123 (license license:gpl2+)))
125 (define-public par2cmdline
131 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
133 (file-name (string-append name "-" version ".tar.gz"))
136 "1jpshmmcr81mxly0md2rr231qz9c8c680bbvcmhh100dg9i4a6s6"))))
138 `(("automake" ,automake)
139 ("autoconf" ,autoconf)))
140 (build-system gnu-build-system)
143 (modify-phases %standard-phases
144 (add-after 'unpack 'autoreconf
145 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
146 (synopsis "File verification and repair tools")
147 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
148 generate and verify PAR2 recovery files. These files can be distributed
149 alongside the source files or stored together with back-ups to protect against
150 transmission errors or @dfn{bit rot}, the degradation of storage media over
152 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
153 damage isn't too extensive (and smaller than the size of the recovery file), it
154 can even repair them.")
155 (home-page "https://github.com/Parchive/par2cmdline")
156 (license license:gpl3+)))
165 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
168 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
169 (build-system gnu-build-system)
170 (native-inputs `(("pkg-config" ,pkg-config)))
180 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
182 (home-page "http://archive.miek.nl/projects/hdup/index.html")
183 (synopsis "Simple incremental backup tool")
185 "Hdup2 is a backup utility, its aim is to make backup really simple. The
186 backup scheduling is done by means of a cron job. It supports an
187 include/exclude mechanism, remote backups, encrypted backups and split
188 backups (called chunks) to allow easy burning to CD/DVD.")
189 (license license:gpl2)))
191 (define-public libarchive
198 (uri (string-append "http://libarchive.org/downloads/libarchive-"
200 (patches (search-patches "libarchive-CVE-2017-14166.patch"
201 "libarchive-CVE-2017-14502.patch"))
204 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
205 (build-system gnu-build-system)
206 ;; TODO: Add -L/path/to/nettle in libarchive.pc.
216 (modify-phases %standard-phases
217 (add-before 'build 'patch-pwd
219 (substitute* "Makefile"
220 (("/bin/pwd") (which "pwd")))
224 ;; XXX: The test_owner_parse, test_read_disk, and
225 ;; test_write_disk_lookup tests expect user 'root' to exist, but
226 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
228 ;; The tests allow one to disable tests matching a globbing pattern.
229 (and (zero? (system* "make"
230 "libarchive_test" "bsdcpio_test" "bsdtar_test"))
231 ;; XXX: This glob disables too much.
232 (zero? (system* "./libarchive_test" "^test_*_disk*"))
233 (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
234 (zero? (system* "./bsdtar_test"))))))
235 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
236 ;; compiled with C99 or C11 or a gnu variant.
237 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
238 (home-page "http://libarchive.org/")
239 (synopsis "Multi-format archive and compression library")
241 "Libarchive provides a flexible interface for reading and writing
242 archives in various formats such as tar and cpio. Libarchive also supports
243 reading and writing archives compressed using various compression filters such
244 as gzip and bzip2. The library is inherently stream-oriented; readers
245 serially iterate through the archive, writers serially add things to the
246 archive. In particular, note that there is currently no built-in support for
247 random access nor for in-place modification.")
248 (license license:bsd-2)))
257 (file-name (string-append name "-" version ".tar.gz"))
258 (uri (string-append "https://github.com/miekg/rdup/archive/"
262 "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
263 (build-system gnu-build-system)
265 `(("autoconf" ,autoconf)
266 ("automake" ,automake)
267 ("pkg-config" ,pkg-config)
270 ("dejagnu" ,dejagnu)))
274 ("libarchive" ,libarchive)
278 `(#:parallel-build? #f ;race conditions
280 (modify-phases %standard-phases
281 (add-after 'unpack 'bootstrap
283 (invoke "autoreconf")))
284 (add-before 'build 'qualify-inputs
285 (lambda* (#:key inputs #:allow-other-keys)
286 ;; This script is full of pitfalls. Fix some that particularly
287 ;; affect Guix users & leave the rest as reader excercises.
288 (substitute* "rdup-simple"
289 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
290 (("([' ])mcrypt " all delimiter)
291 (string-append delimiter (which "mcrypt") " "))
292 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
293 (("which") "command -v"))
295 (add-before 'check 'pre-check
297 (setenv "HOME" (getcwd))
298 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
299 (("/bin/cat") (which "cat")))
301 (home-page "https://github.com/miekg/rdup")
302 (synopsis "Provide a list of files to backup")
304 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
305 Rdup itself does not backup anything, it only print a list of absolute
306 file names to standard output. Auxiliary scripts are needed that act on this
307 list and implement the backup strategy.")
308 (license license:gpl3+)))
317 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
318 "btar-" version ".tar.gz"))
321 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
322 (build-system gnu-build-system)
324 `(("librsync" ,librsync)))
326 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
328 #:tests? #f ;test input not distributed
330 ;; no configure phase
331 (modify-phases %standard-phases
332 (delete 'configure))))
333 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
334 (synopsis "Tar-compatible archiver")
336 "Btar is a tar-compatible archiver which allows arbitrary compression and
337 ciphering, redundancy, differential backup, indexed extraction, multicore
338 compression, input and output serialisation, and tolerance to partial archive
340 (license license:gpl3+)))
342 (define-public rdiff-backup
344 (name "rdiff-backup")
349 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
353 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
354 (build-system python-build-system)
356 `(("python" ,python-2)
357 ("librsync" ,librsync)))
361 (home-page "https://www.nongnu.org/rdiff-backup/")
362 (synopsis "Local/remote mirroring+incremental backup")
364 "Rdiff-backup backs up one directory to another, possibly over a network.
365 The target directory ends up a copy of the source directory, but extra reverse
366 diffs are stored in a special subdirectory of that target directory, so you
367 can still recover files lost some time ago. The idea is to combine the best
368 features of a mirror and an incremental backup. Rdiff-backup also preserves
369 subdirectories, hard links, dev files, permissions, uid/gid ownership,
370 modification times, extended attributes, acls, and resource forks. Also,
371 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
372 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
373 to a remote location, and only the differences will be transmitted. Finally,
374 rdiff-backup is easy to use and settings have sensible defaults.")
375 (license license:gpl2+)))
377 (define-public rsnapshot
385 "https://github.com/rsnapshot/rsnapshot/releases/download/"
386 version "/rsnapshot-" version ".tar.gz"))
389 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
390 (build-system gnu-build-system)
393 (modify-phases %standard-phases
396 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
397 "t/backup_exec/conf/backup_exec_fail.conf"
398 "t/backup_exec/conf/backup_exec.conf")
399 (("/bin/true") (which "true"))
400 (("/bin/false") (which "false")))
401 (zero? (system* "make" "test")))))))
405 (home-page "http://rsnapshot.org")
406 (synopsis "Deduplicating snapshot backup utility based on rsync")
407 (description "rsnapshot is a file system snapshot utility based on rsync.
408 rsnapshot makes it easy to make periodic snapshots of local machines, and
409 remote machines over SSH. To reduce the disk space required for each backup,
410 rsnapshot uses hard links to deduplicate identical files.")
411 (license license:gpl2+)))
413 (define-public libchop
419 (uri (string-append "mirror://savannah/libchop/libchop-"
423 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
424 (patches (search-patches "diffutils-gets-undeclared.patch"))))
425 (build-system gnu-build-system)
427 `(("guile" ,guile-2.0)
429 ("pkg-config" ,pkg-config)))
431 `(("guile" ,guile-2.0)
432 ("util-linux" ,util-linux)
437 ("libgcrypt" ,libgcrypt)
441 (home-page "https://nongnu.org/libchop/")
442 (synopsis "Tools & library for data backup and distributed storage")
444 "Libchop is a set of utilities and library for data backup and
445 distributed storage. Its main application is @command{chop-backup}, an
446 encrypted backup program that supports data integrity checks, versioning,
447 distribution among several sites, selective sharing of stored data, adaptive
448 compression, and more. The library itself implements storage techniques such
449 as content-addressable storage, content hash keys, Merkle trees, similarity
450 detection, and lossless compression.")
451 (license license:gpl3+)))
460 (uri (pypi-uri "borgbackup" version))
462 (base32 "0gbdnq7ks46diz6y2pf6wpwkb9hy6hp3immi7jg3h7w72b3ycmj3"))
463 (modules '((guix build utils)))
466 (for-each delete-file
467 (find-files "borg" "^(c|h|p).*\\.c$"))
468 ;; Remove bundled shared libraries.
469 (with-directory-excursion "src/borg/algorithms"
470 (for-each delete-file-recursively
471 (list "blake2" "lz4" "zstd")))))))
472 (build-system python-build-system)
474 `(#:modules ((srfi srfi-26) ; for cut
476 (guix build python-build-system))
478 (modify-phases %standard-phases
479 (add-after 'unpack 'set-env
480 (lambda* (#:key inputs #:allow-other-keys)
481 (let ((openssl (assoc-ref inputs "openssl"))
482 (libb2 (assoc-ref inputs "libb2"))
483 (lz4 (assoc-ref inputs "lz4"))
484 (zstd (assoc-ref inputs "zstd")))
485 (setenv "BORG_OPENSSL_PREFIX" openssl)
486 (setenv "BORG_LIBB2_PREFIX" libb2)
487 (setenv "BORG_LIBLZ4_PREFIX" lz4)
488 (setenv "BORG_LIBZSTD_PREFIX" zstd)
489 (setenv "PYTHON_EGG_CACHE" "/tmp")
490 ;; The test 'test_return_codes[python]' fails when
491 ;; HOME=/homeless-shelter.
492 (setenv "HOME" "/tmp")
494 ;; Later versions of msgpack were disallowed to some warnings and lack
495 ;; of support for Python versions that we don't support anyways. So,
496 ;; it's okay to to keep using more recents versions of msgpack for
497 ;; Borg. Also see the note about msgpack in the list of inputs.
498 ;; https://github.com/borgbackup/borg/issues/3517#issuecomment-357221978
499 (add-before 'build 'adjust-msgpack-dependency
501 (substitute* "setup.py"
502 (("msgpack-python>=0.4.6,<0.5.0")
503 "msgpack-python>=0.4.6"))
505 ;; The tests need to be run after Borg is installed.
507 (add-after 'install 'check
508 (lambda* (#:key inputs outputs #:allow-other-keys)
509 ;; Make the installed package available for the test suite.
510 (add-installed-pythonpath inputs outputs)
511 ;; The tests should be run in an empty directory.
513 (with-directory-excursion "tests"
515 (system* "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
517 ;; These tests need to write to '/var'.
518 "not test_get_cache_dir "
519 "and not test_get_config_dir "
520 "and not test_get_keys_dir "
521 "and not test_get_security_dir "
522 ;; These tests assume there is a root user in
524 "and not test_access_acl "
525 "and not test_default_acl "
526 "and not test_non_ascii_acl "
527 ;; This test needs the unpackaged pytest-benchmark.
529 ;; These tests assume the kernel supports FUSE.
531 "and not test_fuse_allow_damaged_files "
532 "and not test_mount_hardlinks"))))))
533 (add-after 'install 'install-doc
534 (lambda* (#:key inputs outputs #:allow-other-keys)
535 (let* ((out (assoc-ref outputs "out"))
536 (man (string-append out "/share/man/man1"))
537 (misc (string-append out "/share/borg/misc")))
538 (for-each (cut install-file <> misc)
539 '("docs/misc/create_chunker-params.txt"
540 "docs/misc/internals-picture.txt"
541 "docs/misc/prune-example.txt"))
542 (add-installed-pythonpath inputs outputs)
544 (zero? (system* "python3" "setup.py" "build_man"))
546 (copy-recursively "docs/man" man)
549 `(("python-cython" ,python-cython)
550 ("python-setuptools-scm" ,python-setuptools-scm)
551 ("python-pytest" ,python-pytest)
552 ;; For generating the documentation.
553 ("python-sphinx" ,python-sphinx)
554 ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
560 ("python-llfuse" ,python-llfuse)
561 ;; The Python msgpack library changed its name so Borg requires this
562 ;; transitional package for now:
563 ;; <https://bugs.gnu.org/30662>
564 ("python-msgpack" ,python-msgpack-transitional)
566 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
567 (description "Borg is a deduplicating backup program. Optionally, it
568 supports compression and authenticated encryption. The main goal of Borg is to
569 provide an efficient and secure way to backup data. The data deduplication
570 technique used makes Borg suitable for daily backups since only changes are
571 stored. The authenticated encryption technique makes it suitable for backups
572 to not fully trusted targets. Borg is a fork of Attic.")
573 (home-page "https://www.borgbackup.org/")
574 (license license:bsd-3)))
583 "https://pypi.python.org/packages/source/A/Attic/Attic-"
587 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
588 (build-system python-build-system)
590 `(;; The tests assume they are run as root:
591 ;; https://github.com/jborg/attic/issues/7
594 (modify-phases %standard-phases
596 'build 'set-openssl-prefix
597 (lambda* (#:key inputs #:allow-other-keys)
598 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
603 ("python-msgpack" ,python-msgpack)
605 ;; Attic is probably incompatible with llfuse > 0.41.
606 ;; These links are to discussions of llfuse compatibility from
607 ;; the borg project. Borg is a recent fork of attic, and attic
608 ;; has not been updated since the fork, so it's likely that
609 ;; llfuse compatibility requirements are still the same.
610 ;; https://github.com/borgbackup/borg/issues/642
611 ;; https://github.com/borgbackup/borg/issues/643
612 ("python-llfuse" ,python-llfuse-0.41)))
613 (synopsis "Deduplicating backup program")
614 (description "Attic is a deduplicating backup program. The main goal of
615 Attic is to provide an efficient and secure way to backup data. The data
616 deduplication technique used makes Attic suitable for daily backups since only
617 changes are stored.")
618 (home-page "https://attic-backup.org/")
619 (license license:bsd-3)
620 (properties `((superseded . ,borg)))))
622 (define-public wimlib
628 (uri (string-append "https://wimlib.net/downloads/"
629 name "-" version ".tar.gz"))
632 "0ks6hq7vwq13ljkzxp3a490bf8dnracgl2azf57rg49ad2fzab45"))))
633 (build-system gnu-build-system)
635 `(("pkg-config" ,pkg-config)))
640 ("openssl" ,openssl)))
642 `(#:configure-flags (list "--enable-test-support")))
643 (home-page "https://wimlib.net/")
644 (synopsis "WIM file manipulation library and utilities")
645 (description "wimlib is a C library and set of command-line utilities for
646 creating, modifying, extracting, and mounting archives in the Windows Imaging
647 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
648 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
649 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
650 ;; LGPL, except those files explicitly marked as being released into the
651 ;; public domain (CC0) in their headers.
652 (license (list license:gpl3+
664 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
665 version ".orig.tar.xz"))
668 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
669 (build-system python-build-system)
673 (modify-phases %standard-phases
676 (substitute* "obnamlib/vfs_local_tests.py"
677 ;; Check for the nobody user instead of root
678 (("self.fs.get_username\\(0\\), 'root'")
679 "self.fs.get_username(65534), 'nobody'")
680 ;; Disable tests checking for root group
681 (("self.fs.get_groupname\\(0\\)") "'root'"))
682 (substitute* "obnamlib/vfs_local.py"
683 ;; Don't cover get_groupname function
684 (("def get_groupname\\(self, gid\\):")
685 "def get_groupname(self, gid): # pragma: no cover"))
686 ;; Can't run network tests
687 (zero? (system* "./check" "--unit-tests")))))))
689 `(("python2-cliapp" ,python2-cliapp)
690 ("python2-larch" ,python2-larch)
691 ("python2-paramiko" ,python2-paramiko)
692 ("python2-pyaml" ,python2-pyaml)
693 ("python2-tracing" ,python2-tracing)
694 ("python2-ttystatus" ,python2-ttystatus)))
697 ("python2-coverage" ,python2-coverage)
698 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
699 ("python2-pep8" ,python2-pep8)
700 ("python2-pylint" ,python2-pylint)))
701 (home-page "https://obnam.org/")
702 (synopsis "Easy and secure backup program")
703 (description "Obnam is an easy, secure backup program. Features
704 include snapshot backups, data de-duplication and encrypted backups
705 using GnuPG. Backups can be stored on local hard disks, or online via
706 the SSH SFTP protocol. The backup server, if used, does not require
707 any special software, on top of SSH.")
708 (license license:gpl3+)))
710 (define-public dirvish
714 (build-system gnu-build-system)
718 "http://dirvish.org/dirvish-" version ".tgz"))
721 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
723 `(#:modules ((ice-9 match) (ice-9 rdelim)
724 ,@%gnu-build-system-modules)
726 ;; This mostly mirrors the steps taken in the install.sh that ships
727 ;; with dirvish, but simplified because we aren't prompting interactively
728 (modify-phases %standard-phases
733 (lambda* (#:key inputs outputs #:allow-other-keys)
734 ;; These are mostly the same steps the install.sh that comes with
736 (let* (;; Files we'll be copying
738 '("dirvish" "dirvish-runall"
739 "dirvish-expire" "dirvish-locate"))
741 '(("dirvish" "8") ("dirvish-runall" "8")
742 ("dirvish-expire" "8") ("dirvish-locate" "8")
743 ("dirvish.conf" "5")))
746 (assoc-ref outputs "out"))
748 ;; Just a default... not so useful on guixsd though
749 ;; You probably want to a service with file(s) to point to.
750 (confdir "/etc/dirvish")
752 (perl (string-append (assoc-ref %build-inputs "perl")
754 (loadconfig.pl (call-with-input-file "loadconfig.pl"
758 (define (write-pl filename)
760 (string-append "#!" perl "\n\n"
761 "$CONFDIR = \"" confdir "\";\n\n"))
762 (define input-file-location
763 (string-append filename ".pl"))
764 (define target-file-location
765 (string-append output-dir "/bin/" filename ".pl"))
766 (define text-to-write
767 (string-append pl-header
768 (call-with-input-file input-file-location
771 (with-output-to-file target-file-location
773 (display text-to-write)))
774 (chmod target-file-location #o755)
775 (wrap-program target-file-location
776 `("PERL5LIB" ":" prefix
777 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
778 "/lib/perl5/site_perl"))
779 '("perl-libtime-period"
780 "perl-libtime-parsedate")))))
786 (string-append file-base "." man-num))
788 (string-append output-dir
789 "/share/man/man" man-num
791 (copy-file filename output-path)))))
794 (mkdir-p (string-append output-dir "/bin/"))
795 (mkdir-p (string-append output-dir "/share/man/man8/"))
796 (mkdir-p (string-append output-dir "/share/man/man5/"))
798 ;; Write out executables
799 (for-each write-pl executables)
800 ;; Write out man pages
801 (for-each write-man man-pages)
806 ("perl-libtime-period" ,perl-libtime-period)
807 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
808 (home-page "http://dirvish.org/")
809 (synopsis "Fast, disk based, rotating network backup system")
811 "With dirvish you can maintain a set of complete images of your
812 file systems with unattended creation and expiration. A dirvish backup vault
813 is like a time machine for your data. ")
814 (license (license:fsf-free "file://COPYING"
815 "Open Software License 2.0"))))