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