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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)
38 #:use-module ((gnu packages compression)
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))
51 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
55 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
56 (patches (list (search-patch "dmd-getpw.patch")
57 (search-patch "dmd-tests-longer-sleeps.patch")))))
58 (build-system gnu-build-system)
60 '(#:configure-flags '("--localstatedir=/var")))
61 (native-inputs `(("pkg-config" ,pkg-config)))
62 (inputs `(("guile" ,guile-2.0)))
63 (synopsis "Daemon managing daemons")
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.")
70 (home-page "http://www.gnu.org/software/dmd/")))
80 "http://projects.gw-computing.net/attachments/download/78/dfc-"
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")
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.")
101 (uri (string-append "mirror://sourceforge/htop/"
102 version "/htop-" version ".tar.gz"))
105 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
106 (build-system gnu-build-system)
108 `(("ncurses" ,ncurses)))
109 (home-page "http://htop.sourceforge.net/")
110 (synopsis "Interactive process viewer")
112 "This is htop, an interactive process viewer. It is a text-mode
113 application (for console or X terminals) and requires ncurses.")
123 (uri (string-append "mirror://gnu/pies/pies-"
127 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
128 (build-system gnu-build-system)
129 (home-page "http://www.gnu.org/software/pies/")
130 (synopsis "Program invocation and execution supervisor")
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.")
138 (define-public inetutils
144 (uri (string-append "mirror://gnu/inetutils/inetutils-"
148 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
149 (build-system gnu-build-system)
150 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
151 ;; which is currently missing.
153 (inputs `(("ncurses" ,ncurses)
154 ("readline" ,readline))) ; for 'ftp'
155 (home-page "http://www.gnu.org/software/inetutils/")
156 (synopsis "Basic networking utilities")
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.")
162 (define-public shadow
169 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
173 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
174 (build-system gnu-build-system)
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")
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"
187 (string-append libc "/sbin/nscd")))))
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\\."))
200 (inputs (if (string-suffix? "-linux"
201 (or (%current-target-system)
203 `(("linux-pam" ,linux-pam))
205 (home-page "http://pkg-shadow.alioth.debian.org/")
206 (synopsis "Authentication-related tools such as passwd, su, and login")
208 "Shadow provides a number of authentication-related tools, including:
209 login, passwd, su, groupadd, and useradd.")
211 ;; The `vipw' program is GPLv2+.
212 ;; libmisc/salt.c is public domain.
215 (define-public mingetty
221 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
225 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
226 (build-system gnu-build-system)
228 `(#:phases (alist-replace 'configure
229 (lambda* (#:key inputs outputs
231 (let* ((out (assoc-ref outputs "out"))
233 out "/share/man/man8"))
234 (sbin (string-append out "/sbin"))
235 (shadow (assoc-ref inputs "shadow"))
236 (login (string-append shadow
238 (substitute* "Makefile"
240 (string-append "SBINDIR = " out
243 (string-append "MANDIR = " out
244 "/share/man/man8\n")))
246 ;; Pick the right 'login' by default.
247 (substitute* "mingetty.c"
249 (string-append "\"" login "\"")))
254 #:tests? #f)) ; no tests
255 (inputs `(("shadow" ,shadow)))
257 (home-page "http://sourceforge.net/projects/mingetty")
258 (synopsis "Getty for the text console")
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.")
265 (define-public net-base
272 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
276 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
277 (build-system trivial-build-system)
279 `(#:modules ((guix build utils))
281 (use-modules (guix build utils)
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"
292 (chdir ,(string-append "netbase-" version))
295 '("etc-services" "etc-protocols" "etc-rpc")
296 (map (cut string-append etc "/" <>)
297 '("services" "protocols" "rpc")))
299 (native-inputs `(("tar" ,tar)
301 (synopsis "IANA protocol, port, and RPC number assignments")
303 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
304 files, which contain information about the IANA-assigned port, protocol, and
306 (home-page "http://packages.debian.org/sid/netbase")
309 (define-public netcat
315 (uri (string-append "mirror://sourceforge/netcat/netcat-"
319 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
320 (build-system gnu-build-system)
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")
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.")
345 (uri (string-append "mirror://gnu/alive/alive-"
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")
357 "GNU Alive sends periodic pings to a server, generally to keep a
361 (define-public isc-dhcp
367 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
368 version "/dhcp-" version ".tar.gz"))
371 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
372 (build-system gnu-build-system)
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"
386 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
387 ;; we must patch shebangs in there and make sure the right
389 (with-directory-excursion "bind"
390 (substitute* "Makefile"
392 (let ((sh (which "sh")))
393 (string-append "./configure CONFIG_SHELL="
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"
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"
413 (string-append (assoc-ref inputs "iproute")
417 (copy-file "client/scripts/linux"
418 (string-append libexec "/dhclient-script"))
420 (wrap-program (string-append libexec "/dhclient-script")
423 (string-append dir "/bin:"
425 (list net-tools coreutils sed))))))
428 (native-inputs `(("perl" ,perl)))
430 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
431 (inputs `(("coreutils" ,coreutils)
433 ("net-tools" ,net-tools)
434 ("iproute" ,iproute)))
436 (home-page "http://www.isc.org/products/DHCP/")
437 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
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.")
444 (define-public libpcap
450 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
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")
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.")
465 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
468 (define-public jnettop
474 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
478 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
479 (build-system gnu-build-system)
481 `(("pkg-config" ,pkg-config)))
485 ("libpcap" ,libpcap)))
486 (home-page "http://jnettop.kubs.info/")
487 (synopsis "Visualize network traffic by bandwidth use")
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.")