gnu: Rename (gnu packages system) to (gnu packages admin).
[jackhill/guix/guix.git] / gnu / packages / admin.scm
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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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.
11 ;;;
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.
16 ;;;
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/>.
19
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)
35 #:select (tar))
36 #:use-module ((gnu packages compression)
37 #:select (gzip))
38 #:use-module (gnu packages pkg-config))
39
40 (define-public dmd
41 (package
42 (name "dmd")
43 (version "0.1")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
47 version ".tar.gz"))
48 (sha256
49 (base32
50 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
51 (patches (list (search-patch "dmd-getpw.patch")))))
52 (build-system gnu-build-system)
53 (arguments
54 '(#:configure-flags '("--localstatedir=/var")))
55 (native-inputs `(("pkg-config" ,pkg-config)))
56 (inputs `(("guile" ,guile-2.0)))
57 (synopsis "Daemon managing daemons")
58 (description
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.")
63 (license gpl3+)
64 (home-page "http://www.gnu.org/software/dmd/")))
65
66 (define-public dfc
67 (package
68 (name "dfc")
69 (version "3.0.3")
70 (source
71 (origin
72 (method url-fetch)
73 (uri (string-append
74 "http://projects.gw-computing.net/attachments/download/78/dfc-"
75 version ".tar.gz"))
76 (sha256
77 (base32
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")
84 (description
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.")
87 (license bsd-3)))
88
89 (define-public htop
90 (package
91 (name "htop")
92 (version "1.0.2")
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "mirror://sourceforge/htop/"
96 version "/htop-" version ".tar.gz"))
97 (sha256
98 (base32
99 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
100 (build-system gnu-build-system)
101 (inputs
102 `(("ncurses" ,ncurses)))
103 (home-page "http://htop.sourceforge.net/")
104 (synopsis "Interactive process viewer")
105 (description
106 "This is htop, an interactive process viewer. It is a text-mode
107 application (for console or X terminals) and requires ncurses.")
108 (license gpl2)))
109
110 (define-public pies
111 (package
112 (name "pies")
113 (version "1.2")
114 (source
115 (origin
116 (method url-fetch)
117 (uri (string-append "mirror://gnu/pies/pies-"
118 version ".tar.bz2"))
119 (sha256
120 (base32
121 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
122 (build-system gnu-build-system)
123 (home-page "http://www.gnu.org/software/pies/")
124 (synopsis "Program invocation and execution supervisor")
125 (description
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.")
130 (license gpl3+)))
131
132 (define-public inetutils
133 (package
134 (name "inetutils")
135 (version "1.9.1")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://gnu/inetutils/inetutils-"
139 version ".tar.gz"))
140 (sha256
141 (base32
142 "0azzg6njgq79byl6960kb0wihfhhzf49snslhxgvi30ribgfpa82"))
143 (patches
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.
148 #:tests? #f))
149 (inputs `(("ncurses" ,ncurses)))
150 (home-page "http://www.gnu.org/software/inetutils/")
151 (synopsis "Basic networking utilities")
152 (description
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.")
155 (license gpl3+)))
156
157 (define-public shadow
158 (package
159 (name "shadow")
160 (version "4.1.5.1")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append
164 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
165 version ".tar.bz2"))
166 (sha256
167 (base32
168 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
169 (build-system gnu-build-system)
170 (arguments
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")
174
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"
181 (("/usr/sbin/nscd")
182 (string-append libc "/sbin/nscd")))))
183 (alist-cons-after
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\\."))
192 #t))
193 %standard-phases))))
194
195 (inputs (if (string-suffix? "-linux"
196 (or (%current-target-system)
197 (%current-system)))
198 `(("linux-pam" ,linux-pam))
199 '()))
200 (home-page "http://pkg-shadow.alioth.debian.org/")
201 (synopsis "Authentication-related tools such as passwd, su, and login")
202 (description
203 "Shadow provides a number of authentication-related tools, including:
204 login, passwd, su, groupadd, and useradd.")
205
206 ;; The `vipw' program is GPLv2+.
207 ;; libmisc/salt.c is public domain.
208 (license bsd-3)))
209
210 (define-public mingetty
211 (package
212 (name "mingetty")
213 (version "1.08")
214 (source (origin
215 (method url-fetch)
216 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
217 version ".tar.gz"))
218 (sha256
219 (base32
220 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
221 (build-system gnu-build-system)
222 (arguments
223 `(#:phases (alist-replace 'configure
224 (lambda* (#:key inputs outputs
225 #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (man8 (string-append
228 out "/share/man/man8"))
229 (sbin (string-append out "/sbin"))
230 (shadow (assoc-ref inputs "shadow"))
231 (login (string-append shadow
232 "/bin/login")))
233 (substitute* "Makefile"
234 (("^SBINDIR.*")
235 (string-append "SBINDIR = " out
236 "/sbin\n"))
237 (("^MANDIR.*")
238 (string-append "MANDIR = " out
239 "/share/man/man8\n")))
240
241 ;; Pick the right 'login' by default.
242 (substitute* "mingetty.c"
243 (("\"/bin/login\"")
244 (string-append "\"" login "\"")))
245
246 (mkdir-p sbin)
247 (mkdir-p man8)))
248 %standard-phases)
249 #:tests? #f)) ; no tests
250 (inputs `(("shadow" ,shadow)))
251
252 (home-page "http://sourceforge.net/projects/mingetty")
253 (synopsis "Getty for the text console")
254 (description
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.")
258 (license gpl2+)))
259
260 (define-public net-base
261 (package
262 (name "net-base")
263 (version "5.1")
264 (source (origin
265 (method url-fetch)
266 (uri (string-append
267 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
268 version ".tar.gz"))
269 (sha256
270 (base32
271 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
272 (build-system trivial-build-system)
273 (arguments
274 `(#:modules ((guix build utils))
275 #:builder (begin
276 (use-modules (guix build utils)
277 (srfi srfi-26))
278
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"
286 source)
287 (chdir ,(string-append "netbase-" version))
288 (mkdir-p etc)
289 (for-each copy-file
290 '("etc-services" "etc-protocols" "etc-rpc")
291 (map (cut string-append etc "/" <>)
292 '("services" "protocols" "rpc")))
293 #t))))
294 (native-inputs `(("tar" ,tar)
295 ("gzip" ,gzip)))
296 (synopsis "IANA protocol, port, and RPC number assignments")
297 (description
298 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
299 files, which contain information about the IANA-assigned port, protocol, and
300 ONC RPC numbers")
301 (home-page "http://packages.debian.org/sid/netbase")
302 (license gpl2)))
303
304 (define-public netcat
305 (package
306 (name "netcat")
307 (version "0.7.1")
308 (source (origin
309 (method url-fetch)
310 (uri (string-append "mirror://sourceforge/netcat/netcat-"
311 version ".tar.bz2"))
312 (sha256
313 (base32
314 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
315 (build-system gnu-build-system)
316 (home-page "http://netcat.sourceforge.net")
317 (synopsis "Read and write data over TCP/IP")
318 (description
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.")
325 (license gpl2+)))
326
327 (define-public alive
328 (package
329 (name "alive")
330 (version "2.0.2")
331 (source (origin
332 (method url-fetch)
333 (uri (string-append "mirror://gnu/alive/alive-"
334 version ".tar.xz"))
335 (sha256
336 (base32
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")
344 (description
345 "GNU Alive sends periodic pings to a server, generally to keep a
346 connection alive.")
347 (license gpl3+)))
348
349 (define-public isc-dhcp
350 (package
351 (name "isc-dhcp")
352 (version "4.3.0a1")
353 (source (origin
354 (method url-fetch)
355 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
356 version "/dhcp-" version ".tar.gz"))
357 (sha256
358 (base32
359 "0001n26m4488nl95h53wg60sywbli4d246vz2h8lpv70jlrq9q1p"))))
360 (build-system gnu-build-system)
361 (arguments
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"
372 "\"\n"))))
373
374 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
375 ;; we must patch shebangs in there and make sure the right
376 ;; shell is used.
377 (with-directory-excursion "bind"
378 (substitute* "Makefile"
379 (("\\./configure")
380 (let ((sh (which "sh")))
381 (string-append "./configure CONFIG_SHELL="
382 sh " SHELL=" sh))))
383
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"
388 "bind-9.9.5b1"))))
389 (alist-cons-after
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"
400 (("/sbin/ip")
401 (string-append (assoc-ref inputs "iproute")
402 "/sbin/ip")))
403
404 (mkdir-p libexec)
405 (copy-file "client/scripts/linux"
406 (string-append libexec "/dhclient-script"))
407
408 (wrap-program (string-append libexec "/dhclient-script")
409 `("PATH" ":" prefix
410 ,(map (lambda (dir)
411 (string-append dir "/bin:"
412 dir "/sbin"))
413 (list net-tools coreutils sed))))))
414 %standard-phases))))
415
416 (native-inputs `(("perl" ,perl)))
417
418 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
419 (inputs `(("coreutils" ,coreutils)
420 ("sed" ,sed)
421 ("net-tools" ,net-tools)
422 ("iproute" ,iproute)))
423
424 (home-page "http://www.isc.org/products/DHCP/")
425 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
426 (description
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"))))