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 git-download)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system trivial)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages ncurses)
32 #:use-module (gnu packages readline)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages perl)
37 #:use-module ((gnu packages base)
39 #:use-module ((gnu packages compression)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages flex)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages pkg-config))
52 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
56 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
57 (patches (list (search-patch "dmd-getpw.patch")
58 (search-patch "dmd-tests-longer-sleeps.patch")))))
59 (build-system gnu-build-system)
61 '(#:configure-flags '("--localstatedir=/var")))
62 (native-inputs `(("pkg-config" ,pkg-config)))
63 (inputs `(("guile" ,guile-2.0)))
64 (synopsis "Daemon managing daemons")
66 "GNU DMD is a daemon-managing daemon, meaning that it manages the
67 execution of system services, replacing similar functionality found in
68 typical init systems. It provides dependency-handling through a convenient
69 interface and is based on GNU Guile.")
71 (home-page "http://www.gnu.org/software/dmd/")))
81 "http://projects.gw-computing.net/attachments/download/78/dfc-"
85 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
86 (build-system cmake-build-system)
87 (arguments '(#:tests? #f)) ; There are no tests.
88 (native-inputs `(("gettext" ,gnu-gettext)))
89 (home-page "http://projects.gw-computing.net/projects/dfc")
90 (synopsis "Display file system space usage using graphs and colors")
92 "dfc (df color) is a modern version of df. It uses colors, draws pretty
93 graphs and can export its output to different formats.")
102 (uri (string-append "mirror://sourceforge/htop/"
103 version "/htop-" version ".tar.gz"))
106 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
107 (build-system gnu-build-system)
109 `(("ncurses" ,ncurses)))
110 (home-page "http://htop.sourceforge.net/")
111 (synopsis "Interactive process viewer")
113 "This is htop, an interactive process viewer. It is a text-mode
114 application (for console or X terminals) and requires ncurses.")
124 (uri (string-append "mirror://gnu/pies/pies-"
128 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
129 (build-system gnu-build-system)
130 (home-page "http://www.gnu.org/software/pies/")
131 (synopsis "Program invocation and execution supervisor")
133 "GNU pies is a program that supervises the invocation and execution of
134 other programs. It reads the list of programs to be started from its
135 configuration file, executes them, and then monitors their status,
136 re-executing them as necessary.")
139 (define-public inetutils
145 (uri (string-append "mirror://gnu/inetutils/inetutils-"
149 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
150 (build-system gnu-build-system)
151 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
152 ;; which is currently missing.
154 (inputs `(("ncurses" ,ncurses)
155 ("readline" ,readline))) ; for 'ftp'
156 (home-page "http://www.gnu.org/software/inetutils/")
157 (synopsis "Basic networking utilities")
159 "Inetutils is a collection of common network programs, such as an ftp
160 client and server, a telnet client and server, and an rsh client and server.")
163 (define-public shadow
168 ;; Shadow has no real upstream, and not even tarballs.
169 ;; See <https://lists.gnu.org/archive/html/guix-devel/2014-03/msg00233.html>.
172 (url "git://git.debian.org/git/pkg-shadow/shadow")
173 (commit (string-append "upstream/" version))))
176 "1xx85d83kmacmjzqbamgydcjkwsqd5fi1s2wgwx6myq5wa39qx0n"))))
177 (build-system gnu-build-system)
179 '(;; Assume System V `setpgrp (void)', which is the default on GNU
180 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
181 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
183 #:phases (alist-cons-before
184 'build 'set-nscd-file-name
185 (lambda* (#:key inputs #:allow-other-keys)
186 ;; Use the right file name for nscd.
187 (let ((libc (assoc-ref inputs "libc")))
188 (substitute* "lib/nscd.c"
190 (string-append libc "/sbin/nscd")))))
192 'install 'remove-groups
193 (lambda* (#:key outputs #:allow-other-keys)
194 ;; Remove `groups', which is already provided by Coreutils.
195 (let* ((out (assoc-ref outputs "out"))
196 (bin (string-append out "/bin"))
197 (man (string-append out "/share/man/man1")))
198 (delete-file (string-append bin "/groups"))
199 (for-each delete-file (find-files man "^groups\\."))
203 (inputs (if (string-suffix? "-linux"
204 (or (%current-target-system)
206 `(("linux-pam" ,linux-pam))
208 (home-page "http://pkg-shadow.alioth.debian.org/")
209 (synopsis "Authentication-related tools such as passwd, su, and login")
211 "Shadow provides a number of authentication-related tools, including:
212 login, passwd, su, groupadd, and useradd.")
214 ;; The `vipw' program is GPLv2+.
215 ;; libmisc/salt.c is public domain.
218 (define-public mingetty
224 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
228 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
229 (build-system gnu-build-system)
231 `(#:phases (alist-replace 'configure
232 (lambda* (#:key inputs outputs
234 (let* ((out (assoc-ref outputs "out"))
236 out "/share/man/man8"))
237 (sbin (string-append out "/sbin"))
238 (shadow (assoc-ref inputs "shadow"))
239 (login (string-append shadow
241 (substitute* "Makefile"
243 (string-append "SBINDIR = " out
246 (string-append "MANDIR = " out
247 "/share/man/man8\n")))
249 ;; Pick the right 'login' by default.
250 (substitute* "mingetty.c"
252 (string-append "\"" login "\"")))
257 #:tests? #f)) ; no tests
258 (inputs `(("shadow" ,shadow)))
260 (home-page "http://sourceforge.net/projects/mingetty")
261 (synopsis "Getty for the text console")
263 "Small console getty that is started on the Linux text console,
264 asks for a login name and then transfers over to 'login'. It is extended to
265 allow automatic login and starting any app.")
268 (define-public net-base
275 "mirror://debian/pool/main/n/netbase/netbase_"
279 "01rkvqrg7krkx8b432nz6bpi8w3s4cm5q5r891k23cdrc9nsaayn"))))
280 (build-system trivial-build-system)
282 `(#:modules ((guix build utils))
284 (use-modules (guix build utils)
287 (let* ((source (assoc-ref %build-inputs "source"))
288 (tar (assoc-ref %build-inputs "tar"))
289 (gzip (assoc-ref %build-inputs "gzip"))
290 (output (assoc-ref %outputs "out"))
291 (etc (string-append output "/etc")))
292 (setenv "PATH" (string-append gzip "/bin"))
293 (system* (string-append tar "/bin/tar") "xvf"
295 (chdir ,(string-append "netbase-" version))
298 '("etc-services" "etc-protocols" "etc-rpc")
299 (map (cut string-append etc "/" <>)
300 '("services" "protocols" "rpc")))
302 (native-inputs `(("tar" ,tar)
304 (synopsis "IANA protocol, port, and RPC number assignments")
306 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
307 files, which contain information about the IANA-assigned port, protocol, and
309 (home-page "http://packages.debian.org/sid/netbase")
312 (define-public netcat
318 (uri (string-append "mirror://sourceforge/netcat/netcat-"
322 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
323 (build-system gnu-build-system)
326 ;; By default, man and info pages are put in PREFIX/{man,info},
327 ;; but we want them in PREFIX/share/{man,info}.
328 (let ((out (assoc-ref %outputs "out")))
329 (list (string-append "--mandir=" out "/share/man")
330 (string-append "--infodir=" out "/share/info")))))
331 (home-page "http://netcat.sourceforge.net")
332 (synopsis "Read and write data over TCP/IP")
334 "Netcat is a featured networking utility which reads and writes data
335 across network connections, using the TCP/IP protocol. It is designed to be a
336 reliable \"back-end\" tool that can be used directly or easily driven by other
337 programs and scripts. At the same time, it is a feature-rich network debugging
338 and exploration tool, since it can create almost any kind of connection you
339 would need and has several interesting built-in capabilities.")
348 (uri (string-append "mirror://gnu/alive/alive-"
352 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
353 (build-system gnu-build-system)
354 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
355 (inputs `(("guile" ,guile-2.0)
356 ("inetutils" ,inetutils)))
357 (home-page "http://www.gnu.org/software/alive/")
358 (synopsis "Autologin and keep-alive daemon")
360 "GNU Alive sends periodic pings to a server, generally to keep a
364 (define-public isc-dhcp
370 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
371 version "/dhcp-" version ".tar.gz"))
374 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
375 (build-system gnu-build-system)
377 '(#:phases (alist-cons-after
378 'configure 'post-configure
379 (lambda* (#:key outputs #:allow-other-keys)
380 ;; Point to the right client script, which will be
381 ;; installed in a later phase.
382 (substitute* "includes/dhcpd.h"
383 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
384 (let ((out (assoc-ref outputs "out")))
385 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
386 out "/libexec/dhclient-script"
389 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
390 ;; we must patch shebangs in there and make sure the right
392 (with-directory-excursion "bind"
393 (substitute* "Makefile"
395 (let ((sh (which "sh")))
396 (string-append "./configure CONFIG_SHELL="
399 (system* "tar" "xf" "bind.tar.gz")
400 (for-each patch-shebang
401 (find-files "bind-9.9.5" ".*"))
402 (zero? (system* "tar" "cf" "bind.tar.gz"
405 'install 'post-install
406 (lambda* (#:key inputs outputs #:allow-other-keys)
407 ;; Install the dhclient script for GNU/Linux and make sure
408 ;; if finds all the programs it needs.
409 (let* ((out (assoc-ref outputs "out"))
410 (libexec (string-append out "/libexec"))
411 (coreutils (assoc-ref inputs "coreutils"))
412 (net-tools (assoc-ref inputs "net-tools"))
413 (sed (assoc-ref inputs "sed")))
414 (substitute* "client/scripts/linux"
416 (string-append (assoc-ref inputs "iproute")
420 (copy-file "client/scripts/linux"
421 (string-append libexec "/dhclient-script"))
423 (wrap-program (string-append libexec "/dhclient-script")
426 (string-append dir "/bin:"
428 (list net-tools coreutils sed))))))
431 (native-inputs `(("perl" ,perl)))
433 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
434 (inputs `(("coreutils" ,coreutils)
436 ("net-tools" ,net-tools)
437 ("iproute" ,iproute)))
439 (home-page "http://www.isc.org/products/DHCP/")
440 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
442 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
443 reference implementation of all aspects of DHCP, through a suite of DHCP
444 tools: server, client, and relay agent.")
447 (define-public libpcap
453 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
457 "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs"))))
458 (build-system gnu-build-system)
459 (native-inputs `(("bison" ,bison) ("flex" ,flex)))
460 (arguments '(#:tests? #f)) ; no 'check' target
461 (home-page "http://www.tcpdump.org")
462 (synopsis "Network packet capture library")
464 "libpcap is an interface for user-level packet capture. It provides a
465 portable framework for low-level network monitoring. Applications include
466 network statistics collection, security monitoring, network debugging, etc.")
468 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
471 (define-public jnettop
477 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
481 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
482 (build-system gnu-build-system)
484 `(("pkg-config" ,pkg-config)))
488 ("libpcap" ,libpcap)))
489 (home-page "http://jnettop.kubs.info/")
490 (synopsis "Visualize network traffic by bandwidth use")
492 "Jnettop is a traffic visualiser, which captures traffic going
493 through the host it is running from and displays streams sorted
494 by bandwidth they use.")