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