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