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 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages backup)
28 #:use-module (guix packages)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages acl)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages crypto)
41 #:use-module (gnu packages databases)
42 #:use-module (gnu packages dejagnu)
43 #:use-module (gnu packages ftp)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gnupg)
46 #:use-module (gnu packages gperf)
47 #:use-module (gnu packages guile)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages mcrypt)
50 #:use-module (gnu packages nettle)
51 #:use-module (gnu packages pcre)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages python-crypto)
56 #:use-module (gnu packages python-web)
57 #:use-module (gnu packages rsync)
58 #:use-module (gnu packages ssh)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages xml))
62 (define-public duplicity
69 (uri (string-append "https://code.launchpad.net/duplicity/"
70 (version-major+minor version)
71 "-series/" version "/+download/duplicity-"
75 "1rhgrz2lm9vbfdp2raykrih1c6n2lw5jd572z4dsz488m52avjqi"))))
76 (build-system python-build-system)
78 `(("util-linux" ,util-linux) ;setsid command, for the tests
79 ("par2cmdline" ,par2cmdline)
80 ("python-pexpect" ,python2-pexpect)
81 ("mock" ,python2-mock)))
83 `(("lockfile" ,python2-lockfile)
84 ("urllib3" ,python2-urllib3)))
86 `(("librsync" ,librsync)
88 ("gnupg" ,gnupg) ;gpg executable needed
89 ("util-linux" ,util-linux) ;for setsid
92 `(#:python ,python-2 ;setup assumes Python 2
95 (modify-phases %standard-phases
96 (add-before 'build 'patch-source
97 (lambda* (#:key inputs #:allow-other-keys)
98 ;; embed gpg store name
99 (substitute* "duplicity/gpginterface.py"
100 (("self.call = 'gpg'")
101 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
102 (substitute* '("testing/functional/__init__.py"
103 "testing/overrides/bin/lftp")
104 (("/bin/sh") (which "sh")))
106 (add-before 'check 'check-setup
107 (lambda* (#:key inputs #:allow-other-keys)
108 (setenv "HOME" (getcwd)) ;gpg needs to write to $HOME
109 (setenv "TZDIR" ;some timestamp checks need TZDIR
110 (string-append (assoc-ref inputs "tzdata")
113 (home-page "http://duplicity.nongnu.org/index.html")
114 (synopsis "Encrypted backup using rsync algorithm")
116 "Duplicity backs up directories by producing encrypted tar-format volumes
117 and uploading them to a remote or local file server. Because duplicity uses
118 librsync, the incremental archives are space efficient and only record the
119 parts of files that have changed since the last backup. Because duplicity
120 uses GnuPG to encrypt and/or sign these archives, they will be safe from
121 spying and/or modification by the server.")
122 (license license:gpl2+)))
124 (define-public par2cmdline
130 (uri (string-append "https://github.com/Parchive/par2cmdline/archive/v"
132 (file-name (string-append name "-" version ".tar.gz"))
135 "1jpshmmcr81mxly0md2rr231qz9c8c680bbvcmhh100dg9i4a6s6"))))
137 `(("automake" ,automake)
138 ("autoconf" ,autoconf)))
139 (build-system gnu-build-system)
142 (modify-phases %standard-phases
143 (add-after 'unpack 'autoreconf
144 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
145 (synopsis "File verification and repair tools")
146 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
147 generate and verify PAR2 recovery files. These files can be distributed
148 alongside the source files or stored together with back-ups to protect against
149 transmission errors or @dfn{bit rot}, the degradation of storage media over
151 Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
152 damage isn't too extensive (and smaller than the size of the recovery file), it
153 can even repair them.")
154 (home-page "https://github.com/Parchive/par2cmdline")
155 (license license:gpl3+)))
164 (uri "https://fossies.org/linux/privat/old/hdup-2.0.14.tar.bz2")
167 "02bnczg01cyhajmm4rhbnc0ja0dd9ikv9fwv28asxh1rlx9yr0b7"))))
168 (build-system gnu-build-system)
169 (native-inputs `(("pkg-config" ,pkg-config)))
179 `(,(string-append "--sbindir=" (assoc-ref %outputs "out") "/bin"))
181 (home-page "http://archive.miek.nl/projects/hdup/index.html")
182 (synopsis "Simple incremental backup tool")
184 "Hdup2 is a backup utility, its aim is to make backup really simple. The
185 backup scheduling is done by means of a cron job. It supports an
186 include/exclude mechanism, remote backups, encrypted backups and split
187 backups (called chunks) to allow easy burning to CD/DVD.")
188 (license license:gpl2)))
190 (define-public libarchive
193 (replacement libarchive-3.3.2)
198 (uri (string-append "http://libarchive.org/downloads/libarchive-"
202 "1rr40hxlm9vy5z2zb5w7pyfkgd1a4s061qapm83s19accb8mpji9"))))
203 (build-system gnu-build-system)
204 ;; TODO: Add -L/path/to/nettle in libarchive.pc.
217 (substitute* "Makefile"
218 (("/bin/pwd") (which "pwd"))))
222 ;; XXX: The test_owner_parse, test_read_disk, and
223 ;; test_write_disk_lookup tests expect user 'root' to exist, but
224 ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
226 ;; The tests allow one to disable tests matching a globbing pattern.
227 (and (zero? (system* "make"
228 "libarchive_test" "bsdcpio_test" "bsdtar_test"))
229 ;; XXX: This glob disables too much.
230 (zero? (system* "./libarchive_test" "^test_*_disk*"))
231 (zero? (system* "./bsdcpio_test" "^test_owner_parse"))
232 (zero? (system* "./bsdtar_test"))))
234 ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
235 ;; compiled with C99 or C11 or a gnu variant.
236 #:configure-flags '("CFLAGS=-O2 -g -std=c99")))
237 (home-page "http://libarchive.org/")
238 (synopsis "Multi-format archive and compression library")
240 "Libarchive provides a flexible interface for reading and writing
241 archives in various formats such as tar and cpio. Libarchive also supports
242 reading and writing archives compressed using various compression filters such
243 as gzip and bzip2. The library is inherently stream-oriented; readers
244 serially iterate through the archive, writers serially add things to the
245 archive. In particular, note that there is currently no built-in support for
246 random access nor for in-place modification.")
247 (license license:bsd-2)))
249 (define libarchive-3.3.2
256 (uri (string-append "http://libarchive.org/downloads/libarchive-"
258 (patches (search-patches "libarchive-CVE-2017-14166.patch"
259 "libarchive-CVE-2017-14502.patch"))
262 "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))))
271 (uri (string-append "http://archive.miek.nl/projects/rdup/rdup-"
275 "0aklwd9v7ix0m4ayl762sil685f42cwljzx3jz5skrnjaq32npmj"))
276 (modules '((guix build utils)))
278 ;; Some test scripts are missing shebangs, which cause "could not
279 ;; execute" errors. Add shebangs.
282 (with-atomic-file-replacement
283 (string-append "testsuite/rdup/" testscript)
286 (format out "#!/bin/sh\n" )
287 (dump-port in out)))))
288 '("rdup.hardlink.helper"
289 "rdup.hardlink-strip.helper"
290 "rdup.hardlink-strip2.helper"
291 "rdup.pipeline.helper")))))
292 (build-system gnu-build-system)
294 `(("pkg-config" ,pkg-config)
295 ("dejagnu" ,dejagnu)))
299 ("libarchive" ,libarchive)
302 `(#:parallel-build? #f ;race conditions
304 (modify-phases %standard-phases
305 (add-before 'build 'remove-Werror
306 ;; rdup uses a deprecated function from libarchive
308 (substitute* "GNUmakefile"
309 (("^(CFLAGS=.*)-Werror" _ front) front))
311 (add-before 'check 'pre-check
313 (setenv "HOME" (getcwd))
314 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
315 (("/bin/cat") (which "cat")))
317 (home-page "http://archive.miek.nl/projects/rdup/index.html")
318 (synopsis "Provide a list of files to backup")
320 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
321 Rdup itself does not backup anything, it only print a list of absolute
322 file names to standard output. Auxiliary scripts are needed that act on this
323 list and implement the backup strategy.")
324 (license license:gpl3+)))
333 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
334 "btar-" version ".tar.gz"))
337 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
338 (build-system gnu-build-system)
340 `(("librsync" ,librsync)))
342 `(#:make-flags `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
344 #:tests? #f ;test input not distributed
346 ;; no configure phase
347 (modify-phases %standard-phases
348 (delete 'configure))))
349 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
350 (synopsis "Tar-compatible archiver")
352 "Btar is a tar-compatible archiver which allows arbitrary compression and
353 ciphering, redundancy, differential backup, indexed extraction, multicore
354 compression, input and output serialisation, and tolerance to partial archive
356 (license license:gpl3+)))
358 (define-public rdiff-backup
360 (name "rdiff-backup")
365 (uri (string-append "mirror://savannah/rdiff-backup/rdiff-backup-"
369 "1nwmmh816f96h0ff1jxk95ad38ilbhbdl5dgibx1d4cl81dsi48d"))))
370 (build-system python-build-system)
372 `(("python" ,python-2)
373 ("librsync" ,librsync)))
377 (home-page "http://www.nongnu.org/rdiff-backup/")
378 (synopsis "Local/remote mirroring+incremental backup")
380 "Rdiff-backup backs up one directory to another, possibly over a network.
381 The target directory ends up a copy of the source directory, but extra reverse
382 diffs are stored in a special subdirectory of that target directory, so you
383 can still recover files lost some time ago. The idea is to combine the best
384 features of a mirror and an incremental backup. Rdiff-backup also preserves
385 subdirectories, hard links, dev files, permissions, uid/gid ownership,
386 modification times, extended attributes, acls, and resource forks. Also,
387 rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
388 rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
389 to a remote location, and only the differences will be transmitted. Finally,
390 rdiff-backup is easy to use and settings have sensible defaults.")
391 (license license:gpl2+)))
393 (define-public rsnapshot
401 "https://github.com/rsnapshot/rsnapshot/releases/download/"
402 version "/rsnapshot-" version ".tar.gz"))
405 "05jfy99a0xs6lvsjfp3wz21z0myqhmwl2grn3jr9clijbg282ah4"))))
406 (build-system gnu-build-system)
409 (modify-phases %standard-phases
412 (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
413 "t/backup_exec/conf/backup_exec_fail.conf"
414 "t/backup_exec/conf/backup_exec.conf")
415 (("/bin/true") (which "true"))
416 (("/bin/false") (which "false")))
417 (zero? (system* "make" "test")))))))
421 (home-page "http://rsnapshot.org")
422 (synopsis "Deduplicating snapshot backup utility based on rsync")
423 (description "rsnapshot is a filesystem snapshot utility based on rsync.
424 rsnapshot makes it easy to make periodic snapshots of local machines, and
425 remote machines over SSH. To reduce the disk space required for each backup,
426 rsnapshot uses hard links to deduplicate identical files.")
427 (license license:gpl2+)))
429 (define-public libchop
435 (uri (string-append "mirror://savannah/libchop/libchop-"
439 "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g"))
440 (patches (search-patches "diffutils-gets-undeclared.patch"))))
441 (build-system gnu-build-system)
443 `(("guile" ,guile-2.0)
445 ("pkg-config" ,pkg-config)))
447 `(("guile" ,guile-2.0)
448 ("util-linux" ,util-linux)
453 ("libgcrypt" ,libgcrypt)
457 (home-page "http://nongnu.org/libchop/")
458 (synopsis "Tools & library for data backup and distributed storage")
460 "Libchop is a set of utilities and library for data backup and
461 distributed storage. Its main application is @command{chop-backup}, an
462 encrypted backup program that supports data integrity checks, versioning,
463 distribution among several sites, selective sharing of stored data, adaptive
464 compression, and more. The library itself implements storage techniques such
465 as content-addressable storage, content hash keys, Merkle trees, similarity
466 detection, and lossless compression.")
467 (license license:gpl3+)))
476 (uri (pypi-uri "borgbackup" version))
478 (base32 "1cicqwh85wfp65y00qaq6q4i4jcyy9b66qz5gpl80qc880wab912"))
479 (modules '((guix build utils)))
482 (for-each delete-file
483 (find-files "borg" "^(c|h|p).*\\.c$"))
484 ;; Remove bundled shared libraries.
485 (with-directory-excursion "src/borg/algorithms"
486 (for-each delete-file-recursively
487 (list "blake2" "lz4" "zstd")))))))
488 (build-system python-build-system)
490 `(#:modules ((srfi srfi-26) ; for cut
492 (guix build python-build-system))
494 (modify-phases %standard-phases
495 (add-after 'unpack 'set-env
496 (lambda* (#:key inputs #:allow-other-keys)
497 (let ((openssl (assoc-ref inputs "openssl"))
498 (libb2 (assoc-ref inputs "libb2"))
499 (lz4 (assoc-ref inputs "lz4"))
500 (zstd (assoc-ref inputs "zstd")))
501 (setenv "BORG_OPENSSL_PREFIX" openssl)
502 (setenv "BORG_LIBB2_PREFIX" libb2)
503 (setenv "BORG_LIBLZ4_PREFIX" lz4)
504 (setenv "BORG_LIBZSTD_PREFIX" zstd)
505 (setenv "PYTHON_EGG_CACHE" "/tmp")
506 ;; The test 'test_return_codes[python]' fails when
507 ;; HOME=/homeless-shelter.
508 (setenv "HOME" "/tmp")
510 ;; The tests need to be run after Borg is installed.
512 (add-after 'install 'check
513 (lambda* (#:key inputs outputs #:allow-other-keys)
514 ;; Make the installed package available for the test suite.
515 (add-installed-pythonpath inputs outputs)
516 ;; The tests should be run in an empty directory.
518 (with-directory-excursion "tests"
520 (system* "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
522 ;; These tests need to write to '/var'.
523 "not test_get_cache_dir "
524 "and not test_get_config_dir "
525 "and not test_get_keys_dir "
526 "and not test_get_security_dir "
527 ;; These tests assume there is a root user in
529 "and not test_access_acl "
530 "and not test_default_acl "
531 "and not test_non_ascii_acl "
532 ;; This test needs the unpackaged pytest-benchmark.
534 ;; These tests assume the kernel supports FUSE.
536 "and not test_fuse_allow_damaged_files "
537 "and not test_mount_hardlinks"))))))
538 (add-after 'install 'install-doc
539 (lambda* (#:key inputs outputs #:allow-other-keys)
540 (let* ((out (assoc-ref outputs "out"))
541 (man (string-append out "/share/man/man1"))
542 (misc (string-append out "/share/borg/misc")))
543 (for-each (cut install-file <> misc)
544 '("docs/misc/create_chunker-params.txt"
545 "docs/misc/internals-picture.txt"
546 "docs/misc/prune-example.txt"))
547 (add-installed-pythonpath inputs outputs)
549 (zero? (system* "python3" "setup.py" "build_man"))
551 (copy-recursively "docs/man" man)
554 `(("python-cython" ,python-cython)
555 ("python-setuptools-scm" ,python-setuptools-scm)
556 ;; Borg >=1.0.8's test suite uses 'tmpdir_factory', which was introduced
558 ("python-pytest" ,python-pytest-3.0)
559 ;; For generating the documentation.
560 ("python-sphinx" ,python-sphinx)
561 ("python-guzzle-sphinx-theme" ,python-guzzle-sphinx-theme)))
567 ("python-llfuse" ,python-llfuse)
568 ("python-msgpack" ,python-msgpack)
570 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
571 (description "Borg is a deduplicating backup program. Optionally, it
572 supports compression and authenticated encryption. The main goal of Borg is to
573 provide an efficient and secure way to backup data. The data deduplication
574 technique used makes Borg suitable for daily backups since only changes are
575 stored. The authenticated encryption technique makes it suitable for backups
576 to not fully trusted targets. Borg is a fork of Attic.")
577 (home-page "https://www.borgbackup.org/")
578 (license license:bsd-3)))
587 "https://pypi.python.org/packages/source/A/Attic/Attic-"
591 "0b5skd36r4c0915lwpkqg5hxm49gls9pprs1b7hc40910wlcsl36"))))
592 (build-system python-build-system)
594 `(;; The tests assume they are run as root:
595 ;; https://github.com/jborg/attic/issues/7
598 (modify-phases %standard-phases
600 'build 'set-openssl-prefix
601 (lambda* (#:key inputs #:allow-other-keys)
602 (setenv "ATTIC_OPENSSL_PREFIX" (assoc-ref inputs "openssl"))
607 ("python-msgpack" ,python-msgpack)
609 ;; Attic is probably incompatible with llfuse > 0.41.
610 ;; These links are to discussions of llfuse compatibility from
611 ;; the borg project. Borg is a recent fork of attic, and attic
612 ;; has not been updated since the fork, so it's likely that
613 ;; llfuse compatibility requirements are still the same.
614 ;; https://github.com/borgbackup/borg/issues/642
615 ;; https://github.com/borgbackup/borg/issues/643
616 ("python-llfuse" ,python-llfuse-0.41)))
617 (synopsis "Deduplicating backup program")
618 (description "Attic is a deduplicating backup program. The main goal of
619 Attic is to provide an efficient and secure way to backup data. The data
620 deduplication technique used makes Attic suitable for daily backups since only
621 changes are stored.")
622 (home-page "https://attic-backup.org/")
623 (license license:bsd-3)
624 (properties `((superseded . ,borg)))))
626 (define-public wimlib
632 (uri (string-append "https://wimlib.net/downloads/"
633 name "-" version ".tar.gz"))
636 "0ks6hq7vwq13ljkzxp3a490bf8dnracgl2azf57rg49ad2fzab45"))))
637 (build-system gnu-build-system)
639 `(("pkg-config" ,pkg-config)))
644 ("openssl" ,openssl)))
646 `(#:configure-flags (list "--enable-test-support")))
647 (home-page "https://wimlib.net/")
648 (synopsis "WIM file manipulation library and utilities")
649 (description "wimlib is a C library and set of command-line utilities for
650 creating, modifying, extracting, and mounting archives in the Windows Imaging
651 Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
652 NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
653 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
654 ;; LGPL, except those files explicitly marked as being released into the
655 ;; public domain (CC0) in their headers.
656 (license (list license:gpl3+
668 "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
669 version ".orig.tar.xz"))
672 "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
673 (build-system python-build-system)
677 (modify-phases %standard-phases
680 (substitute* "obnamlib/vfs_local_tests.py"
681 ;; Check for the nobody user instead of root
682 (("self.fs.get_username\\(0\\), 'root'")
683 "self.fs.get_username(65534), 'nobody'")
684 ;; Disable tests checking for root group
685 (("self.fs.get_groupname\\(0\\)") "'root'"))
686 (substitute* "obnamlib/vfs_local.py"
687 ;; Don't cover get_groupname function
688 (("def get_groupname\\(self, gid\\):")
689 "def get_groupname(self, gid): # pragma: no cover"))
690 ;; Can't run network tests
691 (zero? (system* "./check" "--unit-tests")))))))
693 `(("python2-cliapp" ,python2-cliapp)
694 ("python2-larch" ,python2-larch)
695 ("python2-paramiko" ,python2-paramiko)
696 ("python2-pyaml" ,python2-pyaml)
697 ("python2-tracing" ,python2-tracing)
698 ("python2-ttystatus" ,python2-ttystatus)))
701 ("python2-coverage" ,python2-coverage)
702 ("python2-coverage-test-runner" ,python2-coverage-test-runner)
703 ("python2-pep8" ,python2-pep8)
704 ("python2-pylint" ,python2-pylint)))
705 (home-page "https://obnam.org/")
706 (synopsis "Easy and secure backup program")
707 (description "Obnam is an easy, secure backup program. Features
708 include snapshot backups, data de-duplication and encrypted backups
709 using GnuPG. Backups can be stored on local hard disks, or online via
710 the SSH SFTP protocol. The backup server, if used, does not require
711 any special software, on top of SSH.")
712 (license license:gpl3+)))
714 (define-public dirvish
718 (build-system gnu-build-system)
722 "http://dirvish.org/dirvish-" version ".tgz"))
725 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
727 `(#:modules ((ice-9 match) (ice-9 rdelim)
728 ,@%gnu-build-system-modules)
730 ;; This mostly mirrors the steps taken in the install.sh that ships
731 ;; with dirvish, but simplified because we aren't prompting interactively
732 (modify-phases %standard-phases
737 (lambda* (#:key inputs outputs #:allow-other-keys)
738 ;; These are mostly the same steps the install.sh that comes with
740 (let* (;; Files we'll be copying
742 '("dirvish" "dirvish-runall"
743 "dirvish-expire" "dirvish-locate"))
745 '(("dirvish" "8") ("dirvish-runall" "8")
746 ("dirvish-expire" "8") ("dirvish-locate" "8")
747 ("dirvish.conf" "5")))
750 (assoc-ref outputs "out"))
752 ;; Just a default... not so useful on guixsd though
753 ;; You probably want to a service with file(s) to point to.
754 (confdir "/etc/dirvish")
756 (perl (string-append (assoc-ref %build-inputs "perl")
758 (loadconfig.pl (call-with-input-file "loadconfig.pl"
762 (define (write-pl filename)
764 (string-append "#!" perl "\n\n"
765 "$CONFDIR = \"" confdir "\";\n\n"))
766 (define input-file-location
767 (string-append filename ".pl"))
768 (define target-file-location
769 (string-append output-dir "/bin/" filename ".pl"))
770 (define text-to-write
771 (string-append pl-header
772 (call-with-input-file input-file-location
775 (with-output-to-file target-file-location
777 (display text-to-write)))
778 (chmod target-file-location #o755)
779 (wrap-program target-file-location
780 `("PERL5LIB" ":" prefix
781 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
782 "/lib/perl5/site_perl"))
783 '("perl-libtime-period"
784 "perl-libtime-parsedate")))))
790 (string-append file-base "." man-num))
792 (string-append output-dir
793 "/share/man/man" man-num
795 (copy-file filename output-path)))))
798 (mkdir-p (string-append output-dir "/bin/"))
799 (mkdir-p (string-append output-dir "/share/man/man8/"))
800 (mkdir-p (string-append output-dir "/share/man/man5/"))
802 ;; Write out executables
803 (for-each write-pl executables)
804 ;; Write out man pages
805 (for-each write-man man-pages)
810 ("perl-libtime-period" ,perl-libtime-period)
811 ("perl-libtime-parsedate" ,perl-libtime-parsedate)))
812 (home-page "http://dirvish.org/")
813 (synopsis "Fast, disk based, rotating network backup system")
815 "With dirvish you can maintain a set of complete images of your
816 filesystems with unattended creation and expiration. A dirvish backup vault
817 is like a time machine for your data. ")
818 (license (license:fsf-free "file://COPYING"
819 "Open Software License 2.0"))))