Merge branch 'master' into core-updates
[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>
66269d47 3;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
0d55c356 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
fd76c904 6;;;
233e7676 7;;; This file is part of GNU Guix.
fd76c904 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 21
1ffa7090 22(define-module (gnu packages linux)
023fef7d
LC
23 #:use-module ((guix licenses)
24 #:hide (zlib))
59a43334 25 #:use-module (gnu packages)
30016044 26 #:use-module ((gnu packages compression) #:prefix guix:)
1ffa7090 27 #:use-module (gnu packages flex)
90a0048f 28 #:use-module (gnu packages bison)
d7d42d6b 29 #:use-module (gnu packages gperf)
1ffa7090
LC
30 #:use-module (gnu packages libusb)
31 #:use-module (gnu packages ncurses)
d7d42d6b 32 #:use-module (gnu packages pciutils)
5f96f303 33 #:use-module (gnu packages databases)
1ffa7090
LC
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
7c0dbe78 36 #:use-module (gnu packages python)
e7b38500 37 #:use-module (gnu packages algebra)
1dba6407 38 #:use-module (gnu packages gettext)
db288efa 39 #:use-module (gnu packages glib)
17b293a0 40 #:use-module (gnu packages pulseaudio)
c762e82e 41 #:use-module (gnu packages attr)
17b293a0 42 #:use-module (gnu packages xml)
215b6431 43 #:use-module (gnu packages autotools)
f57d2639 44 #:use-module (gnu packages texinfo)
b10e9ff6 45 #:use-module (gnu packages check)
30016044
MW
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages which)
48 #:use-module (gnu packages rrdtool)
b087d413 49 #:use-module (gnu packages gtk)
02b80c3f
NK
50 #:use-module (guix packages)
51 #:use-module (guix download)
7c0dbe78 52 #:use-module (guix build-system gnu)
220193ad 53 #:use-module (guix build-system cmake)
e102f940 54 #:use-module (guix build-system python)
a94546ec
LC
55 #:use-module (guix build-system trivial)
56 #:use-module (srfi srfi-26)
57 #:use-module (ice-9 match))
fd76c904 58
aaf4cb20
LC
59(define-public (system->linux-architecture arch)
60 "Return the Linux architecture name for ARCH, a Guix system name such as
61\"x86_64-linux\"."
618cea69
NK
62 (let ((arch (car (string-split arch #\-))))
63 (cond ((string=? arch "i686") "i386")
64 ((string-prefix? "mips" arch) "mips")
aaf4cb20 65 ((string-prefix? "arm" arch) "arm")
618cea69
NK
66 (else arch))))
67
6023cc74
LC
68(define (linux-libre-urls version)
69 "Return a list of URLs for Linux-Libre VERSION."
70 (list (string-append
71 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
72 version "-gnu/linux-libre-" version "-gnu.tar.xz")
73
74 ;; XXX: Work around <http://bugs.gnu.org/14851>.
75 (string-append
76 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
77 version "-gnu.tar.xz")
78
79 ;; Maybe this URL will become valid eventually.
80 (string-append
81 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
82 version "-gnu.tar.xz")))
83
80fe5c60 84(define-public linux-libre-headers
dfb52abb 85 (let* ((version "3.3.8")
80fe5c60 86 (build-phase
618cea69
NK
87 (lambda (arch)
88 `(lambda _
89 (setenv "ARCH" ,(system->linux-architecture arch))
90 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 91
618cea69
NK
92 (and (zero? (system* "make" "defconfig"))
93 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
94 (install-phase
95 `(lambda* (#:key outputs #:allow-other-keys)
96 (let ((out (assoc-ref outputs "out")))
97 (and (zero? (system* "make"
98 (string-append "INSTALL_HDR_PATH=" out)
99 "headers_install"))
100 (mkdir (string-append out "/include/config"))
101 (call-with-output-file
102 (string-append out
103 "/include/config/kernel.release")
104 (lambda (p)
dfb52abb 105 (format p "~a-default~%" ,version))))))))
80fe5c60
LC
106 (package
107 (name "linux-libre-headers")
dfb52abb 108 (version version)
80fe5c60
LC
109 (source (origin
110 (method url-fetch)
6023cc74 111 (uri (linux-libre-urls version))
80fe5c60
LC
112 (sha256
113 (base32
114 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
115 (build-system gnu-build-system)
116 (native-inputs `(("perl" ,perl)))
117 (arguments
118 `(#:modules ((guix build gnu-build-system)
119 (guix build utils)
56c092ce 120 (srfi srfi-1))
80fe5c60 121 #:phases (alist-replace
fb6c2fa8
LC
122 'build ,(build-phase (or (%current-target-system)
123 (%current-system)))
80fe5c60
LC
124 (alist-replace
125 'install ,install-phase
56c092ce 126 (alist-delete 'configure %standard-phases)))
80fe5c60
LC
127 #:tests? #f))
128 (synopsis "GNU Linux-Libre kernel headers")
129 (description "Headers of the Linux-Libre kernel.")
38bbd61d 130 (license gpl2)
80fe5c60
LC
131 (home-page "http://www.gnu.org/software/linux-libre/"))))
132
b4fcb735
LC
133(define-public module-init-tools
134 (package
135 (name "module-init-tools")
136 (version "3.16")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
140 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
141 version ".tar.bz2"))
142 (sha256
143 (base32
d3bbe992
LC
144 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
145 (patches
146 (list (search-patch "module-init-tools-moduledir.patch")))))
b4fcb735 147 (build-system gnu-build-system)
b4fcb735 148 (arguments
5c413a9c
LC
149 ;; FIXME: The upstream tarball lacks man pages, and building them would
150 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
151 ;; but they vanished. In the meantime, fake it.
b4fcb735 152 '(#:phases (alist-cons-before
5c413a9c
LC
153 'configure 'fake-docbook
154 (lambda _
155 (substitute* "Makefile.in"
156 (("^DOCBOOKTOMAN.*$")
157 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
158 %standard-phases)))
159 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
160 (synopsis "Tools for loading and managing Linux kernel modules")
161 (description
162 "Tools for loading and managing Linux kernel modules, such as `modprobe',
163`insmod', `lsmod', and more.")
164 (license gpl2+)))
165
ac47a7c2
LC
166(define %boot-logo-patch
167 ;; Linux-Libre boot logo featuring Freedo and a gnu.
168 (origin
169 (method url-fetch)
170 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 171 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
172 (sha256
173 (base32
174 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
175
a94546ec
LC
176(define (kernel-config system)
177 "Return the absolute file name of the Linux-Libre build configuration file
1650dd8a 178for SYSTEM, or #f if there is no configuration for SYSTEM."
a94546ec
LC
179 (define (lookup file)
180 (let ((file (string-append "gnu/packages/" file)))
181 (search-path %load-path file)))
182
183 (match system
184 ("i686-linux"
185 (lookup "linux-libre-i686.conf"))
186 ("x86_64-linux"
187 (lookup "linux-libre-x86_64.conf"))
188 (_
1650dd8a 189 #f)))
a94546ec 190
beacfcab 191(define-public linux-libre
e46db772 192 (let* ((version "3.16.2")
beacfcab 193 (build-phase
ac47a7c2
LC
194 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
195 ;; Apply the neat patch.
196 (system* "patch" "-p1" "--batch"
197 "-i" (assoc-ref inputs "patch/freedo+gnu"))
198
beacfcab
LC
199 (let ((arch (car (string-split system #\-))))
200 (setenv "ARCH"
201 (cond ((string=? arch "i686") "i386")
202 (else arch)))
203 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
204
a94546ec
LC
205 (let ((build (assoc-ref %standard-phases 'build))
206 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
207
208 ;; Use the architecture-specific config if available, and
209 ;; 'defconfig' otherwise.
210 (if config
211 (begin
212 (copy-file config ".config")
213 (chmod ".config" #o666))
214 (system* "make" "defconfig"))
a94546ec
LC
215
216 ;; Appending works even when the option wasn't in the
217 ;; file. The last one prevails if duplicated.
218 (let ((port (open-file ".config" "a")))
219 (display (string-append "CONFIG_NET_9P=m\n"
220 "CONFIG_NET_9P_VIRTIO=m\n"
221 "CONFIG_VIRTIO_BLK=m\n"
222 "CONFIG_VIRTIO_NET=m\n"
223 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
224 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
225 "CONFIG_VIRTIO_PCI=m\n"
226 "CONFIG_VIRTIO_BALLOON=m\n"
227 "CONFIG_VIRTIO_MMIO=m\n"
228 "CONFIG_FUSE_FS=m\n"
229 "CONFIG_CIFS=m\n"
230 "CONFIG_9P_FS=m\n")
231 port)
232 (close-port port))
233
234 (zero? (system* "make" "oldconfig"))
235
236 ;; Call the default `build' phase so `-j' is correctly
237 ;; passed.
238 (apply build #:make-flags "all" args))))
beacfcab
LC
239 (install-phase
240 `(lambda* (#:key inputs outputs #:allow-other-keys)
241 (let* ((out (assoc-ref outputs "out"))
242 (moddir (string-append out "/lib/modules"))
243 (mit (assoc-ref inputs "module-init-tools")))
244 (mkdir-p moddir)
245 (for-each (lambda (file)
246 (copy-file file
247 (string-append out "/" (basename file))))
248 (find-files "." "^(bzImage|System\\.map)$"))
249 (copy-file ".config" (string-append out "/config"))
250 (zero? (system* "make"
251 (string-append "DEPMOD=" mit "/sbin/depmod")
252 (string-append "MODULE_DIR=" moddir)
253 (string-append "INSTALL_PATH=" out)
254 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 255 "INSTALL_MOD_STRIP=1"
beacfcab
LC
256 "modules_install"))))))
257 (package
258 (name "linux-libre")
dfb52abb 259 (version version)
beacfcab
LC
260 (source (origin
261 (method url-fetch)
6023cc74 262 (uri (linux-libre-urls version))
beacfcab
LC
263 (sha256
264 (base32
e46db772 265 "1p08cqy6427yi808fpbwbb4zbwhnkibj2i1wbrfa5rjhd4vnnffz"))))
beacfcab
LC
266 (build-system gnu-build-system)
267 (native-inputs `(("perl" ,perl)
e7b38500 268 ("bc" ,bc)
ac47a7c2 269 ("module-init-tools" ,module-init-tools)
a94546ec 270 ("patch/freedo+gnu" ,%boot-logo-patch)
1650dd8a
LC
271
272 ,@(let ((conf (kernel-config (or (%current-target-system)
273 (%current-system)))))
274 (if conf
275 `(("kconfig" ,conf))
276 '()))))
beacfcab
LC
277 (arguments
278 `(#:modules ((guix build gnu-build-system)
279 (guix build utils)
280 (srfi srfi-1)
281 (ice-9 match))
282 #:phases (alist-replace
283 'build ,build-phase
284 (alist-replace
285 'install ,install-phase
286 (alist-delete 'configure %standard-phases)))
287 #:tests? #f))
f50d2669 288 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 289 (description
79c311b8
LC
290 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
291It has been modified to remove all non-free binary blobs.")
beacfcab
LC
292 (license gpl2)
293 (home-page "http://www.gnu.org/software/linux-libre/"))))
294
c84d0eca
LC
295\f
296;;;
297;;; Pluggable authentication modules (PAM).
298;;;
299
fd76c904
LC
300(define-public linux-pam
301 (package
302 (name "linux-pam")
303 (version "1.1.6")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
308 version ".tar.bz2")
309 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
310 version ".tar.bz2")))
311 (sha256
312 (base32
313 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
314 (build-system gnu-build-system)
c4c4cc05 315 (native-inputs
fd76c904
LC
316 `(("flex" ,flex)
317
318 ;; TODO: optional dependencies
319 ;; ("libxcrypt" ,libxcrypt)
320 ;; ("cracklib" ,cracklib)
321 ))
322 (arguments
c134056a
LC
323 '(;; Most users, such as `shadow', expect the headers to be under
324 ;; `security'.
325 #:configure-flags (list (string-append "--includedir="
326 (assoc-ref %outputs "out")
327 "/include/security"))
328
329 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
330 ;; isn't available.
331 #:tests? #f))
fd76c904
LC
332 (home-page "http://www.linux-pam.org/")
333 (synopsis "Pluggable authentication modules for Linux")
334 (description
335 "A *Free* project to implement OSF's RFC 86.0.
336Pluggable authentication modules are small shared object files that can
337be used through the PAM API to perform tasks, like authenticating a user
338at login. Local and dynamic reconfiguration are its key features")
4a44e743 339 (license bsd-3)))
686f14e8 340
c84d0eca
LC
341\f
342;;;
343;;; Miscellaneous.
344;;;
345
686f14e8
LC
346(define-public psmisc
347 (package
348 (name "psmisc")
349 (version "22.20")
350 (source
351 (origin
352 (method url-fetch)
353 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
354 version ".tar.gz"))
355 (sha256
356 (base32
357 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
358 (build-system gnu-build-system)
359 (inputs `(("ncurses" ,ncurses)))
360 (home-page "http://psmisc.sourceforge.net/")
361 (synopsis
362 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
363 (description
364 "This PSmisc package is a set of some small useful utilities that
365use the proc filesystem. We're not about changing the world, but
366providing the system administrator with some help in common tasks.")
4a44e743 367 (license gpl2+)))
02b80c3f
NK
368
369(define-public util-linux
370 (package
371 (name "util-linux")
372 (version "2.21")
5a6a3ba4
LC
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "mirror://kernel.org/linux/utils/"
376 name "/v" version "/"
377 name "-" version ".2" ".tar.xz"))
378 (sha256
379 (base32
380 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
381 (patches (list (search-patch "util-linux-perl.patch")))))
02b80c3f
NK
382 (build-system gnu-build-system)
383 (arguments
8b8476b8
AE
384 `(#:configure-flags '("--disable-use-tty-group"
385 "--enable-ddate")
02b80c3f
NK
386 #:phases (alist-cons-after
387 'install 'patch-chkdupexe
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let ((out (assoc-ref outputs "out")))
390 (substitute* (string-append out "/bin/chkdupexe")
391 ;; Allow 'patch-shebang' to do its work.
392 (("@PERL@") "/bin/perl"))))
393 %standard-phases)))
4a44e743 394 (inputs `(("zlib" ,guix:zlib)
c4c4cc05
JD
395 ("ncurses" ,ncurses)))
396 (native-inputs
397 `(("perl" ,perl)))
02b80c3f 398 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 399 (synopsis "Collection of utilities for the Linux kernel")
02b80c3f
NK
400 (description
401 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 402
02b80c3f 403 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 404 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 405 ;; explicitly defined license.
fe8ccfcc
LC
406 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
407 bsd-4 public-domain))))
5d5c4278 408
e47e3eff
LC
409(define-public procps
410 (package
411 (name "procps")
412 (version "3.2.8")
413 (source (origin
414 (method url-fetch)
415 (uri (string-append "http://procps.sourceforge.net/procps-"
416 version ".tar.gz"))
417 (sha256
418 (base32
01eafd38
LC
419 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
420 (patches (list (search-patch "procps-make-3.82.patch")))))
e47e3eff 421 (build-system gnu-build-system)
01eafd38 422 (inputs `(("ncurses" ,ncurses)))
e47e3eff 423 (arguments
01eafd38 424 '(#:phases (alist-replace
e47e3eff
LC
425 'configure
426 (lambda* (#:key outputs #:allow-other-keys)
427 ;; No `configure', just a single Makefile.
428 (let ((out (assoc-ref outputs "out")))
429 (substitute* "Makefile"
430 (("/usr/") "/")
431 (("--(owner|group) 0") "")
432 (("ldconfig") "true")
433 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
434 ;; Add libproc to the RPATH.
435 (string-append "LDFLAGS := -Wl,-rpath="
436 out "/lib" value))))
437 (setenv "CC" "gcc"))
438 (alist-replace
439 'install
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let ((out (assoc-ref outputs "out")))
442 (and (zero?
443 (system* "make" "install"
444 (string-append "DESTDIR=" out)))
445
446 ;; Sanity check.
447 (zero?
448 (system* (string-append out "/bin/ps")
449 "--version")))))
450 %standard-phases))
451
452 ;; What did you expect? Tests?
453 #:tests? #f))
454 (home-page "http://procps.sourceforge.net/")
35ec07c7 455 (synopsis "Utilities that give information about processes")
e47e3eff
LC
456 (description
457 "procps is the package that has a bunch of small useful utilities
458that give information about processes using the Linux /proc file system.
459The package includes the programs ps, top, vmstat, w, kill, free,
460slabtop, and skill.")
461 (license gpl2)))
462
5d5c4278
NK
463(define-public usbutils
464 (package
465 (name "usbutils")
466 (version "006")
467 (source
468 (origin
469 (method url-fetch)
470 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
471 "usbutils-" version ".tar.xz"))
472 (sha256
473 (base32
474 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
475 (build-system gnu-build-system)
476 (inputs
c4c4cc05
JD
477 `(("libusb" ,libusb)))
478 (native-inputs
479 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
480 (home-page "http://www.linux-usb.org/")
481 (synopsis
482 "Tools for working with USB devices, such as lsusb")
483 (description
484 "Tools for working with USB devices, such as lsusb.")
4050e5d6 485 (license gpl2+)))
0750452a
LC
486
487(define-public e2fsprogs
488 (package
489 (name "e2fsprogs")
490 (version "1.42.7")
491 (source (origin
492 (method url-fetch)
493 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
494 version ".tar.gz"))
495 (sha256
496 (base32
497 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
498 (build-system gnu-build-system)
c4c4cc05 499 (inputs `(("util-linux" ,util-linux)))
f57d2639
LC
500 (native-inputs `(("pkg-config" ,pkg-config)
501 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
0750452a
LC
502 (arguments
503 '(#:phases (alist-cons-before
504 'configure 'patch-shells
505 (lambda _
506 (substitute* "configure"
507 (("/bin/sh (.*)parse-types.sh" _ dir)
508 (string-append (which "sh") " " dir
509 "parse-types.sh")))
510 (substitute* (find-files "." "^Makefile.in$")
511 (("#!/bin/sh")
512 (string-append "#!" (which "sh")))))
513 %standard-phases)
514
515 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
516 ;; they fail because we get an extra line that says "Can't check if
517 ;; filesystem is mounted due to missing mtab file".
518 #:tests? #f))
519 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 520 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
521 (description
522 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
523 (license (list gpl2 ; programs
524 lgpl2.0 ; libext2fs
525 x11)))) ; libuuid
d8482ad0 526
e102f940
LC
527(define-public e2fsck/static
528 (package
529 (name "e2fsck-static")
0997771a 530 (version (package-version e2fsprogs))
e102f940
LC
531 (build-system trivial-build-system)
532 (source #f)
533 (arguments
534 `(#:modules ((guix build utils))
535 #:builder
536 (begin
537 (use-modules (guix build utils)
538 (ice-9 ftw)
539 (srfi srfi-26))
540
541 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
542 "/sbin"))
543 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
544 (mkdir-p bin)
545 (with-directory-excursion bin
546 (for-each (lambda (file)
547 (copy-file (string-append source "/" file)
548 file)
549 (remove-store-references file)
550 (chmod file #o555))
551 (scandir source (cut string-prefix? "fsck." <>))))))))
0997771a 552 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
e102f940
LC
553 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
554 (description
555 "This package provides statically-linked command of fsck.ext[234] taken
556from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
557 (home-page (package-home-page e2fsprogs))
558 (license (package-license e2fsprogs))))
e102f940 559
d8482ad0
LC
560(define-public strace
561 (package
562 (name "strace")
563 (version "4.7")
564 (source (origin
565 (method url-fetch)
566 (uri (string-append "mirror://sourceforge/strace/strace-"
567 version ".tar.xz"))
568 (sha256
569 (base32
570 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
571 (build-system gnu-build-system)
c4c4cc05 572 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
573 (home-page "http://strace.sourceforge.net/")
574 (synopsis "System call tracer for Linux")
575 (description
576 "strace is a system call tracer, i.e. a debugging tool which prints out a
577trace of all the system calls made by a another process/program.")
578 (license bsd-3)))
ba04571a
LC
579
580(define-public alsa-lib
581 (package
582 (name "alsa-lib")
583 (version "1.0.27.1")
584 (source (origin
585 (method url-fetch)
586 (uri (string-append
587 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
588 version ".tar.bz2"))
589 (sha256
590 (base32
bcd94e19
MW
591 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
592 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
ba04571a
LC
593 (build-system gnu-build-system)
594 (home-page "http://www.alsa-project.org/")
595 (synopsis "The Advanced Linux Sound Architecture libraries")
596 (description
597 "The Advanced Linux Sound Architecture (ALSA) provides audio and
598MIDI functionality to the Linux-based operating system.")
599 (license lgpl2.1+)))
10afdf50 600
17b293a0
LC
601(define-public alsa-utils
602 (package
603 (name "alsa-utils")
604 (version "1.0.27.2")
605 (source (origin
606 (method url-fetch)
607 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
608 version ".tar.bz2"))
609 (sha256
610 (base32
611 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
612 (build-system gnu-build-system)
613 (arguments
614 ;; XXX: Disable man page creation until we have DocBook.
615 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
616
617 ;; The udev rule is responsible for restoring
618 ;; the volume.
17b293a0
LC
619 (string-append "--with-udev-rules-dir="
620 (assoc-ref %outputs "out")
621 "/lib/udev/rules.d"))
622 #:phases (alist-cons-before
623 'install 'pre-install
624 (lambda _
625 ;; Don't try to mkdir /var/lib/alsa.
626 (substitute* "Makefile"
627 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
628 "true\n")))
629 %standard-phases)))
630 (inputs
631 `(("libsamplerate" ,libsamplerate)
632 ("ncurses" ,ncurses)
633 ("alsa-lib" ,alsa-lib)
634 ("xmlto" ,xmlto)
1dba6407 635 ("gettext" ,gnu-gettext)))
17b293a0
LC
636 (home-page "http://www.alsa-project.org/")
637 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
638 (description
639 "The Advanced Linux Sound Architecture (ALSA) provides audio and
640MIDI functionality to the Linux-based operating system.")
641
642 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
643 ;; GPLv2-only.
644 (license gpl2)))
645
10afdf50
LC
646(define-public iptables
647 (package
648 (name "iptables")
649 (version "1.4.16.2")
650 (source (origin
651 (method url-fetch)
652 (uri (string-append
653 "http://www.netfilter.org/projects/iptables/files/iptables-"
654 version ".tar.bz2"))
655 (sha256
656 (base32
657 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
658 (build-system gnu-build-system)
659 (arguments '(#:tests? #f)) ; no test suite
660 (home-page "http://www.netfilter.org/projects/iptables/index.html")
661 (synopsis "Program to configure the Linux IP packet filtering rules")
662 (description
663 "iptables is the userspace command line program used to configure the
664Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
665system administrators. Since Network Address Translation is also configured
666from the packet filter ruleset, iptables is used for this, too. The iptables
667package also includes ip6tables. ip6tables is used for configuring the IPv6
668packet filter.")
669 (license gpl2+)))
90a0048f
LC
670
671(define-public iproute
672 (package
673 (name "iproute2")
5fd7f3e0 674 (version "3.12.0")
90a0048f
LC
675 (source (origin
676 (method url-fetch)
677 (uri (string-append
678 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
679 version ".tar.xz"))
680 (sha256
681 (base32
5fd7f3e0 682 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
90a0048f
LC
683 (build-system gnu-build-system)
684 (arguments
685 `(#:tests? #f ; no test suite
686 #:make-flags (let ((out (assoc-ref %outputs "out")))
687 (list "DESTDIR="
688 (string-append "LIBDIR=" out "/lib")
689 (string-append "SBINDIR=" out "/sbin")
690 (string-append "CONFDIR=" out "/etc")
691 (string-append "DOCDIR=" out "/share/doc/"
692 ,name "-" ,version)
693 (string-append "MANDIR=" out "/share/man")))
694 #:phases (alist-cons-before
695 'install 'pre-install
696 (lambda _
697 ;; Don't attempt to create /var/lib/arpd.
698 (substitute* "Makefile"
699 (("^.*ARPDDIR.*$") "")))
700 %standard-phases)))
701 (inputs
702 `(("iptables" ,iptables)
c4c4cc05
JD
703 ("db4" ,bdb)))
704 (native-inputs
705 `(("pkg-config" ,pkg-config)
90a0048f
LC
706 ("flex" ,flex)
707 ("bison" ,bison)))
708 (home-page
709 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
710 (synopsis
711 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
712 (description
713 "Iproute2 is a collection of utilities for controlling TCP/IP
714networking and traffic with the Linux kernel.
715
716Most network configuration manuals still refer to ifconfig and route as the
717primary network configuration tools, but ifconfig is known to behave
718inadequately in modern network environments. They should be deprecated, but
719most distros still include them. Most network configuration systems make use
720of ifconfig and thus provide a limited feature set. The /etc/net project aims
721to support most modern network technologies, as it doesn't use ifconfig and
722allows a system administrator to make use of all iproute2 features, including
723traffic control.
724
725iproute2 is usually shipped in a package called iproute or iproute2 and
726consists of several tools, of which the most important are ip and tc. ip
727controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
728tools print detailed usage messages and are accompanied by a set of
729manpages.")
730 (license gpl2+)))
85e0dc6a
LC
731
732(define-public net-tools
733 ;; XXX: This package is basically unmaintained, but it provides a few
734 ;; commands not yet provided by Inetutils, such as 'route', so we have to
735 ;; live with it.
736 (package
737 (name "net-tools")
738 (version "1.60")
739 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
740 (source (origin
741 (method url-fetch)
742 (uri (string-append home-page "/" name "-"
743 version ".tar.bz2"))
744 (sha256
745 (base32
746 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
747 (build-system gnu-build-system)
748 (arguments
cd143df0
LC
749 '(#:phases (alist-cons-after
750 'unpack 'patch
85e0dc6a
LC
751 (lambda* (#:key inputs #:allow-other-keys)
752 (define (apply-patch file)
753 (zero? (system* "patch" "-p1" "--batch"
754 "--input" file)))
755
756 (let ((patch.gz (assoc-ref inputs "patch")))
757 (format #t "applying Debian patch set '~a'...~%"
758 patch.gz)
759 (system (string-append "gunzip < " patch.gz " > the-patch"))
760 (pk 'here)
761 (and (apply-patch "the-patch")
762 (for-each apply-patch
763 (find-files "debian/patches"
764 "\\.patch")))))
765 (alist-replace
766 'configure
767 (lambda* (#:key outputs #:allow-other-keys)
768 (let ((out (assoc-ref outputs "out")))
769 (mkdir-p (string-append out "/bin"))
770 (mkdir-p (string-append out "/sbin"))
771
772 ;; Pretend we have everything...
773 (system "yes | make config")
774
775 ;; ... except we don't have libdnet, so remove that
776 ;; definition.
777 (substitute* '("config.make" "config.h")
778 (("^.*HAVE_AFDECnet.*$") ""))))
779 %standard-phases))
780
781 ;; Binaries that depend on libnet-tools.a don't declare that
782 ;; dependency, making it parallel-unsafe.
783 #:parallel-build? #f
784
785 #:tests? #f ; no test suite
0d55c356
MW
786 #:make-flags (let ((out (assoc-ref %outputs "out")))
787 (list "CC=gcc"
788 (string-append "BASEDIR=" out)
789 (string-append "INSTALLNLSDIR=" out "/share/locale")
790 (string-append "mandir=/share/man")))))
85e0dc6a
LC
791
792 ;; Use the big Debian patch set (the thing does not even compile out of
793 ;; the box.)
794 (inputs `(("patch" ,(origin
795 (method url-fetch)
796 (uri
797 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
798 (sha256
799 (base32
800 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 801 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
802
803 (synopsis "Tools for controlling the network subsystem in Linux")
804 (description
805 "This package includes the important tools for controlling the network
806subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
807netstat, rarp and route. Additionally, this package contains utilities
808relating to particular network hardware types (plipconfig, slattach) and
809advanced aspects of IP configuration (iptunnel, ipmaddr).")
810 (license gpl2+)))
c762e82e
LC
811
812(define-public libcap
813 (package
814 (name "libcap")
815 (version "2.22")
816 (source (origin
817 (method url-fetch)
818
819 ;; Tarballs used to be available from
820 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
821 ;; but they never came back after kernel.org was compromised.
822 (uri (string-append
823 "mirror://debian/pool/main/libc/libcap2/libcap2_"
824 version ".orig.tar.gz"))
825 (sha256
826 (base32
827 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
828 (build-system gnu-build-system)
829 (arguments '(#:phases (alist-delete 'configure %standard-phases)
830 #:tests? #f ; no 'check' target
831 #:make-flags (list "lib=lib"
832 (string-append "prefix="
833 (assoc-ref %outputs "out"))
834 "RAISE_SETFCAP=no")))
835 (native-inputs `(("perl" ,perl)))
836 (inputs `(("attr" ,attr)))
837 (home-page "https://sites.google.com/site/fullycapable/")
838 (synopsis "Library for working with POSIX capabilities")
839 (description
840 "libcap2 provides a programming interface to POSIX capabilities on
841Linux-based operating systems.")
842
843 ;; License is BSD-3 or GPLv2, at the user's choice.
844 (license gpl2)))
215b6431
LC
845
846(define-public bridge-utils
847 (package
848 (name "bridge-utils")
849 (version "1.5")
850 (source (origin
851 (method url-fetch)
852 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
853 version ".tar.gz"))
854 (sha256
855 (base32
856 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
857 (build-system gnu-build-system)
858
859 ;; The tarball lacks all the generated files.
860 (native-inputs `(("autoconf" ,autoconf)
861 ("automake" ,automake)))
862 (arguments
863 '(#:phases (alist-cons-before
864 'configure 'bootstrap
865 (lambda _
866 (zero? (system* "autoreconf" "-vf")))
867 %standard-phases)
868 #:tests? #f)) ; no 'check' target
869
870 (home-page
871 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
872 (synopsis "Manipulate Ethernet bridges")
873 (description
874 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
875to connect two Ethernet segments together in a protocol independent way.
876Packets are forwarded based on Ethernet address, rather than IP address (like
877a router). Since forwarding is done at Layer 2, all protocols can go
878transparently through a bridge.")
879 (license gpl2+)))
3cc20675
LC
880
881(define-public libnl
882 (package
883 (name "libnl")
884 (version "3.2.13")
885 (source (origin
886 (method url-fetch)
887 (uri (string-append
888 "http://www.infradead.org/~tgr/libnl/files/libnl-"
889 version ".tar.gz"))
890 (sha256
891 (base32
892 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
893 (build-system gnu-build-system)
894 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
895 (home-page "http://www.infradead.org/~tgr/libnl/")
896 (synopsis "NetLink protocol library suite")
897 (description
898 "The libnl suite is a collection of libraries providing APIs to netlink
899protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
900between the kernel and user space processes. It was designed to be a more
901flexible successor to ioctl to provide mainly networking related kernel
902configuration and monitoring interfaces.")
903
904 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
905 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
906 (license gpl2)))
023fef7d
LC
907
908(define-public powertop
909 (package
910 (name "powertop")
911 (version "2.5")
912 (source
913 (origin
914 (method url-fetch)
915 (uri (string-append
916 "https://01.org/powertop/sites/default/files/downloads/powertop-"
917 version ".tar.gz"))
918 (sha256
919 (base32
920 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
921 (build-system gnu-build-system)
922 (inputs
923 ;; TODO: Add pciutils.
924 `(("zlib" ,guix:zlib)
023fef7d
LC
925 ;; ("pciutils" ,pciutils)
926 ("ncurses" ,ncurses)
927 ("libnl" ,libnl)))
c4c4cc05
JD
928 (native-inputs
929 `(("pkg-config" ,pkg-config)))
023fef7d
LC
930 (home-page "https://01.org/powertop/")
931 (synopsis "Analyze power consumption on Intel-based laptops")
932 (description
933 "PowerTOP is a Linux tool to diagnose issues with power consumption and
934power management. In addition to being a diagnostic tool, PowerTOP also has
935an interactive mode where the user can experiment various power management
936settings for cases where the operating system has not enabled these
937settings.")
938 (license gpl2)))
6869e5c9
LC
939
940(define-public aumix
941 (package
942 (name "aumix")
943 (version "2.9.1")
944 (source (origin
945 (method url-fetch)
946 (uri (string-append
947 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
948 version ".tar.bz2"))
949 (sha256
950 (base32
951 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
952 (build-system gnu-build-system)
953 (inputs `(("ncurses" ,ncurses)))
954 (home-page "http://www.jpj.net/~trevor/aumix.html")
955 (synopsis "Audio mixer for X and the console")
956 (description
957 "Aumix adjusts an audio mixer from X, the console, a terminal,
958the command line or a script.")
959 (license gpl2+)))
7c0dbe78
SHT
960
961(define-public iotop
962 (package
963 (name "iotop")
964 (version "0.6")
965 (source
966 (origin
967 (method url-fetch)
968 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
969 version ".tar.gz"))
970 (sha256 (base32
971 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
972 (build-system python-build-system)
973 (arguments
35cebf01 974 ;; The setup.py script expects python-2.
7c0dbe78 975 `(#:python ,python-2
35cebf01 976 ;; There are currently no checks in the package.
7c0dbe78
SHT
977 #:tests? #f))
978 (native-inputs `(("python" ,python-2)))
979 (home-page "http://guichaz.free.fr/iotop/")
980 (synopsis
981 "Displays the IO activity of running processes")
982 (description
983 "Iotop is a Python program with a top like user interface to show the
984processes currently causing I/O.")
35cebf01 985 (license gpl2+)))
e30835e2
LC
986
987(define-public fuse
988 (package
989 (name "fuse")
990 (version "2.9.3")
991 (source (origin
992 (method url-fetch)
993 (uri (string-append "mirror://sourceforge/fuse/fuse-"
994 version ".tar.gz"))
995 (sha256
996 (base32
997 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
998 (build-system gnu-build-system)
b148bd71 999 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1000 (arguments
1001 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1002 (assoc-ref %outputs "out")
1003 "/sbin")
1004 (string-append "INIT_D_PATH="
1005 (assoc-ref %outputs "out")
1006 "/etc/init.d")
1007 (string-append "UDEV_RULES_PATH="
1008 (assoc-ref %outputs "out")
b148bd71
LC
1009 "/etc/udev"))
1010 #:phases (alist-cons-before
1011 'build 'set-file-names
1012 (lambda* (#:key inputs #:allow-other-keys)
1013 ;; libfuse calls out to mount(8) and umount(8). Make sure
1014 ;; it refers to the right ones.
1015 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1016 (("/bin/(u?)mount" _ maybe-u)
1017 (string-append (assoc-ref inputs "util-linux")
1018 "/bin/" maybe-u "mount")))
1019 (substitute* '("util/mount.fuse.c")
1020 (("/bin/sh")
bd663902
LC
1021 (which "sh")))
1022
1023 ;; This hack leads libfuse to search for 'fusermount' in
1024 ;; $PATH, where it may find a setuid-root binary, instead of
1025 ;; trying solely $out/sbin/fusermount and failing because
1026 ;; it's not setuid.
1027 (substitute* "lib/Makefile"
1028 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1029 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1030 %standard-phases)))
e30835e2
LC
1031 (home-page "http://fuse.sourceforge.net/")
1032 (synopsis "Support file systems implemented in user space")
1033 (description
1034 "As a consequence of its monolithic design, file system code for Linux
1035normally goes into the kernel itself---which is not only a robustness issue,
1036but also an impediment to system extensibility. FUSE, for \"file systems in
1037user space\", is a kernel module and user-space library that tries to address
1038part of this problem by allowing users to run file system implementations as
1039user-space processes.")
1040 (license (list lgpl2.1 ; library
1041 gpl2+)))) ; command-line utilities
220193ad
LC
1042
1043(define-public unionfs-fuse
1044 (package
1045 (name "unionfs-fuse")
1046 (version "0.26")
1047 (source (origin
1048 (method url-fetch)
1049 (uri (string-append
1050 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1051 version ".tar.xz"))
1052 (sha256
1053 (base32
1054 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1055 (build-system cmake-build-system)
1056 (inputs `(("fuse" ,fuse)))
1057 (arguments '(#:tests? #f)) ; no tests
1058 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1059 (synopsis "User-space union file system")
1060 (description
1061 "UnionFS-FUSE is a flexible union file system implementation in user
1062space, using the FUSE library. Mounting a union file system allows you to
1063\"aggregate\" the contents of several directories into a single mount point.
1064UnionFS-FUSE additionally supports copy-on-write.")
1065 (license bsd-3)))
ed748588 1066
0b7a0c20
LC
1067(define fuse-static
1068 (package (inherit fuse)
1069 (name "fuse-static")
1070 (source (origin (inherit (package-source fuse))
1071 (modules '((guix build utils)))
1072 (snippet
1073 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1074 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1075 ;; it doesn't do that, allowing us to remove the dependency on
1076 ;; util-linux (something that is useful in initrds.)
1077 '(substitute* '("lib/mount_util.c"
1078 "util/mount_util.c")
1079 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1080 "0")
1081 (("/bin/")
1082 "")))))))
1083
ed748588
LC
1084(define-public unionfs-fuse/static
1085 (package (inherit unionfs-fuse)
1086 (synopsis "User-space union file system (statically linked)")
1087 (name (string-append (package-name unionfs-fuse) "-static"))
1088 (source (origin (inherit (package-source unionfs-fuse))
1089 (modules '((guix build utils)))
1090 (snippet
1091 ;; Add -ldl to the libraries, because libfuse.a needs that.
1092 '(substitute* "src/CMakeLists.txt"
1093 (("target_link_libraries(.*)\\)" _ libs)
1094 (string-append "target_link_libraries"
1095 libs " dl)"))))))
1096 (arguments
1097 '(#:tests? #f
1456cff1
LC
1098 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1099 #:phases (alist-cons-after
1100 'install 'post-install
1101 (lambda* (#:key outputs #:allow-other-keys)
1102 (let* ((out (assoc-ref outputs "out"))
1103 (exe (string-append out "/bin/unionfs")))
1104 ;; By default, 'unionfs' keeps references to
1105 ;; $glibc/share/locale and similar stuff. Remove them.
1106 (remove-store-references exe)))
1107 %standard-phases)))
0b7a0c20 1108 (inputs `(("fuse" ,fuse-static)))))
67b66003 1109
db288efa
LC
1110(define-public sshfs-fuse
1111 (package
1112 (name "sshfs-fuse")
1113 (version "2.5")
1114 (source (origin
1115 (method url-fetch)
1116 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1117 version ".tar.gz"))
1118 (sha256
1119 (base32
1120 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1121 (build-system gnu-build-system)
1122 (inputs
1123 `(("fuse" ,fuse)
1124 ("glib" ,glib)))
1125 (native-inputs
1126 `(("pkg-config" ,pkg-config)))
1127 (home-page "http://fuse.sourceforge.net/sshfs.html")
1128 (synopsis "Mount remote file systems over SSH")
1129 (description
1130 "This is a file system client based on the SSH File Transfer Protocol.
1131Since most SSH servers already support this protocol it is very easy to set
1132up: on the server side there's nothing to do; on the client side mounting the
1133file system is as easy as logging into the server with an SSH client.")
1134 (license gpl2+)))
1135
67b66003
LC
1136(define-public numactl
1137 (package
1138 (name "numactl")
1139 (version "2.0.9")
1140 (source (origin
1141 (method url-fetch)
1142 (uri (string-append
1143 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1144 version
1145 ".tar.gz"))
1146 (sha256
1147 (base32
1148 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1149 (build-system gnu-build-system)
1150 (arguments
1151 '(#:phases (alist-replace
1152 'configure
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 ;; There's no 'configure' script, just a raw makefile.
1155 (substitute* "Makefile"
1156 (("^prefix := .*$")
1157 (string-append "prefix := " (assoc-ref outputs "out")
1158 "\n"))
1159 (("^libdir := .*$")
1160 ;; By default the thing tries to install under
1161 ;; $prefix/lib64 when on a 64-bit platform.
1162 (string-append "libdir := $(prefix)/lib\n"))))
1163 %standard-phases)
1164
1165 #:make-flags (list
1166 ;; By default the thing tries to use 'cc'.
1167 "CC=gcc"
1168
1169 ;; Make sure programs have an RPATH so they can find
1170 ;; libnuma.so.
1171 (string-append "LDLIBS=-Wl,-rpath="
1172 (assoc-ref %outputs "out") "/lib"))
1173
1174 ;; There's a 'test' target, but it requires NUMA support in the kernel
1175 ;; to run, which we can't assume to have.
1176 #:tests? #f))
1177 (home-page "http://oss.sgi.com/projects/libnuma/")
1178 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1179 (description
1180 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1181memory is not all in one place. The numactl program allows you to run your
1182application program on specific CPU's and memory nodes. It does this by
1183supplying a NUMA memory policy to the operating system before running your
1184program.
1185
1186The package contains other commands, such as numademo, numastat and memhog.
1187The numademo command provides a quick overview of NUMA performance on your
1188system.")
1189 (license (list gpl2 ; programs
1190 lgpl2.1)))) ; library
b10e9ff6
LC
1191
1192(define-public kbd
1193 (package
1194 (name "kbd")
1195 (version "2.0.1")
1196 (source (origin
1197 (method url-fetch)
1198 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1199 version ".tar.gz"))
1200 (sha256
1201 (base32
c8f60748
LC
1202 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1203 (modules '((guix build utils)))
1204 (snippet
f2cdcafb
LC
1205 '(begin
1206 (substitute* "tests/Makefile.in"
1207 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1208 (("@VERSION@")
1209 "[@]VERSION[@]"))
1210 (substitute* '("src/unicode_start" "src/unicode_stop")
1211 ;; Assume the Coreutils are in $PATH.
1212 (("/usr/bin/tty")
1213 "tty"))))))
b10e9ff6
LC
1214 (build-system gnu-build-system)
1215 (arguments
1216 '(#:phases (alist-cons-before
1217 'build 'pre-build
1218 (lambda* (#:key inputs #:allow-other-keys)
1219 (let ((gzip (assoc-ref %build-inputs "gzip"))
1220 (bzip2 (assoc-ref %build-inputs "bzip2")))
1221 (substitute* "src/libkeymap/findfile.c"
1222 (("gzip")
1223 (string-append gzip "/bin/gzip"))
1224 (("bzip2")
1225 (string-append bzip2 "/bin/bzip2")))))
f2cdcafb
LC
1226 (alist-cons-after
1227 'install 'post-install
1228 (lambda* (#:key outputs #:allow-other-keys)
1229 ;; Make sure these programs find their comrades.
1230 (let* ((out (assoc-ref outputs "out"))
1231 (bin (string-append out "/bin")))
1232 (for-each (lambda (prog)
1233 (wrap-program (string-append bin "/" prog)
1234 `("PATH" ":" prefix (,bin))))
1235 '("unicode_start" "unicode_stop"))))
1236 %standard-phases))))
b10e9ff6
LC
1237 (inputs `(("check" ,check)
1238 ("gzip" ,guix:gzip)
1239 ("bzip2" ,guix:bzip2)
1240 ("pam" ,linux-pam)))
1241 (native-inputs `(("pkg-config" ,pkg-config)))
1242 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1243 (synopsis "Linux keyboard utilities and keyboard maps")
1244 (description
1245 "This package contains keytable files and keyboard utilities compatible
1246for systems using the Linux kernel. This includes commands such as
1247'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1248 (license gpl2+)))
de0b620e
LC
1249
1250(define-public inotify-tools
1251 (package
1252 (name "inotify-tools")
1253 (version "3.13")
1254 (source (origin
1255 (method url-fetch)
1256 (uri (string-append
1257 "mirror://sourceforge/inotify-tools/inotify-tools/"
1258 version "/inotify-tools-" version ".tar.gz"))
1259 (sha256
1260 (base32
1261 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1262 (build-system gnu-build-system)
1263 (home-page "http://inotify-tools.sourceforge.net/")
1264 (synopsis "Monitor file accesses")
1265 (description
1266 "The inotify-tools packages provides a C library and command-line tools
1267to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1268 (license gpl2+)))
e062d542
AE
1269
1270(define-public kmod
1271 (package
1272 (name "kmod")
1273 (version "17")
1274 (source (origin
1275 (method url-fetch)
1276 (uri
1277 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1278 "kmod-" version ".tar.xz"))
1279 (sha256
1280 (base32
528b6a3d
LC
1281 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1282 (patches (list (search-patch "kmod-module-directory.patch")))))
e062d542
AE
1283 (build-system gnu-build-system)
1284 (native-inputs
1285 `(("pkg-config" ,pkg-config)))
1286 (inputs
1287 `(("xz" ,guix:xz)
1288 ("zlib" ,guix:zlib)))
1289 (arguments
1290 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1291 #:configure-flags '("--with-xz" "--with-zlib")
1292 #:phases (alist-cons-after
1293 'install 'install-modprobe&co
1294 (lambda* (#:key outputs #:allow-other-keys)
1295 (let* ((out (assoc-ref outputs "out"))
1296 (bin (string-append out "/bin")))
1297 (for-each (lambda (tool)
1298 (symlink "kmod"
1299 (string-append bin "/" tool)))
1300 '("insmod" "rmmod" "lsmod" "modprobe"
1301 "modinfo" "depmod"))))
1302 %standard-phases)))
e062d542
AE
1303 (home-page "https://www.kernel.org/")
1304 (synopsis "Kernel module tools")
1305 (description "kmod is a set of tools to handle common tasks with Linux
1306kernel modules like insert, remove, list, check properties, resolve
1307dependencies and aliases.
1308
1309These tools are designed on top of libkmod, a library that is shipped with
1310kmod. The aim is to be compatible with tools, configurations and indices
1311from the module-init-tools project.")
1312 (license gpl2+))) ; library under lgpl2.1+
d7d42d6b
AE
1313
1314(define-public udev
1315 (package
1316 (name "udev")
1317 (version "182")
1318 (source (origin
1319 (method url-fetch)
1320 (uri (string-append
1321 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1322 version ".tar.xz"))
1323 (sha256
1324 (base32
1325 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1326 (patches (list (search-patch "udev-gir-libtool.patch")))))
1327 (build-system gnu-build-system)
1328 (arguments
1329 `(#:configure-flags (list (string-append
1330 "--with-pci-ids-path="
1331 (assoc-ref %build-inputs "pciutils")
1332 "/share/pci.ids.gz")
1333
1334 "--with-firmware-path=/no/firmware"
1335
1336 ;; Work around undefined reference to
1337 ;; 'mq_getattr' in sc-daemon.c.
1338 "LDFLAGS=-lrt")))
1339 (native-inputs
1340 `(("pkg-config" ,pkg-config)
1341 ("gperf" ,gperf)
426adbe8 1342 ("glib" ,glib "bin") ; glib-genmarshal, etc.
d7d42d6b
AE
1343 ("perl" ,perl) ; for the tests
1344 ("python" ,python-2))) ; ditto
1345 (inputs
1346 `(("kmod" ,kmod)
1347 ("pciutils" ,pciutils)
1348 ("usbutils" ,usbutils)
1349 ("util-linux" ,util-linux)
1350 ("glib" ,glib)
1351 ("gobject-introspection" ,gobject-introspection)))
1352 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1353 (synopsis "Userspace device management")
1354 (description "Udev is a daemon which dynamically creates and removes
1355device nodes from /dev/, handles hotplug events and loads drivers at boot
1356time.")
1357 (license gpl2+))) ; libudev is under lgpl2.1+
000f7559 1358
66269d47
LC
1359(define-public lvm2
1360 (package
1361 (name "lvm2")
1362 (version "2.02.109")
1363 (source (origin
1364 (method url-fetch)
1365 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1366 version ".tgz"))
1367 (sha256
1368 (base32
1369 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1370 (modules '((guix build utils)))
1371 (snippet
1372 '(begin
1373 (use-modules (guix build utils))
1374
1375 ;; Honor sysconfdir.
1376 (substitute* "make.tmpl.in"
1377 (("confdir = .*$")
1378 "confdir = @sysconfdir@\n")
1379 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1380 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1381 (build-system gnu-build-system)
1382 (native-inputs
1383 `(("pkg-config" ,pkg-config)
1384 ("procps" ,procps))) ;tests use 'pgrep'
1385 (inputs
1386 `(("udev" ,udev)))
1387 (arguments
1388 '(#:phases (alist-cons-after
1389 'configure 'set-makefile-shell
1390 (lambda _
1391 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1392 ;; expected.
1393 (setenv "SHELL" (which "sh"))
1394
1395 ;; Replace /bin/sh with the right file name.
1396 (patch-makefile-SHELL "make.tmpl"))
1397 %standard-phases)
1398
1399 #:configure-flags (list (string-append "--sysconfdir="
1400 (assoc-ref %outputs "out")
1401 "/etc/lvm")
1402 "--enable-udev_sync"
f2817d43
LC
1403 "--enable-udev_rules"
1404
1405 ;; Make sure programs such as 'dmsetup' can
1406 ;; find libdevmapper.so.
1407 (string-append "LDFLAGS=-Wl,-rpath="
1408 (assoc-ref %outputs "out")
1409 "/lib"))
66269d47
LC
1410
1411 ;; The tests use 'mknod', which requires root access.
1412 #:tests? #f))
1413 (home-page "http://sourceware.org/lvm2/")
1414 (synopsis "Logical volume management for Linux")
1415 (description
1416 "LVM2 is the logical volume management tool set for Linux-based systems.
1417This package includes the user-space libraries and tools, including the device
1418mapper. Kernel components are part of Linux-libre.")
1419
1420 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1421 ;; Command-line tools are GPLv2.
1422 (license (list gpl2 lgpl2.1))))
1423
000f7559
DT
1424(define-public wireless-tools
1425 (package
1426 (name "wireless-tools")
1427 (version "30.pre9")
1428 (source (origin
1429 (method url-fetch)
1430 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1431 version ".tar.gz"))
1432 (sha256
1433 (base32
1434 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))))
1435 (build-system gnu-build-system)
1436 (arguments
1437 `(#:phases (alist-replace
1438 'configure
1439 (lambda* (#:key outputs #:allow-other-keys)
1440 (setenv "PREFIX" (assoc-ref outputs "out")))
1441 %standard-phases)
1442 #:tests? #f))
1443 (synopsis "Tools for manipulating Linux Wireless Extensions")
1444 (description "Wireless Tools are used to manipulate the Linux Wireless
1445Extensions. The Wireless Extension is an interface allowing you to set
1446Wireless LAN specific parameters and get the specific stats.")
1447 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1448 (license gpl2+)))
30016044
MW
1449
1450(define-public lm-sensors
1451 (package
1452 (name "lm-sensors")
1453 (version "3.3.5")
1454 (source (origin
1455 (method url-fetch)
1456 (uri (string-append
1457 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1458 version ".tar.bz2"))
1459 (sha256
1460 (base32
1461 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1462 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1463 (build-system gnu-build-system)
1464 (inputs `(("rrdtool" ,rrdtool)
1465 ("perl" ,perl)
1466 ("kmod" ,kmod)
1467 ("gnuplot" ,gnuplot)))
1468 (native-inputs `(("pkg-config" ,pkg-config)
1469 ("flex" ,flex)
1470 ("bison" ,bison)
1471 ("which" ,which)))
1472 (arguments
1473 `(#:tests? #f ; no 'check' target
1474 #:make-flags (list (string-append "PREFIX=" %output)
1475 (string-append "ETCDIR=" %output "/etc")
1476 (string-append "MANDIR=" %output "/share/man"))
1477 #:phases
1478 (alist-delete
1479 'configure
1480 (alist-cons-before
1481 'build 'patch-exec-paths
1482 (lambda* (#:key inputs outputs #:allow-other-keys)
1483 (substitute* "prog/detect/sensors-detect"
1484 (("`uname")
1485 (string-append "`" (assoc-ref inputs "coreutils")
1486 "/bin/uname"))
1487 (("(`|\")modprobe" all open-quote)
1488 (string-append open-quote
1489 (assoc-ref inputs "kmod")
1490 "/bin/modprobe")))
1491 (substitute* '("prog/pwm/pwmconfig"
1492 "prog/pwm/fancontrol")
1493 (("gnuplot")
1494 (string-append (assoc-ref inputs "gnuplot")
1495 "/bin/gnuplot"))
1496 (("cat ")
1497 (string-append (assoc-ref inputs "coreutils")
1498 "/bin/cat "))
1499 (("egrep ")
1500 (string-append (assoc-ref inputs "grep")
1501 "/bin/egrep "))
1502 (("sed -e")
1503 (string-append (assoc-ref inputs "sed")
1504 "/bin/sed -e"))
1505 (("cut -d")
1506 (string-append (assoc-ref inputs "coreutils")
1507 "/bin/cut -d"))
1508 (("sleep ")
1509 (string-append (assoc-ref inputs "coreutils")
1510 "/bin/sleep "))
1511 (("readlink -f")
1512 (string-append (assoc-ref inputs "coreutils")
1513 "/bin/readlink -f"))))
1514 %standard-phases))))
1515 (home-page "http://www.lm-sensors.org/")
1516 (synopsis "Utilities to read temperature/voltage/fan sensors")
1517 (description
1518 "lm-sensors is a hardware health monitoring package for Linux. It allows
1519you to access information from temperature, voltage, and fan speed sensors.
1520It works with most newer systems.")
1521 (license gpl2+)))
b087d413
MW
1522
1523(define-public xsensors
1524 (package
1525 (name "xsensors")
1526 (version "0.70")
1527 (source (origin
1528 (method url-fetch)
1529 (uri (string-append
1530 "http://www.linuxhardware.org/xsensors/xsensors-"
1531 version ".tar.gz"))
1532 (sha256
1533 (base32
1534 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1535 (build-system gnu-build-system)
1536 (inputs `(("lm-sensors" ,lm-sensors)
1537 ("gtk" ,gtk+-2)))
1538 (native-inputs `(("pkg-config" ,pkg-config)))
1539 (arguments
1540 `(#:phases (alist-cons-before
1541 'configure 'enable-deprecated
1542 (lambda _
1543 (substitute* "src/Makefile.in"
1544 (("-DGDK_DISABLE_DEPRECATED") "")
1545 (("-DGTK_DISABLE_DEPRECATED") "")))
1546 (alist-cons-before
1547 'configure 'remove-Werror
1548 (lambda _
1549 (substitute* '("configure" "src/Makefile.in")
1550 (("-Werror") "")))
1551 %standard-phases))))
1552 (home-page "http://www.linuxhardware.org/xsensors/")
1553 (synopsis "Hardware health information viewer")
1554 (description
1555 "xsensors reads data from the libsensors library regarding hardware
1556health such as temperature, voltage and fan speed and displays the information
1557in a digital read-out.")
1558 (license gpl2+)))