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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages admin)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system cmake)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system trivial)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages readline)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages guile)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages perl)
35 #:use-module ((gnu packages base)
37 #:use-module ((gnu packages compression)
39 #:use-module (gnu packages bison)
40 #:use-module (gnu packages flex)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages pkg-config))
50 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
54 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
55 (patches (list (search-patch "dmd-getpw.patch")
56 (search-patch "dmd-tests-longer-sleeps.patch")))))
57 (build-system gnu-build-system)
59 '(#:configure-flags '("--localstatedir=/var")))
60 (native-inputs `(("pkg-config" ,pkg-config)))
61 (inputs `(("guile" ,guile-2.0)))
62 (synopsis "Daemon managing daemons")
64 "GNU DMD is a daemon-managing daemon, meaning that it manages the
65 execution of system services, replacing similar functionality found in
66 typical init systems. It provides dependency-handling through a convenient
67 interface and is based on GNU Guile.")
69 (home-page "http://www.gnu.org/software/dmd/")))
79 "http://projects.gw-computing.net/attachments/download/78/dfc-"
83 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
84 (build-system cmake-build-system)
85 (arguments '(#:tests? #f)) ; There are no tests.
86 (native-inputs `(("gettext" ,gnu-gettext)))
87 (home-page "http://projects.gw-computing.net/projects/dfc")
88 (synopsis "Display file system space usage using graphs and colors")
90 "dfc (df color) is a modern version of df. It uses colors, draws pretty
91 graphs and can export its output to different formats.")
100 (uri (string-append "mirror://sourceforge/htop/"
101 version "/htop-" version ".tar.gz"))
104 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
105 (build-system gnu-build-system)
107 `(("ncurses" ,ncurses)))
108 (home-page "http://htop.sourceforge.net/")
109 (synopsis "Interactive process viewer")
111 "This is htop, an interactive process viewer. It is a text-mode
112 application (for console or X terminals) and requires ncurses.")
122 (uri (string-append "mirror://gnu/pies/pies-"
126 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
127 (build-system gnu-build-system)
128 (home-page "http://www.gnu.org/software/pies/")
129 (synopsis "Program invocation and execution supervisor")
131 "GNU pies is a program that supervises the invocation and execution of
132 other programs. It reads the list of programs to be started from its
133 configuration file, executes them, and then monitors their status,
134 re-executing them as necessary.")
137 (define-public inetutils
143 (uri (string-append "mirror://gnu/inetutils/inetutils-"
147 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
148 (build-system gnu-build-system)
149 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
150 ;; which is currently missing.
152 (inputs `(("ncurses" ,ncurses)
153 ("readline" ,readline))) ; for 'ftp'
154 (home-page "http://www.gnu.org/software/inetutils/")
155 (synopsis "Basic networking utilities")
157 "Inetutils is a collection of common network programs, such as an ftp
158 client and server, a telnet client and server, and an rsh client and server.")
161 (define-public shadow
168 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
172 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
173 (build-system gnu-build-system)
175 '(;; Assume System V `setpgrp (void)', which is the default on GNU
176 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
177 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
179 #:phases (alist-cons-before
180 'build 'set-nscd-file-name
181 (lambda* (#:key inputs #:allow-other-keys)
182 ;; Use the right file name for nscd.
183 (let ((libc (assoc-ref inputs "libc")))
184 (substitute* "lib/nscd.c"
186 (string-append libc "/sbin/nscd")))))
188 'install 'remove-groups
189 (lambda* (#:key outputs #:allow-other-keys)
190 ;; Remove `groups', which is already provided by Coreutils.
191 (let* ((out (assoc-ref outputs "out"))
192 (bin (string-append out "/bin"))
193 (man (string-append out "/share/man/man1")))
194 (delete-file (string-append bin "/groups"))
195 (for-each delete-file (find-files man "^groups\\."))
199 (inputs (if (string-suffix? "-linux"
200 (or (%current-target-system)
202 `(("linux-pam" ,linux-pam))
204 (home-page "http://pkg-shadow.alioth.debian.org/")
205 (synopsis "Authentication-related tools such as passwd, su, and login")
207 "Shadow provides a number of authentication-related tools, including:
208 login, passwd, su, groupadd, and useradd.")
210 ;; The `vipw' program is GPLv2+.
211 ;; libmisc/salt.c is public domain.
214 (define-public mingetty
220 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
224 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
225 (build-system gnu-build-system)
227 `(#:phases (alist-replace 'configure
228 (lambda* (#:key inputs outputs
230 (let* ((out (assoc-ref outputs "out"))
232 out "/share/man/man8"))
233 (sbin (string-append out "/sbin"))
234 (shadow (assoc-ref inputs "shadow"))
235 (login (string-append shadow
237 (substitute* "Makefile"
239 (string-append "SBINDIR = " out
242 (string-append "MANDIR = " out
243 "/share/man/man8\n")))
245 ;; Pick the right 'login' by default.
246 (substitute* "mingetty.c"
248 (string-append "\"" login "\"")))
253 #:tests? #f)) ; no tests
254 (inputs `(("shadow" ,shadow)))
256 (home-page "http://sourceforge.net/projects/mingetty")
257 (synopsis "Getty for the text console")
259 "Small console getty that is started on the Linux text console,
260 asks for a login name and then transfers over to 'login'. It is extended to
261 allow automatic login and starting any app.")
264 (define-public net-base
271 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
275 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
276 (build-system trivial-build-system)
278 `(#:modules ((guix build utils))
280 (use-modules (guix build utils)
283 (let* ((source (assoc-ref %build-inputs "source"))
284 (tar (assoc-ref %build-inputs "tar"))
285 (gzip (assoc-ref %build-inputs "gzip"))
286 (output (assoc-ref %outputs "out"))
287 (etc (string-append output "/etc")))
288 (setenv "PATH" (string-append gzip "/bin"))
289 (system* (string-append tar "/bin/tar") "xvf"
291 (chdir ,(string-append "netbase-" version))
294 '("etc-services" "etc-protocols" "etc-rpc")
295 (map (cut string-append etc "/" <>)
296 '("services" "protocols" "rpc")))
298 (native-inputs `(("tar" ,tar)
300 (synopsis "IANA protocol, port, and RPC number assignments")
302 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
303 files, which contain information about the IANA-assigned port, protocol, and
305 (home-page "http://packages.debian.org/sid/netbase")
308 (define-public netcat
314 (uri (string-append "mirror://sourceforge/netcat/netcat-"
318 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
319 (build-system gnu-build-system)
320 (home-page "http://netcat.sourceforge.net")
321 (synopsis "Read and write data over TCP/IP")
323 "Netcat is a featured networking utility which reads and writes data
324 across network connections, using the TCP/IP protocol. It is designed to be a
325 reliable \"back-end\" tool that can be used directly or easily driven by other
326 programs and scripts. At the same time, it is a feature-rich network debugging
327 and exploration tool, since it can create almost any kind of connection you
328 would need and has several interesting built-in capabilities.")
337 (uri (string-append "mirror://gnu/alive/alive-"
341 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
342 (build-system gnu-build-system)
343 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
344 (inputs `(("guile" ,guile-2.0)
345 ("inetutils" ,inetutils)))
346 (home-page "http://www.gnu.org/software/alive/")
347 (synopsis "Autologin and keep-alive daemon")
349 "GNU Alive sends periodic pings to a server, generally to keep a
353 (define-public isc-dhcp
359 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
360 version "/dhcp-" version ".tar.gz"))
363 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
364 (build-system gnu-build-system)
366 '(#:phases (alist-cons-after
367 'configure 'post-configure
368 (lambda* (#:key outputs #:allow-other-keys)
369 ;; Point to the right client script, which will be
370 ;; installed in a later phase.
371 (substitute* "includes/dhcpd.h"
372 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
373 (let ((out (assoc-ref outputs "out")))
374 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
375 out "/libexec/dhclient-script"
378 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
379 ;; we must patch shebangs in there and make sure the right
381 (with-directory-excursion "bind"
382 (substitute* "Makefile"
384 (let ((sh (which "sh")))
385 (string-append "./configure CONFIG_SHELL="
388 (system* "tar" "xf" "bind.tar.gz")
389 (for-each patch-shebang
390 (find-files "bind-9.9.5" ".*"))
391 (zero? (system* "tar" "cf" "bind.tar.gz"
394 'install 'post-install
395 (lambda* (#:key inputs outputs #:allow-other-keys)
396 ;; Install the dhclient script for GNU/Linux and make sure
397 ;; if finds all the programs it needs.
398 (let* ((out (assoc-ref outputs "out"))
399 (libexec (string-append out "/libexec"))
400 (coreutils (assoc-ref inputs "coreutils"))
401 (net-tools (assoc-ref inputs "net-tools"))
402 (sed (assoc-ref inputs "sed")))
403 (substitute* "client/scripts/linux"
405 (string-append (assoc-ref inputs "iproute")
409 (copy-file "client/scripts/linux"
410 (string-append libexec "/dhclient-script"))
412 (wrap-program (string-append libexec "/dhclient-script")
415 (string-append dir "/bin:"
417 (list net-tools coreutils sed))))))
420 (native-inputs `(("perl" ,perl)))
422 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
423 (inputs `(("coreutils" ,coreutils)
425 ("net-tools" ,net-tools)
426 ("iproute" ,iproute)))
428 (home-page "http://www.isc.org/products/DHCP/")
429 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
431 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
432 reference implementation of all aspects of DHCP, through a suite of DHCP
433 tools: server, client, and relay agent.")
436 (define-public libpcap
442 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
446 "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs"))))
447 (build-system gnu-build-system)
448 (native-inputs `(("bison" ,bison) ("flex" ,flex)))
449 (arguments '(#:tests? #f)) ; no 'check' target
450 (home-page "http://www.tcpdump.org")
451 (synopsis "Network packet capture library")
453 "libpcap is an interface for user-level packet capture. It provides a
454 portable framework for low-level network monitoring. Applications include
455 network statistics collection, security monitoring, network debugging, etc.")
457 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
460 (define-public jnettop
466 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
470 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
471 (build-system gnu-build-system)
473 `(("pkg-config" ,pkg-config)))
477 ("libpcap" ,libpcap)))
478 (home-page "http://jnettop.kubs.info/")
479 (synopsis "Visualize network traffic by bandwidth use")
481 "Jnettop is a traffic visualiser, which captures traffic going
482 through the host it is running from and displays streams sorted
483 by bandwidth they use.")