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 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
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 admin)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system trivial)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages ncurses)
33 #:use-module (gnu packages readline)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages guile)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages tcl)
39 #:use-module ((gnu packages base)
41 #:use-module ((gnu packages compression)
43 #:use-module ((gnu packages openssl)
44 #:renamer (symbol-prefix-proc 'o:))
45 #:use-module (gnu packages bison)
46 #:use-module (gnu packages flex)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages texinfo)
50 #:use-module (gnu packages xorg))
58 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
62 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
63 (patches (list (search-patch "dmd-getpw.patch")
64 (search-patch "dmd-tests-longer-sleeps.patch")))))
65 (build-system gnu-build-system)
67 '(#:configure-flags '("--localstatedir=/var")))
68 (native-inputs `(("pkg-config" ,pkg-config)))
69 (inputs `(("guile" ,guile-2.0)))
70 (synopsis "Daemon managing daemons")
72 "GNU DMD is a daemon-managing daemon, meaning that it manages the
73 execution of system services, replacing similar functionality found in
74 typical init systems. It provides dependency-handling through a convenient
75 interface and is based on GNU Guile.")
77 (home-page "http://www.gnu.org/software/dmd/")))
87 "http://projects.gw-computing.net/attachments/download/78/dfc-"
91 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
92 (build-system cmake-build-system)
93 (arguments '(#:tests? #f)) ; There are no tests.
94 (native-inputs `(("gettext" ,gnu-gettext)))
95 (home-page "http://projects.gw-computing.net/projects/dfc")
96 (synopsis "Display file system space usage using graphs and colors")
98 "dfc (df color) is a modern version of df. It uses colors, draws pretty
99 graphs and can export its output to different formats.")
108 (uri (string-append "mirror://sourceforge/htop/"
109 version "/htop-" version ".tar.gz"))
112 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
113 (build-system gnu-build-system)
115 `(("ncurses" ,ncurses)))
116 (home-page "http://htop.sourceforge.net/")
117 (synopsis "Interactive process viewer")
119 "This is htop, an interactive process viewer. It is a text-mode
120 application (for console or X terminals) and requires ncurses.")
130 (uri (string-append "mirror://gnu/pies/pies-"
134 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
135 (build-system gnu-build-system)
136 (home-page "http://www.gnu.org/software/pies/")
137 (synopsis "Program invocation and execution supervisor")
139 "GNU pies is a program that supervises the invocation and execution of
140 other programs. It reads the list of programs to be started from its
141 configuration file, executes them, and then monitors their status,
142 re-executing them as necessary.")
145 (define-public inetutils
151 (uri (string-append "mirror://gnu/inetutils/inetutils-"
155 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
156 (build-system gnu-build-system)
157 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
158 ;; which is currently missing.
160 (inputs `(("ncurses" ,ncurses)
161 ("readline" ,readline))) ; for 'ftp'
162 (home-page "http://www.gnu.org/software/inetutils/")
163 (synopsis "Basic networking utilities")
165 "Inetutils is a collection of common network programs, such as an ftp
166 client and server, a telnet client and server, and an rsh client and server.")
169 (define-public shadow
174 ;; Shadow has no real upstream, and not even tarballs.
175 ;; See <https://lists.gnu.org/archive/html/guix-devel/2014-03/msg00233.html>.
178 (url "git://git.debian.org/git/pkg-shadow/shadow")
179 (commit (string-append "upstream/" version))))
182 "1xx85d83kmacmjzqbamgydcjkwsqd5fi1s2wgwx6myq5wa39qx0n"))))
183 (build-system gnu-build-system)
185 '(;; Assume System V `setpgrp (void)', which is the default on GNU
186 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
187 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
189 #:phases (alist-cons-before
190 'build 'set-nscd-file-name
191 (lambda* (#:key inputs #:allow-other-keys)
192 ;; Use the right file name for nscd.
193 (let ((libc (assoc-ref inputs "libc")))
194 (substitute* "lib/nscd.c"
196 (string-append libc "/sbin/nscd")))))
198 'install 'remove-groups
199 (lambda* (#:key outputs #:allow-other-keys)
200 ;; Remove `groups', which is already provided by Coreutils.
201 (let* ((out (assoc-ref outputs "out"))
202 (bin (string-append out "/bin"))
203 (man (string-append out "/share/man/man1")))
204 (delete-file (string-append bin "/groups"))
205 (for-each delete-file (find-files man "^groups\\."))
208 'unpack 'reset-timestamps
210 ;; FIXME: Reset the file timestamps here, until the
211 ;; 'unpack' phase does it for us. See
212 ;; <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00098.html>.
213 (for-each (lambda (file)
215 (find-files "." "")))
216 %standard-phases)))))
218 (inputs (if (string-suffix? "-linux"
219 (or (%current-target-system)
221 `(("linux-pam" ,linux-pam))
223 (home-page "http://pkg-shadow.alioth.debian.org/")
224 (synopsis "Authentication-related tools such as passwd, su, and login")
226 "Shadow provides a number of authentication-related tools, including:
227 login, passwd, su, groupadd, and useradd.")
229 ;; The `vipw' program is GPLv2+.
230 ;; libmisc/salt.c is public domain.
233 (define-public mingetty
239 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
243 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
244 (build-system gnu-build-system)
246 `(#:phases (alist-replace 'configure
247 (lambda* (#:key inputs outputs
249 (let* ((out (assoc-ref outputs "out"))
251 out "/share/man/man8"))
252 (sbin (string-append out "/sbin"))
253 (shadow (assoc-ref inputs "shadow"))
254 (login (string-append shadow
256 (substitute* "Makefile"
258 (string-append "SBINDIR = " out
261 (string-append "MANDIR = " out
262 "/share/man/man8\n")))
264 ;; Pick the right 'login' by default.
265 (substitute* "mingetty.c"
267 (string-append "\"" login "\"")))
272 #:tests? #f)) ; no tests
273 (inputs `(("shadow" ,shadow)))
275 (home-page "http://sourceforge.net/projects/mingetty")
276 (synopsis "Getty for the text console")
278 "Small console getty that is started on the Linux text console,
279 asks for a login name and then transfers over to 'login'. It is extended to
280 allow automatic login and starting any app.")
283 (define-public net-base
290 "mirror://debian/pool/main/n/netbase/netbase_"
294 "01rkvqrg7krkx8b432nz6bpi8w3s4cm5q5r891k23cdrc9nsaayn"))))
295 (build-system trivial-build-system)
297 `(#:modules ((guix build utils))
299 (use-modules (guix build utils)
302 (let* ((source (assoc-ref %build-inputs "source"))
303 (tar (assoc-ref %build-inputs "tar"))
304 (gzip (assoc-ref %build-inputs "gzip"))
305 (output (assoc-ref %outputs "out"))
306 (etc (string-append output "/etc")))
307 (setenv "PATH" (string-append gzip "/bin"))
308 (system* (string-append tar "/bin/tar") "xvf"
310 (chdir ,(string-append "netbase-" version))
313 '("etc-services" "etc-protocols" "etc-rpc")
314 (map (cut string-append etc "/" <>)
315 '("services" "protocols" "rpc")))
317 (native-inputs `(("tar" ,tar)
319 (synopsis "IANA protocol, port, and RPC number assignments")
321 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
322 files, which contain information about the IANA-assigned port, protocol, and
324 (home-page "http://packages.debian.org/sid/netbase")
327 (define-public netcat
333 (uri (string-append "mirror://sourceforge/netcat/netcat-"
337 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
338 (build-system gnu-build-system)
341 ;; By default, man and info pages are put in PREFIX/{man,info},
342 ;; but we want them in PREFIX/share/{man,info}.
343 (let ((out (assoc-ref %outputs "out")))
344 (list (string-append "--mandir=" out "/share/man")
345 (string-append "--infodir=" out "/share/info")))))
346 (home-page "http://netcat.sourceforge.net")
347 (synopsis "Read and write data over TCP/IP")
349 "Netcat is a featured networking utility which reads and writes data
350 across network connections, using the TCP/IP protocol. It is designed to be a
351 reliable \"back-end\" tool that can be used directly or easily driven by other
352 programs and scripts. At the same time, it is a feature-rich network debugging
353 and exploration tool, since it can create almost any kind of connection you
354 would need and has several interesting built-in capabilities.")
363 (uri (string-append "mirror://gnu/alive/alive-"
367 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
368 (build-system gnu-build-system)
369 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
370 (inputs `(("guile" ,guile-2.0)
371 ("inetutils" ,inetutils)))
372 (home-page "http://www.gnu.org/software/alive/")
373 (synopsis "Autologin and keep-alive daemon")
375 "GNU Alive sends periodic pings to a server, generally to keep a
379 (define-public isc-dhcp
385 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
386 version "/dhcp-" version ".tar.gz"))
389 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
390 (build-system gnu-build-system)
392 '(#:phases (alist-cons-after
393 'configure 'post-configure
394 (lambda* (#:key outputs #:allow-other-keys)
395 ;; Point to the right client script, which will be
396 ;; installed in a later phase.
397 (substitute* "includes/dhcpd.h"
398 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
399 (let ((out (assoc-ref outputs "out")))
400 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
401 out "/libexec/dhclient-script"
404 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
405 ;; we must patch shebangs in there and make sure the right
407 (with-directory-excursion "bind"
408 (substitute* "Makefile"
410 (let ((sh (which "sh")))
411 (string-append "./configure CONFIG_SHELL="
414 (system* "tar" "xf" "bind.tar.gz")
415 (for-each patch-shebang
416 (find-files "bind-9.9.5" ".*"))
417 (zero? (system* "tar" "cf" "bind.tar.gz"
420 'install 'post-install
421 (lambda* (#:key inputs outputs #:allow-other-keys)
422 ;; Install the dhclient script for GNU/Linux and make sure
423 ;; if finds all the programs it needs.
424 (let* ((out (assoc-ref outputs "out"))
425 (libexec (string-append out "/libexec"))
426 (coreutils (assoc-ref inputs "coreutils"))
427 (net-tools (assoc-ref inputs "net-tools"))
428 (sed (assoc-ref inputs "sed")))
429 (substitute* "client/scripts/linux"
431 (string-append (assoc-ref inputs "iproute")
435 (copy-file "client/scripts/linux"
436 (string-append libexec "/dhclient-script"))
438 (wrap-program (string-append libexec "/dhclient-script")
441 (string-append dir "/bin:"
443 (list net-tools coreutils sed))))))
446 (native-inputs `(("perl" ,perl)))
448 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
449 (inputs `(("coreutils" ,coreutils)
451 ("net-tools" ,net-tools)
452 ("iproute" ,iproute)))
454 (home-page "http://www.isc.org/products/DHCP/")
455 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
457 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
458 reference implementation of all aspects of DHCP, through a suite of DHCP
459 tools: server, client, and relay agent.")
462 (define-public libpcap
468 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
472 "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs"))))
473 (build-system gnu-build-system)
474 (native-inputs `(("bison" ,bison) ("flex" ,flex)))
475 (arguments '(#:tests? #f)) ; no 'check' target
476 (home-page "http://www.tcpdump.org")
477 (synopsis "Network packet capture library")
479 "libpcap is an interface for user-level packet capture. It provides a
480 portable framework for low-level network monitoring. Applications include
481 network statistics collection, security monitoring, network debugging, etc.")
483 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
486 (define-public tcpdump
492 (uri (string-append "http://www.tcpdump.org/release/tcpdump-"
496 "15hb7zkzd66nag102qbv100hcnf7frglbkylmr8adwr8f5jkkaql"))))
497 (build-system gnu-build-system)
498 (inputs `(("libpcap" ,libpcap)
499 ("openssl" ,o:openssl)))
500 (native-inputs `(("perl" ,perl))) ; for tests
501 (home-page "http://www.tcpdump.org/")
502 (synopsis "Network packet analyzer")
504 "Tcpdump is a command-line tool to analyze network traffic passing
505 through the network interface controller.")
508 (define-public jnettop
514 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
518 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
519 (build-system gnu-build-system)
521 `(("pkg-config" ,pkg-config)))
525 ("libpcap" ,libpcap)))
526 (home-page "http://jnettop.kubs.info/")
527 (synopsis "Visualize network traffic by bandwidth use")
529 "Jnettop is a traffic visualiser, which captures traffic going
530 through the host it is running from and displays streams sorted
531 by bandwidth they use.")
534 (define-public clusterssh
540 (uri (string-append "mirror://sourceforge/clusterssh/"
541 "clusterssh-" version ".tar.gz"))
544 "1bwggpvaj2al5blg1ynapviv2kpydffpzq2zkhi81najnvzc1rr7"))))
545 (build-system gnu-build-system)
546 (inputs `(("perl" ,perl)))
547 (propagated-inputs `(("xterm" ,xterm)
549 ("perl-x11-protocol" ,perl-x11-protocol)))
553 'install 'set-load-paths
554 (lambda* (#:key inputs outputs #:allow-other-keys)
555 ;; Put the perl-tk and perl-x11-protocol modules in the perl inc
557 (let* ((out (assoc-ref outputs "out"))
558 (prog (string-append out "/bin/cssh"))
559 (perl-ver ,(package-version perl))
560 (x11-inc (string-append
561 (assoc-ref inputs "perl-x11-protocol")
562 "/lib/perl5/site_perl/" perl-ver))
563 (tk-inc (string-append
564 (assoc-ref inputs "perl-tk")
565 "/lib/perl5/site_perl/" perl-ver
569 `("PERL5LIB" ":" prefix (,x11-inc ,tk-inc)))))
571 ;; The clusterssh.sourceforge.net address requires login to view
572 (home-page "http://sourceforge.net/projects/clusterssh/")
573 (synopsis "Secure concurrent multi-server terminal control")
575 "ClusterSSH controls a number of xterm windows via a single graphical
576 console window to allow commands to be interactively run on multiple servers
577 over ssh connections.")
580 (define-public rottlog
586 (uri (string-append "mirror://gnu/rottlog/rottlog-"
590 "0751mb9l2f0jrk3vj6q8ilanifd121dliwk0c34g8k0dlzsv3kd7"))
591 (modules '((guix build utils)))
593 '(substitute* "Makefile.in"
594 (("-o \\$\\{LOG_OWN\\} -g \\$\\{LOG_GROUP\\}")
595 ;; Don't try to chown root.
597 (("mkdir -p \\$\\(ROTT_STATDIR\\)")
598 ;; Don't attempt to create /var/lib/rottlog.
600 (build-system gnu-build-system)
602 '(#:configure-flags (list (string-append "ROTT_ETCDIR="
603 (assoc-ref %outputs "out")
605 "--localstatedir=/var")
606 #:phases (alist-cons-after
607 'install 'install-info
609 (zero? (system* "make" "install-info")))
611 (native-inputs `(("texinfo" ,texinfo)
612 ("util-linux" ,util-linux))) ; for 'cal'
613 (home-page "http://www.gnu.org/software/rottlog/")
614 (synopsis "Log rotation and management")
616 "GNU Rot[t]log is a program for managing log files. It is used to
617 automatically rotate out log files when they have reached a given size or
618 according to a given schedule. It can also be used to automatically compress
619 and archive such logs. Rot[t]log will mail reports of its activity to the
620 system administrator.")