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