gnu: dehydrated: Install documentation.

* gnu/packages/tls.scm (dehydrated)[arguments]: Install compressed man
page and other basic documentation.
This commit is contained in:
Tobias Geerinckx-Rice 2020-03-01 15:17:40 +01:00
parent bcfacecd3b
commit c150d6378d
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -918,28 +918,39 @@ (define-public dehydrated
"0dgskgbdd95p13jx6s13p77y15wngb5cm6p4305cf2s54w0bvahh"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
`(#:modules ((guix build utils)
(srfi srfi-26))
#:builder
(begin
(use-modules (guix build utils))
(use-modules (guix build utils)
(srfi srfi-26))
(let* ((source (assoc-ref %build-inputs "source"))
(tar (assoc-ref %build-inputs "tar"))
(gz (assoc-ref %build-inputs "gzip"))
(out (assoc-ref %outputs "out"))
(bin (string-append out "/bin"))
(doc (string-append out "/share/doc/"))
(doc (string-append out "/share/doc/" ,name "-" ,version))
(man (string-append out "/share/man"))
(bash (in-vicinity (assoc-ref %build-inputs "bash") "bin")))
(setenv "PATH" (string-append gz "/bin"))
(invoke (string-append tar "/bin/tar") "xvf" source)
(chdir (string-append ,name "-" ,version))
(copy-recursively "docs" doc)
(install-file "LICENSE" doc)
(mkdir-p man)
(rename-file (string-append doc "/man")
(string-append man "/man1"))
(for-each (cut invoke "gzip" "-9" <>)
(find-files man ".*"))
(install-file "dehydrated" bin)
(install-file "LICENSE" (string-append doc ,name "-" ,version))
(with-directory-excursion bin
(patch-shebang "dehydrated" (list bash))
;; Do not try to write in the store.
;; Do not try to write to the store.
(substitute* "dehydrated"
(("SCRIPTDIR=\"\\$.*\"") "SCRIPTDIR=~/.dehydrated"))