gnu: linux-libre: Upgrade to 3.15.
[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 ;;; 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 linux)
22 #:use-module ((guix licenses)
23 #:hide (zlib))
24 #:use-module (gnu packages)
25 #:use-module ((gnu packages compression)
26 #:renamer (symbol-prefix-proc 'guix:))
27 #:use-module (gnu packages flex)
28 #:use-module (gnu packages bison)
29 #:use-module (gnu packages libusb)
30 #:use-module (gnu packages ncurses)
31 #:use-module (gnu packages bdb)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages algebra)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages pulseaudio)
39 #:use-module (gnu packages attr)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages texinfo)
43 #:use-module (gnu packages check)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system cmake)
48 #:use-module (guix build-system python)
49 #:use-module (guix build-system trivial))
50
51 (define-public (system->linux-architecture arch)
52 "Return the Linux architecture name for ARCH, a Guix system name such as
53 \"x86_64-linux\"."
54 (let ((arch (car (string-split arch #\-))))
55 (cond ((string=? arch "i686") "i386")
56 ((string-prefix? "mips" arch) "mips")
57 ((string-prefix? "arm" arch) "arm")
58 (else arch))))
59
60 (define (linux-libre-urls version)
61 "Return a list of URLs for Linux-Libre VERSION."
62 (list (string-append
63 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
64 version "-gnu/linux-libre-" version "-gnu.tar.xz")
65
66 ;; XXX: Work around <http://bugs.gnu.org/14851>.
67 (string-append
68 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
69 version "-gnu.tar.xz")
70
71 ;; Maybe this URL will become valid eventually.
72 (string-append
73 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
74 version "-gnu.tar.xz")))
75
76 (define-public linux-libre-headers
77 (let* ((version "3.3.8")
78 (build-phase
79 (lambda (arch)
80 `(lambda _
81 (setenv "ARCH" ,(system->linux-architecture arch))
82 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
83
84 (and (zero? (system* "make" "defconfig"))
85 (zero? (system* "make" "mrproper" "headers_check"))))))
86 (install-phase
87 `(lambda* (#:key outputs #:allow-other-keys)
88 (let ((out (assoc-ref outputs "out")))
89 (and (zero? (system* "make"
90 (string-append "INSTALL_HDR_PATH=" out)
91 "headers_install"))
92 (mkdir (string-append out "/include/config"))
93 (call-with-output-file
94 (string-append out
95 "/include/config/kernel.release")
96 (lambda (p)
97 (format p "~a-default~%" ,version))))))))
98 (package
99 (name "linux-libre-headers")
100 (version version)
101 (source (origin
102 (method url-fetch)
103 (uri (linux-libre-urls version))
104 (sha256
105 (base32
106 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
107 (build-system gnu-build-system)
108 (native-inputs `(("perl" ,perl)))
109 (arguments
110 `(#:modules ((guix build gnu-build-system)
111 (guix build utils)
112 (srfi srfi-1))
113 #:phases (alist-replace
114 'build ,(build-phase (or (%current-target-system)
115 (%current-system)))
116 (alist-replace
117 'install ,install-phase
118 (alist-delete 'configure %standard-phases)))
119 #:tests? #f))
120 (synopsis "GNU Linux-Libre kernel headers")
121 (description "Headers of the Linux-Libre kernel.")
122 (license gpl2)
123 (home-page "http://www.gnu.org/software/linux-libre/"))))
124
125 (define-public module-init-tools
126 (package
127 (name "module-init-tools")
128 (version "3.16")
129 (source (origin
130 (method url-fetch)
131 (uri (string-append
132 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
133 version ".tar.bz2"))
134 (sha256
135 (base32
136 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
137 (patches
138 (list (search-patch "module-init-tools-moduledir.patch")))))
139 (build-system gnu-build-system)
140 (arguments
141 ;; FIXME: The upstream tarball lacks man pages, and building them would
142 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
143 ;; but they vanished. In the meantime, fake it.
144 '(#:phases (alist-cons-before
145 'configure 'fake-docbook
146 (lambda _
147 (substitute* "Makefile.in"
148 (("^DOCBOOKTOMAN.*$")
149 "DOCBOOKTOMAN = true\n")))
150 %standard-phases)))
151 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
152 (synopsis "Tools for loading and managing Linux kernel modules")
153 (description
154 "Tools for loading and managing Linux kernel modules, such as `modprobe',
155 `insmod', `lsmod', and more.")
156 (license gpl2+)))
157
158 (define-public linux-libre
159 (let* ((version "3.15")
160 (build-phase
161 '(lambda* (#:key system #:allow-other-keys #:rest args)
162 (let ((arch (car (string-split system #\-))))
163 (setenv "ARCH"
164 (cond ((string=? arch "i686") "i386")
165 (else arch)))
166 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
167
168 (let ((build (assoc-ref %standard-phases 'build)))
169 (and (zero? (system* "make" "defconfig"))
170 (begin
171 ;; Appending works even when the option wasn't in the
172 ;; file. The last one prevails if duplicated.
173 (let ((port (open-file ".config" "a")))
174 (display (string-append "CONFIG_NET_9P=m\n"
175 "CONFIG_NET_9P_VIRTIO=m\n"
176 "CONFIG_VIRTIO_BLK=m\n"
177 "CONFIG_SATA_SIS=y\n"
178 "CONFIG_VIRTIO_NET=m\n"
179 "CONFIG_SIS190=y\n"
180 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
181 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
182 "CONFIG_VIRTIO_PCI=m\n"
183 "CONFIG_VIRTIO_BALLOON=m\n"
184 "CONFIG_VIRTIO_MMIO=m\n"
185 "CONFIG_FUSE_FS=m\n"
186 "CONFIG_CIFS=m\n"
187 "CONFIG_9P_FS=m\n"
188 "CONFIG_E1000E=m\n")
189 port)
190 (close-port port))
191
192 (zero? (system* "make" "oldconfig")))
193
194 ;; Call the default `build' phase so `-j' is correctly
195 ;; passed.
196 (apply build #:make-flags "all" args)))))
197 (install-phase
198 `(lambda* (#:key inputs outputs #:allow-other-keys)
199 (let* ((out (assoc-ref outputs "out"))
200 (moddir (string-append out "/lib/modules"))
201 (mit (assoc-ref inputs "module-init-tools")))
202 (mkdir-p moddir)
203 (for-each (lambda (file)
204 (copy-file file
205 (string-append out "/" (basename file))))
206 (find-files "." "^(bzImage|System\\.map)$"))
207 (copy-file ".config" (string-append out "/config"))
208 (zero? (system* "make"
209 (string-append "DEPMOD=" mit "/sbin/depmod")
210 (string-append "MODULE_DIR=" moddir)
211 (string-append "INSTALL_PATH=" out)
212 (string-append "INSTALL_MOD_PATH=" out)
213 "modules_install"))))))
214 (package
215 (name "linux-libre")
216 (version version)
217 (source (origin
218 (method url-fetch)
219 (uri (linux-libre-urls version))
220 (sha256
221 (base32
222 "125n04rwqmr3bm9slk62w6xcg355hx85rwv2x16nl6qki70hsick"))))
223 (build-system gnu-build-system)
224 (native-inputs `(("perl" ,perl)
225 ("bc" ,bc)
226 ("module-init-tools" ,module-init-tools)))
227 (arguments
228 `(#:modules ((guix build gnu-build-system)
229 (guix build utils)
230 (srfi srfi-1)
231 (ice-9 match))
232 #:phases (alist-replace
233 'build ,build-phase
234 (alist-replace
235 'install ,install-phase
236 (alist-delete 'configure %standard-phases)))
237 #:tests? #f))
238 (synopsis "100% free redistribution of a cleaned Linux kernel")
239 (description
240 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
241 It has been modified to remove all non-free binary blobs.")
242 (license gpl2)
243 (home-page "http://www.gnu.org/software/linux-libre/"))))
244
245 \f
246 ;;;
247 ;;; Pluggable authentication modules (PAM).
248 ;;;
249
250 (define-public linux-pam
251 (package
252 (name "linux-pam")
253 (version "1.1.6")
254 (source
255 (origin
256 (method url-fetch)
257 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
258 version ".tar.bz2")
259 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
260 version ".tar.bz2")))
261 (sha256
262 (base32
263 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
264 (build-system gnu-build-system)
265 (native-inputs
266 `(("flex" ,flex)
267
268 ;; TODO: optional dependencies
269 ;; ("libxcrypt" ,libxcrypt)
270 ;; ("cracklib" ,cracklib)
271 ))
272 (arguments
273 '(;; Most users, such as `shadow', expect the headers to be under
274 ;; `security'.
275 #:configure-flags (list (string-append "--includedir="
276 (assoc-ref %outputs "out")
277 "/include/security"))
278
279 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
280 ;; isn't available.
281 #:tests? #f))
282 (home-page "http://www.linux-pam.org/")
283 (synopsis "Pluggable authentication modules for Linux")
284 (description
285 "A *Free* project to implement OSF's RFC 86.0.
286 Pluggable authentication modules are small shared object files that can
287 be used through the PAM API to perform tasks, like authenticating a user
288 at login. Local and dynamic reconfiguration are its key features")
289 (license bsd-3)))
290
291 \f
292 ;;;
293 ;;; Miscellaneous.
294 ;;;
295
296 (define-public psmisc
297 (package
298 (name "psmisc")
299 (version "22.20")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
304 version ".tar.gz"))
305 (sha256
306 (base32
307 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
308 (build-system gnu-build-system)
309 (inputs `(("ncurses" ,ncurses)))
310 (home-page "http://psmisc.sourceforge.net/")
311 (synopsis
312 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
313 (description
314 "This PSmisc package is a set of some small useful utilities that
315 use the proc filesystem. We're not about changing the world, but
316 providing the system administrator with some help in common tasks.")
317 (license gpl2+)))
318
319 (define-public util-linux
320 (package
321 (name "util-linux")
322 (version "2.21")
323 (source (origin
324 (method url-fetch)
325 (uri (string-append "mirror://kernel.org/linux/utils/"
326 name "/v" version "/"
327 name "-" version ".2" ".tar.xz"))
328 (sha256
329 (base32
330 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
331 (patches (list (search-patch "util-linux-perl.patch")))))
332 (build-system gnu-build-system)
333 (arguments
334 `(#:configure-flags '("--disable-use-tty-group"
335 "--enable-ddate")
336 #:phases (alist-cons-after
337 'install 'patch-chkdupexe
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let ((out (assoc-ref outputs "out")))
340 (substitute* (string-append out "/bin/chkdupexe")
341 ;; Allow 'patch-shebang' to do its work.
342 (("@PERL@") "/bin/perl"))))
343 %standard-phases)))
344 (inputs `(("zlib" ,guix:zlib)
345 ("ncurses" ,ncurses)))
346 (native-inputs
347 `(("perl" ,perl)))
348 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
349 (synopsis "Collection of utilities for the Linux kernel")
350 (description
351 "util-linux is a random collection of utilities for the Linux kernel.")
352
353 ;; Note that util-linux doesn't use the same license for all the
354 ;; code. GPLv2+ is the default license for a code without an
355 ;; explicitly defined license.
356 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
357 bsd-4 public-domain))))
358
359 (define-public procps
360 (package
361 (name "procps")
362 (version "3.2.8")
363 (source (origin
364 (method url-fetch)
365 (uri (string-append "http://procps.sourceforge.net/procps-"
366 version ".tar.gz"))
367 (sha256
368 (base32
369 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
370 (patches (list (search-patch "procps-make-3.82.patch")))))
371 (build-system gnu-build-system)
372 (inputs `(("ncurses" ,ncurses)))
373 (arguments
374 '(#:phases (alist-replace
375 'configure
376 (lambda* (#:key outputs #:allow-other-keys)
377 ;; No `configure', just a single Makefile.
378 (let ((out (assoc-ref outputs "out")))
379 (substitute* "Makefile"
380 (("/usr/") "/")
381 (("--(owner|group) 0") "")
382 (("ldconfig") "true")
383 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
384 ;; Add libproc to the RPATH.
385 (string-append "LDFLAGS := -Wl,-rpath="
386 out "/lib" value))))
387 (setenv "CC" "gcc"))
388 (alist-replace
389 'install
390 (lambda* (#:key outputs #:allow-other-keys)
391 (let ((out (assoc-ref outputs "out")))
392 (and (zero?
393 (system* "make" "install"
394 (string-append "DESTDIR=" out)))
395
396 ;; Sanity check.
397 (zero?
398 (system* (string-append out "/bin/ps")
399 "--version")))))
400 %standard-phases))
401
402 ;; What did you expect? Tests?
403 #:tests? #f))
404 (home-page "http://procps.sourceforge.net/")
405 (synopsis "Utilities that give information about processes")
406 (description
407 "procps is the package that has a bunch of small useful utilities
408 that give information about processes using the Linux /proc file system.
409 The package includes the programs ps, top, vmstat, w, kill, free,
410 slabtop, and skill.")
411 (license gpl2)))
412
413 (define-public usbutils
414 (package
415 (name "usbutils")
416 (version "006")
417 (source
418 (origin
419 (method url-fetch)
420 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
421 "usbutils-" version ".tar.xz"))
422 (sha256
423 (base32
424 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
425 (build-system gnu-build-system)
426 (inputs
427 `(("libusb" ,libusb)))
428 (native-inputs
429 `(("pkg-config" ,pkg-config)))
430 (home-page "http://www.linux-usb.org/")
431 (synopsis
432 "Tools for working with USB devices, such as lsusb")
433 (description
434 "Tools for working with USB devices, such as lsusb.")
435 (license gpl2+)))
436
437 (define-public e2fsprogs
438 (package
439 (name "e2fsprogs")
440 (version "1.42.7")
441 (source (origin
442 (method url-fetch)
443 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
444 version ".tar.gz"))
445 (sha256
446 (base32
447 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
448 (build-system gnu-build-system)
449 (inputs `(("util-linux" ,util-linux)))
450 (native-inputs `(("pkg-config" ,pkg-config)
451 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
452 (arguments
453 '(#:phases (alist-cons-before
454 'configure 'patch-shells
455 (lambda _
456 (substitute* "configure"
457 (("/bin/sh (.*)parse-types.sh" _ dir)
458 (string-append (which "sh") " " dir
459 "parse-types.sh")))
460 (substitute* (find-files "." "^Makefile.in$")
461 (("#!/bin/sh")
462 (string-append "#!" (which "sh")))))
463 %standard-phases)
464
465 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
466 ;; they fail because we get an extra line that says "Can't check if
467 ;; filesystem is mounted due to missing mtab file".
468 #:tests? #f))
469 (home-page "http://e2fsprogs.sourceforge.net/")
470 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
471 (description
472 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
473 (license (list gpl2 ; programs
474 lgpl2.0 ; libext2fs
475 x11)))) ; libuuid
476
477 (define-public e2fsck/static
478 (package
479 (name "e2fsck-static")
480 (version (package-version e2fsprogs))
481 (build-system trivial-build-system)
482 (source #f)
483 (arguments
484 `(#:modules ((guix build utils))
485 #:builder
486 (begin
487 (use-modules (guix build utils)
488 (ice-9 ftw)
489 (srfi srfi-26))
490
491 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
492 "/sbin"))
493 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
494 (mkdir-p bin)
495 (with-directory-excursion bin
496 (for-each (lambda (file)
497 (copy-file (string-append source "/" file)
498 file)
499 (remove-store-references file)
500 (chmod file #o555))
501 (scandir source (cut string-prefix? "fsck." <>))))))))
502 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
503 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
504 (description
505 "This package provides statically-linked command of fsck.ext[234] taken
506 from the e2fsprogs package. It is meant to be used in initrds.")
507 (home-page (package-home-page e2fsprogs))
508 (license (package-license e2fsprogs))))
509
510 (define-public strace
511 (package
512 (name "strace")
513 (version "4.7")
514 (source (origin
515 (method url-fetch)
516 (uri (string-append "mirror://sourceforge/strace/strace-"
517 version ".tar.xz"))
518 (sha256
519 (base32
520 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
521 (build-system gnu-build-system)
522 (native-inputs `(("perl" ,perl)))
523 (home-page "http://strace.sourceforge.net/")
524 (synopsis "System call tracer for Linux")
525 (description
526 "strace is a system call tracer, i.e. a debugging tool which prints out a
527 trace of all the system calls made by a another process/program.")
528 (license bsd-3)))
529
530 (define-public alsa-lib
531 (package
532 (name "alsa-lib")
533 (version "1.0.27.1")
534 (source (origin
535 (method url-fetch)
536 (uri (string-append
537 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
538 version ".tar.bz2"))
539 (sha256
540 (base32
541 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
542 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
543 (build-system gnu-build-system)
544 (home-page "http://www.alsa-project.org/")
545 (synopsis "The Advanced Linux Sound Architecture libraries")
546 (description
547 "The Advanced Linux Sound Architecture (ALSA) provides audio and
548 MIDI functionality to the Linux-based operating system.")
549 (license lgpl2.1+)))
550
551 (define-public alsa-utils
552 (package
553 (name "alsa-utils")
554 (version "1.0.27.2")
555 (source (origin
556 (method url-fetch)
557 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
558 version ".tar.bz2"))
559 (sha256
560 (base32
561 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
562 (build-system gnu-build-system)
563 (arguments
564 ;; XXX: Disable man page creation until we have DocBook.
565 '(#:configure-flags (list "--disable-xmlto"
566 (string-append "--with-udev-rules-dir="
567 (assoc-ref %outputs "out")
568 "/lib/udev/rules.d"))
569 #:phases (alist-cons-before
570 'install 'pre-install
571 (lambda _
572 ;; Don't try to mkdir /var/lib/alsa.
573 (substitute* "Makefile"
574 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
575 "true\n")))
576 %standard-phases)))
577 (inputs
578 `(("libsamplerate" ,libsamplerate)
579 ("ncurses" ,ncurses)
580 ("alsa-lib" ,alsa-lib)
581 ("xmlto" ,xmlto)
582 ("gettext" ,gnu-gettext)))
583 (home-page "http://www.alsa-project.org/")
584 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
585 (description
586 "The Advanced Linux Sound Architecture (ALSA) provides audio and
587 MIDI functionality to the Linux-based operating system.")
588
589 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
590 ;; GPLv2-only.
591 (license gpl2)))
592
593 (define-public iptables
594 (package
595 (name "iptables")
596 (version "1.4.16.2")
597 (source (origin
598 (method url-fetch)
599 (uri (string-append
600 "http://www.netfilter.org/projects/iptables/files/iptables-"
601 version ".tar.bz2"))
602 (sha256
603 (base32
604 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
605 (build-system gnu-build-system)
606 (arguments '(#:tests? #f)) ; no test suite
607 (home-page "http://www.netfilter.org/projects/iptables/index.html")
608 (synopsis "Program to configure the Linux IP packet filtering rules")
609 (description
610 "iptables is the userspace command line program used to configure the
611 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
612 system administrators. Since Network Address Translation is also configured
613 from the packet filter ruleset, iptables is used for this, too. The iptables
614 package also includes ip6tables. ip6tables is used for configuring the IPv6
615 packet filter.")
616 (license gpl2+)))
617
618 (define-public iproute
619 (package
620 (name "iproute2")
621 (version "3.12.0")
622 (source (origin
623 (method url-fetch)
624 (uri (string-append
625 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
626 version ".tar.xz"))
627 (sha256
628 (base32
629 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
630 (build-system gnu-build-system)
631 (arguments
632 `(#:tests? #f ; no test suite
633 #:make-flags (let ((out (assoc-ref %outputs "out")))
634 (list "DESTDIR="
635 (string-append "LIBDIR=" out "/lib")
636 (string-append "SBINDIR=" out "/sbin")
637 (string-append "CONFDIR=" out "/etc")
638 (string-append "DOCDIR=" out "/share/doc/"
639 ,name "-" ,version)
640 (string-append "MANDIR=" out "/share/man")))
641 #:phases (alist-cons-before
642 'install 'pre-install
643 (lambda _
644 ;; Don't attempt to create /var/lib/arpd.
645 (substitute* "Makefile"
646 (("^.*ARPDDIR.*$") "")))
647 %standard-phases)))
648 (inputs
649 `(("iptables" ,iptables)
650 ("db4" ,bdb)))
651 (native-inputs
652 `(("pkg-config" ,pkg-config)
653 ("flex" ,flex)
654 ("bison" ,bison)))
655 (home-page
656 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
657 (synopsis
658 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
659 (description
660 "Iproute2 is a collection of utilities for controlling TCP/IP
661 networking and traffic with the Linux kernel.
662
663 Most network configuration manuals still refer to ifconfig and route as the
664 primary network configuration tools, but ifconfig is known to behave
665 inadequately in modern network environments. They should be deprecated, but
666 most distros still include them. Most network configuration systems make use
667 of ifconfig and thus provide a limited feature set. The /etc/net project aims
668 to support most modern network technologies, as it doesn't use ifconfig and
669 allows a system administrator to make use of all iproute2 features, including
670 traffic control.
671
672 iproute2 is usually shipped in a package called iproute or iproute2 and
673 consists of several tools, of which the most important are ip and tc. ip
674 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
675 tools print detailed usage messages and are accompanied by a set of
676 manpages.")
677 (license gpl2+)))
678
679 (define-public net-tools
680 ;; XXX: This package is basically unmaintained, but it provides a few
681 ;; commands not yet provided by Inetutils, such as 'route', so we have to
682 ;; live with it.
683 (package
684 (name "net-tools")
685 (version "1.60")
686 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
687 (source (origin
688 (method url-fetch)
689 (uri (string-append home-page "/" name "-"
690 version ".tar.bz2"))
691 (sha256
692 (base32
693 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
694 (build-system gnu-build-system)
695 (arguments
696 '(#:phases (alist-cons-after
697 'unpack 'patch
698 (lambda* (#:key inputs #:allow-other-keys)
699 (define (apply-patch file)
700 (zero? (system* "patch" "-p1" "--batch"
701 "--input" file)))
702
703 (let ((patch.gz (assoc-ref inputs "patch")))
704 (format #t "applying Debian patch set '~a'...~%"
705 patch.gz)
706 (system (string-append "gunzip < " patch.gz " > the-patch"))
707 (pk 'here)
708 (and (apply-patch "the-patch")
709 (for-each apply-patch
710 (find-files "debian/patches"
711 "\\.patch")))))
712 (alist-replace
713 'configure
714 (lambda* (#:key outputs #:allow-other-keys)
715 (let ((out (assoc-ref outputs "out")))
716 (mkdir-p (string-append out "/bin"))
717 (mkdir-p (string-append out "/sbin"))
718
719 ;; Pretend we have everything...
720 (system "yes | make config")
721
722 ;; ... except we don't have libdnet, so remove that
723 ;; definition.
724 (substitute* '("config.make" "config.h")
725 (("^.*HAVE_AFDECnet.*$") ""))))
726 %standard-phases))
727
728 ;; Binaries that depend on libnet-tools.a don't declare that
729 ;; dependency, making it parallel-unsafe.
730 #:parallel-build? #f
731
732 #:tests? #f ; no test suite
733 #:make-flags (let ((out (assoc-ref %outputs "out")))
734 (list "CC=gcc"
735 (string-append "BASEDIR=" out)
736 (string-append "INSTALLNLSDIR=" out "/share/locale")
737 (string-append "mandir=/share/man")))))
738
739 ;; Use the big Debian patch set (the thing does not even compile out of
740 ;; the box.)
741 (inputs `(("patch" ,(origin
742 (method url-fetch)
743 (uri
744 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
745 (sha256
746 (base32
747 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
748 (native-inputs `(("gettext" ,gnu-gettext)))
749
750 (synopsis "Tools for controlling the network subsystem in Linux")
751 (description
752 "This package includes the important tools for controlling the network
753 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
754 netstat, rarp and route. Additionally, this package contains utilities
755 relating to particular network hardware types (plipconfig, slattach) and
756 advanced aspects of IP configuration (iptunnel, ipmaddr).")
757 (license gpl2+)))
758
759 (define-public libcap
760 (package
761 (name "libcap")
762 (version "2.22")
763 (source (origin
764 (method url-fetch)
765
766 ;; Tarballs used to be available from
767 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
768 ;; but they never came back after kernel.org was compromised.
769 (uri (string-append
770 "mirror://debian/pool/main/libc/libcap2/libcap2_"
771 version ".orig.tar.gz"))
772 (sha256
773 (base32
774 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
775 (build-system gnu-build-system)
776 (arguments '(#:phases (alist-delete 'configure %standard-phases)
777 #:tests? #f ; no 'check' target
778 #:make-flags (list "lib=lib"
779 (string-append "prefix="
780 (assoc-ref %outputs "out"))
781 "RAISE_SETFCAP=no")))
782 (native-inputs `(("perl" ,perl)))
783 (inputs `(("attr" ,attr)))
784 (home-page "https://sites.google.com/site/fullycapable/")
785 (synopsis "Library for working with POSIX capabilities")
786 (description
787 "libcap2 provides a programming interface to POSIX capabilities on
788 Linux-based operating systems.")
789
790 ;; License is BSD-3 or GPLv2, at the user's choice.
791 (license gpl2)))
792
793 (define-public bridge-utils
794 (package
795 (name "bridge-utils")
796 (version "1.5")
797 (source (origin
798 (method url-fetch)
799 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
800 version ".tar.gz"))
801 (sha256
802 (base32
803 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
804 (build-system gnu-build-system)
805
806 ;; The tarball lacks all the generated files.
807 (native-inputs `(("autoconf" ,autoconf)
808 ("automake" ,automake)))
809 (arguments
810 '(#:phases (alist-cons-before
811 'configure 'bootstrap
812 (lambda _
813 (zero? (system* "autoreconf" "-vf")))
814 %standard-phases)
815 #:tests? #f)) ; no 'check' target
816
817 (home-page
818 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
819 (synopsis "Manipulate Ethernet bridges")
820 (description
821 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
822 to connect two Ethernet segments together in a protocol independent way.
823 Packets are forwarded based on Ethernet address, rather than IP address (like
824 a router). Since forwarding is done at Layer 2, all protocols can go
825 transparently through a bridge.")
826 (license gpl2+)))
827
828 (define-public libnl
829 (package
830 (name "libnl")
831 (version "3.2.13")
832 (source (origin
833 (method url-fetch)
834 (uri (string-append
835 "http://www.infradead.org/~tgr/libnl/files/libnl-"
836 version ".tar.gz"))
837 (sha256
838 (base32
839 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
840 (build-system gnu-build-system)
841 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
842 (home-page "http://www.infradead.org/~tgr/libnl/")
843 (synopsis "NetLink protocol library suite")
844 (description
845 "The libnl suite is a collection of libraries providing APIs to netlink
846 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
847 between the kernel and user space processes. It was designed to be a more
848 flexible successor to ioctl to provide mainly networking related kernel
849 configuration and monitoring interfaces.")
850
851 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
852 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
853 (license gpl2)))
854
855 (define-public powertop
856 (package
857 (name "powertop")
858 (version "2.5")
859 (source
860 (origin
861 (method url-fetch)
862 (uri (string-append
863 "https://01.org/powertop/sites/default/files/downloads/powertop-"
864 version ".tar.gz"))
865 (sha256
866 (base32
867 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
868 (build-system gnu-build-system)
869 (inputs
870 ;; TODO: Add pciutils.
871 `(("zlib" ,guix:zlib)
872 ;; ("pciutils" ,pciutils)
873 ("ncurses" ,ncurses)
874 ("libnl" ,libnl)))
875 (native-inputs
876 `(("pkg-config" ,pkg-config)))
877 (home-page "https://01.org/powertop/")
878 (synopsis "Analyze power consumption on Intel-based laptops")
879 (description
880 "PowerTOP is a Linux tool to diagnose issues with power consumption and
881 power management. In addition to being a diagnostic tool, PowerTOP also has
882 an interactive mode where the user can experiment various power management
883 settings for cases where the operating system has not enabled these
884 settings.")
885 (license gpl2)))
886
887 (define-public aumix
888 (package
889 (name "aumix")
890 (version "2.9.1")
891 (source (origin
892 (method url-fetch)
893 (uri (string-append
894 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
895 version ".tar.bz2"))
896 (sha256
897 (base32
898 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
899 (build-system gnu-build-system)
900 (inputs `(("ncurses" ,ncurses)))
901 (home-page "http://www.jpj.net/~trevor/aumix.html")
902 (synopsis "Audio mixer for X and the console")
903 (description
904 "Aumix adjusts an audio mixer from X, the console, a terminal,
905 the command line or a script.")
906 (license gpl2+)))
907
908 (define-public iotop
909 (package
910 (name "iotop")
911 (version "0.6")
912 (source
913 (origin
914 (method url-fetch)
915 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
916 version ".tar.gz"))
917 (sha256 (base32
918 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
919 (build-system python-build-system)
920 (arguments
921 ;; The setup.py script expects python-2.
922 `(#:python ,python-2
923 ;; There are currently no checks in the package.
924 #:tests? #f))
925 (native-inputs `(("python" ,python-2)))
926 (home-page "http://guichaz.free.fr/iotop/")
927 (synopsis
928 "Displays the IO activity of running processes")
929 (description
930 "Iotop is a Python program with a top like user interface to show the
931 processes currently causing I/O.")
932 (license gpl2+)))
933
934 (define-public fuse
935 (package
936 (name "fuse")
937 (version "2.9.3")
938 (source (origin
939 (method url-fetch)
940 (uri (string-append "mirror://sourceforge/fuse/fuse-"
941 version ".tar.gz"))
942 (sha256
943 (base32
944 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
945 (build-system gnu-build-system)
946 (inputs `(("util-linux" ,util-linux)))
947 (arguments
948 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
949 (assoc-ref %outputs "out")
950 "/sbin")
951 (string-append "INIT_D_PATH="
952 (assoc-ref %outputs "out")
953 "/etc/init.d")
954 (string-append "UDEV_RULES_PATH="
955 (assoc-ref %outputs "out")
956 "/etc/udev"))
957 #:phases (alist-cons-before
958 'build 'set-file-names
959 (lambda* (#:key inputs #:allow-other-keys)
960 ;; libfuse calls out to mount(8) and umount(8). Make sure
961 ;; it refers to the right ones.
962 (substitute* '("lib/mount_util.c" "util/mount_util.c")
963 (("/bin/(u?)mount" _ maybe-u)
964 (string-append (assoc-ref inputs "util-linux")
965 "/bin/" maybe-u "mount")))
966 (substitute* '("util/mount.fuse.c")
967 (("/bin/sh")
968 (which "sh")))
969
970 ;; This hack leads libfuse to search for 'fusermount' in
971 ;; $PATH, where it may find a setuid-root binary, instead of
972 ;; trying solely $out/sbin/fusermount and failing because
973 ;; it's not setuid.
974 (substitute* "lib/Makefile"
975 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
976 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
977 %standard-phases)))
978 (home-page "http://fuse.sourceforge.net/")
979 (synopsis "Support file systems implemented in user space")
980 (description
981 "As a consequence of its monolithic design, file system code for Linux
982 normally goes into the kernel itself---which is not only a robustness issue,
983 but also an impediment to system extensibility. FUSE, for \"file systems in
984 user space\", is a kernel module and user-space library that tries to address
985 part of this problem by allowing users to run file system implementations as
986 user-space processes.")
987 (license (list lgpl2.1 ; library
988 gpl2+)))) ; command-line utilities
989
990 (define-public unionfs-fuse
991 (package
992 (name "unionfs-fuse")
993 (version "0.26")
994 (source (origin
995 (method url-fetch)
996 (uri (string-append
997 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
998 version ".tar.xz"))
999 (sha256
1000 (base32
1001 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1002 (build-system cmake-build-system)
1003 (inputs `(("fuse" ,fuse)))
1004 (arguments '(#:tests? #f)) ; no tests
1005 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1006 (synopsis "User-space union file system")
1007 (description
1008 "UnionFS-FUSE is a flexible union file system implementation in user
1009 space, using the FUSE library. Mounting a union file system allows you to
1010 \"aggregate\" the contents of several directories into a single mount point.
1011 UnionFS-FUSE additionally supports copy-on-write.")
1012 (license bsd-3)))
1013
1014 (define fuse-static
1015 (package (inherit fuse)
1016 (name "fuse-static")
1017 (source (origin (inherit (package-source fuse))
1018 (modules '((guix build utils)))
1019 (snippet
1020 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1021 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1022 ;; it doesn't do that, allowing us to remove the dependency on
1023 ;; util-linux (something that is useful in initrds.)
1024 '(substitute* '("lib/mount_util.c"
1025 "util/mount_util.c")
1026 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1027 "0")
1028 (("/bin/")
1029 "")))))))
1030
1031 (define-public unionfs-fuse/static
1032 (package (inherit unionfs-fuse)
1033 (synopsis "User-space union file system (statically linked)")
1034 (name (string-append (package-name unionfs-fuse) "-static"))
1035 (source (origin (inherit (package-source unionfs-fuse))
1036 (modules '((guix build utils)))
1037 (snippet
1038 ;; Add -ldl to the libraries, because libfuse.a needs that.
1039 '(substitute* "src/CMakeLists.txt"
1040 (("target_link_libraries(.*)\\)" _ libs)
1041 (string-append "target_link_libraries"
1042 libs " dl)"))))))
1043 (arguments
1044 '(#:tests? #f
1045 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")))
1046 (inputs `(("fuse" ,fuse-static)))))
1047
1048 (define-public sshfs-fuse
1049 (package
1050 (name "sshfs-fuse")
1051 (version "2.5")
1052 (source (origin
1053 (method url-fetch)
1054 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1055 version ".tar.gz"))
1056 (sha256
1057 (base32
1058 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1059 (build-system gnu-build-system)
1060 (inputs
1061 `(("fuse" ,fuse)
1062 ("glib" ,glib)))
1063 (native-inputs
1064 `(("pkg-config" ,pkg-config)))
1065 (home-page "http://fuse.sourceforge.net/sshfs.html")
1066 (synopsis "Mount remote file systems over SSH")
1067 (description
1068 "This is a file system client based on the SSH File Transfer Protocol.
1069 Since most SSH servers already support this protocol it is very easy to set
1070 up: on the server side there's nothing to do; on the client side mounting the
1071 file system is as easy as logging into the server with an SSH client.")
1072 (license gpl2+)))
1073
1074 (define-public numactl
1075 (package
1076 (name "numactl")
1077 (version "2.0.9")
1078 (source (origin
1079 (method url-fetch)
1080 (uri (string-append
1081 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1082 version
1083 ".tar.gz"))
1084 (sha256
1085 (base32
1086 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1087 (build-system gnu-build-system)
1088 (arguments
1089 '(#:phases (alist-replace
1090 'configure
1091 (lambda* (#:key outputs #:allow-other-keys)
1092 ;; There's no 'configure' script, just a raw makefile.
1093 (substitute* "Makefile"
1094 (("^prefix := .*$")
1095 (string-append "prefix := " (assoc-ref outputs "out")
1096 "\n"))
1097 (("^libdir := .*$")
1098 ;; By default the thing tries to install under
1099 ;; $prefix/lib64 when on a 64-bit platform.
1100 (string-append "libdir := $(prefix)/lib\n"))))
1101 %standard-phases)
1102
1103 #:make-flags (list
1104 ;; By default the thing tries to use 'cc'.
1105 "CC=gcc"
1106
1107 ;; Make sure programs have an RPATH so they can find
1108 ;; libnuma.so.
1109 (string-append "LDLIBS=-Wl,-rpath="
1110 (assoc-ref %outputs "out") "/lib"))
1111
1112 ;; There's a 'test' target, but it requires NUMA support in the kernel
1113 ;; to run, which we can't assume to have.
1114 #:tests? #f))
1115 (home-page "http://oss.sgi.com/projects/libnuma/")
1116 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1117 (description
1118 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1119 memory is not all in one place. The numactl program allows you to run your
1120 application program on specific CPU's and memory nodes. It does this by
1121 supplying a NUMA memory policy to the operating system before running your
1122 program.
1123
1124 The package contains other commands, such as numademo, numastat and memhog.
1125 The numademo command provides a quick overview of NUMA performance on your
1126 system.")
1127 (license (list gpl2 ; programs
1128 lgpl2.1)))) ; library
1129
1130 (define-public kbd
1131 (package
1132 (name "kbd")
1133 (version "2.0.1")
1134 (source (origin
1135 (method url-fetch)
1136 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1137 version ".tar.gz"))
1138 (sha256
1139 (base32
1140 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1141 (modules '((guix build utils)))
1142 (snippet
1143 '(substitute* "tests/Makefile.in"
1144 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1145 (("@VERSION@")
1146 "[@]VERSION[@]")))))
1147 (build-system gnu-build-system)
1148 (arguments
1149 '(#:phases (alist-cons-before
1150 'build 'pre-build
1151 (lambda* (#:key inputs #:allow-other-keys)
1152 (let ((gzip (assoc-ref %build-inputs "gzip"))
1153 (bzip2 (assoc-ref %build-inputs "bzip2")))
1154 (substitute* "src/libkeymap/findfile.c"
1155 (("gzip")
1156 (string-append gzip "/bin/gzip"))
1157 (("bzip2")
1158 (string-append bzip2 "/bin/bzip2")))))
1159 %standard-phases)))
1160 (inputs `(("check" ,check)
1161 ("gzip" ,guix:gzip)
1162 ("bzip2" ,guix:bzip2)
1163 ("pam" ,linux-pam)))
1164 (native-inputs `(("pkg-config" ,pkg-config)))
1165 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1166 (synopsis "Linux keyboard utilities and keyboard maps")
1167 (description
1168 "This package contains keytable files and keyboard utilities compatible
1169 for systems using the Linux kernel. This includes commands such as
1170 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1171 (license gpl2+)))
1172
1173 (define-public inotify-tools
1174 (package
1175 (name "inotify-tools")
1176 (version "3.13")
1177 (source (origin
1178 (method url-fetch)
1179 (uri (string-append
1180 "mirror://sourceforge/inotify-tools/inotify-tools/"
1181 version "/inotify-tools-" version ".tar.gz"))
1182 (sha256
1183 (base32
1184 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1185 (build-system gnu-build-system)
1186 (home-page "http://inotify-tools.sourceforge.net/")
1187 (synopsis "Monitor file accesses")
1188 (description
1189 "The inotify-tools packages provides a C library and command-line tools
1190 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1191 (license gpl2+)))