gnu: Python: use /nix/.../sh instead of /bin/sh in the subprocess module
[jackhill/guix/guix.git] / gnu / packages / admin.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
c73d4c92 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
340c7033 3;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
0e4e89c2 4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
1df895b0 5;;;
233e7676 6;;; This file is part of GNU Guix.
1df895b0 7;;;
233e7676 8;;; GNU Guix is free software; you can redistribute it and/or modify it
1df895b0
LC
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.
12;;;
233e7676 13;;; GNU Guix is distributed in the hope that it will be useful, but
1df895b0
LC
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.
17;;;
18;;; You should have received a copy of the GNU General Public License
233e7676 19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1df895b0 20
4aeea896 21(define-module (gnu packages admin)
4a44e743 22 #:use-module (guix licenses)
1df895b0
LC
23 #:use-module (guix packages)
24 #:use-module (guix download)
fbc1a58f 25 #:use-module (guix build-system cmake)
1df895b0 26 #:use-module (guix build-system gnu)
c773aba8 27 #:use-module (guix build-system trivial)
59a43334 28 #:use-module (gnu packages)
c73d4c92 29 #:use-module (gnu packages base)
9a9e72d5 30 #:use-module (gnu packages ncurses)
9927622f 31 #:use-module (gnu packages readline)
f15164e7
LC
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages guile)
1dba6407 34 #:use-module (gnu packages gettext)
c73d4c92 35 #:use-module (gnu packages perl)
c773aba8
LC
36 #:use-module ((gnu packages base)
37 #:select (tar))
38 #:use-module ((gnu packages compression)
39 #:select (gzip))
02c86a5e
LC
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages flex)
42 #:use-module (gnu packages glib)
f15164e7
LC
43 #:use-module (gnu packages pkg-config))
44
45(define-public dmd
46 (package
47 (name "dmd")
2941448e 48 (version "0.1")
f15164e7
LC
49 (source (origin
50 (method url-fetch)
d0821398
LC
51 (uri (string-append "ftp://alpha.gnu.org/gnu/dmd/dmd-"
52 version ".tar.gz"))
f15164e7
LC
53 (sha256
54 (base32
9b0ac802 55 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg"))
436c95d9
MW
56 (patches (list (search-patch "dmd-getpw.patch")
57 (search-patch "dmd-tests-longer-sleeps.patch")))))
f15164e7
LC
58 (build-system gnu-build-system)
59 (arguments
60 '(#:configure-flags '("--localstatedir=/var")))
2941448e
LC
61 (native-inputs `(("pkg-config" ,pkg-config)))
62 (inputs `(("guile" ,guile-2.0)))
f15164e7 63 (synopsis "Daemon managing daemons")
a22dc0c4 64 (description
79c311b8
LC
65 "GNU DMD is a daemon-managing daemon, meaning that it manages the
66execution of system services, replacing similar functionality found in
67typical init systems. It provides dependency-handling through a convenient
68interface and is based on GNU Guile.")
f15164e7
LC
69 (license gpl3+)
70 (home-page "http://www.gnu.org/software/dmd/")))
1df895b0 71
fbc1a58f
CR
72(define-public dfc
73 (package
74 (name "dfc")
75 (version "3.0.3")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (string-append
80 "http://projects.gw-computing.net/attachments/download/78/dfc-"
81 version ".tar.gz"))
82 (sha256
83 (base32
84 "1b4hfqv23l87cb37fxwzfk2sgspkyxpr3ig2hsd23hr6mm982j7z"))))
85 (build-system cmake-build-system)
86 (arguments '(#:tests? #f)) ; There are no tests.
1dba6407 87 (native-inputs `(("gettext" ,gnu-gettext)))
fbc1a58f
CR
88 (home-page "http://projects.gw-computing.net/projects/dfc")
89 (synopsis "Display file system space usage using graphs and colors")
90 (description
91 "dfc (df color) is a modern version of df. It uses colors, draws pretty
92graphs and can export its output to different formats.")
93 (license bsd-3)))
94
340c7033
CR
95(define-public htop
96 (package
97 (name "htop")
98 (version "1.0.2")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "mirror://sourceforge/htop/"
102 version "/htop-" version ".tar.gz"))
103 (sha256
104 (base32
105 "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f"))))
106 (build-system gnu-build-system)
107 (inputs
108 `(("ncurses" ,ncurses)))
109 (home-page "http://htop.sourceforge.net/")
110 (synopsis "Interactive process viewer")
111 (description
112 "This is htop, an interactive process viewer. It is a text-mode
113application (for console or X terminals) and requires ncurses.")
114 (license gpl2)))
115
1df895b0
LC
116(define-public pies
117 (package
118 (name "pies")
119 (version "1.2")
120 (source
121 (origin
122 (method url-fetch)
123 (uri (string-append "mirror://gnu/pies/pies-"
124 version ".tar.bz2"))
125 (sha256
126 (base32
127 "18w0dbg77i56cx1bwa789w0qi3l4xkkbascxcv2b6gbm0zmjg1g6"))))
128 (build-system gnu-build-system)
129 (home-page "http://www.gnu.org/software/pies/")
f50d2669 130 (synopsis "Program invocation and execution supervisor")
1df895b0 131 (description
79c311b8 132 "GNU pies is a program that supervises the invocation and execution of
a22dc0c4
LC
133other programs. It reads the list of programs to be started from its
134configuration file, executes them, and then monitors their status,
135re-executing them as necessary.")
4a44e743 136 (license gpl3+)))
1df895b0
LC
137
138(define-public inetutils
139 (package
140 (name "inetutils")
9927622f 141 (version "1.9.2")
01eafd38
LC
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://gnu/inetutils/inetutils-"
145 version ".tar.gz"))
146 (sha256
147 (base32
9927622f 148 "04wrm0v7l4890mmbaawd6wjwdv08bkglgqhpz0q4dkb0l50fl8q4"))))
1df895b0 149 (build-system gnu-build-system)
01eafd38 150 (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux,
1df895b0
LC
151 ;; which is currently missing.
152 #:tests? #f))
9927622f
LC
153 (inputs `(("ncurses" ,ncurses)
154 ("readline" ,readline))) ; for 'ftp'
1df895b0 155 (home-page "http://www.gnu.org/software/inetutils/")
f50d2669 156 (synopsis "Basic networking utilities")
1df895b0 157 (description
a22dc0c4
LC
158 "Inetutils is a collection of common network programs, such as an ftp
159client and server, a telnet client and server, and an rsh client and server.")
4a44e743 160 (license gpl3+)))
9a9e72d5
LC
161
162(define-public shadow
163 (package
164 (name "shadow")
165 (version "4.1.5.1")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append
169 "http://pkg-shadow.alioth.debian.org/releases/shadow-"
170 version ".tar.bz2"))
171 (sha256
172 (base32
173 "1yvqx57vzih0jdy3grir8vfbkxp0cl0myql37bnmi2yn90vk6cma"))))
174 (build-system gnu-build-system)
175 (arguments
176 '(;; Assume System V `setpgrp (void)', which is the default on GNU
177 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
178 #:configure-flags '("--with-libpam" "ac_cv_func_setpgrp_void=yes")
179
180 #:phases (alist-cons-before
181 'build 'set-nscd-file-name
182 (lambda* (#:key inputs #:allow-other-keys)
183 ;; Use the right file name for nscd.
184 (let ((libc (assoc-ref inputs "libc")))
185 (substitute* "lib/nscd.c"
186 (("/usr/sbin/nscd")
187 (string-append libc "/sbin/nscd")))))
188 (alist-cons-after
189 'install 'remove-groups
190 (lambda* (#:key outputs #:allow-other-keys)
191 ;; Remove `groups', which is already provided by Coreutils.
192 (let* ((out (assoc-ref outputs "out"))
193 (bin (string-append out "/bin"))
194 (man (string-append out "/share/man/man1")))
195 (delete-file (string-append bin "/groups"))
196 (for-each delete-file (find-files man "^groups\\."))
197 #t))
198 %standard-phases))))
199
200 (inputs (if (string-suffix? "-linux"
201 (or (%current-target-system)
202 (%current-system)))
203 `(("linux-pam" ,linux-pam))
204 '()))
205 (home-page "http://pkg-shadow.alioth.debian.org/")
206 (synopsis "Authentication-related tools such as passwd, su, and login")
207 (description
208 "Shadow provides a number of authentication-related tools, including:
209login, passwd, su, groupadd, and useradd.")
210
211 ;; The `vipw' program is GPLv2+.
212 ;; libmisc/salt.c is public domain.
213 (license bsd-3)))
1e151896
LC
214
215(define-public mingetty
216 (package
217 (name "mingetty")
218 (version "1.08")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "mirror://sourceforge/mingetty/mingetty-"
222 version ".tar.gz"))
223 (sha256
224 (base32
225 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
226 (build-system gnu-build-system)
227 (arguments
228 `(#:phases (alist-replace 'configure
229 (lambda* (#:key inputs outputs
230 #:allow-other-keys)
231 (let* ((out (assoc-ref outputs "out"))
232 (man8 (string-append
233 out "/share/man/man8"))
234 (sbin (string-append out "/sbin"))
235 (shadow (assoc-ref inputs "shadow"))
236 (login (string-append shadow
237 "/bin/login")))
238 (substitute* "Makefile"
239 (("^SBINDIR.*")
240 (string-append "SBINDIR = " out
241 "/sbin\n"))
242 (("^MANDIR.*")
243 (string-append "MANDIR = " out
244 "/share/man/man8\n")))
245
246 ;; Pick the right 'login' by default.
247 (substitute* "mingetty.c"
248 (("\"/bin/login\"")
249 (string-append "\"" login "\"")))
250
251 (mkdir-p sbin)
252 (mkdir-p man8)))
253 %standard-phases)
254 #:tests? #f)) ; no tests
255 (inputs `(("shadow" ,shadow)))
256
257 (home-page "http://sourceforge.net/projects/mingetty")
258 (synopsis "Getty for the text console")
259 (description
260 "Small console getty that is started on the Linux text console,
261asks for a login name and then transfers over to 'login'. It is extended to
262allow automatic login and starting any app.")
263 (license gpl2+)))
c773aba8
LC
264
265(define-public net-base
266 (package
267 (name "net-base")
268 (version "5.1")
269 (source (origin
270 (method url-fetch)
271 (uri (string-append
272 "http://ftp.de.debian.org/debian/pool/main/n/netbase/netbase_"
273 version ".tar.gz"))
274 (sha256
275 (base32
276 "17l8xk2x632id5f9x9v5fs9wqc650hldd2lf3dh90r1zisj1ya8d"))))
277 (build-system trivial-build-system)
278 (arguments
279 `(#:modules ((guix build utils))
280 #:builder (begin
281 (use-modules (guix build utils)
282 (srfi srfi-26))
283
284 (let* ((source (assoc-ref %build-inputs "source"))
285 (tar (assoc-ref %build-inputs "tar"))
286 (gzip (assoc-ref %build-inputs "gzip"))
287 (output (assoc-ref %outputs "out"))
288 (etc (string-append output "/etc")))
289 (setenv "PATH" (string-append gzip "/bin"))
290 (system* (string-append tar "/bin/tar") "xvf"
291 source)
292 (chdir ,(string-append "netbase-" version))
293 (mkdir-p etc)
294 (for-each copy-file
295 '("etc-services" "etc-protocols" "etc-rpc")
296 (map (cut string-append etc "/" <>)
297 '("services" "protocols" "rpc")))
298 #t))))
299 (native-inputs `(("tar" ,tar)
300 ("gzip" ,gzip)))
301 (synopsis "IANA protocol, port, and RPC number assignments")
302 (description
303 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
304files, which contain information about the IANA-assigned port, protocol, and
305ONC RPC numbers")
306 (home-page "http://packages.debian.org/sid/netbase")
307 (license gpl2)))
94c4a58a
LC
308
309(define-public netcat
310 (package
311 (name "netcat")
312 (version "0.7.1")
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "mirror://sourceforge/netcat/netcat-"
316 version ".tar.bz2"))
317 (sha256
318 (base32
319 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
320 (build-system gnu-build-system)
0e4e89c2
MW
321 (arguments
322 `(#:configure-flags
323 ;; By default, man and info pages are put in PREFIX/{man,info},
324 ;; but we want them in PREFIX/share/{man,info}.
325 (let ((out (assoc-ref %outputs "out")))
326 (list (string-append "--mandir=" out "/share/man")
327 (string-append "--infodir=" out "/share/info")))))
94c4a58a
LC
328 (home-page "http://netcat.sourceforge.net")
329 (synopsis "Read and write data over TCP/IP")
330 (description
331 "Netcat is a featured networking utility which reads and writes data
332across network connections, using the TCP/IP protocol. It is designed to be a
333reliable \"back-end\" tool that can be used directly or easily driven by other
334programs and scripts. At the same time, it is a feature-rich network debugging
335and exploration tool, since it can create almost any kind of connection you
336would need and has several interesting built-in capabilities.")
337 (license gpl2+)))
d038cac1
LC
338
339(define-public alive
340 (package
341 (name "alive")
342 (version "2.0.2")
343 (source (origin
344 (method url-fetch)
345 (uri (string-append "mirror://gnu/alive/alive-"
346 version ".tar.xz"))
347 (sha256
348 (base32
349 "1vrzg51ai68x9yld7vbgl58sxaw5qpx8rbakwcxn4cqq6vpxj38j"))))
350 (build-system gnu-build-system)
351 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
352 (inputs `(("guile" ,guile-2.0)
353 ("inetutils" ,inetutils)))
354 (home-page "http://www.gnu.org/software/alive/")
355 (synopsis "Autologin and keep-alive daemon")
356 (description
357 "GNU Alive sends periodic pings to a server, generally to keep a
358connection alive.")
359 (license gpl3+)))
c73d4c92
LC
360
361(define-public isc-dhcp
362 (package
363 (name "isc-dhcp")
9e5ace9d 364 (version "4.3.0")
c73d4c92
LC
365 (source (origin
366 (method url-fetch)
367 (uri (string-append "http://ftp.isc.org/isc/dhcp/"
368 version "/dhcp-" version ".tar.gz"))
369 (sha256
370 (base32
9e5ace9d 371 "12mydvj6x3zcl3gla06bywfkkrgg03g66fijs94mwb7kbiym3dm7"))))
c73d4c92
LC
372 (build-system gnu-build-system)
373 (arguments
374 '(#:phases (alist-cons-after
375 'configure 'post-configure
376 (lambda* (#:key outputs #:allow-other-keys)
377 ;; Point to the right client script, which will be
378 ;; installed in a later phase.
379 (substitute* "includes/dhcpd.h"
380 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
381 (let ((out (assoc-ref outputs "out")))
382 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
383 out "/libexec/dhclient-script"
384 "\"\n"))))
385
386 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
387 ;; we must patch shebangs in there and make sure the right
388 ;; shell is used.
389 (with-directory-excursion "bind"
390 (substitute* "Makefile"
391 (("\\./configure")
392 (let ((sh (which "sh")))
393 (string-append "./configure CONFIG_SHELL="
394 sh " SHELL=" sh))))
395
396 (system* "tar" "xf" "bind.tar.gz")
397 (for-each patch-shebang
9e5ace9d 398 (find-files "bind-9.9.5" ".*"))
c73d4c92 399 (zero? (system* "tar" "cf" "bind.tar.gz"
9e5ace9d 400 "bind-9.9.5"))))
c73d4c92
LC
401 (alist-cons-after
402 'install 'post-install
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 ;; Install the dhclient script for GNU/Linux and make sure
405 ;; if finds all the programs it needs.
406 (let* ((out (assoc-ref outputs "out"))
407 (libexec (string-append out "/libexec"))
408 (coreutils (assoc-ref inputs "coreutils"))
409 (net-tools (assoc-ref inputs "net-tools"))
410 (sed (assoc-ref inputs "sed")))
411 (substitute* "client/scripts/linux"
412 (("/sbin/ip")
413 (string-append (assoc-ref inputs "iproute")
414 "/sbin/ip")))
415
416 (mkdir-p libexec)
417 (copy-file "client/scripts/linux"
418 (string-append libexec "/dhclient-script"))
419
420 (wrap-program (string-append libexec "/dhclient-script")
421 `("PATH" ":" prefix
422 ,(map (lambda (dir)
423 (string-append dir "/bin:"
424 dir "/sbin"))
425 (list net-tools coreutils sed))))))
426 %standard-phases))))
427
428 (native-inputs `(("perl" ,perl)))
429
430 ;; Even Coreutils and sed are needed here in case we're cross-compiling.
431 (inputs `(("coreutils" ,coreutils)
432 ("sed" ,sed)
433 ("net-tools" ,net-tools)
434 ("iproute" ,iproute)))
435
436 (home-page "http://www.isc.org/products/DHCP/")
437 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
438 (description
439 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
440reference implementation of all aspects of DHCP, through a suite of DHCP
441tools: server, client, and relay agent.")
463d6dac 442 (license isc)))
02c86a5e
LC
443
444(define-public libpcap
445 (package
446 (name "libpcap")
447 (version "1.5.3")
448 (source (origin
449 (method url-fetch)
450 (uri (string-append "http://www.tcpdump.org/release/libpcap-"
451 version ".tar.gz"))
452 (sha256
453 (base32
454 "14wyjywrdi1ikaj6yc9c72m6m2r64z94lb0gm7k1a3q6q5cj3scs"))))
455 (build-system gnu-build-system)
456 (native-inputs `(("bison" ,bison) ("flex" ,flex)))
457 (arguments '(#:tests? #f)) ; no 'check' target
458 (home-page "http://www.tcpdump.org")
459 (synopsis "Network packet capture library")
460 (description
461 "libpcap is an interface for user-level packet capture. It provides a
462portable framework for low-level network monitoring. Applications include
463network statistics collection, security monitoring, network debugging, etc.")
464
465 ;; fad-*.c and a couple other files are BSD-4, but the rest is BSD-3.
466 (license bsd-3)))
467
468(define-public jnettop
469 (package
470 (name "jnettop")
471 (version "0.13.0")
472 (source (origin
473 (method url-fetch)
474 (uri (string-append "http://jnettop.kubs.info/dist/jnettop-"
475 version ".tar.gz"))
476 (sha256
477 (base32
478 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
479 (build-system gnu-build-system)
480 (native-inputs
481 `(("pkg-config" ,pkg-config)))
482 (inputs
483 `(("glib" ,glib)
484 ("ncurses" ,ncurses)
485 ("libpcap" ,libpcap)))
486 (home-page "http://jnettop.kubs.info/")
487 (synopsis "Visualize network traffic by bandwidth use")
488 (description
489 "Jnettop is a traffic visualiser, which captures traffic going
490through the host it is running from and displays streams sorted
491by bandwidth they use.")
492 (license gpl2+)))