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