Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / admin.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages admin)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system trivial)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages ncurses)
31 #:use-module (gnu packages readline)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages perl)
36 #:use-module ((gnu packages base)
37 #:select (tar))
38 #:use-module ((gnu packages compression)
39 #:select (gzip))
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages flex)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages pkg-config))
44
45 (define-public dmd
46 (package
47 (name "dmd")
48 (version "0.1")
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
52 version ".tar.gz"))
53 (sha256
54 (base32
55 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
56 (patches (list (search-patch "dmd-getpw.patch")
57 (search-patch "dmd-tests-longer-sleeps.patch")))))
58 (build-system gnu-build-system)
59 (arguments
60 '(#:configure-flags '("--localstatedir=/var")))
61 (native-inputs `(("pkg-config" ,pkg-config)))
62 (inputs `(("guile" ,guile-2.0)))
63 (synopsis "Daemon managing daemons")
64 (description
65 "GNU DMD is a daemon-managing daemon, meaning that it manages the
66 execution of system services, replacing similar functionality found in
67 typical init systems. It provides dependency-handling through a convenient
68 interface and is based on GNU Guile.")
69 (license gpl3+)
70 (home-page "http://www.gnu.org/software/dmd/")))
71
72 (define-public dfc
73 (package
74 (name "dfc")
75 (version "3.0.3")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (string-append
80 "http://projects.gw-computing.net/attachments/download/78/dfc-"
81 version ".tar.gz"))
82 (sha256
83 (base32
84 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
85 (build-system cmake-build-system)
86 (arguments '(#:tests? #f)) ; There are no tests.
87 (native-inputs `(("gettext" ,gnu-gettext)))
88 (home-page "http://projects.gw-computing.net/projects/dfc")
89 (synopsis "Display file system space usage using graphs and colors")
90 (description
91 "dfc (df color) is a modern version of df. It uses colors, draws pretty
92 graphs and can export its output to different formats.")
93 (license bsd-3)))
94
95 (define-public htop
96 (package
97 (name "htop")
98 (version "1.0.2")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "mirror://sourceforge/htop/"
102 version "/htop-" version ".tar.gz"))
103 (sha256
104 (base32
105 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
106 (build-system gnu-build-system)
107 (inputs
108 `(("ncurses" ,ncurses)))
109 (home-page "http://htop.sourceforge.net/")
110 (synopsis "Interactive process viewer")
111 (description
112 "This is htop, an interactive process viewer. It is a text-mode
113 application (for console or X terminals) and requires ncurses.")
114 (license gpl2)))
115
116 (define-public pies
117 (package
118 (name "pies")
119 (version "1.2")
120 (source
121 (origin
122 (method url-fetch)
123 (uri (string-append "mirror://gnu/pies/pies-"
124 version ".tar.bz2"))
125 (sha256
126 (base32
127 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
128 (build-system gnu-build-system)
129 (home-page "http://www.gnu.org/software/pies/")
130 (synopsis "Program invocation and execution supervisor")
131 (description
132 "GNU pies is a program that supervises the invocation and execution of
133 other programs. It reads the list of programs to be started from its
134 configuration file, executes them, and then monitors their status,
135 re-executing them as necessary.")
136 (license gpl3+)))
137
138 (define-public inetutils
139 (package
140 (name "inetutils")
141 (version "1.9.2")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://gnu/inetutils/inetutils-"
145 version ".tar.gz"))
146 (sha256
147 (base32
148 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
149 (build-system gnu-build-system)
150 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
151 ;; which is currently missing.
152 #:tests? #f))
153 (inputs `(("ncurses" ,ncurses)
154 ("readline" ,readline))) ; for 'ftp'
155 (home-page "http://www.gnu.org/software/inetutils/")
156 (synopsis "Basic networking utilities")
157 (description
158 "Inetutils is a collection of common network programs, such as an ftp
159 client and server, a telnet client and server, and an rsh client and server.")
160 (license gpl3+)))
161
162 (define-public shadow
163 (package
164 (name "shadow")
165 (version "4.1.5.1")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append
169 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
170 version ".tar.bz2"))
171 (sha256
172 (base32
173 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
174 (build-system gnu-build-system)
175 (arguments
176 '(;; Assume System V `setpgrp (void)', which is the default on GNU
177 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
178 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
179
180 #:phases (alist-cons-before
181 'build 'set-nscd-file-name
182 (lambda* (#:key inputs #:allow-other-keys)
183 ;; Use the right file name for nscd.
184 (let ((libc (assoc-ref inputs "libc")))
185 (substitute* "lib/nscd.c"
186 (("/usr/sbin/nscd")
187 (string-append libc "/sbin/nscd")))))
188 (alist-cons-after
189 'install 'remove-groups
190 (lambda* (#:key outputs #:allow-other-keys)
191 ;; Remove `groups', which is already provided by Coreutils.
192 (let* ((out (assoc-ref outputs "out"))
193 (bin (string-append out "/bin"))
194 (man (string-append out "/share/man/man1")))
195 (delete-file (string-append bin "/groups"))
196 (for-each delete-file (find-files man "^groups\\."))
197 #t))
198 %standard-phases))))
199
200 (inputs (if (string-suffix? "-linux"
201 (or (%current-target-system)
202 (%current-system)))
203 `(("linux-pam" ,linux-pam))
204 '()))
205 (home-page "http://pkg-shadow.alioth.debian.org/")
206 (synopsis "Authentication-related tools such as passwd, su, and login")
207 (description
208 "Shadow provides a number of authentication-related tools, including:
209 login, passwd, su, groupadd, and useradd.")
210
211 ;; The `vipw' program is GPLv2+.
212 ;; libmisc/salt.c is public domain.
213 (license bsd-3)))
214
215 (define-public mingetty
216 (package
217 (name "mingetty")
218 (version "1.08")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
222 version ".tar.gz"))
223 (sha256
224 (base32
225 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
226 (build-system gnu-build-system)
227 (arguments
228 `(#:phases (alist-replace 'configure
229 (lambda* (#:key inputs outputs
230 #:allow-other-keys)
231 (let* ((out (assoc-ref outputs "out"))
232 (man8 (string-append
233 out "/share/man/man8"))
234 (sbin (string-append out "/sbin"))
235 (shadow (assoc-ref inputs "shadow"))
236 (login (string-append shadow
237 "/bin/login")))
238 (substitute* "Makefile"
239 (("^SBINDIR.*")
240 (string-append "SBINDIR = " out
241 "/sbin\n"))
242 (("^MANDIR.*")
243 (string-append "MANDIR = " out
244 "/share/man/man8\n")))
245
246 ;; Pick the right 'login' by default.
247 (substitute* "mingetty.c"
248 (("\"/bin/login\"")
249 (string-append "\"" login "\"")))
250
251 (mkdir-p sbin)
252 (mkdir-p man8)))
253 %standard-phases)
254 #:tests? #f)) ; no tests
255 (inputs `(("shadow" ,shadow)))
256
257 (home-page "http://sourceforge.net/projects/mingetty")
258 (synopsis "Getty for the text console")
259 (description
260 "Small console getty that is started on the Linux text console,
261 asks for a login name and then transfers over to 'login'. It is extended to
262 allow automatic login and starting any app.")
263 (license gpl2+)))
264
265 (define-public net-base
266 (package
267 (name "net-base")
268 (version "5.1")
269 (source (origin
270 (method url-fetch)
271 (uri (string-append
272 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
273 version ".tar.gz"))
274 (sha256
275 (base32
276 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
277 (build-system trivial-build-system)
278 (arguments
279 `(#:modules ((guix build utils))
280 #:builder (begin
281 (use-modules (guix build utils)
282 (srfi srfi-26))
283
284 (let* ((source (assoc-ref %build-inputs "source"))
285 (tar (assoc-ref %build-inputs "tar"))
286 (gzip (assoc-ref %build-inputs "gzip"))
287 (output (assoc-ref %outputs "out"))
288 (etc (string-append output "/etc")))
289 (setenv "PATH" (string-append gzip "/bin"))
290 (system* (string-append tar "/bin/tar") "xvf"
291 source)
292 (chdir ,(string-append "netbase-" version))
293 (mkdir-p etc)
294 (for-each copy-file
295 '("etc-services" "etc-protocols" "etc-rpc")
296 (map (cut string-append etc "/" <>)
297 '("services" "protocols" "rpc")))
298 #t))))
299 (native-inputs `(("tar" ,tar)
300 ("gzip" ,gzip)))
301 (synopsis "IANA protocol, port, and RPC number assignments")
302 (description
303 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
304 files, which contain information about the IANA-assigned port, protocol, and
305 ONC RPC numbers")
306 (home-page "http://packages.debian.org/sid/netbase")
307 (license gpl2)))
308
309 (define-public netcat
310 (package
311 (name "netcat")
312 (version "0.7.1")
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "mirror://sourceforge/netcat/netcat-"
316 version ".tar.bz2"))
317 (sha256
318 (base32
319 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
320 (build-system gnu-build-system)
321 (arguments
322 `(#:configure-flags
323 ;; By default, man and info pages are put in PREFIX/{man,info},
324 ;; but we want them in PREFIX/share/{man,info}.
325 (let ((out (assoc-ref %outputs "out")))
326 (list (string-append "--mandir=" out "/share/man")
327 (string-append "--infodir=" out "/share/info")))))
328 (home-page "http://netcat.sourceforge.net")
329 (synopsis "Read and write data over TCP/IP")
330 (description
331 "Netcat is a featured networking utility which reads and writes data
332 across network connections, using the TCP/IP protocol. It is designed to be a
333 reliable \"back-end\" tool that can be used directly or easily driven by other
334 programs and scripts. At the same time, it is a feature-rich network debugging
335 and exploration tool, since it can create almost any kind of connection you
336 would need and has several interesting built-in capabilities.")
337 (license gpl2+)))
338
339 (define-public alive
340 (package
341 (name "alive")
342 (version "2.0.2")
343 (source (origin
344 (method url-fetch)
345 (uri (string-append "mirror://gnu/alive/alive-"
346 version ".tar.xz"))
347 (sha256
348 (base32
349 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
350 (build-system gnu-build-system)
351 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
352 (inputs `(("guile" ,guile-2.0)
353 ("inetutils" ,inetutils)))
354 (home-page "http://www.gnu.org/software/alive/")
355 (synopsis "Autologin and keep-alive daemon")
356 (description
357 "GNU Alive sends periodic pings to a server, generally to keep a
358 connection alive.")
359 (license gpl3+)))
360
361 (define-public isc-dhcp
362 (package
363 (name "isc-dhcp")
364 (version "4.3.0")
365 (source (origin
366 (method url-fetch)
367 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
368 version "/dhcp-" version ".tar.gz"))
369 (sha256
370 (base32
371 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
372 (build-system gnu-build-system)
373 (arguments
374 '(#:phases (alist-cons-after
375 'configure 'post-configure
376 (lambda* (#:key outputs #:allow-other-keys)
377 ;; Point to the right client script, which will be
378 ;; installed in a later phase.
379 (substitute* "includes/dhcpd.h"
380 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
381 (let ((out (assoc-ref outputs "out")))
382 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
383 out "/libexec/dhclient-script"
384 "\"\n"))))
385
386 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
387 ;; we must patch shebangs in there and make sure the right
388 ;; shell is used.
389 (with-directory-excursion "bind"
390 (substitute* "Makefile"
391 (("\\./configure")
392 (let ((sh (which "sh")))
393 (string-append "./configure CONFIG_SHELL="
394 sh " SHELL=" sh))))
395
396 (system* "tar" "xf" "bind.tar.gz")
397 (for-each patch-shebang
398 (find-files "bind-9.9.5" ".*"))
399 (zero? (system* "tar" "cf" "bind.tar.gz"
400 "bind-9.9.5"))))
401 (alist-cons-after
402 'install 'post-install
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 ;; Install the dhclient script for GNU/Linux and make sure
405 ;; if finds all the programs it needs.
406 (let* ((out (assoc-ref outputs "out"))
407 (libexec (string-append out "/libexec"))
408 (coreutils (assoc-ref inputs "coreutils"))
409 (net-tools (assoc-ref inputs "net-tools"))
410 (sed (assoc-ref inputs "sed")))
411 (substitute* "client/scripts/linux"
412 (("/sbin/ip")
413 (string-append (assoc-ref inputs "iproute")
414 "/sbin/ip")))
415
416 (mkdir-p libexec)
417 (copy-file "client/scripts/linux"
418 (string-append libexec "/dhclient-script"))
419
420 (wrap-program (string-append libexec "/dhclient-script")
421 `("PATH" ":" prefix
422 ,(map (lambda (dir)
423 (string-append dir "/bin:"
424 dir "/sbin"))
425 (list net-tools coreutils sed))))))
426 %standard-phases))))
427
428 (native-inputs `(("perl" ,perl)))
429
430 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
431 (inputs `(("coreutils" ,coreutils)
432 ("sed" ,sed)
433 ("net-tools" ,net-tools)
434 ("iproute" ,iproute)))
435
436 (home-page "http://www.isc.org/products/DHCP/")
437 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
438 (description
439 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
440 reference implementation of all aspects of DHCP, through a suite of DHCP
441 tools: server, client, and relay agent.")
442 (license isc)))
443
444 (define-public libpcap
445 (package
446 (name "libpcap")
447 (version "1.5.3")
448 (source (origin
449 (method url-fetch)
450 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
451 version ".tar.gz"))
452 (sha256
453 (base32
454 "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs"))))
455 (build-system gnu-build-system)
456 (native-inputs `(("bison" ,bison) ("flex" ,flex)))
457 (arguments '(#:tests? #f)) ; no 'check' target
458 (home-page "http://www.tcpdump.org")
459 (synopsis "Network packet capture library")
460 (description
461 "libpcap is an interface for user-level packet capture. It provides a
462 portable framework for low-level network monitoring. Applications include
463 network statistics collection, security monitoring, network debugging, etc.")
464
465 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
466 (license bsd-3)))
467
468 (define-public jnettop
469 (package
470 (name "jnettop")
471 (version "0.13.0")
472 (source (origin
473 (method url-fetch)
474 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
475 version ".tar.gz"))
476 (sha256
477 (base32
478 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
479 (build-system gnu-build-system)
480 (native-inputs
481 `(("pkg-config" ,pkg-config)))
482 (inputs
483 `(("glib" ,glib)
484 ("ncurses" ,ncurses)
485 ("libpcap" ,libpcap)))
486 (home-page "http://jnettop.kubs.info/")
487 (synopsis "Visualize network traffic by bandwidth use")
488 (description
489 "Jnettop is a traffic visualiser, which captures traffic going
490 through the host it is running from and displays streams sorted
491 by bandwidth they use.")
492 (license gpl2+)))