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 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages man)
23 #:use-module (guix licenses)
24 #:use-module (guix download)
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages databases)
28 #:use-module (gnu packages flex)
29 #:use-module (gnu packages gawk)
30 #:use-module (gnu packages groff)
31 #:use-module (gnu packages less)
32 #:use-module (gnu packages lynx)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages linux))
37 (define-public libpipeline
44 "mirror://savannah/libpipeline/libpipeline-"
48 "1dlvp2mxlhg5zbj509kc60h7g39hpgwkzkpdf855cyzizgkmkivr"))))
49 (build-system gnu-build-system)
50 (home-page "http://libpipeline.nongnu.org/")
51 (synopsis "C library for manipulating pipelines of subprocesses")
53 "libpipeline is a C library for manipulating pipelines of subprocesses in
54 a flexible and convenient way.")
63 (uri (string-append "mirror://savannah/man-db/man-db-"
67 "03ly0hbpgjnag576rgccanaisn7f6422q5qxrj64vyzslc2651y4"))))
68 (build-system gnu-build-system)
72 '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)
79 (string-append "#!" (which "sh")))))
80 (remove file-is-directory?
81 (find-files "src/tests" ".*")))))
84 (let ((groff (assoc-ref %build-inputs "groff"))
85 (less (assoc-ref %build-inputs "less"))
86 (gzip (assoc-ref %build-inputs "gzip"))
87 (bzip2 (assoc-ref %build-inputs "bzip2"))
88 (xz (assoc-ref %build-inputs "xz"))
89 (util (assoc-ref %build-inputs "util-linux")))
90 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
91 (append (list "--disable-setuid" ;; Disable setuid man user.
92 (string-append "--with-pager=" less "/bin/less")
93 (string-append "--with-gzip=" gzip "/bin/gzip")
94 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
95 (string-append "--with-xz=" xz "/bin/xz")
96 (string-append "--with-col=" util "/bin/col")
97 ;; Default value is "/usr/lib/tmpfiles.d" (not
99 (string-append "--with-systemdtmpfilesdir="
100 %output "/lib/tmpfiles.d"))
102 (string-append "--with-" prog "=" groff "/bin/" prog))
103 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
104 #:modules ((guix build gnu-build-system)
108 `(("pkg-config" ,pkg-config)))
114 ("libpipeline" ,libpipeline)
115 ("util-linux" ,util-linux)))
117 (list (search-path-specification
119 (files '("share/man")))))
120 (home-page "http://man-db.nongnu.org/")
121 (synopsis "Standard Unix documentation system")
123 "Man-db is an implementation of the standard Unix documentation system
124 accessed using the man command. It uses a Berkeley DB database in place of
125 the traditional flat-text whatis databases.")
128 (define-public man-pages
135 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
139 "1c8q618shf469nfp55qrwjv9630fgq5abfk946xya9hw1bfp6wjl"))))
140 (build-system gnu-build-system)
142 '(#:phases (alist-delete 'configure %standard-phases)
144 ;; The 'all' target depends on three targets that directly populate
145 ;; $(MANDIR) based on its current contents. Doing that in parallel
146 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
150 #:make-flags (list (string-append "MANDIR="
151 (assoc-ref %outputs "out")
153 (home-page "http://www.kernel.org/doc/man-pages/")
154 (synopsis "Development manual pages from the Linux project")
156 "This package provides traditional Unix \"man pages\" documenting the
157 Linux kernel and C library interfaces employed by user-space programs.")
159 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
162 (define-public help2man
169 (uri (string-append "mirror://gnu/help2man/help2man-"
173 "0z1zgw6k1fba59fii6ksfi1g2gci6i4ysa3kdfh3j475fdkn1if4"))))
174 (build-system gnu-build-system)
175 (arguments `(;; There's no `check' target.
179 ;; TODO: Add these optional dependencies.
180 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
181 ;; ("gettext" ,gnu-gettext)
183 (home-page "http://www.gnu.org/software/help2man/")
184 (synopsis "Automatically generate man pages from program --help")
186 "GNU help2man is a program that converts the output of standard
187 \"--help\" and \"--version\" command-line arguments into a manual page
191 (define-public txt2man
199 "https://github.com/mvertes/txt2man/archive/txt2man-"
203 "0sjq687jknq65wbnjh2siq8hc09ydpnlmrkrnwl66mrhd4n9g7fz"))))
204 (build-system gnu-build-system)
206 `(#:tests? #f ; no "check" target
207 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
208 #:phases (alist-delete 'configure %standard-phases)))
211 (home-page "https://github.com/mvertes/txt2man")
212 (synopsis "Convert text to man page")
213 (description "Txt2man converts flat ASCII text to man page format.")