Revert "gnu: util-linux: Don't install 'logger'."
[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"))
b0e652d8 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 502 (arguments
ddfc2fd8
LC
503 '(;; The 'blkid' command and library are already provided by util-linux,
504 ;; which is the preferred source for them (see, e.g.,
505 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
506 #:configure-flags '("--disable-blkid")
507
508 #:phases (alist-cons-before
0750452a
LC
509 'configure 'patch-shells
510 (lambda _
511 (substitute* "configure"
512 (("/bin/sh (.*)parse-types.sh" _ dir)
513 (string-append (which "sh") " " dir
514 "parse-types.sh")))
515 (substitute* (find-files "." "^Makefile.in$")
516 (("#!/bin/sh")
517 (string-append "#!" (which "sh")))))
518 %standard-phases)
519
520 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
521 ;; they fail because we get an extra line that says "Can't check if
522 ;; filesystem is mounted due to missing mtab file".
523 #:tests? #f))
524 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 525 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
526 (description
527 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
528 (license (list gpl2 ; programs
529 lgpl2.0 ; libext2fs
530 x11)))) ; libuuid
d8482ad0 531
e102f940
LC
532(define-public e2fsck/static
533 (package
534 (name "e2fsck-static")
0997771a 535 (version (package-version e2fsprogs))
e102f940
LC
536 (build-system trivial-build-system)
537 (source #f)
538 (arguments
539 `(#:modules ((guix build utils))
540 #:builder
541 (begin
542 (use-modules (guix build utils)
543 (ice-9 ftw)
544 (srfi srfi-26))
545
546 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
547 "/sbin"))
548 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
549 (mkdir-p bin)
550 (with-directory-excursion bin
551 (for-each (lambda (file)
552 (copy-file (string-append source "/" file)
553 file)
554 (remove-store-references file)
555 (chmod file #o555))
556 (scandir source (cut string-prefix? "fsck." <>))))))))
0997771a 557 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
e102f940
LC
558 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
559 (description
560 "This package provides statically-linked command of fsck.ext[234] taken
561from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
562 (home-page (package-home-page e2fsprogs))
563 (license (package-license e2fsprogs))))
e102f940 564
d8482ad0
LC
565(define-public strace
566 (package
567 (name "strace")
568 (version "4.7")
569 (source (origin
570 (method url-fetch)
571 (uri (string-append "mirror://sourceforge/strace/strace-"
572 version ".tar.xz"))
573 (sha256
574 (base32
575 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
576 (build-system gnu-build-system)
c4c4cc05 577 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
578 (home-page "http://strace.sourceforge.net/")
579 (synopsis "System call tracer for Linux")
580 (description
581 "strace is a system call tracer, i.e. a debugging tool which prints out a
582trace of all the system calls made by a another process/program.")
583 (license bsd-3)))
ba04571a
LC
584
585(define-public alsa-lib
586 (package
587 (name "alsa-lib")
588 (version "1.0.27.1")
589 (source (origin
590 (method url-fetch)
591 (uri (string-append
592 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
593 version ".tar.bz2"))
594 (sha256
595 (base32
bcd94e19
MW
596 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
597 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
ba04571a
LC
598 (build-system gnu-build-system)
599 (home-page "http://www.alsa-project.org/")
600 (synopsis "The Advanced Linux Sound Architecture libraries")
601 (description
602 "The Advanced Linux Sound Architecture (ALSA) provides audio and
603MIDI functionality to the Linux-based operating system.")
604 (license lgpl2.1+)))
10afdf50 605
17b293a0
LC
606(define-public alsa-utils
607 (package
608 (name "alsa-utils")
609 (version "1.0.27.2")
610 (source (origin
611 (method url-fetch)
612 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
613 version ".tar.bz2"))
614 (sha256
615 (base32
616 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
617 (build-system gnu-build-system)
618 (arguments
619 ;; XXX: Disable man page creation until we have DocBook.
620 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
621
622 ;; The udev rule is responsible for restoring
623 ;; the volume.
17b293a0
LC
624 (string-append "--with-udev-rules-dir="
625 (assoc-ref %outputs "out")
626 "/lib/udev/rules.d"))
627 #:phases (alist-cons-before
628 'install 'pre-install
629 (lambda _
630 ;; Don't try to mkdir /var/lib/alsa.
631 (substitute* "Makefile"
632 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
633 "true\n")))
634 %standard-phases)))
635 (inputs
636 `(("libsamplerate" ,libsamplerate)
637 ("ncurses" ,ncurses)
638 ("alsa-lib" ,alsa-lib)
639 ("xmlto" ,xmlto)
1dba6407 640 ("gettext" ,gnu-gettext)))
17b293a0
LC
641 (home-page "http://www.alsa-project.org/")
642 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
643 (description
644 "The Advanced Linux Sound Architecture (ALSA) provides audio and
645MIDI functionality to the Linux-based operating system.")
646
647 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
648 ;; GPLv2-only.
649 (license gpl2)))
650
10afdf50
LC
651(define-public iptables
652 (package
653 (name "iptables")
654 (version "1.4.16.2")
655 (source (origin
656 (method url-fetch)
657 (uri (string-append
658 "http://www.netfilter.org/projects/iptables/files/iptables-"
659 version ".tar.bz2"))
660 (sha256
661 (base32
662 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
663 (build-system gnu-build-system)
664 (arguments '(#:tests? #f)) ; no test suite
665 (home-page "http://www.netfilter.org/projects/iptables/index.html")
666 (synopsis "Program to configure the Linux IP packet filtering rules")
667 (description
668 "iptables is the userspace command line program used to configure the
669Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
670system administrators. Since Network Address Translation is also configured
671from the packet filter ruleset, iptables is used for this, too. The iptables
672package also includes ip6tables. ip6tables is used for configuring the IPv6
673packet filter.")
674 (license gpl2+)))
90a0048f
LC
675
676(define-public iproute
677 (package
678 (name "iproute2")
5fd7f3e0 679 (version "3.12.0")
90a0048f
LC
680 (source (origin
681 (method url-fetch)
682 (uri (string-append
683 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
684 version ".tar.xz"))
685 (sha256
686 (base32
5fd7f3e0 687 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
90a0048f
LC
688 (build-system gnu-build-system)
689 (arguments
690 `(#:tests? #f ; no test suite
691 #:make-flags (let ((out (assoc-ref %outputs "out")))
692 (list "DESTDIR="
693 (string-append "LIBDIR=" out "/lib")
694 (string-append "SBINDIR=" out "/sbin")
695 (string-append "CONFDIR=" out "/etc")
696 (string-append "DOCDIR=" out "/share/doc/"
697 ,name "-" ,version)
698 (string-append "MANDIR=" out "/share/man")))
699 #:phases (alist-cons-before
700 'install 'pre-install
701 (lambda _
702 ;; Don't attempt to create /var/lib/arpd.
703 (substitute* "Makefile"
704 (("^.*ARPDDIR.*$") "")))
705 %standard-phases)))
706 (inputs
707 `(("iptables" ,iptables)
c4c4cc05
JD
708 ("db4" ,bdb)))
709 (native-inputs
710 `(("pkg-config" ,pkg-config)
90a0048f
LC
711 ("flex" ,flex)
712 ("bison" ,bison)))
713 (home-page
714 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
715 (synopsis
716 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
717 (description
718 "Iproute2 is a collection of utilities for controlling TCP/IP
719networking and traffic with the Linux kernel.
720
721Most network configuration manuals still refer to ifconfig and route as the
722primary network configuration tools, but ifconfig is known to behave
723inadequately in modern network environments. They should be deprecated, but
724most distros still include them. Most network configuration systems make use
725of ifconfig and thus provide a limited feature set. The /etc/net project aims
726to support most modern network technologies, as it doesn't use ifconfig and
727allows a system administrator to make use of all iproute2 features, including
728traffic control.
729
730iproute2 is usually shipped in a package called iproute or iproute2 and
731consists of several tools, of which the most important are ip and tc. ip
732controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
733tools print detailed usage messages and are accompanied by a set of
734manpages.")
735 (license gpl2+)))
85e0dc6a
LC
736
737(define-public net-tools
738 ;; XXX: This package is basically unmaintained, but it provides a few
739 ;; commands not yet provided by Inetutils, such as 'route', so we have to
740 ;; live with it.
741 (package
742 (name "net-tools")
743 (version "1.60")
744 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
745 (source (origin
746 (method url-fetch)
747 (uri (string-append home-page "/" name "-"
748 version ".tar.bz2"))
749 (sha256
750 (base32
751 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
752 (build-system gnu-build-system)
753 (arguments
cd143df0
LC
754 '(#:phases (alist-cons-after
755 'unpack 'patch
85e0dc6a
LC
756 (lambda* (#:key inputs #:allow-other-keys)
757 (define (apply-patch file)
758 (zero? (system* "patch" "-p1" "--batch"
759 "--input" file)))
760
761 (let ((patch.gz (assoc-ref inputs "patch")))
762 (format #t "applying Debian patch set '~a'...~%"
763 patch.gz)
764 (system (string-append "gunzip < " patch.gz " > the-patch"))
765 (pk 'here)
766 (and (apply-patch "the-patch")
767 (for-each apply-patch
768 (find-files "debian/patches"
769 "\\.patch")))))
770 (alist-replace
771 'configure
772 (lambda* (#:key outputs #:allow-other-keys)
773 (let ((out (assoc-ref outputs "out")))
774 (mkdir-p (string-append out "/bin"))
775 (mkdir-p (string-append out "/sbin"))
776
777 ;; Pretend we have everything...
778 (system "yes | make config")
779
780 ;; ... except we don't have libdnet, so remove that
781 ;; definition.
782 (substitute* '("config.make" "config.h")
783 (("^.*HAVE_AFDECnet.*$") ""))))
784 %standard-phases))
785
786 ;; Binaries that depend on libnet-tools.a don't declare that
787 ;; dependency, making it parallel-unsafe.
788 #:parallel-build? #f
789
790 #:tests? #f ; no test suite
0d55c356
MW
791 #:make-flags (let ((out (assoc-ref %outputs "out")))
792 (list "CC=gcc"
793 (string-append "BASEDIR=" out)
794 (string-append "INSTALLNLSDIR=" out "/share/locale")
795 (string-append "mandir=/share/man")))))
85e0dc6a
LC
796
797 ;; Use the big Debian patch set (the thing does not even compile out of
798 ;; the box.)
799 (inputs `(("patch" ,(origin
800 (method url-fetch)
801 (uri
802 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
803 (sha256
804 (base32
805 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 806 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
807
808 (synopsis "Tools for controlling the network subsystem in Linux")
809 (description
810 "This package includes the important tools for controlling the network
811subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
812netstat, rarp and route. Additionally, this package contains utilities
813relating to particular network hardware types (plipconfig, slattach) and
814advanced aspects of IP configuration (iptunnel, ipmaddr).")
815 (license gpl2+)))
c762e82e
LC
816
817(define-public libcap
818 (package
819 (name "libcap")
820 (version "2.22")
821 (source (origin
822 (method url-fetch)
823
824 ;; Tarballs used to be available from
825 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
826 ;; but they never came back after kernel.org was compromised.
827 (uri (string-append
828 "mirror://debian/pool/main/libc/libcap2/libcap2_"
829 version ".orig.tar.gz"))
830 (sha256
831 (base32
832 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
833 (build-system gnu-build-system)
834 (arguments '(#:phases (alist-delete 'configure %standard-phases)
835 #:tests? #f ; no 'check' target
836 #:make-flags (list "lib=lib"
837 (string-append "prefix="
838 (assoc-ref %outputs "out"))
839 "RAISE_SETFCAP=no")))
840 (native-inputs `(("perl" ,perl)))
841 (inputs `(("attr" ,attr)))
842 (home-page "https://sites.google.com/site/fullycapable/")
843 (synopsis "Library for working with POSIX capabilities")
844 (description
845 "libcap2 provides a programming interface to POSIX capabilities on
846Linux-based operating systems.")
847
848 ;; License is BSD-3 or GPLv2, at the user's choice.
849 (license gpl2)))
215b6431
LC
850
851(define-public bridge-utils
852 (package
853 (name "bridge-utils")
854 (version "1.5")
855 (source (origin
856 (method url-fetch)
857 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
858 version ".tar.gz"))
859 (sha256
860 (base32
861 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
862 (build-system gnu-build-system)
863
864 ;; The tarball lacks all the generated files.
865 (native-inputs `(("autoconf" ,autoconf)
866 ("automake" ,automake)))
867 (arguments
868 '(#:phases (alist-cons-before
869 'configure 'bootstrap
870 (lambda _
871 (zero? (system* "autoreconf" "-vf")))
872 %standard-phases)
873 #:tests? #f)) ; no 'check' target
874
875 (home-page
876 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
877 (synopsis "Manipulate Ethernet bridges")
878 (description
879 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
880to connect two Ethernet segments together in a protocol independent way.
881Packets are forwarded based on Ethernet address, rather than IP address (like
882a router). Since forwarding is done at Layer 2, all protocols can go
883transparently through a bridge.")
884 (license gpl2+)))
3cc20675
LC
885
886(define-public libnl
887 (package
888 (name "libnl")
889 (version "3.2.13")
890 (source (origin
891 (method url-fetch)
892 (uri (string-append
893 "http://www.infradead.org/~tgr/libnl/files/libnl-"
894 version ".tar.gz"))
895 (sha256
896 (base32
897 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
898 (build-system gnu-build-system)
899 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
900 (home-page "http://www.infradead.org/~tgr/libnl/")
901 (synopsis "NetLink protocol library suite")
902 (description
903 "The libnl suite is a collection of libraries providing APIs to netlink
904protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
905between the kernel and user space processes. It was designed to be a more
906flexible successor to ioctl to provide mainly networking related kernel
907configuration and monitoring interfaces.")
908
909 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
910 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
911 (license gpl2)))
023fef7d
LC
912
913(define-public powertop
914 (package
915 (name "powertop")
916 (version "2.5")
917 (source
918 (origin
919 (method url-fetch)
920 (uri (string-append
921 "https://01.org/powertop/sites/default/files/downloads/powertop-"
922 version ".tar.gz"))
923 (sha256
924 (base32
925 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
926 (build-system gnu-build-system)
927 (inputs
928 ;; TODO: Add pciutils.
929 `(("zlib" ,guix:zlib)
023fef7d
LC
930 ;; ("pciutils" ,pciutils)
931 ("ncurses" ,ncurses)
932 ("libnl" ,libnl)))
c4c4cc05
JD
933 (native-inputs
934 `(("pkg-config" ,pkg-config)))
023fef7d
LC
935 (home-page "https://01.org/powertop/")
936 (synopsis "Analyze power consumption on Intel-based laptops")
937 (description
938 "PowerTOP is a Linux tool to diagnose issues with power consumption and
939power management. In addition to being a diagnostic tool, PowerTOP also has
940an interactive mode where the user can experiment various power management
941settings for cases where the operating system has not enabled these
942settings.")
943 (license gpl2)))
6869e5c9
LC
944
945(define-public aumix
946 (package
947 (name "aumix")
948 (version "2.9.1")
949 (source (origin
950 (method url-fetch)
951 (uri (string-append
952 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
953 version ".tar.bz2"))
954 (sha256
955 (base32
956 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
957 (build-system gnu-build-system)
958 (inputs `(("ncurses" ,ncurses)))
959 (home-page "http://www.jpj.net/~trevor/aumix.html")
960 (synopsis "Audio mixer for X and the console")
961 (description
962 "Aumix adjusts an audio mixer from X, the console, a terminal,
963the command line or a script.")
964 (license gpl2+)))
7c0dbe78
SHT
965
966(define-public iotop
967 (package
968 (name "iotop")
969 (version "0.6")
970 (source
971 (origin
972 (method url-fetch)
973 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
974 version ".tar.gz"))
975 (sha256 (base32
976 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
977 (build-system python-build-system)
978 (arguments
35cebf01 979 ;; The setup.py script expects python-2.
7c0dbe78 980 `(#:python ,python-2
35cebf01 981 ;; There are currently no checks in the package.
7c0dbe78
SHT
982 #:tests? #f))
983 (native-inputs `(("python" ,python-2)))
984 (home-page "http://guichaz.free.fr/iotop/")
985 (synopsis
986 "Displays the IO activity of running processes")
987 (description
988 "Iotop is a Python program with a top like user interface to show the
989processes currently causing I/O.")
35cebf01 990 (license gpl2+)))
e30835e2
LC
991
992(define-public fuse
993 (package
994 (name "fuse")
995 (version "2.9.3")
996 (source (origin
997 (method url-fetch)
998 (uri (string-append "mirror://sourceforge/fuse/fuse-"
999 version ".tar.gz"))
1000 (sha256
1001 (base32
1002 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
1003 (build-system gnu-build-system)
b148bd71 1004 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1005 (arguments
1006 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1007 (assoc-ref %outputs "out")
1008 "/sbin")
1009 (string-append "INIT_D_PATH="
1010 (assoc-ref %outputs "out")
1011 "/etc/init.d")
1012 (string-append "UDEV_RULES_PATH="
1013 (assoc-ref %outputs "out")
b148bd71
LC
1014 "/etc/udev"))
1015 #:phases (alist-cons-before
1016 'build 'set-file-names
1017 (lambda* (#:key inputs #:allow-other-keys)
1018 ;; libfuse calls out to mount(8) and umount(8). Make sure
1019 ;; it refers to the right ones.
1020 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1021 (("/bin/(u?)mount" _ maybe-u)
1022 (string-append (assoc-ref inputs "util-linux")
1023 "/bin/" maybe-u "mount")))
1024 (substitute* '("util/mount.fuse.c")
1025 (("/bin/sh")
bd663902
LC
1026 (which "sh")))
1027
1028 ;; This hack leads libfuse to search for 'fusermount' in
1029 ;; $PATH, where it may find a setuid-root binary, instead of
1030 ;; trying solely $out/sbin/fusermount and failing because
1031 ;; it's not setuid.
1032 (substitute* "lib/Makefile"
1033 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1034 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1035 %standard-phases)))
e30835e2
LC
1036 (home-page "http://fuse.sourceforge.net/")
1037 (synopsis "Support file systems implemented in user space")
1038 (description
1039 "As a consequence of its monolithic design, file system code for Linux
1040normally goes into the kernel itself---which is not only a robustness issue,
1041but also an impediment to system extensibility. FUSE, for \"file systems in
1042user space\", is a kernel module and user-space library that tries to address
1043part of this problem by allowing users to run file system implementations as
1044user-space processes.")
1045 (license (list lgpl2.1 ; library
1046 gpl2+)))) ; command-line utilities
220193ad
LC
1047
1048(define-public unionfs-fuse
1049 (package
1050 (name "unionfs-fuse")
1051 (version "0.26")
1052 (source (origin
1053 (method url-fetch)
1054 (uri (string-append
1055 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1056 version ".tar.xz"))
1057 (sha256
1058 (base32
1059 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1060 (build-system cmake-build-system)
1061 (inputs `(("fuse" ,fuse)))
1062 (arguments '(#:tests? #f)) ; no tests
1063 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1064 (synopsis "User-space union file system")
1065 (description
1066 "UnionFS-FUSE is a flexible union file system implementation in user
1067space, using the FUSE library. Mounting a union file system allows you to
1068\"aggregate\" the contents of several directories into a single mount point.
1069UnionFS-FUSE additionally supports copy-on-write.")
1070 (license bsd-3)))
ed748588 1071
0b7a0c20
LC
1072(define fuse-static
1073 (package (inherit fuse)
1074 (name "fuse-static")
1075 (source (origin (inherit (package-source fuse))
1076 (modules '((guix build utils)))
1077 (snippet
1078 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1079 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1080 ;; it doesn't do that, allowing us to remove the dependency on
1081 ;; util-linux (something that is useful in initrds.)
1082 '(substitute* '("lib/mount_util.c"
1083 "util/mount_util.c")
1084 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1085 "0")
1086 (("/bin/")
1087 "")))))))
1088
ed748588
LC
1089(define-public unionfs-fuse/static
1090 (package (inherit unionfs-fuse)
1091 (synopsis "User-space union file system (statically linked)")
1092 (name (string-append (package-name unionfs-fuse) "-static"))
1093 (source (origin (inherit (package-source unionfs-fuse))
1094 (modules '((guix build utils)))
1095 (snippet
1096 ;; Add -ldl to the libraries, because libfuse.a needs that.
1097 '(substitute* "src/CMakeLists.txt"
1098 (("target_link_libraries(.*)\\)" _ libs)
1099 (string-append "target_link_libraries"
1100 libs " dl)"))))))
1101 (arguments
1102 '(#:tests? #f
1456cff1
LC
1103 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1104 #:phases (alist-cons-after
1105 'install 'post-install
1106 (lambda* (#:key outputs #:allow-other-keys)
1107 (let* ((out (assoc-ref outputs "out"))
1108 (exe (string-append out "/bin/unionfs")))
1109 ;; By default, 'unionfs' keeps references to
1110 ;; $glibc/share/locale and similar stuff. Remove them.
1111 (remove-store-references exe)))
1112 %standard-phases)))
0b7a0c20 1113 (inputs `(("fuse" ,fuse-static)))))
67b66003 1114
db288efa
LC
1115(define-public sshfs-fuse
1116 (package
1117 (name "sshfs-fuse")
1118 (version "2.5")
1119 (source (origin
1120 (method url-fetch)
1121 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1122 version ".tar.gz"))
1123 (sha256
1124 (base32
1125 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1126 (build-system gnu-build-system)
1127 (inputs
1128 `(("fuse" ,fuse)
1129 ("glib" ,glib)))
1130 (native-inputs
1131 `(("pkg-config" ,pkg-config)))
1132 (home-page "http://fuse.sourceforge.net/sshfs.html")
1133 (synopsis "Mount remote file systems over SSH")
1134 (description
1135 "This is a file system client based on the SSH File Transfer Protocol.
1136Since most SSH servers already support this protocol it is very easy to set
1137up: on the server side there's nothing to do; on the client side mounting the
1138file system is as easy as logging into the server with an SSH client.")
1139 (license gpl2+)))
1140
67b66003
LC
1141(define-public numactl
1142 (package
1143 (name "numactl")
1144 (version "2.0.9")
1145 (source (origin
1146 (method url-fetch)
1147 (uri (string-append
1148 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1149 version
1150 ".tar.gz"))
1151 (sha256
1152 (base32
1153 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1154 (build-system gnu-build-system)
1155 (arguments
1156 '(#:phases (alist-replace
1157 'configure
1158 (lambda* (#:key outputs #:allow-other-keys)
1159 ;; There's no 'configure' script, just a raw makefile.
1160 (substitute* "Makefile"
1161 (("^prefix := .*$")
1162 (string-append "prefix := " (assoc-ref outputs "out")
1163 "\n"))
1164 (("^libdir := .*$")
1165 ;; By default the thing tries to install under
1166 ;; $prefix/lib64 when on a 64-bit platform.
1167 (string-append "libdir := $(prefix)/lib\n"))))
1168 %standard-phases)
1169
1170 #:make-flags (list
1171 ;; By default the thing tries to use 'cc'.
1172 "CC=gcc"
1173
1174 ;; Make sure programs have an RPATH so they can find
1175 ;; libnuma.so.
1176 (string-append "LDLIBS=-Wl,-rpath="
1177 (assoc-ref %outputs "out") "/lib"))
1178
1179 ;; There's a 'test' target, but it requires NUMA support in the kernel
1180 ;; to run, which we can't assume to have.
1181 #:tests? #f))
1182 (home-page "http://oss.sgi.com/projects/libnuma/")
1183 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1184 (description
1185 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1186memory is not all in one place. The numactl program allows you to run your
1187application program on specific CPU's and memory nodes. It does this by
1188supplying a NUMA memory policy to the operating system before running your
1189program.
1190
1191The package contains other commands, such as numademo, numastat and memhog.
1192The numademo command provides a quick overview of NUMA performance on your
1193system.")
1194 (license (list gpl2 ; programs
1195 lgpl2.1)))) ; library
b10e9ff6
LC
1196
1197(define-public kbd
1198 (package
1199 (name "kbd")
1200 (version "2.0.1")
1201 (source (origin
1202 (method url-fetch)
1203 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1204 version ".tar.gz"))
1205 (sha256
1206 (base32
c8f60748
LC
1207 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1208 (modules '((guix build utils)))
1209 (snippet
f2cdcafb
LC
1210 '(begin
1211 (substitute* "tests/Makefile.in"
1212 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1213 (("@VERSION@")
1214 "[@]VERSION[@]"))
1215 (substitute* '("src/unicode_start" "src/unicode_stop")
1216 ;; Assume the Coreutils are in $PATH.
1217 (("/usr/bin/tty")
1218 "tty"))))))
b10e9ff6
LC
1219 (build-system gnu-build-system)
1220 (arguments
1221 '(#:phases (alist-cons-before
1222 'build 'pre-build
1223 (lambda* (#:key inputs #:allow-other-keys)
1224 (let ((gzip (assoc-ref %build-inputs "gzip"))
1225 (bzip2 (assoc-ref %build-inputs "bzip2")))
1226 (substitute* "src/libkeymap/findfile.c"
1227 (("gzip")
1228 (string-append gzip "/bin/gzip"))
1229 (("bzip2")
1230 (string-append bzip2 "/bin/bzip2")))))
f2cdcafb
LC
1231 (alist-cons-after
1232 'install 'post-install
1233 (lambda* (#:key outputs #:allow-other-keys)
1234 ;; Make sure these programs find their comrades.
1235 (let* ((out (assoc-ref outputs "out"))
1236 (bin (string-append out "/bin")))
1237 (for-each (lambda (prog)
1238 (wrap-program (string-append bin "/" prog)
1239 `("PATH" ":" prefix (,bin))))
1240 '("unicode_start" "unicode_stop"))))
1241 %standard-phases))))
b10e9ff6
LC
1242 (inputs `(("check" ,check)
1243 ("gzip" ,guix:gzip)
1244 ("bzip2" ,guix:bzip2)
1245 ("pam" ,linux-pam)))
1246 (native-inputs `(("pkg-config" ,pkg-config)))
1247 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1248 (synopsis "Linux keyboard utilities and keyboard maps")
1249 (description
1250 "This package contains keytable files and keyboard utilities compatible
1251for systems using the Linux kernel. This includes commands such as
1252'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1253 (license gpl2+)))
de0b620e
LC
1254
1255(define-public inotify-tools
1256 (package
1257 (name "inotify-tools")
1258 (version "3.13")
1259 (source (origin
1260 (method url-fetch)
1261 (uri (string-append
1262 "mirror://sourceforge/inotify-tools/inotify-tools/"
1263 version "/inotify-tools-" version ".tar.gz"))
1264 (sha256
1265 (base32
1266 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1267 (build-system gnu-build-system)
1268 (home-page "http://inotify-tools.sourceforge.net/")
1269 (synopsis "Monitor file accesses")
1270 (description
1271 "The inotify-tools packages provides a C library and command-line tools
1272to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1273 (license gpl2+)))
e062d542
AE
1274
1275(define-public kmod
1276 (package
1277 (name "kmod")
1278 (version "17")
1279 (source (origin
1280 (method url-fetch)
1281 (uri
1282 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1283 "kmod-" version ".tar.xz"))
1284 (sha256
1285 (base32
528b6a3d
LC
1286 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1287 (patches (list (search-patch "kmod-module-directory.patch")))))
e062d542
AE
1288 (build-system gnu-build-system)
1289 (native-inputs
1290 `(("pkg-config" ,pkg-config)))
1291 (inputs
1292 `(("xz" ,guix:xz)
1293 ("zlib" ,guix:zlib)))
1294 (arguments
1295 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1296 #:configure-flags '("--with-xz" "--with-zlib")
1297 #:phases (alist-cons-after
1298 'install 'install-modprobe&co
1299 (lambda* (#:key outputs #:allow-other-keys)
1300 (let* ((out (assoc-ref outputs "out"))
1301 (bin (string-append out "/bin")))
1302 (for-each (lambda (tool)
1303 (symlink "kmod"
1304 (string-append bin "/" tool)))
1305 '("insmod" "rmmod" "lsmod" "modprobe"
1306 "modinfo" "depmod"))))
1307 %standard-phases)))
e062d542
AE
1308 (home-page "https://www.kernel.org/")
1309 (synopsis "Kernel module tools")
1310 (description "kmod is a set of tools to handle common tasks with Linux
1311kernel modules like insert, remove, list, check properties, resolve
1312dependencies and aliases.
1313
1314These tools are designed on top of libkmod, a library that is shipped with
1315kmod. The aim is to be compatible with tools, configurations and indices
1316from the module-init-tools project.")
1317 (license gpl2+))) ; library under lgpl2.1+
d7d42d6b
AE
1318
1319(define-public udev
7fa715e7 1320 ;; The last pre-systemd version.
d7d42d6b
AE
1321 (package
1322 (name "udev")
1323 (version "182")
1324 (source (origin
1325 (method url-fetch)
1326 (uri (string-append
1327 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1328 version ".tar.xz"))
1329 (sha256
1330 (base32
1331 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1332 (patches (list (search-patch "udev-gir-libtool.patch")))))
1333 (build-system gnu-build-system)
1334 (arguments
1335 `(#:configure-flags (list (string-append
1336 "--with-pci-ids-path="
1337 (assoc-ref %build-inputs "pciutils")
1338 "/share/pci.ids.gz")
1339
1340 "--with-firmware-path=/no/firmware"
1341
1342 ;; Work around undefined reference to
1343 ;; 'mq_getattr' in sc-daemon.c.
1344 "LDFLAGS=-lrt")))
1345 (native-inputs
1346 `(("pkg-config" ,pkg-config)
1347 ("gperf" ,gperf)
426adbe8 1348 ("glib" ,glib "bin") ; glib-genmarshal, etc.
d7d42d6b
AE
1349 ("perl" ,perl) ; for the tests
1350 ("python" ,python-2))) ; ditto
1351 (inputs
1352 `(("kmod" ,kmod)
1353 ("pciutils" ,pciutils)
1354 ("usbutils" ,usbutils)
1355 ("util-linux" ,util-linux)
1356 ("glib" ,glib)
1357 ("gobject-introspection" ,gobject-introspection)))
1358 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1359 (synopsis "Userspace device management")
1360 (description "Udev is a daemon which dynamically creates and removes
1361device nodes from /dev/, handles hotplug events and loads drivers at boot
1362time.")
1363 (license gpl2+))) ; libudev is under lgpl2.1+
000f7559 1364
7fa715e7
LC
1365(define-public eudev
1366 ;; The post-systemd fork, maintained by Gentoo.
1367 (package (inherit udev)
1368 (name "eudev")
1369 (version "1.9")
1370 (source (origin
1371 (method url-fetch)
1372 (uri (string-append
1373 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1374 version ".tar.gz"))
1375 (sha256
1376 (base32
1377 "1w6f8h7fhjz3prs630f8gawv7jx74zi600z0pm997kkp24pyj5wg"))))
1378 (home-page "http://www.gentoo.org/proj/en/eudev/")))
1379
66269d47
LC
1380(define-public lvm2
1381 (package
1382 (name "lvm2")
1383 (version "2.02.109")
1384 (source (origin
1385 (method url-fetch)
1386 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1387 version ".tgz"))
1388 (sha256
1389 (base32
1390 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1391 (modules '((guix build utils)))
1392 (snippet
1393 '(begin
1394 (use-modules (guix build utils))
1395
1396 ;; Honor sysconfdir.
1397 (substitute* "make.tmpl.in"
1398 (("confdir = .*$")
1399 "confdir = @sysconfdir@\n")
1400 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1401 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1402 (build-system gnu-build-system)
1403 (native-inputs
1404 `(("pkg-config" ,pkg-config)
1405 ("procps" ,procps))) ;tests use 'pgrep'
1406 (inputs
1407 `(("udev" ,udev)))
1408 (arguments
1409 '(#:phases (alist-cons-after
1410 'configure 'set-makefile-shell
1411 (lambda _
1412 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1413 ;; expected.
1414 (setenv "SHELL" (which "sh"))
1415
1416 ;; Replace /bin/sh with the right file name.
1417 (patch-makefile-SHELL "make.tmpl"))
1418 %standard-phases)
1419
1420 #:configure-flags (list (string-append "--sysconfdir="
1421 (assoc-ref %outputs "out")
1422 "/etc/lvm")
1423 "--enable-udev_sync"
f2817d43
LC
1424 "--enable-udev_rules"
1425
1426 ;; Make sure programs such as 'dmsetup' can
1427 ;; find libdevmapper.so.
1428 (string-append "LDFLAGS=-Wl,-rpath="
1429 (assoc-ref %outputs "out")
1430 "/lib"))
66269d47
LC
1431
1432 ;; The tests use 'mknod', which requires root access.
1433 #:tests? #f))
1434 (home-page "http://sourceware.org/lvm2/")
1435 (synopsis "Logical volume management for Linux")
1436 (description
1437 "LVM2 is the logical volume management tool set for Linux-based systems.
1438This package includes the user-space libraries and tools, including the device
1439mapper. Kernel components are part of Linux-libre.")
1440
1441 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1442 ;; Command-line tools are GPLv2.
1443 (license (list gpl2 lgpl2.1))))
1444
000f7559
DT
1445(define-public wireless-tools
1446 (package
1447 (name "wireless-tools")
1448 (version "30.pre9")
1449 (source (origin
1450 (method url-fetch)
1451 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1452 version ".tar.gz"))
1453 (sha256
1454 (base32
1455 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))))
1456 (build-system gnu-build-system)
1457 (arguments
1458 `(#:phases (alist-replace
1459 'configure
1460 (lambda* (#:key outputs #:allow-other-keys)
1461 (setenv "PREFIX" (assoc-ref outputs "out")))
1462 %standard-phases)
1463 #:tests? #f))
1464 (synopsis "Tools for manipulating Linux Wireless Extensions")
1465 (description "Wireless Tools are used to manipulate the Linux Wireless
1466Extensions. The Wireless Extension is an interface allowing you to set
1467Wireless LAN specific parameters and get the specific stats.")
1468 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1469 (license gpl2+)))
30016044
MW
1470
1471(define-public lm-sensors
1472 (package
1473 (name "lm-sensors")
1474 (version "3.3.5")
1475 (source (origin
1476 (method url-fetch)
1477 (uri (string-append
1478 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1479 version ".tar.bz2"))
1480 (sha256
1481 (base32
1482 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1483 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1484 (build-system gnu-build-system)
1485 (inputs `(("rrdtool" ,rrdtool)
1486 ("perl" ,perl)
1487 ("kmod" ,kmod)
1488 ("gnuplot" ,gnuplot)))
1489 (native-inputs `(("pkg-config" ,pkg-config)
1490 ("flex" ,flex)
1491 ("bison" ,bison)
1492 ("which" ,which)))
1493 (arguments
1494 `(#:tests? #f ; no 'check' target
1495 #:make-flags (list (string-append "PREFIX=" %output)
1496 (string-append "ETCDIR=" %output "/etc")
1497 (string-append "MANDIR=" %output "/share/man"))
1498 #:phases
1499 (alist-delete
1500 'configure
1501 (alist-cons-before
1502 'build 'patch-exec-paths
1503 (lambda* (#:key inputs outputs #:allow-other-keys)
1504 (substitute* "prog/detect/sensors-detect"
1505 (("`uname")
1506 (string-append "`" (assoc-ref inputs "coreutils")
1507 "/bin/uname"))
1508 (("(`|\")modprobe" all open-quote)
1509 (string-append open-quote
1510 (assoc-ref inputs "kmod")
1511 "/bin/modprobe")))
1512 (substitute* '("prog/pwm/pwmconfig"
1513 "prog/pwm/fancontrol")
1514 (("gnuplot")
1515 (string-append (assoc-ref inputs "gnuplot")
1516 "/bin/gnuplot"))
1517 (("cat ")
1518 (string-append (assoc-ref inputs "coreutils")
1519 "/bin/cat "))
1520 (("egrep ")
1521 (string-append (assoc-ref inputs "grep")
1522 "/bin/egrep "))
1523 (("sed -e")
1524 (string-append (assoc-ref inputs "sed")
1525 "/bin/sed -e"))
1526 (("cut -d")
1527 (string-append (assoc-ref inputs "coreutils")
1528 "/bin/cut -d"))
1529 (("sleep ")
1530 (string-append (assoc-ref inputs "coreutils")
1531 "/bin/sleep "))
1532 (("readlink -f")
1533 (string-append (assoc-ref inputs "coreutils")
1534 "/bin/readlink -f"))))
1535 %standard-phases))))
1536 (home-page "http://www.lm-sensors.org/")
1537 (synopsis "Utilities to read temperature/voltage/fan sensors")
1538 (description
1539 "lm-sensors is a hardware health monitoring package for Linux. It allows
1540you to access information from temperature, voltage, and fan speed sensors.
1541It works with most newer systems.")
1542 (license gpl2+)))
b087d413
MW
1543
1544(define-public xsensors
1545 (package
1546 (name "xsensors")
1547 (version "0.70")
1548 (source (origin
1549 (method url-fetch)
1550 (uri (string-append
1551 "http://www.linuxhardware.org/xsensors/xsensors-"
1552 version ".tar.gz"))
1553 (sha256
1554 (base32
1555 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1556 (build-system gnu-build-system)
1557 (inputs `(("lm-sensors" ,lm-sensors)
1558 ("gtk" ,gtk+-2)))
1559 (native-inputs `(("pkg-config" ,pkg-config)))
1560 (arguments
1561 `(#:phases (alist-cons-before
1562 'configure 'enable-deprecated
1563 (lambda _
1564 (substitute* "src/Makefile.in"
1565 (("-DGDK_DISABLE_DEPRECATED") "")
1566 (("-DGTK_DISABLE_DEPRECATED") "")))
1567 (alist-cons-before
1568 'configure 'remove-Werror
1569 (lambda _
1570 (substitute* '("configure" "src/Makefile.in")
1571 (("-Werror") "")))
1572 %standard-phases))))
1573 (home-page "http://www.linuxhardware.org/xsensors/")
1574 (synopsis "Hardware health information viewer")
1575 (description
1576 "xsensors reads data from the libsensors library regarding hardware
1577health such as temperature, voltage and fan speed and displays the information
1578in a digital read-out.")
1579 (license gpl2+)))