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 linux)
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages perl)
34 #:use-module ((gnu packages base)
36 #:use-module ((gnu packages compression)
38 #:use-module (gnu packages pkg-config))
46 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
50 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
51 (patches (list (search-patch "dmd-getpw.patch")))))
52 (build-system gnu-build-system)
54 '(#:configure-flags '("--localstatedir=/var")))
55 (native-inputs `(("pkg-config" ,pkg-config)))
56 (inputs `(("guile" ,guile-2.0)))
57 (synopsis "Daemon managing daemons")
59 "GNU DMD is a daemon-managing daemon, meaning that it manages the
60 execution of system services, replacing similar functionality found in
61 typical init systems. It provides dependency-handling through a convenient
62 interface and is based on GNU Guile.")
64 (home-page "http://www.gnu.org/software/dmd/")))
74 "http://projects.gw-computing.net/attachments/download/78/dfc-"
78 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
79 (build-system cmake-build-system)
80 (arguments '(#:tests? #f)) ; There are no tests.
81 (native-inputs `(("gettext" ,gnu-gettext)))
82 (home-page "http://projects.gw-computing.net/projects/dfc")
83 (synopsis "Display file system space usage using graphs and colors")
85 "dfc (df color) is a modern version of df. It uses colors, draws pretty
86 graphs and can export its output to different formats.")
95 (uri (string-append "mirror://sourceforge/htop/"
96 version "/htop-" version ".tar.gz"))
99 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
100 (build-system gnu-build-system)
102 `(("ncurses" ,ncurses)))
103 (home-page "http://htop.sourceforge.net/")
104 (synopsis "Interactive process viewer")
106 "This is htop, an interactive process viewer. It is a text-mode
107 application (for console or X terminals) and requires ncurses.")
117 (uri (string-append "mirror://gnu/pies/pies-"
121 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
122 (build-system gnu-build-system)
123 (home-page "http://www.gnu.org/software/pies/")
124 (synopsis "Program invocation and execution supervisor")
126 "GNU pies is a program that supervises the invocation and execution of
127 other programs. It reads the list of programs to be started from its
128 configuration file, executes them, and then monitors their status,
129 re-executing them as necessary.")
132 (define-public inetutils
138 (uri (string-append "mirror://gnu/inetutils/inetutils-"
142 "0azzg6njgq79byl6960kb0wihfhhzf49snslhxgvi30ribgfpa82"))
144 (list (search-patch "diffutils-gets-undeclared.patch")))))
145 (build-system gnu-build-system)
146 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
147 ;; which is currently missing.
149 (inputs `(("ncurses" ,ncurses)))
150 (home-page "http://www.gnu.org/software/inetutils/")
151 (synopsis "Basic networking utilities")
153 "Inetutils is a collection of common network programs, such as an ftp
154 client and server, a telnet client and server, and an rsh client and server.")
157 (define-public shadow
164 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
168 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
169 (build-system gnu-build-system)
171 '(;; Assume System V `setpgrp (void)', which is the default on GNU
172 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
173 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
175 #:phases (alist-cons-before
176 'build 'set-nscd-file-name
177 (lambda* (#:key inputs #:allow-other-keys)
178 ;; Use the right file name for nscd.
179 (let ((libc (assoc-ref inputs "libc")))
180 (substitute* "lib/nscd.c"
182 (string-append libc "/sbin/nscd")))))
184 'install 'remove-groups
185 (lambda* (#:key outputs #:allow-other-keys)
186 ;; Remove `groups', which is already provided by Coreutils.
187 (let* ((out (assoc-ref outputs "out"))
188 (bin (string-append out "/bin"))
189 (man (string-append out "/share/man/man1")))
190 (delete-file (string-append bin "/groups"))
191 (for-each delete-file (find-files man "^groups\\."))
195 (inputs (if (string-suffix? "-linux"
196 (or (%current-target-system)
198 `(("linux-pam" ,linux-pam))
200 (home-page "http://pkg-shadow.alioth.debian.org/")
201 (synopsis "Authentication-related tools such as passwd, su, and login")
203 "Shadow provides a number of authentication-related tools, including:
204 login, passwd, su, groupadd, and useradd.")
206 ;; The `vipw' program is GPLv2+.
207 ;; libmisc/salt.c is public domain.
210 (define-public mingetty
216 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
220 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
221 (build-system gnu-build-system)
223 `(#:phases (alist-replace 'configure
224 (lambda* (#:key inputs outputs
226 (let* ((out (assoc-ref outputs "out"))
228 out "/share/man/man8"))
229 (sbin (string-append out "/sbin"))
230 (shadow (assoc-ref inputs "shadow"))
231 (login (string-append shadow
233 (substitute* "Makefile"
235 (string-append "SBINDIR = " out
238 (string-append "MANDIR = " out
239 "/share/man/man8\n")))
241 ;; Pick the right 'login' by default.
242 (substitute* "mingetty.c"
244 (string-append "\"" login "\"")))
249 #:tests? #f)) ; no tests
250 (inputs `(("shadow" ,shadow)))
252 (home-page "http://sourceforge.net/projects/mingetty")
253 (synopsis "Getty for the text console")
255 "Small console getty that is started on the Linux text console,
256 asks for a login name and then transfers over to 'login'. It is extended to
257 allow automatic login and starting any app.")
260 (define-public net-base
267 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
271 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
272 (build-system trivial-build-system)
274 `(#:modules ((guix build utils))
276 (use-modules (guix build utils)
279 (let* ((source (assoc-ref %build-inputs "source"))
280 (tar (assoc-ref %build-inputs "tar"))
281 (gzip (assoc-ref %build-inputs "gzip"))
282 (output (assoc-ref %outputs "out"))
283 (etc (string-append output "/etc")))
284 (setenv "PATH" (string-append gzip "/bin"))
285 (system* (string-append tar "/bin/tar") "xvf"
287 (chdir ,(string-append "netbase-" version))
290 '("etc-services" "etc-protocols" "etc-rpc")
291 (map (cut string-append etc "/" <>)
292 '("services" "protocols" "rpc")))
294 (native-inputs `(("tar" ,tar)
296 (synopsis "IANA protocol, port, and RPC number assignments")
298 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
299 files, which contain information about the IANA-assigned port, protocol, and
301 (home-page "http://packages.debian.org/sid/netbase")
304 (define-public netcat
310 (uri (string-append "mirror://sourceforge/netcat/netcat-"
314 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
315 (build-system gnu-build-system)
316 (home-page "http://netcat.sourceforge.net")
317 (synopsis "Read and write data over TCP/IP")
319 "Netcat is a featured networking utility which reads and writes data
320 across network connections, using the TCP/IP protocol. It is designed to be a
321 reliable \"back-end\" tool that can be used directly or easily driven by other
322 programs and scripts. At the same time, it is a feature-rich network debugging
323 and exploration tool, since it can create almost any kind of connection you
324 would need and has several interesting built-in capabilities.")
333 (uri (string-append "mirror://gnu/alive/alive-"
337 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
338 (build-system gnu-build-system)
339 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
340 (inputs `(("guile" ,guile-2.0)
341 ("inetutils" ,inetutils)))
342 (home-page "http://www.gnu.org/software/alive/")
343 (synopsis "Autologin and keep-alive daemon")
345 "GNU Alive sends periodic pings to a server, generally to keep a
349 (define-public isc-dhcp
355 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
356 version "/dhcp-" version ".tar.gz"))
359 "0001n26m4488nl95h53wg60sywbli4d246vz2h8lpv70jlrq9q1p"))))
360 (build-system gnu-build-system)
362 '(#:phases (alist-cons-after
363 'configure 'post-configure
364 (lambda* (#:key outputs #:allow-other-keys)
365 ;; Point to the right client script, which will be
366 ;; installed in a later phase.
367 (substitute* "includes/dhcpd.h"
368 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
369 (let ((out (assoc-ref outputs "out")))
370 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
371 out "/libexec/dhclient-script"
374 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
375 ;; we must patch shebangs in there and make sure the right
377 (with-directory-excursion "bind"
378 (substitute* "Makefile"
380 (let ((sh (which "sh")))
381 (string-append "./configure CONFIG_SHELL="
384 (system* "tar" "xf" "bind.tar.gz")
385 (for-each patch-shebang
386 (find-files "bind-9.9.5b1" ".*"))
387 (zero? (system* "tar" "cf" "bind.tar.gz"
390 'install 'post-install
391 (lambda* (#:key inputs outputs #:allow-other-keys)
392 ;; Install the dhclient script for GNU/Linux and make sure
393 ;; if finds all the programs it needs.
394 (let* ((out (assoc-ref outputs "out"))
395 (libexec (string-append out "/libexec"))
396 (coreutils (assoc-ref inputs "coreutils"))
397 (net-tools (assoc-ref inputs "net-tools"))
398 (sed (assoc-ref inputs "sed")))
399 (substitute* "client/scripts/linux"
401 (string-append (assoc-ref inputs "iproute")
405 (copy-file "client/scripts/linux"
406 (string-append libexec "/dhclient-script"))
408 (wrap-program (string-append libexec "/dhclient-script")
411 (string-append dir "/bin:"
413 (list net-tools coreutils sed))))))
416 (native-inputs `(("perl" ,perl)))
418 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
419 (inputs `(("coreutils" ,coreutils)
421 ("net-tools" ,net-tools)
422 ("iproute" ,iproute)))
424 (home-page "http://www.isc.org/products/DHCP/")
425 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
427 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
428 reference implementation of all aspects of DHCP, through a suite of DHCP
429 tools: server, client, and relay agent.")
430 (license (bsd-style "http://www.isc.org/sw/dhcp/dhcp-copyright.php"))))