gnu: OpenSSH: Update to 7.9p1.
[jackhill/guix/guix.git] / gnu / packages / man.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
4 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages man)
25 #:use-module (guix licenses)
26 #:use-module (guix download)
27 #:use-module (guix packages)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gawk)
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages less)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages linux))
37
38 (define-public libpipeline
39 (package
40 (name "libpipeline")
41 (version "1.5.0")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append
45 "mirror://savannah/libpipeline/libpipeline-"
46 version ".tar.gz"))
47 (sha256
48 (base32
49 "0avg525wvifcvjrwa6i1r6kvahmsswj0mpxrsxzzdzra9wpf2whd"))))
50 (build-system gnu-build-system)
51 (home-page "http://libpipeline.nongnu.org/")
52 (synopsis "C library for manipulating pipelines of subprocesses")
53 (description
54 "libpipeline is a C library for manipulating pipelines of subprocesses in
55 a flexible and convenient way.")
56 (license gpl3+)))
57
58 (define-public man-db
59 (package
60 (name "man-db")
61 (version "2.8.3")
62 (source (origin
63 (method url-fetch)
64 (uri (string-append "mirror://savannah/man-db/man-db-"
65 version ".tar.xz"))
66 (sha256
67 (base32
68 "1b641kcgjvyc41pj67dn4p0zvwlj1vx3l6nf7qdcc7kf6v5a2cjr"))))
69 (build-system gnu-build-system)
70 (arguments
71 `(#:phases
72 (modify-phases %standard-phases
73 (add-after 'patch-source-shebangs 'patch-test-shebangs
74 (lambda* (#:key outputs #:allow-other-keys)
75 ;; Patch shebangs in test scripts.
76 (let ((out (assoc-ref outputs "out")))
77 (for-each (lambda (file)
78 (substitute* file
79 (("#! /bin/sh")
80 (string-append "#!" (which "sh")))))
81 (remove file-is-directory?
82 (find-files "src/tests" ".*")))
83 #t)))
84 (add-after 'unpack 'patch-iconv-path
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* "src/man.c"
87 (("\"iconv\"")
88 (string-append "\"" (which "iconv") "\"")))
89 #t)))
90 #:configure-flags
91 (let ((groff (assoc-ref %build-inputs "groff"))
92 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
93 (less (assoc-ref %build-inputs "less"))
94 (gzip (assoc-ref %build-inputs "gzip"))
95 (bzip2 (assoc-ref %build-inputs "bzip2"))
96 (xz (assoc-ref %build-inputs "xz"))
97 (util (assoc-ref %build-inputs "util-linux")))
98 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
99 (append (list ;; Disable setuid man user.
100 "--disable-setuid"
101 ;; Don't constrain ownership of system-wide cache files.
102 ;; Otherwise creating the manpage database fails with
103 ;; man-db > 2.7.5.
104 "--disable-cache-owner"
105 (string-append "--with-pager=" less "/bin/less")
106 (string-append "--with-gzip=" gzip "/bin/gzip")
107 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
108 (string-append "--with-xz=" xz "/bin/xz")
109 (string-append "--with-col=" util "/bin/col")
110 ;; Default value is "/usr/lib/tmpfiles.d" (not
111 ;; prefix-sensitive).
112 (string-append "--with-systemdtmpfilesdir="
113 %output "/lib/tmpfiles.d"))
114 (map (lambda (prog)
115 (string-append "--with-" prog "=" groff-minimal
116 "/bin/" prog))
117 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
118
119 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
120 ;; pulls in Perl.)
121 #:disallowed-references (,groff)
122
123 #:modules ((guix build gnu-build-system)
124 (guix build utils)
125 (srfi srfi-1))))
126 (native-inputs
127 `(("pkg-config" ,pkg-config)
128 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
129 (inputs
130 `(("flex" ,flex)
131 ("gdbm" ,gdbm)
132 ("groff-minimal" ,groff-minimal)
133 ("less" ,less)
134 ("libpipeline" ,libpipeline)
135 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
136 ;; failures in the build chroot.
137 ;;("libseccomp" ,libseccomp)
138 ("util-linux" ,util-linux)))
139 (native-search-paths
140 (list (search-path-specification
141 (variable "MANPATH")
142 (files '("share/man")))))
143 (home-page "http://man-db.nongnu.org/")
144 (synopsis "Standard Unix documentation system")
145 (description
146 "Man-db is an implementation of the standard Unix documentation system
147 accessed using the man command. It uses a Berkeley DB database in place of
148 the traditional flat-text whatis databases.")
149 (license gpl2+)))
150
151 (define-public man-pages
152 (package
153 (name "man-pages")
154 (version "4.16")
155 (source (origin
156 (method url-fetch)
157 (uri
158 (list
159 (string-append
160 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
161 version ".tar.xz")
162 (string-append
163 "mirror://kernel.org/linux/docs/man-pages/Archive/"
164 "man-pages-" version ".tar.xz")))
165 (sha256
166 (base32
167 "1d2d6llazg3inwjiz22cn46mbm5ydpbyh9qb55z4j3nm4w6wrzs7"))))
168 (build-system gnu-build-system)
169 (arguments
170 '(#:phases (modify-phases %standard-phases (delete 'configure))
171
172 ;; The 'all' target depends on three targets that directly populate
173 ;; $(MANDIR) based on its current contents. Doing that in parallel
174 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
175 #:parallel-build? #f
176
177 #:tests? #f
178 #:make-flags (list (string-append "MANDIR="
179 (assoc-ref %outputs "out")
180 "/share/man"))))
181 (home-page "https://www.kernel.org/doc/man-pages/")
182 (synopsis "Development manual pages from the Linux project")
183 (description
184 "This package provides traditional Unix \"man pages\" documenting the
185 Linux kernel and C library interfaces employed by user-space programs.")
186
187 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
188 (license gpl2+)))
189
190 (define-public help2man
191 (package
192 (name "help2man")
193 (version "1.47.6")
194 (source
195 (origin
196 (method url-fetch)
197 (uri (string-append "mirror://gnu/help2man/help2man-"
198 version ".tar.xz"))
199 (sha256
200 (base32
201 "0vz4dlrvy4vc6l7w0a7n668pfa0rdm73wr2gar58wqranyah46yr"))))
202 (build-system gnu-build-system)
203 (arguments `(;; There's no `check' target.
204 #:tests? #f))
205 (inputs
206 `(("perl" ,perl)
207 ;; TODO: Add these optional dependencies.
208 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
209 ;; ("gettext" ,gettext-minimal)
210 ))
211 (home-page "https://www.gnu.org/software/help2man/")
212 (synopsis "Automatically generate man pages from program --help")
213 (description
214 "GNU help2man is a program that converts the output of standard
215 \"--help\" and \"--version\" command-line arguments into a manual page
216 automatically.")
217 (license gpl3+)))
218
219 (define-public txt2man
220 (package
221 (name "txt2man")
222 (version "1.6.0")
223 (source
224 (origin
225 (method url-fetch)
226 (uri (string-append
227 "https://github.com/mvertes/txt2man/archive/txt2man-"
228 version ".tar.gz"))
229 (sha256
230 (base32
231 "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn"))))
232 (build-system gnu-build-system)
233 (arguments
234 `(#:tests? #f ; no "check" target
235 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
236 #:phases (modify-phases %standard-phases (delete 'configure))))
237 (inputs
238 `(("gawk" ,gawk)))
239 (home-page "https://github.com/mvertes/txt2man")
240 (synopsis "Convert text to man page")
241 (description "Txt2man converts flat ASCII text to man page format.")
242 (license gpl2+)))