gnu: java: Use HTTPS for osgi.org home pages.
[jackhill/guix/guix.git] / gnu / packages / man.scm
CommitLineData
cd2e0b64 1;;; GNU Guix --- Functional package management for GNU
c85f0691 2;;; Copyright © 2012, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
cd2e0b64 3;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
e79b3c37 4;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
d2eb275a 5;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
a916c826 6;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
fb5569b0 7;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
cd2e0b64
DT
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)
67ca0a01 28 #:use-module (guix build-system gnu)
b416aadf 29 #:use-module (gnu packages databases)
67ca0a01 30 #:use-module (gnu packages flex)
dd6b54b8 31 #:use-module (gnu packages gawk)
67ca0a01
DT
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages less)
cb3da233 34 #:use-module (gnu packages perl)
d2eb275a
AK
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages linux))
cd2e0b64
DT
37
38(define-public libpipeline
39 (package
40 (name "libpipeline")
97156ba2 41 (version "1.5.0")
cd2e0b64
DT
42 (source (origin
43 (method url-fetch)
44 (uri (string-append
45 "mirror://savannah/libpipeline/libpipeline-"
46 version ".tar.gz"))
47 (sha256
48 (base32
97156ba2 49 "0avg525wvifcvjrwa6i1r6kvahmsswj0mpxrsxzzdzra9wpf2whd"))))
cd2e0b64
DT
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
55a flexible and convenient way.")
56 (license gpl3+)))
67ca0a01
DT
57
58(define-public man-db
59 (package
60 (name "man-db")
28790093 61 (version "2.7.6.1")
67ca0a01
DT
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
28790093 68 "0gqgs4zc3r87apns0k5qp689p2ylxx2596s2mkmkxjjay99brv88"))))
67ca0a01
DT
69 (build-system gnu-build-system)
70 (arguments
c85f0691 71 `(#:phases
e79b3c37
RW
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?
ea55a395
RW
82 (find-files "src/tests" ".*"))))))
83 (add-after 'unpack 'patch-iconv-path
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "src/man.c"
86 (("\"iconv\"")
87 (string-append "\"" (which "iconv") "\"")))
88 #t)))
67ca0a01
DT
89 #:configure-flags
90 (let ((groff (assoc-ref %build-inputs "groff"))
c85f0691 91 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
67ca0a01
DT
92 (less (assoc-ref %build-inputs "less"))
93 (gzip (assoc-ref %build-inputs "gzip"))
d2eb275a
AK
94 (bzip2 (assoc-ref %build-inputs "bzip2"))
95 (xz (assoc-ref %build-inputs "xz"))
96 (util (assoc-ref %build-inputs "util-linux")))
67ca0a01 97 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
28790093
LF
98 (append (list ;; Disable setuid man user.
99 "--disable-setuid"
100 ;; Don't constrain ownership of system-wide cache files.
101 ;; Otherwise creating the manpage database fails with
102 ;; man-db > 2.7.5.
103 "--disable-cache-owner"
67ca0a01
DT
104 (string-append "--with-pager=" less "/bin/less")
105 (string-append "--with-gzip=" gzip "/bin/gzip")
106 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
d2eb275a 107 (string-append "--with-xz=" xz "/bin/xz")
a37f9722
AK
108 (string-append "--with-col=" util "/bin/col")
109 ;; Default value is "/usr/lib/tmpfiles.d" (not
110 ;; prefix-sensitive).
111 (string-append "--with-systemdtmpfilesdir="
112 %output "/lib/tmpfiles.d"))
67ca0a01 113 (map (lambda (prog)
c85f0691
LC
114 (string-append "--with-" prog "=" groff-minimal
115 "/bin/" prog))
67ca0a01 116 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
c85f0691
LC
117
118 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
119 ;; pulls in Perl.)
120 #:disallowed-references (,groff)
121
67ca0a01
DT
122 #:modules ((guix build gnu-build-system)
123 (guix build utils)
124 (srfi srfi-1))))
125 (native-inputs
c85f0691
LC
126 `(("pkg-config" ,pkg-config)
127 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
67ca0a01
DT
128 (inputs
129 `(("flex" ,flex)
130 ("gdbm" ,gdbm)
c85f0691 131 ("groff-minimal" ,groff-minimal)
67ca0a01 132 ("less" ,less)
d2eb275a
AK
133 ("libpipeline" ,libpipeline)
134 ("util-linux" ,util-linux)))
2b42718b
LC
135 (native-search-paths
136 (list (search-path-specification
137 (variable "MANPATH")
af070955 138 (files '("share/man")))))
67ca0a01
DT
139 (home-page "http://man-db.nongnu.org/")
140 (synopsis "Standard Unix documentation system")
141 (description
142 "Man-db is an implementation of the standard Unix documentation system
143accessed using the man command. It uses a Berkeley DB database in place of
144the traditional flat-text whatis databases.")
145 (license gpl2+)))
cb3da233 146
c5cd288b
LC
147(define-public man-pages
148 (package
149 (name "man-pages")
fb5569b0 150 (version "4.14")
c5cd288b
LC
151 (source (origin
152 (method url-fetch)
a916c826
EF
153 (uri
154 (list
155 (string-append
dcd3ed9c 156 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
a916c826
EF
157 version ".tar.xz")
158 (string-append
159 "mirror://kernel.org/linux/docs/man-pages/Archive/"
160 "man-pages-" version ".tar.xz")))
c5cd288b
LC
161 (sha256
162 (base32
fb5569b0 163 "0wf9ymqxk1k5xwcl3n919p66a1aayif3x4cahj4w04y3k1wbhlih"))))
c5cd288b
LC
164 (build-system gnu-build-system)
165 (arguments
dc1d3cde 166 '(#:phases (modify-phases %standard-phases (delete 'configure))
3b509259
LC
167
168 ;; The 'all' target depends on three targets that directly populate
169 ;; $(MANDIR) based on its current contents. Doing that in parallel
170 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
171 #:parallel-build? #f
172
c5cd288b
LC
173 #:tests? #f
174 #:make-flags (list (string-append "MANDIR="
175 (assoc-ref %outputs "out")
176 "/share/man"))))
4e128dd5 177 (home-page "https://www.kernel.org/doc/man-pages/")
c5cd288b
LC
178 (synopsis "Development manual pages from the Linux project")
179 (description
180 "This package provides traditional Unix \"man pages\" documenting the
181Linux kernel and C library interfaces employed by user-space programs.")
182
183 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
184 (license gpl2+)))
185
cb3da233
DT
186(define-public help2man
187 (package
188 (name "help2man")
8ac012d0 189 (version "1.47.4")
cb3da233
DT
190 (source
191 (origin
192 (method url-fetch)
193 (uri (string-append "mirror://gnu/help2man/help2man-"
194 version ".tar.xz"))
195 (sha256
196 (base32
8ac012d0 197 "0lvp4306f5nq08f3snffs5pp1zwv8l35z6f5g0dds51zs6bzdv6l"))))
cb3da233
DT
198 (build-system gnu-build-system)
199 (arguments `(;; There's no `check' target.
200 #:tests? #f))
201 (inputs
202 `(("perl" ,perl)
203 ;; TODO: Add these optional dependencies.
204 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
b94a6ca0 205 ;; ("gettext" ,gettext-minimal)
cb3da233 206 ))
6fd52309 207 (home-page "https://www.gnu.org/software/help2man/")
cb3da233
DT
208 (synopsis "Automatically generate man pages from program --help")
209 (description
210 "GNU help2man is a program that converts the output of standard
211\"--help\" and \"--version\" command-line arguments into a manual page
212automatically.")
213 (license gpl3+)))
dd6b54b8
RW
214
215(define-public txt2man
216 (package
217 (name "txt2man")
53c36279 218 (version "1.6.0")
dd6b54b8
RW
219 (source
220 (origin
221 (method url-fetch)
222 (uri (string-append
223 "https://github.com/mvertes/txt2man/archive/txt2man-"
224 version ".tar.gz"))
225 (sha256
226 (base32
53c36279 227 "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn"))))
dd6b54b8
RW
228 (build-system gnu-build-system)
229 (arguments
230 `(#:tests? #f ; no "check" target
231 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
dc1d3cde 232 #:phases (modify-phases %standard-phases (delete 'configure))))
dd6b54b8
RW
233 (inputs
234 `(("gawk" ,gawk)))
235 (home-page "https://github.com/mvertes/txt2man")
236 (synopsis "Convert text to man page")
237 (description "Txt2man converts flat ASCII text to man page format.")
238 (license gpl2+)))