gnu: linux: Add iotop-0.6.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
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 linux)
21 #:use-module ((guix licenses)
22 #:hide (zlib))
23 #:use-module (gnu packages)
24 #:use-module ((gnu packages compression)
25 #:renamer (symbol-prefix-proc 'guix:))
26 #:use-module (gnu packages flex)
27 #:use-module (gnu packages bison)
28 #:use-module (gnu packages libusb)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages bdb)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages pulseaudio)
37 #:use-module (gnu packages attr)
38 #:use-module (gnu packages xml)
39 #:use-module (gnu packages autotools)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python))
44
45 (define-public (system->linux-architecture arch)
46 "Return the Linux architecture name for ARCH, a Guix system name such as
47 \"x86_64-linux\"."
48 (let ((arch (car (string-split arch #\-))))
49 (cond ((string=? arch "i686") "i386")
50 ((string-prefix? "mips" arch) "mips")
51 ((string-prefix? "arm" arch) "arm")
52 (else arch))))
53
54 (define (linux-libre-urls version)
55 "Return a list of URLs for Linux-Libre VERSION."
56 (list (string-append
57 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
58 version "-gnu/linux-libre-" version "-gnu.tar.xz")
59
60 ;; XXX: Work around <http://bugs.gnu.org/14851>.
61 (string-append
62 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
63 version "-gnu.tar.xz")
64
65 ;; Maybe this URL will become valid eventually.
66 (string-append
67 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
68 version "-gnu.tar.xz")))
69
70 (define-public linux-libre-headers
71 (let* ((version "3.3.8")
72 (build-phase
73 (lambda (arch)
74 `(lambda _
75 (setenv "ARCH" ,(system->linux-architecture arch))
76 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
77
78 (and (zero? (system* "make" "defconfig"))
79 (zero? (system* "make" "mrproper" "headers_check"))))))
80 (install-phase
81 `(lambda* (#:key outputs #:allow-other-keys)
82 (let ((out (assoc-ref outputs "out")))
83 (and (zero? (system* "make"
84 (string-append "INSTALL_HDR_PATH=" out)
85 "headers_install"))
86 (mkdir (string-append out "/include/config"))
87 (call-with-output-file
88 (string-append out
89 "/include/config/kernel.release")
90 (lambda (p)
91 (format p "~a-default~%" ,version))))))))
92 (package
93 (name "linux-libre-headers")
94 (version version)
95 (source (origin
96 (method url-fetch)
97 (uri (linux-libre-urls version))
98 (sha256
99 (base32
100 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
101 (build-system gnu-build-system)
102 (native-inputs `(("perl" ,perl)))
103 (arguments
104 `(#:modules ((guix build gnu-build-system)
105 (guix build utils)
106 (srfi srfi-1))
107 #:phases (alist-replace
108 'build ,(build-phase (or (%current-target-system)
109 (%current-system)))
110 (alist-replace
111 'install ,install-phase
112 (alist-delete 'configure %standard-phases)))
113 #:tests? #f))
114 (synopsis "GNU Linux-Libre kernel headers")
115 (description "Headers of the Linux-Libre kernel.")
116 (license gpl2)
117 (home-page "http://www.gnu.org/software/linux-libre/"))))
118
119 (define-public module-init-tools
120 (package
121 (name "module-init-tools")
122 (version "3.16")
123 (source (origin
124 (method url-fetch)
125 (uri (string-append
126 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
127 version ".tar.bz2"))
128 (sha256
129 (base32
130 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
131 (build-system gnu-build-system)
132 (arguments
133 ;; FIXME: The upstream tarball lacks man pages, and building them would
134 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
135 ;; but they vanished. In the meantime, fake it.
136 '(#:phases (alist-cons-before
137 'configure 'fake-docbook
138 (lambda _
139 (substitute* "Makefile.in"
140 (("^DOCBOOKTOMAN.*$")
141 "DOCBOOKTOMAN = true\n")))
142 %standard-phases)))
143 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
144 (synopsis "Tools for loading and managing Linux kernel modules")
145 (description
146 "Tools for loading and managing Linux kernel modules, such as `modprobe',
147 `insmod', `lsmod', and more.")
148 (license gpl2+)))
149
150 (define-public linux-libre
151 (let* ((version "3.12")
152 (build-phase
153 '(lambda* (#:key system #:allow-other-keys #:rest args)
154 (let ((arch (car (string-split system #\-))))
155 (setenv "ARCH"
156 (cond ((string=? arch "i686") "i386")
157 (else arch)))
158 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
159
160 (let ((build (assoc-ref %standard-phases 'build)))
161 (and (zero? (system* "make" "defconfig"))
162 (begin
163 (format #t "enabling additional modules...~%")
164 (substitute* ".config"
165 (("^# CONFIG_CIFS.*$")
166 "CONFIG_CIFS=m\n"))
167 (zero? (system* "make" "oldconfig")))
168
169 ;; Call the default `build' phase so `-j' is correctly
170 ;; passed.
171 (apply build #:make-flags "all" args)))))
172 (install-phase
173 `(lambda* (#:key inputs outputs #:allow-other-keys)
174 (let* ((out (assoc-ref outputs "out"))
175 (moddir (string-append out "/lib/modules"))
176 (mit (assoc-ref inputs "module-init-tools")))
177 (mkdir-p moddir)
178 (for-each (lambda (file)
179 (copy-file file
180 (string-append out "/" (basename file))))
181 (find-files "." "^(bzImage|System\\.map)$"))
182 (copy-file ".config" (string-append out "/config"))
183 (zero? (system* "make"
184 (string-append "DEPMOD=" mit "/sbin/depmod")
185 (string-append "MODULE_DIR=" moddir)
186 (string-append "INSTALL_PATH=" out)
187 (string-append "INSTALL_MOD_PATH=" out)
188 "modules_install"))))))
189 (package
190 (name "linux-libre")
191 (version version)
192 (source (origin
193 (method url-fetch)
194 (uri (linux-libre-urls version))
195 (sha256
196 (base32
197 "0drjxm9h2k9bik2mhrqqqi6cm5rn2db647wf0zvb58xldj0zmhb6"))))
198 (build-system gnu-build-system)
199 (native-inputs `(("perl" ,perl)
200 ("bc" ,bc)
201 ("module-init-tools" ,module-init-tools)))
202 (arguments
203 `(#:modules ((guix build gnu-build-system)
204 (guix build utils)
205 (srfi srfi-1)
206 (ice-9 match))
207 #:phases (alist-replace
208 'build ,build-phase
209 (alist-replace
210 'install ,install-phase
211 (alist-delete 'configure %standard-phases)))
212 #:tests? #f))
213 (synopsis "100% free redistribution of a cleaned Linux kernel")
214 (description
215 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
216 It has been modified to remove all non-free binary blobs.")
217 (license gpl2)
218 (home-page "http://www.gnu.org/software/linux-libre/"))))
219
220 \f
221 ;;;
222 ;;; Pluggable authentication modules (PAM).
223 ;;;
224
225 (define-public linux-pam
226 (package
227 (name "linux-pam")
228 (version "1.1.6")
229 (source
230 (origin
231 (method url-fetch)
232 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
233 version ".tar.bz2")
234 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
235 version ".tar.bz2")))
236 (sha256
237 (base32
238 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
239 (build-system gnu-build-system)
240 (native-inputs
241 `(("flex" ,flex)
242
243 ;; TODO: optional dependencies
244 ;; ("libxcrypt" ,libxcrypt)
245 ;; ("cracklib" ,cracklib)
246 ))
247 (arguments
248 '(;; Most users, such as `shadow', expect the headers to be under
249 ;; `security'.
250 #:configure-flags (list (string-append "--includedir="
251 (assoc-ref %outputs "out")
252 "/include/security"))
253
254 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
255 ;; isn't available.
256 #:tests? #f))
257 (home-page "http://www.linux-pam.org/")
258 (synopsis "Pluggable authentication modules for Linux")
259 (description
260 "A *Free* project to implement OSF's RFC 86.0.
261 Pluggable authentication modules are small shared object files that can
262 be used through the PAM API to perform tasks, like authenticating a user
263 at login. Local and dynamic reconfiguration are its key features")
264 (license bsd-3)))
265
266 \f
267 ;;;
268 ;;; Miscellaneous.
269 ;;;
270
271 (define-public psmisc
272 (package
273 (name "psmisc")
274 (version "22.20")
275 (source
276 (origin
277 (method url-fetch)
278 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
279 version ".tar.gz"))
280 (sha256
281 (base32
282 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
283 (build-system gnu-build-system)
284 (inputs `(("ncurses" ,ncurses)))
285 (home-page "http://psmisc.sourceforge.net/")
286 (synopsis
287 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
288 (description
289 "This PSmisc package is a set of some small useful utilities that
290 use the proc filesystem. We're not about changing the world, but
291 providing the system administrator with some help in common tasks.")
292 (license gpl2+)))
293
294 (define-public util-linux
295 (package
296 (name "util-linux")
297 (version "2.21")
298 (source
299 (origin
300 (method url-fetch)
301 (uri (string-append "mirror://kernel.org/linux/utils/"
302 name "/v" version "/"
303 name "-" version ".2" ".tar.xz"))
304 (sha256
305 (base32
306 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
307 (build-system gnu-build-system)
308 (arguments
309 `(#:configure-flags '("--disable-use-tty-group")
310 #:phases (alist-cons-after
311 'install 'patch-chkdupexe
312 (lambda* (#:key outputs #:allow-other-keys)
313 (let ((out (assoc-ref outputs "out")))
314 (substitute* (string-append out "/bin/chkdupexe")
315 ;; Allow 'patch-shebang' to do its work.
316 (("@PERL@") "/bin/perl"))))
317 %standard-phases)))
318 (inputs `(("zlib" ,guix:zlib)
319 ("ncurses" ,ncurses)))
320 (native-inputs
321 `(("perl" ,perl)))
322 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
323 (synopsis "Collection of utilities for the Linux kernel")
324 (description
325 "util-linux is a random collection of utilities for the Linux kernel.")
326
327 ;; Note that util-linux doesn't use the same license for all the
328 ;; code. GPLv2+ is the default license for a code without an
329 ;; explicitly defined license.
330 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
331 bsd-4 public-domain))))
332
333 (define-public procps
334 (package
335 (name "procps")
336 (version "3.2.8")
337 (source (origin
338 (method url-fetch)
339 (uri (string-append "http://procps.sourceforge.net/procps-"
340 version ".tar.gz"))
341 (sha256
342 (base32
343 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
344 (patches (list (search-patch "procps-make-3.82.patch")))))
345 (build-system gnu-build-system)
346 (inputs `(("ncurses" ,ncurses)))
347 (arguments
348 '(#:phases (alist-replace
349 'configure
350 (lambda* (#:key outputs #:allow-other-keys)
351 ;; No `configure', just a single Makefile.
352 (let ((out (assoc-ref outputs "out")))
353 (substitute* "Makefile"
354 (("/usr/") "/")
355 (("--(owner|group) 0") "")
356 (("ldconfig") "true")
357 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
358 ;; Add libproc to the RPATH.
359 (string-append "LDFLAGS := -Wl,-rpath="
360 out "/lib" value))))
361 (setenv "CC" "gcc"))
362 (alist-replace
363 'install
364 (lambda* (#:key outputs #:allow-other-keys)
365 (let ((out (assoc-ref outputs "out")))
366 (and (zero?
367 (system* "make" "install"
368 (string-append "DESTDIR=" out)))
369
370 ;; Sanity check.
371 (zero?
372 (system* (string-append out "/bin/ps")
373 "--version")))))
374 %standard-phases))
375
376 ;; What did you expect? Tests?
377 #:tests? #f))
378 (home-page "http://procps.sourceforge.net/")
379 (synopsis "Utilities that give information about processes")
380 (description
381 "procps is the package that has a bunch of small useful utilities
382 that give information about processes using the Linux /proc file system.
383 The package includes the programs ps, top, vmstat, w, kill, free,
384 slabtop, and skill.")
385 (license gpl2)))
386
387 (define-public usbutils
388 (package
389 (name "usbutils")
390 (version "006")
391 (source
392 (origin
393 (method url-fetch)
394 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
395 "usbutils-" version ".tar.xz"))
396 (sha256
397 (base32
398 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
399 (build-system gnu-build-system)
400 (inputs
401 `(("libusb" ,libusb)))
402 (native-inputs
403 `(("pkg-config" ,pkg-config)))
404 (home-page "http://www.linux-usb.org/")
405 (synopsis
406 "Tools for working with USB devices, such as lsusb")
407 (description
408 "Tools for working with USB devices, such as lsusb.")
409 (license gpl2+)))
410
411 (define-public e2fsprogs
412 (package
413 (name "e2fsprogs")
414 (version "1.42.7")
415 (source (origin
416 (method url-fetch)
417 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
418 version ".tar.gz"))
419 (sha256
420 (base32
421 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
422 (build-system gnu-build-system)
423 (inputs `(("util-linux" ,util-linux)))
424 (native-inputs `(("pkg-config" ,pkg-config)))
425 (arguments
426 '(#:phases (alist-cons-before
427 'configure 'patch-shells
428 (lambda _
429 (substitute* "configure"
430 (("/bin/sh (.*)parse-types.sh" _ dir)
431 (string-append (which "sh") " " dir
432 "parse-types.sh")))
433 (substitute* (find-files "." "^Makefile.in$")
434 (("#!/bin/sh")
435 (string-append "#!" (which "sh")))))
436 %standard-phases)
437
438 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
439 ;; they fail because we get an extra line that says "Can't check if
440 ;; filesystem is mounted due to missing mtab file".
441 #:tests? #f))
442 (home-page "http://e2fsprogs.sourceforge.net/")
443 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
444 (description
445 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
446 (license (list gpl2 ; programs
447 lgpl2.0 ; libext2fs
448 x11)))) ; libuuid
449
450 (define-public strace
451 (package
452 (name "strace")
453 (version "4.7")
454 (source (origin
455 (method url-fetch)
456 (uri (string-append "mirror://sourceforge/strace/strace-"
457 version ".tar.xz"))
458 (sha256
459 (base32
460 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
461 (build-system gnu-build-system)
462 (native-inputs `(("perl" ,perl)))
463 (home-page "http://strace.sourceforge.net/")
464 (synopsis "System call tracer for Linux")
465 (description
466 "strace is a system call tracer, i.e. a debugging tool which prints out a
467 trace of all the system calls made by a another process/program.")
468 (license bsd-3)))
469
470 (define-public alsa-lib
471 (package
472 (name "alsa-lib")
473 (version "1.0.27.1")
474 (source (origin
475 (method url-fetch)
476 (uri (string-append
477 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
478 version ".tar.bz2"))
479 (sha256
480 (base32
481 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
482 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
483 (build-system gnu-build-system)
484 (home-page "http://www.alsa-project.org/")
485 (synopsis "The Advanced Linux Sound Architecture libraries")
486 (description
487 "The Advanced Linux Sound Architecture (ALSA) provides audio and
488 MIDI functionality to the Linux-based operating system.")
489 (license lgpl2.1+)))
490
491 (define-public alsa-utils
492 (package
493 (name "alsa-utils")
494 (version "1.0.27.2")
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
498 version ".tar.bz2"))
499 (sha256
500 (base32
501 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
502 (build-system gnu-build-system)
503 (arguments
504 ;; XXX: Disable man page creation until we have DocBook.
505 '(#:configure-flags (list "--disable-xmlto"
506 (string-append "--with-udev-rules-dir="
507 (assoc-ref %outputs "out")
508 "/lib/udev/rules.d"))
509 #:phases (alist-cons-before
510 'install 'pre-install
511 (lambda _
512 ;; Don't try to mkdir /var/lib/alsa.
513 (substitute* "Makefile"
514 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
515 "true\n")))
516 %standard-phases)))
517 (inputs
518 `(("libsamplerate" ,libsamplerate)
519 ("ncurses" ,ncurses)
520 ("alsa-lib" ,alsa-lib)
521 ("xmlto" ,xmlto)
522 ("gettext" ,gnu-gettext)))
523 (home-page "http://www.alsa-project.org/")
524 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
525 (description
526 "The Advanced Linux Sound Architecture (ALSA) provides audio and
527 MIDI functionality to the Linux-based operating system.")
528
529 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
530 ;; GPLv2-only.
531 (license gpl2)))
532
533 (define-public iptables
534 (package
535 (name "iptables")
536 (version "1.4.16.2")
537 (source (origin
538 (method url-fetch)
539 (uri (string-append
540 "http://www.netfilter.org/projects/iptables/files/iptables-"
541 version ".tar.bz2"))
542 (sha256
543 (base32
544 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
545 (build-system gnu-build-system)
546 (arguments '(#:tests? #f)) ; no test suite
547 (home-page "http://www.netfilter.org/projects/iptables/index.html")
548 (synopsis "Program to configure the Linux IP packet filtering rules")
549 (description
550 "iptables is the userspace command line program used to configure the
551 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
552 system administrators. Since Network Address Translation is also configured
553 from the packet filter ruleset, iptables is used for this, too. The iptables
554 package also includes ip6tables. ip6tables is used for configuring the IPv6
555 packet filter.")
556 (license gpl2+)))
557
558 (define-public iproute
559 (package
560 (name "iproute2")
561 (version "3.12.0")
562 (source (origin
563 (method url-fetch)
564 (uri (string-append
565 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
566 version ".tar.xz"))
567 (sha256
568 (base32
569 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
570 (build-system gnu-build-system)
571 (arguments
572 `(#:tests? #f ; no test suite
573 #:make-flags (let ((out (assoc-ref %outputs "out")))
574 (list "DESTDIR="
575 (string-append "LIBDIR=" out "/lib")
576 (string-append "SBINDIR=" out "/sbin")
577 (string-append "CONFDIR=" out "/etc")
578 (string-append "DOCDIR=" out "/share/doc/"
579 ,name "-" ,version)
580 (string-append "MANDIR=" out "/share/man")))
581 #:phases (alist-cons-before
582 'install 'pre-install
583 (lambda _
584 ;; Don't attempt to create /var/lib/arpd.
585 (substitute* "Makefile"
586 (("^.*ARPDDIR.*$") "")))
587 %standard-phases)))
588 (inputs
589 `(("iptables" ,iptables)
590 ("db4" ,bdb)))
591 (native-inputs
592 `(("pkg-config" ,pkg-config)
593 ("flex" ,flex)
594 ("bison" ,bison)))
595 (home-page
596 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
597 (synopsis
598 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
599 (description
600 "Iproute2 is a collection of utilities for controlling TCP/IP
601 networking and traffic with the Linux kernel.
602
603 Most network configuration manuals still refer to ifconfig and route as the
604 primary network configuration tools, but ifconfig is known to behave
605 inadequately in modern network environments. They should be deprecated, but
606 most distros still include them. Most network configuration systems make use
607 of ifconfig and thus provide a limited feature set. The /etc/net project aims
608 to support most modern network technologies, as it doesn't use ifconfig and
609 allows a system administrator to make use of all iproute2 features, including
610 traffic control.
611
612 iproute2 is usually shipped in a package called iproute or iproute2 and
613 consists of several tools, of which the most important are ip and tc. ip
614 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
615 tools print detailed usage messages and are accompanied by a set of
616 manpages.")
617 (license gpl2+)))
618
619 (define-public net-tools
620 ;; XXX: This package is basically unmaintained, but it provides a few
621 ;; commands not yet provided by Inetutils, such as 'route', so we have to
622 ;; live with it.
623 (package
624 (name "net-tools")
625 (version "1.60")
626 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
627 (source (origin
628 (method url-fetch)
629 (uri (string-append home-page "/" name "-"
630 version ".tar.bz2"))
631 (sha256
632 (base32
633 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
634 (build-system gnu-build-system)
635 (arguments
636 '(#:phases (alist-cons-after
637 'unpack 'patch
638 (lambda* (#:key inputs #:allow-other-keys)
639 (define (apply-patch file)
640 (zero? (system* "patch" "-p1" "--batch"
641 "--input" file)))
642
643 (let ((patch.gz (assoc-ref inputs "patch")))
644 (format #t "applying Debian patch set '~a'...~%"
645 patch.gz)
646 (system (string-append "gunzip < " patch.gz " > the-patch"))
647 (pk 'here)
648 (and (apply-patch "the-patch")
649 (for-each apply-patch
650 (find-files "debian/patches"
651 "\\.patch")))))
652 (alist-replace
653 'configure
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let ((out (assoc-ref outputs "out")))
656 (mkdir-p (string-append out "/bin"))
657 (mkdir-p (string-append out "/sbin"))
658
659 ;; Pretend we have everything...
660 (system "yes | make config")
661
662 ;; ... except we don't have libdnet, so remove that
663 ;; definition.
664 (substitute* '("config.make" "config.h")
665 (("^.*HAVE_AFDECnet.*$") ""))))
666 %standard-phases))
667
668 ;; Binaries that depend on libnet-tools.a don't declare that
669 ;; dependency, making it parallel-unsafe.
670 #:parallel-build? #f
671
672 #:tests? #f ; no test suite
673 #:make-flags (list "CC=gcc"
674 (string-append "BASEDIR="
675 (assoc-ref %outputs "out")))))
676
677 ;; Use the big Debian patch set (the thing does not even compile out of
678 ;; the box.)
679 (inputs `(("patch" ,(origin
680 (method url-fetch)
681 (uri
682 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
683 (sha256
684 (base32
685 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
686 (native-inputs `(("gettext" ,gnu-gettext)))
687
688 (synopsis "Tools for controlling the network subsystem in Linux")
689 (description
690 "This package includes the important tools for controlling the network
691 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
692 netstat, rarp and route. Additionally, this package contains utilities
693 relating to particular network hardware types (plipconfig, slattach) and
694 advanced aspects of IP configuration (iptunnel, ipmaddr).")
695 (license gpl2+)))
696
697 (define-public libcap
698 (package
699 (name "libcap")
700 (version "2.22")
701 (source (origin
702 (method url-fetch)
703
704 ;; Tarballs used to be available from
705 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
706 ;; but they never came back after kernel.org was compromised.
707 (uri (string-append
708 "mirror://debian/pool/main/libc/libcap2/libcap2_"
709 version ".orig.tar.gz"))
710 (sha256
711 (base32
712 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
713 (build-system gnu-build-system)
714 (arguments '(#:phases (alist-delete 'configure %standard-phases)
715 #:tests? #f ; no 'check' target
716 #:make-flags (list "lib=lib"
717 (string-append "prefix="
718 (assoc-ref %outputs "out"))
719 "RAISE_SETFCAP=no")))
720 (native-inputs `(("perl" ,perl)))
721 (inputs `(("attr" ,attr)))
722 (home-page "https://sites.google.com/site/fullycapable/")
723 (synopsis "Library for working with POSIX capabilities")
724 (description
725 "libcap2 provides a programming interface to POSIX capabilities on
726 Linux-based operating systems.")
727
728 ;; License is BSD-3 or GPLv2, at the user's choice.
729 (license gpl2)))
730
731 (define-public bridge-utils
732 (package
733 (name "bridge-utils")
734 (version "1.5")
735 (source (origin
736 (method url-fetch)
737 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
738 version ".tar.gz"))
739 (sha256
740 (base32
741 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
742 (build-system gnu-build-system)
743
744 ;; The tarball lacks all the generated files.
745 (native-inputs `(("autoconf" ,autoconf)
746 ("automake" ,automake)))
747 (arguments
748 '(#:phases (alist-cons-before
749 'configure 'bootstrap
750 (lambda _
751 (zero? (system* "autoreconf" "-vf")))
752 %standard-phases)
753 #:tests? #f)) ; no 'check' target
754
755 (home-page
756 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
757 (synopsis "Manipulate Ethernet bridges")
758 (description
759 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
760 to connect two Ethernet segments together in a protocol independent way.
761 Packets are forwarded based on Ethernet address, rather than IP address (like
762 a router). Since forwarding is done at Layer 2, all protocols can go
763 transparently through a bridge.")
764 (license gpl2+)))
765
766 (define-public libnl
767 (package
768 (name "libnl")
769 (version "3.2.13")
770 (source (origin
771 (method url-fetch)
772 (uri (string-append
773 "http://www.infradead.org/~tgr/libnl/files/libnl-"
774 version ".tar.gz"))
775 (sha256
776 (base32
777 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
778 (build-system gnu-build-system)
779 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
780 (home-page "http://www.infradead.org/~tgr/libnl/")
781 (synopsis "NetLink protocol library suite")
782 (description
783 "The libnl suite is a collection of libraries providing APIs to netlink
784 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
785 between the kernel and user space processes. It was designed to be a more
786 flexible successor to ioctl to provide mainly networking related kernel
787 configuration and monitoring interfaces.")
788
789 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
790 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
791 (license gpl2)))
792
793 (define-public powertop
794 (package
795 (name "powertop")
796 (version "2.5")
797 (source
798 (origin
799 (method url-fetch)
800 (uri (string-append
801 "https://01.org/powertop/sites/default/files/downloads/powertop-"
802 version ".tar.gz"))
803 (sha256
804 (base32
805 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
806 (build-system gnu-build-system)
807 (inputs
808 ;; TODO: Add pciutils.
809 `(("zlib" ,guix:zlib)
810 ;; ("pciutils" ,pciutils)
811 ("ncurses" ,ncurses)
812 ("libnl" ,libnl)))
813 (native-inputs
814 `(("pkg-config" ,pkg-config)))
815 (home-page "https://01.org/powertop/")
816 (synopsis "Analyze power consumption on Intel-based laptops")
817 (description
818 "PowerTOP is a Linux tool to diagnose issues with power consumption and
819 power management. In addition to being a diagnostic tool, PowerTOP also has
820 an interactive mode where the user can experiment various power management
821 settings for cases where the operating system has not enabled these
822 settings.")
823 (license gpl2)))
824
825 (define-public aumix
826 (package
827 (name "aumix")
828 (version "2.9.1")
829 (source (origin
830 (method url-fetch)
831 (uri (string-append
832 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
833 version ".tar.bz2"))
834 (sha256
835 (base32
836 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
837 (build-system gnu-build-system)
838 (inputs `(("ncurses" ,ncurses)))
839 (home-page "http://www.jpj.net/~trevor/aumix.html")
840 (synopsis "Audio mixer for X and the console")
841 (description
842 "Aumix adjusts an audio mixer from X, the console, a terminal,
843 the command line or a script.")
844 (license gpl2+)))
845
846 (define-public iotop
847 (package
848 (name "iotop")
849 (version "0.6")
850 (source
851 (origin
852 (method url-fetch)
853 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
854 version ".tar.gz"))
855 (sha256 (base32
856 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
857 (build-system python-build-system)
858 (arguments
859 ;; The setup.py script expects python-2
860 `(#:python ,python-2
861 ;; There are currently no checks in the package
862 #:tests? #f))
863 (native-inputs `(("python" ,python-2)))
864 (home-page "http://guichaz.free.fr/iotop/")
865 (synopsis
866 "Displays the IO activity of running processes")
867 (description
868 "Iotop is a Python program with a top like user interface to show the
869 processes currently causing I/O.")