gnu: make-linux-libre: Add zImage to output.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
400ed6ac 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
beed3af5 5;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
ebf89f13 8;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
e05647ad 10;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
b53e44fb 11;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
d17ae8c0 14;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
81b98756 15;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
fd76c904 18;;;
233e7676 19;;; This file is part of GNU Guix.
fd76c904 20;;;
233e7676 21;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
233e7676 26;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
233e7676 32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 33
1ffa7090 34(define-module (gnu packages linux)
59a43334 35 #:use-module (gnu packages)
75750abb
DC
36 #:use-module (gnu packages admin)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages attr)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages calendar)
43 #:use-module (gnu packages check)
e385e957 44 #:use-module (gnu packages crypto)
f61e0e79 45 #:use-module (gnu packages compression)
75750abb
DC
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages docbook)
48 #:use-module (gnu packages documentation)
49 #:use-module (gnu packages elf)
1ffa7090 50 #:use-module (gnu packages flex)
75750abb
DC
51 #:use-module (gnu packages freedesktop)
52 #:use-module (gnu packages gcc)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages glib)
e385e957 55 #:use-module (gnu packages gnuzilla)
d7d42d6b 56 #:use-module (gnu packages gperf)
75750abb 57 #:use-module (gnu packages gtk)
1ffa7090 58 #:use-module (gnu packages libusb)
75750abb 59 #:use-module (gnu packages maths)
1ffa7090
LC
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages perl)
75750abb 62 #:use-module (gnu packages pciutils)
1ffa7090 63 #:use-module (gnu packages pkg-config)
75750abb 64 #:use-module (gnu packages pulseaudio)
7c0dbe78 65 #:use-module (gnu packages python)
75750abb
DC
66 #:use-module (gnu packages readline)
67 #:use-module (gnu packages rrdtool)
b1fb4b23 68 #:use-module (gnu packages slang)
f57d2639 69 #:use-module (gnu packages texinfo)
75343704 70 #:use-module (gnu packages tls)
75750abb 71 #:use-module (gnu packages xml)
220193ad 72 #:use-module (guix build-system cmake)
75750abb 73 #:use-module (guix build-system gnu)
e102f940 74 #:use-module (guix build-system python)
a94546ec 75 #:use-module (guix build-system trivial)
75750abb
DC
76 #:use-module (guix download)
77 #:use-module ((guix licenses) #:prefix license:)
78 #:use-module (guix packages)
79 #:use-module (guix utils)
adddd5ba 80 #:use-module (srfi srfi-1)
17db0706 81 #:use-module (srfi srfi-2)
a94546ec
LC
82 #:use-module (srfi srfi-26)
83 #:use-module (ice-9 match))
fd76c904 84
aaf4cb20
LC
85(define-public (system->linux-architecture arch)
86 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 87\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
88 (let ((arch (car (string-split arch #\-))))
89 (cond ((string=? arch "i686") "i386")
90 ((string-prefix? "mips" arch) "mips")
aaf4cb20 91 ((string-prefix? "arm" arch) "arm")
503275e9 92 ((string-prefix? "aarch64" arch) "arm64")
618cea69
NK
93 (else arch))))
94
6023cc74
LC
95(define (linux-libre-urls version)
96 "Return a list of URLs for Linux-Libre VERSION."
97 (list (string-append
98 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
99 version "-gnu/linux-libre-" version "-gnu.tar.xz")
100
101 ;; XXX: Work around <http://bugs.gnu.org/14851>.
102 (string-append
103 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
104 version "-gnu.tar.xz")
105
106 ;; Maybe this URL will become valid eventually.
107 (string-append
108 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
109 version "-gnu.tar.xz")))
110
80fe5c60 111(define-public linux-libre-headers
419016da 112 (let* ((version "4.1.18")
80fe5c60 113 (build-phase
618cea69
NK
114 (lambda (arch)
115 `(lambda _
116 (setenv "ARCH" ,(system->linux-architecture arch))
117 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 118
618cea69
NK
119 (and (zero? (system* "make" "defconfig"))
120 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
121 (install-phase
122 `(lambda* (#:key outputs #:allow-other-keys)
123 (let ((out (assoc-ref outputs "out")))
124 (and (zero? (system* "make"
125 (string-append "INSTALL_HDR_PATH=" out)
126 "headers_install"))
b15389e1
LC
127 (begin
128 (mkdir (string-append out "/include/config"))
129 (call-with-output-file
130 (string-append out
131 "/include/config/kernel.release")
132 (lambda (p)
133 (format p "~a-default~%" ,version)))
134
135 ;; Remove the '.install' and '..install.cmd' files; the
136 ;; latter contains store paths, which pulls in bootstrap
137 ;; binaries in the build environment, and prevents bit
138 ;; reproducibility for the bootstrap binaries.
139 (for-each delete-file (find-files out "\\.install"))
140
141 #t))))))
80fe5c60
LC
142 (package
143 (name "linux-libre-headers")
dfb52abb 144 (version version)
80fe5c60
LC
145 (source (origin
146 (method url-fetch)
6023cc74 147 (uri (linux-libre-urls version))
80fe5c60
LC
148 (sha256
149 (base32
419016da 150 "1bddh2rg645lavhjkk9z75vflba5y0g73z2fjwgbfrj5jb44x9i7"))))
80fe5c60
LC
151 (build-system gnu-build-system)
152 (native-inputs `(("perl" ,perl)))
153 (arguments
154 `(#:modules ((guix build gnu-build-system)
155 (guix build utils)
56c092ce 156 (srfi srfi-1))
80fe5c60 157 #:phases (alist-replace
fb6c2fa8
LC
158 'build ,(build-phase (or (%current-target-system)
159 (%current-system)))
80fe5c60
LC
160 (alist-replace
161 'install ,install-phase
56c092ce 162 (alist-delete 'configure %standard-phases)))
b15389e1 163 #:allowed-references ()
80fe5c60
LC
164 #:tests? #f))
165 (synopsis "GNU Linux-Libre kernel headers")
166 (description "Headers of the Linux-Libre kernel.")
3ac73271 167 (license license:gpl2)
80fe5c60
LC
168 (home-page "http://www.gnu.org/software/linux-libre/"))))
169
b4fcb735
LC
170(define-public module-init-tools
171 (package
172 (name "module-init-tools")
173 (version "3.16")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append
885009c5
DC
177 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
178 "module-init-tools-" version ".tar.bz2"))
b4fcb735
LC
179 (sha256
180 (base32
d3bbe992 181 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
fc1adab1 182 (patches (search-patches "module-init-tools-moduledir.patch"))))
b4fcb735 183 (build-system gnu-build-system)
b4fcb735 184 (arguments
5c413a9c
LC
185 ;; FIXME: The upstream tarball lacks man pages, and building them would
186 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
187 ;; but they vanished. In the meantime, fake it.
b4fcb735 188 '(#:phases (alist-cons-before
5c413a9c
LC
189 'configure 'fake-docbook
190 (lambda _
191 (substitute* "Makefile.in"
192 (("^DOCBOOKTOMAN.*$")
193 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
194 %standard-phases)))
195 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
196 (synopsis "Tools for loading and managing Linux kernel modules")
197 (description
198 "Tools for loading and managing Linux kernel modules, such as `modprobe',
199`insmod', `lsmod', and more.")
3ac73271 200 (license license:gpl2+)))
b4fcb735 201
594d740d
JD
202(define-public libnfsidmap
203 (package
204 (name "libnfsidmap")
205 (version "0.25")
206 (source (origin
207 (method url-fetch)
208 (uri (string-append
209 "http://www.citi.umich.edu/projects/nfsv4/linux/"
210 name "/" name "-" version ".tar.gz"))
211 (sha256
212 (base32
213 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
214 (build-system gnu-build-system)
fd0a23e9
JD
215 (arguments
216 `(#:configure-flags (list
217 (string-append "--with-pluginpath="
218 (assoc-ref %outputs "out")
219 "/lib/libnfsidmap"))))
594d740d
JD
220 (home-page
221 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
222 (synopsis
223 "NFSv4 support library for name/ID mapping")
224 (description "Libnfsidmap is a library holding mulitiple methods of
225mapping names to ids and visa versa, mainly for NFSv4. It provides an
6a540995 226extensible array of mapping functions, currently consisting of two choices:
e2c1b70c 227the default @code{nsswitch} and the experimental @code{umich_ldap}.")
594d740d
JD
228 (license (license:non-copyleft "file://COPYING"
229 "See COPYING in the distribution."))))
230
ac47a7c2
LC
231(define %boot-logo-patch
232 ;; Linux-Libre boot logo featuring Freedo and a gnu.
233 (origin
234 (method url-fetch)
235 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 236 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
237 (sha256
238 (base32
239 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
240
c258807a 241(define* (kernel-config arch #:key variant)
a94546ec 242 "Return the absolute file name of the Linux-Libre build configuration file
c258807a
DC
243for ARCH and optionally VARIANT, or #f if there is no such configuration."
244 (let* ((name (string-append "linux-libre-"
245 (if variant (string-append variant "-") "")
246 arch ".conf"))
247 (file (string-append "gnu/packages/" name)))
248 (if file-exists? (search-path %load-path file) #f)))
a94546ec 249
90c18c32
DC
250(define %default-extra-linux-options
251 `(("CONFIG_NET_9P" . m)
252 ("CONFIG_NET_9P_VIRTIO" . m)
253 ("CONFIG_VIRTIO_BLK" . m)
254 ("CONFIG_VIRTIO_NET" . m)
255 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
256 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
257 ("CONFIG_VIRTIO_PCI" . m)
258 ("CONFIG_VIRTIO_BALLOON" . m)
259 ("CONFIG_VIRTIO_MMIO" . m)
260 ("CONFIG_FUSE_FS" . m)
261 ("CONFIG_CIFS" . m)
262 ("CONFIG_9P_FS" . m)))
263
264(define (config->string options)
265 (string-join (map (match-lambda
266 ((option . 'm)
267 (string-append option "=m"))
268 ((option . #t)
269 (string-append option "=y"))
270 ((option . #f)
271 (string-append option "=n")))
272 options)
273 "\n"))
274
c258807a
DC
275(define* (make-linux-libre version hash
276 #:key
277 ;; A function that takes an arch and a variant.
278 ;; See kernel-config for an example.
a6d01325 279 (extra-version #f)
c258807a 280 (configuration-file #f)
90c18c32
DC
281 (defconfig "defconfig")
282 (extra-options %default-extra-linux-options))
614d1738 283 (package
a6d01325
DC
284 (name (if extra-version
285 (string-append "linux-libre-" extra-version)
286 "linux-libre"))
c258807a 287 (version version)
614d1738
DC
288 (source (origin
289 (method url-fetch)
290 (uri (linux-libre-urls version))
c258807a 291 (sha256 (base32 hash))
499fb7e0 292 (patches (origin-patches %boot-logo-patch))))
614d1738
DC
293 (build-system gnu-build-system)
294 (supported-systems '("x86_64-linux" "i686-linux"))
295 (native-inputs
296 `(("perl" ,perl)
297 ("bc" ,bc)
298 ("openssl" ,openssl)
299 ("module-init-tools" ,module-init-tools)
c258807a
DC
300 ,@(let ((conf (configuration-file
301 (system->linux-architecture
302 (or (%current-target-system)
303 (%current-system)))
304 #:variant (version-major+minor version))))
614d1738
DC
305 (if conf
306 `(("kconfig" ,conf))
307 '()))))
308 (arguments
309 `(#:modules ((guix build gnu-build-system)
310 (guix build utils)
311 (srfi srfi-1)
312 (ice-9 match))
313 #:phases
314 (modify-phases %standard-phases
9416459b 315 (replace 'configure
4b42703e 316 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
317 ;; Avoid introducing timestamps
318 (setenv "KCONFIG_NOTIMESTAMP" "1")
319 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
320
4b42703e 321 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
322 (let ((arch ,(system->linux-architecture
323 (or (%current-target-system)
324 (%current-system)))))
4b42703e
DC
325 (setenv "ARCH" arch)
326 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 327
4b42703e
DC
328 (when target
329 (setenv "CROSS_COMPILE" (string-append target "-"))
330 (format #t "`CROSS_COMPILE' set to `~a'~%"
331 (getenv "CROSS_COMPILE"))))
beacfcab 332
a6d01325
DC
333 (setenv "EXTRA_VERSION" ,extra-version)
334
a94546ec
LC
335 (let ((build (assoc-ref %standard-phases 'build))
336 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
337
338 ;; Use the architecture-specific config if available, and
339 ;; 'defconfig' otherwise.
340 (if config
341 (begin
342 (copy-file config ".config")
343 (chmod ".config" #o666))
c258807a 344 (system* "make" ,defconfig))
a94546ec
LC
345
346 ;; Appending works even when the option wasn't in the
347 ;; file. The last one prevails if duplicated.
90c18c32
DC
348 (let ((port (open-file ".config" "a"))
349 (extra-configuration ,(config->string extra-options)))
350 (display extra-configuration port)
a94546ec
LC
351 (close-port port))
352
9416459b 353 (zero? (system* "make" "oldconfig")))))
614d1738 354 (replace 'install
4b42703e 355 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
356 (let* ((out (assoc-ref outputs "out"))
357 (moddir (string-append out "/lib/modules"))
4b42703e 358 (mit (assoc-ref (or native-inputs inputs) "module-init-tools")))
beacfcab
LC
359 (mkdir-p moddir)
360 (for-each (lambda (file)
361 (copy-file file
362 (string-append out "/" (basename file))))
fd6e0de3 363 (find-files "." "^(bzImage|zImage|vmlinuz|System\\.map)$"))
beacfcab
LC
364 (copy-file ".config" (string-append out "/config"))
365 (zero? (system* "make"
366 (string-append "DEPMOD=" mit "/sbin/depmod")
367 (string-append "MODULE_DIR=" moddir)
368 (string-append "INSTALL_PATH=" out)
369 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 370 "INSTALL_MOD_STRIP=1"
beacfcab 371 "modules_install"))))))
beacfcab 372 #:tests? #f))
614d1738 373 (home-page "http://www.gnu.org/software/linux-libre/")
f50d2669 374 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 375 (description
79c311b8
LC
376 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
377It has been modified to remove all non-free binary blobs.")
614d1738 378 (license license:gpl2)))
beacfcab 379
c258807a
DC
380(define-public linux-libre
381 (make-linux-libre "4.7.3"
382 "18sy1vh4x66hsk0qbq8g5299my082d530zm8c7xnbakq7350igi6"
383 #:configuration-file kernel-config))
384
75b314a6 385(define-public linux-libre-4.4
c258807a
DC
386 (make-linux-libre "4.4.20"
387 "1fi0pyyzcf643vdsss0d9ld6jqyxw0k76r0a5vpd4mv3dcl37yyq"
388 #:configuration-file kernel-config))
75b314a6 389
adddd5ba 390(define-public linux-libre-4.1
c258807a
DC
391 (make-linux-libre "4.1.31"
392 "0grffah921k136w1qwcswxv6m810s8q54nr2rk7kyqka3a1b81yw"
393 #:configuration-file kernel-config))
adddd5ba 394
97121c2a 395\f
c84d0eca
LC
396;;;
397;;; Pluggable authentication modules (PAM).
398;;;
399
fd76c904
LC
400(define-public linux-pam
401 (package
402 (name "linux-pam")
e3780200 403 (version "1.2.1")
fd76c904
LC
404 (source
405 (origin
406 (method url-fetch)
407 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
408 version ".tar.bz2")
409 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
410 version ".tar.bz2")))
411 (sha256
412 (base32
e3780200 413 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))))
fd76c904 414 (build-system gnu-build-system)
c4c4cc05 415 (native-inputs
fd76c904
LC
416 `(("flex" ,flex)
417
418 ;; TODO: optional dependencies
419 ;; ("libxcrypt" ,libxcrypt)
420 ;; ("cracklib" ,cracklib)
421 ))
422 (arguments
c134056a
LC
423 '(;; Most users, such as `shadow', expect the headers to be under
424 ;; `security'.
425 #:configure-flags (list (string-append "--includedir="
426 (assoc-ref %outputs "out")
427 "/include/security"))
428
429 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
430 ;; isn't available.
431 #:tests? #f))
fd76c904
LC
432 (home-page "http://www.linux-pam.org/")
433 (synopsis "Pluggable authentication modules for Linux")
434 (description
435 "A *Free* project to implement OSF's RFC 86.0.
436Pluggable authentication modules are small shared object files that can
437be used through the PAM API to perform tasks, like authenticating a user
e881752c 438at login. Local and dynamic reconfiguration are its key features.")
3ac73271 439 (license license:bsd-3)))
686f14e8 440
53142109 441
c84d0eca
LC
442;;;
443;;; Miscellaneous.
444;;;
445
686f14e8
LC
446(define-public psmisc
447 (package
448 (name "psmisc")
449 (version "22.20")
450 (source
451 (origin
452 (method url-fetch)
453 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
454 version ".tar.gz"))
455 (sha256
456 (base32
457 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
458 (build-system gnu-build-system)
459 (inputs `(("ncurses" ,ncurses)))
460 (home-page "http://psmisc.sourceforge.net/")
461 (synopsis
35b9e423 462 "Small utilities that use the proc filesystem")
686f14e8
LC
463 (description
464 "This PSmisc package is a set of some small useful utilities that
35b9e423 465use the proc filesystem. We're not about changing the world, but
686f14e8 466providing the system administrator with some help in common tasks.")
3ac73271 467 (license license:gpl2+)))
02b80c3f
NK
468
469(define-public util-linux
470 (package
471 (name "util-linux")
57a66c27 472 (version "2.27")
5a6a3ba4
LC
473 (source (origin
474 (method url-fetch)
475 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
476 name "/v" (version-major+minor version) "/"
477 name "-" version ".tar.xz"))
5a6a3ba4
LC
478 (sha256
479 (base32
57a66c27 480 "1ivdx1bhjbakf77agm9dn3wyxia1wgz9lzxgd61zqxw3xzih9gzw"))
fc1adab1 481 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
482 (modules '((guix build utils)))
483 (snippet
ec2da92c
LC
484 ;; We take the 'logger' program from GNU Inetutils and 'kill'
485 ;; from GNU Coreutils.
8338c241
MW
486 '(begin
487 (substitute* "configure"
488 (("build_logger=yes") "build_logger=no")
489 (("build_kill=yes") "build_kill=no"))
490 #t))))
02b80c3f 491 (build-system gnu-build-system)
dd581e9a
TGR
492 (outputs '("out"
493 "static")) ; >2 MiB of static .a libraries
02b80c3f 494 (arguments
29ec55ee 495 `(#:configure-flags (list "--disable-use-tty-group"
29ec55ee
LC
496
497 ;; Install completions where our
498 ;; bash-completion package expects them.
499 (string-append "--with-bashcompletiondir="
500 (assoc-ref %outputs "out")
501 "/etc/bash_completion.d"))
1b9cf4ad 502 #:phases (modify-phases %standard-phases
7e512497
LC
503 (add-before
504 'build 'set-umount-file-name
505 (lambda* (#:key outputs #:allow-other-keys)
506 ;; Tell 'eject' the right file name of 'umount'.
507 (let ((out (assoc-ref outputs "out")))
508 (substitute* "sys-utils/eject.c"
509 (("\"/bin/umount\"")
510 (string-append "\"" out "/bin/umount\"")))
511 #t)))
1b9cf4ad
LC
512 (add-before
513 'check 'pre-check
514 (lambda* (#:key inputs outputs #:allow-other-keys)
515 (let ((out (assoc-ref outputs "out"))
516 (net (assoc-ref inputs "net-base")))
517 ;; Change the test to refer to the right file.
518 (substitute* "tests/ts/misc/mcookie"
519 (("/etc/services")
520 (string-append net "/etc/services")))
dd581e9a
TGR
521 #t)))
522 (add-after
523 'install 'move-static-libraries
524 (lambda* (#:key outputs #:allow-other-keys)
525 (let ((out (assoc-ref outputs "out"))
526 (static (assoc-ref outputs "static")))
527 (mkdir-p (string-append static "/lib"))
528 (with-directory-excursion out
529 (for-each (lambda (file)
530 (rename-file file
531 (string-append static "/"
532 file)))
533 (find-files "lib" "\\.a$")))
1b9cf4ad 534 #t))))))
f61e0e79 535 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
536 ("ncurses" ,ncurses)))
537 (native-inputs
9f533d60
LC
538 `(("perl" ,perl)
539 ("net-base" ,net-base))) ;for tests
02b80c3f 540 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 541 (synopsis "Collection of utilities for the Linux kernel")
437d7286
LF
542 (description "Util-linux is a diverse collection of Linux kernel
543utilities. It provides dmesg and includes tools for working with filesystems,
544block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 545
02b80c3f 546 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 547 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 548 ;; explicitly defined license.
3ac73271
LC
549 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
550 license:bsd-4 license:public-domain))))
5d5c4278 551
e47e3eff
LC
552(define-public procps
553 (package
554 (name "procps")
0cc22848 555 (version "3.3.11")
e47e3eff 556 (source (origin
0cc22848
SB
557 (method url-fetch)
558 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
559 "procps-ng-" version ".tar.xz"))
560 (sha256
561 (base32
d46123aa
MR
562 "1va4n0mpsq327ca9dqp4hnrpgs6821rp0f2m0jyc1bfjl9lk2jg9"))
563 (patches
564 (list (search-patch "procps-non-linux.patch")))))
e47e3eff 565 (build-system gnu-build-system)
e47e3eff 566 (arguments
80393eed
LC
567 '(#:modules ((guix build utils)
568 (guix build gnu-build-system)
569 (srfi srfi-1)
570 (srfi srfi-26))
0cc22848
SB
571 #:phases
572 (modify-phases %standard-phases
573 (add-after
574 'install 'post-install
575 ;; Remove commands and man pages redudant with
576 ;; Coreutils.
577 (lambda* (#:key outputs #:allow-other-keys)
578 (let* ((out (assoc-ref outputs "out"))
579 (dup (append-map (cut find-files out <>)
580 '("^kill" "^uptime"))))
581 (for-each delete-file dup)
582 #t))))))
583 (inputs `(("ncurses" ,ncurses)))
584 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 585 (synopsis "Utilities that give information about processes")
e47e3eff 586 (description
35b9e423 587 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
588that give information about processes using the Linux /proc file system.
589The package includes the programs ps, top, vmstat, w, kill, free,
590slabtop, and skill.")
3ac73271 591 (license license:gpl2)))
e47e3eff 592
5d5c4278
NK
593(define-public usbutils
594 (package
595 (name "usbutils")
596 (version "006")
597 (source
598 (origin
599 (method url-fetch)
600 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
601 "usbutils-" version ".tar.xz"))
602 (sha256
603 (base32
604 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
605 (build-system gnu-build-system)
606 (inputs
c4c4cc05
JD
607 `(("libusb" ,libusb)))
608 (native-inputs
609 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
610 (home-page "http://www.linux-usb.org/")
611 (synopsis
612 "Tools for working with USB devices, such as lsusb")
613 (description
614 "Tools for working with USB devices, such as lsusb.")
3ac73271 615 (license license:gpl2+)))
0750452a
LC
616
617(define-public e2fsprogs
618 (package
619 (name "e2fsprogs")
7409c8d4 620 (version "1.42.13")
0750452a
LC
621 (source (origin
622 (method url-fetch)
7409c8d4
MW
623 (uri (string-append
624 "mirror://kernel.org/linux/kernel/people/tytso/"
625 name "/v" version "/"
626 name "-" version ".tar.xz"))
0750452a
LC
627 (sha256
628 (base32
7409c8d4 629 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
7c594a2c
LC
630 (modules '((guix build utils)))
631 (snippet
632 '(substitute* "MCONFIG.in"
633 (("INSTALL_SYMLINK = /bin/sh")
634 "INSTALL_SYMLINK = sh")))))
0750452a 635 (build-system gnu-build-system)
c4c4cc05 636 (inputs `(("util-linux" ,util-linux)))
f57d2639 637 (native-inputs `(("pkg-config" ,pkg-config)
7c594a2c 638 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
0750452a 639 (arguments
097e012b 640 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 641 ;; commands, so disable them (see, e.g.,
a124bbd2 642 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
c44ed26c
LC
643 #:configure-flags '("--disable-libblkid"
644 "--disable-libuuid" "--disable-uuidd"
645 "--disable-fsck"
7c594a2c
LC
646
647 ;; Install libext2fs et al.
648 "--enable-elf-shlibs")
649
650 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
651 (assoc-ref %outputs "out")
652 "/lib"))
ddfc2fd8
LC
653
654 #:phases (alist-cons-before
0750452a
LC
655 'configure 'patch-shells
656 (lambda _
657 (substitute* "configure"
658 (("/bin/sh (.*)parse-types.sh" _ dir)
659 (string-append (which "sh") " " dir
660 "parse-types.sh")))
661 (substitute* (find-files "." "^Makefile.in$")
662 (("#!/bin/sh")
663 (string-append "#!" (which "sh")))))
1c975f60
LC
664 (alist-cons-after
665 'install 'install-libs
853c2f18
LC
666 (lambda* (#:key outputs #:allow-other-keys)
667 (let* ((out (assoc-ref outputs "out"))
668 (lib (string-append out "/lib")))
669 (and (zero? (system* "make" "install-libs"))
670
671 ;; Make the .a writable so that 'strip' works.
672 ;; Failing to do that, due to debug symbols, we
673 ;; retain a reference to the final
674 ;; linux-libre-headers, which refer to the
675 ;; bootstrap binaries.
676 (let ((archives (find-files lib "\\.a$")))
677 (for-each (lambda (file)
678 (chmod file #o666))
679 archives)
680 #t))))
1c975f60 681 %standard-phases))
0750452a
LC
682
683 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
684 ;; they fail because we get an extra line that says "Can't check if
685 ;; filesystem is mounted due to missing mtab file".
686 #:tests? #f))
687 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 688 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
689 (description
690 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
691 (license (list license:gpl2 ;programs
692 license:lgpl2.0 ;libext2fs
693 license:x11)))) ;libuuid
d8482ad0 694
e48977e7
LC
695(define e2fsprogs/static
696 (static-package
697 (package (inherit e2fsprogs)
698 (arguments
699 ;; Do not build shared libraries.
700 (substitute-keyword-arguments (package-arguments e2fsprogs)
701 ((#:configure-flags _)
702 '(list "--disable-blkid"))
703 ((#:make-flags _)
704 '(list)))))))
705
e102f940
LC
706(define-public e2fsck/static
707 (package
708 (name "e2fsck-static")
0997771a 709 (version (package-version e2fsprogs))
e102f940
LC
710 (build-system trivial-build-system)
711 (source #f)
712 (arguments
713 `(#:modules ((guix build utils))
714 #:builder
715 (begin
716 (use-modules (guix build utils)
717 (ice-9 ftw)
718 (srfi srfi-26))
719
720 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
721 "/sbin"))
722 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
723 (mkdir-p bin)
724 (with-directory-excursion bin
725 (for-each (lambda (file)
726 (copy-file (string-append source "/" file)
727 file)
728 (remove-store-references file)
729 (chmod file #o555))
730 (scandir source (cut string-prefix? "fsck." <>))))))))
e48977e7 731 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
732 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
733 (description
734 "This package provides statically-linked command of fsck.ext[234] taken
735from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
736 (home-page (package-home-page e2fsprogs))
737 (license (package-license e2fsprogs))))
e102f940 738
7c0a9104
LC
739(define-public extundelete
740 (package
741 (name "extundelete")
742 (version "0.2.4")
743 (source (origin
744 (method url-fetch)
745 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
746 "extundelete/" version "/extundelete-"
747 version ".tar.bz2"))
7c0a9104
LC
748 (sha256
749 (base32
750 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
751 (build-system gnu-build-system)
752 (inputs `(("e2fsprogs" ,e2fsprogs)))
753 (home-page "http://extundelete.sourceforge.net/")
754 (synopsis "Recover deleted files from ext2/3/4 partitions")
755 (description
756 "Extundelete is a set of tools that can recover deleted files from an
757ext3 or ext4 partition.")
3ac73271 758 (license license:gpl2)))
7c0a9104 759
1c975f60
LC
760(define-public zerofree
761 (package
762 (name "zerofree")
763 (version "1.0.3")
764 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
765 (source (origin
766 (method url-fetch)
767 (uri (string-append home-page name "-" version
768 ".tgz"))
769 (sha256
770 (base32
771 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
772 (build-system gnu-build-system)
773 (arguments
774 '(#:phases (alist-replace
775 'install
776 (lambda* (#:key outputs #:allow-other-keys)
777 (let* ((out (assoc-ref outputs "out"))
778 (bin (string-append out "/bin")))
779 (mkdir-p bin)
780 (copy-file "zerofree"
781 (string-append bin "/zerofree"))
782 (chmod (string-append bin "/zerofree")
783 #o555)
784 #t))
785 (alist-delete 'configure %standard-phases))
786 #:tests? #f)) ;no tests
787 (inputs `(("libext2fs" ,e2fsprogs)))
788 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
789 (description
790 "The zerofree command scans the free blocks in an ext2 file system and
791fills any non-zero blocks with zeroes. This is a useful way to make disk
792images more compressible.")
3ac73271 793 (license license:gpl2)))
1c975f60 794
d8482ad0
LC
795(define-public strace
796 (package
797 (name "strace")
798 (version "4.7")
799 (source (origin
800 (method url-fetch)
de67e922
LF
801 (uri (string-append "mirror://sourceforge/strace/strace/" version
802 "/strace-" version ".tar.xz"))
d8482ad0
LC
803 (sha256
804 (base32
805 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
806 (build-system gnu-build-system)
c4c4cc05 807 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
808 (home-page "http://strace.sourceforge.net/")
809 (synopsis "System call tracer for Linux")
810 (description
811 "strace is a system call tracer, i.e. a debugging tool which prints out a
812trace of all the system calls made by a another process/program.")
3ac73271 813 (license license:bsd-3)))
ba04571a 814
e1e27737
TUBK
815(define-public ltrace
816 (package
817 (name "ltrace")
818 (version "0.7.3")
819 (source (origin
820 (method url-fetch)
821 (uri (string-append "http://www.ltrace.org/ltrace_" version
822 ".orig.tar.bz2"))
823 (sha256
824 (base32
825 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
826 (build-system gnu-build-system)
827 (inputs `(("libelf" ,libelf)))
828 (arguments
829 ;; Compilation uses -Werror by default, but it fails.
830 '(#:configure-flags '("--disable-werror")))
831 (home-page "http://www.ltrace.org/")
832 (synopsis "Library call tracer for Linux")
833 (description
834 "ltrace intercepts and records dynamic library calls which are called by
835an executed process and the signals received by that process. It can also
836intercept and print the system calls executed by the program.")
3ac73271 837 (license license:gpl2+)))
e1e27737 838
ba04571a
LC
839(define-public alsa-lib
840 (package
841 (name "alsa-lib")
842 (version "1.0.27.1")
843 (source (origin
844 (method url-fetch)
845 (uri (string-append
846 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
847 version ".tar.bz2"))
848 (sha256
849 (base32
bcd94e19 850 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
fc1adab1 851 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
ba04571a
LC
852 (build-system gnu-build-system)
853 (home-page "http://www.alsa-project.org/")
854 (synopsis "The Advanced Linux Sound Architecture libraries")
855 (description
856 "The Advanced Linux Sound Architecture (ALSA) provides audio and
857MIDI functionality to the Linux-based operating system.")
3ac73271 858 (license license:lgpl2.1+)))
10afdf50 859
17b293a0
LC
860(define-public alsa-utils
861 (package
862 (name "alsa-utils")
43043f23 863 (version "1.1.2")
17b293a0
LC
864 (source (origin
865 (method url-fetch)
992b527d
EF
866 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
867 name "-" version ".tar.bz2"))
17b293a0
LC
868 (sha256
869 (base32
43043f23 870 "0wcha78c2sm8qqk5r3w83cvm8fp6fb1zpd35kmcm24kxhz007xks"))))
17b293a0
LC
871 (build-system gnu-build-system)
872 (arguments
873 ;; XXX: Disable man page creation until we have DocBook.
874 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
875
876 ;; The udev rule is responsible for restoring
877 ;; the volume.
17b293a0
LC
878 (string-append "--with-udev-rules-dir="
879 (assoc-ref %outputs "out")
880 "/lib/udev/rules.d"))
49165145
EF
881 #:phases
882 (modify-phases %standard-phases
883 (add-before
884 'install 'pre-install
885 (lambda _
886 ;; Don't try to mkdir /var/lib/alsa.
887 (substitute* "Makefile"
888 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
889 "true\n")))))))
17b293a0
LC
890 (inputs
891 `(("libsamplerate" ,libsamplerate)
892 ("ncurses" ,ncurses)
893 ("alsa-lib" ,alsa-lib)
894 ("xmlto" ,xmlto)
1dba6407 895 ("gettext" ,gnu-gettext)))
17b293a0
LC
896 (home-page "http://www.alsa-project.org/")
897 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
898 (description
899 "The Advanced Linux Sound Architecture (ALSA) provides audio and
900MIDI functionality to the Linux-based operating system.")
901
902 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
903 ;; GPLv2-only.
3ac73271 904 (license license:gpl2)))
17b293a0 905
10afdf50
LC
906(define-public iptables
907 (package
908 (name "iptables")
ac9fc78f 909 (version "1.4.21")
10afdf50
LC
910 (source (origin
911 (method url-fetch)
912 (uri (string-append
913 "http://www.netfilter.org/projects/iptables/files/iptables-"
914 version ".tar.bz2"))
915 (sha256
916 (base32
ac9fc78f 917 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
10afdf50 918 (build-system gnu-build-system)
50c26d9e
SB
919 (arguments
920 '(#:tests? #f ; no test suite
921 #:configure-flags ; add $libdir to the RUNPATH of executables
922 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
10afdf50
LC
923 (home-page "http://www.netfilter.org/projects/iptables/index.html")
924 (synopsis "Program to configure the Linux IP packet filtering rules")
925 (description
926 "iptables is the userspace command line program used to configure the
35e4b3d5 927Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
10afdf50
LC
928system administrators. Since Network Address Translation is also configured
929from the packet filter ruleset, iptables is used for this, too. The iptables
930package also includes ip6tables. ip6tables is used for configuring the IPv6
931packet filter.")
3ac73271 932 (license license:gpl2+)))
90a0048f
LC
933
934(define-public iproute
935 (package
936 (name "iproute2")
75cd4b05 937 (version "4.4.0")
90a0048f 938 (source (origin
75cd4b05
AK
939 (method url-fetch)
940 (uri (string-append
941 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
942 version ".tar.xz"))
943 (sha256
944 (base32
945 "05351m4m0whsivlblvs3m0nz5q9v6r06ik80z27gf6ca51kw74dw"))))
90a0048f
LC
946 (build-system gnu-build-system)
947 (arguments
948 `(#:tests? #f ; no test suite
949 #:make-flags (let ((out (assoc-ref %outputs "out")))
950 (list "DESTDIR="
951 (string-append "LIBDIR=" out "/lib")
952 (string-append "SBINDIR=" out "/sbin")
953 (string-append "CONFDIR=" out "/etc")
954 (string-append "DOCDIR=" out "/share/doc/"
955 ,name "-" ,version)
956 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
957 #:phases (modify-phases %standard-phases
958 (add-before 'install 'pre-install
959 (lambda _
960 ;; Don't attempt to create /var/lib/arpd.
961 (substitute* "Makefile"
962 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
963 (inputs
964 `(("iptables" ,iptables)
c4c4cc05
JD
965 ("db4" ,bdb)))
966 (native-inputs
967 `(("pkg-config" ,pkg-config)
90a0048f
LC
968 ("flex" ,flex)
969 ("bison" ,bison)))
970 (home-page
971 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
972 (synopsis
9e771e3b 973 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
974 (description
975 "Iproute2 is a collection of utilities for controlling TCP/IP
976networking and traffic with the Linux kernel.
977
978Most network configuration manuals still refer to ifconfig and route as the
979primary network configuration tools, but ifconfig is known to behave
980inadequately in modern network environments. They should be deprecated, but
981most distros still include them. Most network configuration systems make use
982of ifconfig and thus provide a limited feature set. The /etc/net project aims
983to support most modern network technologies, as it doesn't use ifconfig and
984allows a system administrator to make use of all iproute2 features, including
985traffic control.
986
987iproute2 is usually shipped in a package called iproute or iproute2 and
988consists of several tools, of which the most important are ip and tc. ip
989controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
990tools print detailed usage messages and are accompanied by a set of
991manpages.")
3ac73271 992 (license license:gpl2+)))
85e0dc6a
LC
993
994(define-public net-tools
995 ;; XXX: This package is basically unmaintained, but it provides a few
996 ;; commands not yet provided by Inetutils, such as 'route', so we have to
997 ;; live with it.
998 (package
999 (name "net-tools")
1000 (version "1.60")
6b55ee88 1001 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
1002 (source (origin
1003 (method url-fetch)
6b55ee88
LC
1004 (uri (list (string-append
1005 "mirror://sourceforge/net-tools/net-tools-"
1006 version ".tar.bz2")
1007 (string-append
1008 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1009 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
1010 (sha256
1011 (base32
177088a3 1012 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 1013 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
1014 (build-system gnu-build-system)
1015 (arguments
c9e0a44e
LC
1016 '(#:modules ((guix build gnu-build-system)
1017 (guix build utils)
1018 (srfi srfi-1)
1019 (srfi srfi-26))
1020 #:phases (alist-cons-after
cd143df0 1021 'unpack 'patch
85e0dc6a
LC
1022 (lambda* (#:key inputs #:allow-other-keys)
1023 (define (apply-patch file)
9a224ac2 1024 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
1025 "--input" file)))
1026
1027 (let ((patch.gz (assoc-ref inputs "patch")))
1028 (format #t "applying Debian patch set '~a'...~%"
1029 patch.gz)
1030 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
1031 (and (apply-patch "the-patch")
1032 (for-each apply-patch
1033 (find-files "debian/patches"
1034 "\\.patch")))))
1035 (alist-replace
1036 'configure
1037 (lambda* (#:key outputs #:allow-other-keys)
1038 (let ((out (assoc-ref outputs "out")))
1039 (mkdir-p (string-append out "/bin"))
1040 (mkdir-p (string-append out "/sbin"))
1041
1042 ;; Pretend we have everything...
1043 (system "yes | make config")
1044
a153ff80
MW
1045 ;; ... except for the things we don't have.
1046 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1047 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1048 ;; that have been removed.
85e0dc6a 1049 (substitute* '("config.make" "config.h")
a153ff80 1050 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1051 (alist-cons-after
1052 'install 'remove-redundant-commands
1053 (lambda* (#:key outputs #:allow-other-keys)
1054 ;; Remove commands and man pages redundant with
1055 ;; Inetutils.
1056 (let* ((out (assoc-ref outputs "out"))
1057 (dup (append-map (cut find-files out <>)
1058 '("^hostname"
1059 "^(yp|nis|dns)?domainname"))))
1060 (for-each delete-file dup)
1061 #t))
1062 %standard-phases)))
85e0dc6a
LC
1063
1064 ;; Binaries that depend on libnet-tools.a don't declare that
1065 ;; dependency, making it parallel-unsafe.
1066 #:parallel-build? #f
1067
1068 #:tests? #f ; no test suite
0d55c356
MW
1069 #:make-flags (let ((out (assoc-ref %outputs "out")))
1070 (list "CC=gcc"
1071 (string-append "BASEDIR=" out)
1072 (string-append "INSTALLNLSDIR=" out "/share/locale")
1073 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1074
1075 ;; Use the big Debian patch set (the thing does not even compile out of
1076 ;; the box.)
1077 (inputs `(("patch" ,(origin
1078 (method url-fetch)
1079 (uri
1080 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1081 (sha256
1082 (base32
1083 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 1084 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
1085
1086 (synopsis "Tools for controlling the network subsystem in Linux")
1087 (description
1088 "This package includes the important tools for controlling the network
1089subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1090netstat, rarp and route. Additionally, this package contains utilities
1091relating to particular network hardware types (plipconfig, slattach) and
1092advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1093 (license license:gpl2+)))
c762e82e
LC
1094
1095(define-public libcap
1096 (package
1097 (name "libcap")
f6c2d05c 1098 (version "2.24")
c762e82e
LC
1099 (source (origin
1100 (method url-fetch)
c762e82e 1101 (uri (string-append
f6c2d05c
LC
1102 "mirror://kernel.org/linux/libs/security/linux-privs/"
1103 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1104 (sha256
1105 (base32
f6c2d05c 1106 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
c762e82e 1107 (build-system gnu-build-system)
6d889daf
SB
1108 (arguments '(#:phases
1109 (modify-phases %standard-phases
1110 (replace 'configure
1111 ;; Add $libdir to the RUNPATH of executables.
1112 (lambda _
1113 (substitute* "Make.Rules"
1114 (("LDFLAGS := #-g")
1115 (string-append "LDFLAGS := -Wl,-rpath="
1116 %output "/lib"))))))
c762e82e
LC
1117 #:tests? #f ; no 'check' target
1118 #:make-flags (list "lib=lib"
1119 (string-append "prefix="
1120 (assoc-ref %outputs "out"))
1121 "RAISE_SETFCAP=no")))
1122 (native-inputs `(("perl" ,perl)))
1123 (inputs `(("attr" ,attr)))
1124 (home-page "https://sites.google.com/site/fullycapable/")
1125 (synopsis "Library for working with POSIX capabilities")
1126 (description
35b9e423 1127 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1128Linux-based operating systems.")
1129
1130 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1131 (license license:gpl2)))
215b6431
LC
1132
1133(define-public bridge-utils
1134 (package
1135 (name "bridge-utils")
1136 (version "1.5")
1137 (source (origin
1138 (method url-fetch)
de67e922
LF
1139 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1140 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1141 (sha256
1142 (base32
1143 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1144 (build-system gnu-build-system)
1145
1146 ;; The tarball lacks all the generated files.
1147 (native-inputs `(("autoconf" ,autoconf)
1148 ("automake" ,automake)))
1149 (arguments
722ec722
MW
1150 '(#:phases (alist-cons-after
1151 'unpack 'bootstrap
215b6431 1152 (lambda _
e5c8e4f3
DT
1153 ;; Fix "field ‘ip6’ has incomplete type" errors.
1154 (substitute* "libbridge/libbridge.h"
1155 (("#include <linux/if_bridge.h>")
1156 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1157
1158 ;; Ensure that the entire build fails if one of the
1159 ;; sub-Makefiles fails.
1160 (substitute* "Makefile.in"
1161 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1162 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1163
215b6431
LC
1164 (zero? (system* "autoreconf" "-vf")))
1165 %standard-phases)
1166 #:tests? #f)) ; no 'check' target
1167
1168 (home-page
1169 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1170 (synopsis "Manipulate Ethernet bridges")
1171 (description
1172 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1173to connect two Ethernet segments together in a protocol independent way.
1174Packets are forwarded based on Ethernet address, rather than IP address (like
1175a router). Since forwarding is done at Layer 2, all protocols can go
1176transparently through a bridge.")
3ac73271 1177 (license license:gpl2+)))
3cc20675
LC
1178
1179(define-public libnl
1180 (package
1181 (name "libnl")
bdac3d4b 1182 (version "3.2.25")
3cc20675
LC
1183 (source (origin
1184 (method url-fetch)
1185 (uri (string-append
1186 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1187 version ".tar.gz"))
1188 (sha256
1189 (base32
bdac3d4b 1190 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1191 (build-system gnu-build-system)
1192 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1193 (home-page "http://www.infradead.org/~tgr/libnl/")
1194 (synopsis "NetLink protocol library suite")
1195 (description
1196 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1197protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1198between the kernel and user space processes. It was designed to be a more
1199flexible successor to ioctl to provide mainly networking related kernel
1200configuration and monitoring interfaces.")
1201
1202 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1203 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1204 (license license:gpl2)))
023fef7d 1205
65cd77db
MW
1206(define-public iw
1207 (package
1208 (name "iw")
2f9e312a 1209 (version "4.3")
65cd77db
MW
1210 (source (origin
1211 (method url-fetch)
1212 (uri (string-append
2f9e312a 1213 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1214 version ".tar.xz"))
1215 (sha256
1216 (base32
2f9e312a 1217 "085jyvrxzarvn5jl0fk618jjxy50nqx7ifngszc4jxk6a4ddibd6"))))
65cd77db
MW
1218 (build-system gnu-build-system)
1219 (native-inputs `(("pkg-config" ,pkg-config)))
1220 (inputs `(("libnl" ,libnl)))
1221 (arguments
1222 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1223 "CC=gcc")
1224 #:phases (alist-delete 'configure %standard-phases)))
2f9e312a 1225 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1226 (synopsis "Tool for configuring wireless devices")
1227 (description
1228 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1229devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1230 (license license:isc)))
65cd77db 1231
023fef7d
LC
1232(define-public powertop
1233 (package
1234 (name "powertop")
ebacb0de 1235 (version "2.8")
023fef7d
LC
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (string-append
bd60e4e2 1240 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1241 version ".tar.gz"))
1242 (sha256
1243 (base32
ebacb0de 1244 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d 1245 (build-system gnu-build-system)
4c48bf55
ML
1246 (arguments
1247 '(#:phases
1248 (modify-phases %standard-phases
1249 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1250 ;; allow calibrating the network interface in GuixSD.
1251 (add-after 'unpack 'patch-absolute-file-names
1252 (lambda* (#:key inputs #:allow-other-keys)
1253 (let ((kmod (assoc-ref inputs "kmod")))
1254 (substitute* (find-files "src" "\\.cpp$")
1255 ;; Give the right 'modprobe' file name so that essential
1256 ;; modules such as msr.ko can be loaded.
1257 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1258 ;; These programs are only needed to calibrate, so using
1259 ;; relative file names avoids adding extra inputs. When they
1260 ;; are missing powertop gracefully handles it.
1261 (("/usr/bin/hcitool") "hcitool")
1262 (("/usr/bin/xset") "xset")
1263 (("/usr/sbin/hciconfig") "hciconfig"))
1264 #t))))))
023fef7d 1265 (inputs
4c48bf55
ML
1266 `(("kmod" ,kmod)
1267 ("libnl" ,libnl)
023fef7d 1268 ("ncurses" ,ncurses)
4c48bf55
ML
1269 ("pciutils" ,pciutils)
1270 ("zlib" ,zlib)))
c4c4cc05 1271 (native-inputs
ebacb0de 1272 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1273 (home-page "https://01.org/powertop/")
1274 (synopsis "Analyze power consumption on Intel-based laptops")
1275 (description
1276 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1277power management. In addition to being a diagnostic tool, PowerTOP also has
1278an interactive mode where the user can experiment various power management
1279settings for cases where the operating system has not enabled these
1280settings.")
3ac73271 1281 (license license:gpl2)))
6869e5c9
LC
1282
1283(define-public aumix
1284 (package
1285 (name "aumix")
1286 (version "2.9.1")
1287 (source (origin
1288 (method url-fetch)
1289 (uri (string-append
1290 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1291 version ".tar.bz2"))
1292 (sha256
1293 (base32
1294 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1295 (build-system gnu-build-system)
1296 (inputs `(("ncurses" ,ncurses)))
1297 (home-page "http://www.jpj.net/~trevor/aumix.html")
1298 (synopsis "Audio mixer for X and the console")
1299 (description
1300 "Aumix adjusts an audio mixer from X, the console, a terminal,
1301the command line or a script.")
3ac73271 1302 (license license:gpl2+)))
7c0dbe78
SHT
1303
1304(define-public iotop
1305 (package
1306 (name "iotop")
1307 (version "0.6")
1308 (source
1309 (origin
1310 (method url-fetch)
1311 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1312 version ".tar.gz"))
1313 (sha256 (base32
1314 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1315 (build-system python-build-system)
1316 (arguments
35cebf01 1317 ;; The setup.py script expects python-2.
7c0dbe78 1318 `(#:python ,python-2
35cebf01 1319 ;; There are currently no checks in the package.
7c0dbe78
SHT
1320 #:tests? #f))
1321 (native-inputs `(("python" ,python-2)))
1322 (home-page "http://guichaz.free.fr/iotop/")
1323 (synopsis
1324 "Displays the IO activity of running processes")
1325 (description
1326 "Iotop is a Python program with a top like user interface to show the
1327processes currently causing I/O.")
3ac73271 1328 (license license:gpl2+)))
e30835e2
LC
1329
1330(define-public fuse
1331 (package
1332 (name "fuse")
0e9bc883 1333 (version "2.9.6")
e30835e2
LC
1334 (source (origin
1335 (method url-fetch)
0e9bc883
LF
1336 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1337 "download/fuse-" version
1338 "/fuse-" version ".tar.gz"))
e30835e2
LC
1339 (sha256
1340 (base32
0e9bc883 1341 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
e30835e2 1342 (build-system gnu-build-system)
b148bd71 1343 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1344 (arguments
1345 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1346 (assoc-ref %outputs "out")
1347 "/sbin")
1348 (string-append "INIT_D_PATH="
1349 (assoc-ref %outputs "out")
1350 "/etc/init.d")
9a4efac9
LC
1351
1352 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1353 (string-append "UDEV_RULES_PATH="
1354 (assoc-ref %outputs "out")
9a4efac9 1355 "/lib/udev/rules.d"))
b148bd71
LC
1356 #:phases (alist-cons-before
1357 'build 'set-file-names
1358 (lambda* (#:key inputs #:allow-other-keys)
1359 ;; libfuse calls out to mount(8) and umount(8). Make sure
1360 ;; it refers to the right ones.
1361 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1362 (("/bin/(u?)mount" _ maybe-u)
1363 (string-append (assoc-ref inputs "util-linux")
1364 "/bin/" maybe-u "mount")))
1365 (substitute* '("util/mount.fuse.c")
1366 (("/bin/sh")
bd663902
LC
1367 (which "sh")))
1368
1369 ;; This hack leads libfuse to search for 'fusermount' in
1370 ;; $PATH, where it may find a setuid-root binary, instead of
1371 ;; trying solely $out/sbin/fusermount and failing because
1372 ;; it's not setuid.
1373 (substitute* "lib/Makefile"
1374 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1375 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1376 %standard-phases)))
0e9bc883 1377 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1378 (synopsis "Support file systems implemented in user space")
1379 (description
1380 "As a consequence of its monolithic design, file system code for Linux
1381normally goes into the kernel itself---which is not only a robustness issue,
1382but also an impediment to system extensibility. FUSE, for \"file systems in
1383user space\", is a kernel module and user-space library that tries to address
1384part of this problem by allowing users to run file system implementations as
1385user-space processes.")
3ac73271
LC
1386 (license (list license:lgpl2.1 ;library
1387 license:gpl2+)))) ;command-line utilities
220193ad
LC
1388
1389(define-public unionfs-fuse
1390 (package
1391 (name "unionfs-fuse")
1392 (version "0.26")
1393 (source (origin
1394 (method url-fetch)
1395 (uri (string-append
1396 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1397 version ".tar.xz"))
1398 (sha256
1399 (base32
1400 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1401 (build-system cmake-build-system)
1402 (inputs `(("fuse" ,fuse)))
1403 (arguments '(#:tests? #f)) ; no tests
1404 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1405 (synopsis "User-space union file system")
1406 (description
1407 "UnionFS-FUSE is a flexible union file system implementation in user
1408space, using the FUSE library. Mounting a union file system allows you to
1409\"aggregate\" the contents of several directories into a single mount point.
1410UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1411 (license license:bsd-3)))
ed748588 1412
0b7a0c20
LC
1413(define fuse-static
1414 (package (inherit fuse)
1415 (name "fuse-static")
1416 (source (origin (inherit (package-source fuse))
1417 (modules '((guix build utils)))
1418 (snippet
1419 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1420 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1421 ;; it doesn't do that, allowing us to remove the dependency on
1422 ;; util-linux (something that is useful in initrds.)
1423 '(substitute* '("lib/mount_util.c"
1424 "util/mount_util.c")
1425 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1426 "0")
1427 (("/bin/")
1428 "")))))))
1429
ed748588
LC
1430(define-public unionfs-fuse/static
1431 (package (inherit unionfs-fuse)
1432 (synopsis "User-space union file system (statically linked)")
1433 (name (string-append (package-name unionfs-fuse) "-static"))
1434 (source (origin (inherit (package-source unionfs-fuse))
1435 (modules '((guix build utils)))
1436 (snippet
1437 ;; Add -ldl to the libraries, because libfuse.a needs that.
1438 '(substitute* "src/CMakeLists.txt"
1439 (("target_link_libraries(.*)\\)" _ libs)
1440 (string-append "target_link_libraries"
1441 libs " dl)"))))))
1442 (arguments
1443 '(#:tests? #f
1456cff1
LC
1444 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1445 #:phases (alist-cons-after
1446 'install 'post-install
1447 (lambda* (#:key outputs #:allow-other-keys)
1448 (let* ((out (assoc-ref outputs "out"))
1449 (exe (string-append out "/bin/unionfs")))
1450 ;; By default, 'unionfs' keeps references to
1451 ;; $glibc/share/locale and similar stuff. Remove them.
1452 (remove-store-references exe)))
1453 %standard-phases)))
0b7a0c20 1454 (inputs `(("fuse" ,fuse-static)))))
67b66003 1455
db288efa
LC
1456(define-public sshfs-fuse
1457 (package
1458 (name "sshfs-fuse")
b58c1b2d 1459 (version "2.8")
db288efa
LC
1460 (source (origin
1461 (method url-fetch)
b58c1b2d
EF
1462 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1463 "download/sshfs_" version
1464 "/sshfs-" version ".tar.gz"))
db288efa
LC
1465 (sha256
1466 (base32
b58c1b2d 1467 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
db288efa
LC
1468 (build-system gnu-build-system)
1469 (inputs
1470 `(("fuse" ,fuse)
1471 ("glib" ,glib)))
1472 (native-inputs
1473 `(("pkg-config" ,pkg-config)))
1474 (home-page "http://fuse.sourceforge.net/sshfs.html")
1475 (synopsis "Mount remote file systems over SSH")
1476 (description
1477 "This is a file system client based on the SSH File Transfer Protocol.
1478Since most SSH servers already support this protocol it is very easy to set
1479up: on the server side there's nothing to do; on the client side mounting the
1480file system is as easy as logging into the server with an SSH client.")
3ac73271 1481 (license license:gpl2+)))
db288efa 1482
67b66003
LC
1483(define-public numactl
1484 (package
1485 (name "numactl")
e35dff97 1486 (version "2.0.11")
67b66003
LC
1487 (source (origin
1488 (method url-fetch)
1489 (uri (string-append
1490 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1491 version
1492 ".tar.gz"))
1493 (sha256
1494 (base32
e35dff97 1495 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1496 (build-system gnu-build-system)
1497 (arguments
e35dff97 1498 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1499 ;; to run, which we can't assume to have.
1500 #:tests? #f))
b0015064 1501
35dfcdd7
AE
1502 ;; NUMA is apparently not supported on armhf, see
1503 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1504 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1505 (home-page "http://oss.sgi.com/projects/libnuma/")
1506 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1507 (description
1508 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1509memory is not all in one place. The numactl program allows you to run your
1510application program on specific CPU's and memory nodes. It does this by
1511supplying a NUMA memory policy to the operating system before running your
1512program.
1513
1514The package contains other commands, such as numademo, numastat and memhog.
1515The numademo command provides a quick overview of NUMA performance on your
1516system.")
3ac73271
LC
1517 (license (list license:gpl2 ;programs
1518 license:lgpl2.1)))) ;library
b10e9ff6
LC
1519
1520(define-public kbd
1521 (package
1522 (name "kbd")
a78daf5e 1523 (version "2.0.3")
b10e9ff6
LC
1524 (source (origin
1525 (method url-fetch)
1526 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1527 version ".tar.xz"))
b10e9ff6
LC
1528 (sha256
1529 (base32
a78daf5e 1530 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
c8f60748
LC
1531 (modules '((guix build utils)))
1532 (snippet
f2cdcafb
LC
1533 '(begin
1534 (substitute* "tests/Makefile.in"
1535 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1536 (("@VERSION@")
1537 "[@]VERSION[@]"))
1538 (substitute* '("src/unicode_start" "src/unicode_stop")
1539 ;; Assume the Coreutils are in $PATH.
1540 (("/usr/bin/tty")
1541 "tty"))))))
b10e9ff6
LC
1542 (build-system gnu-build-system)
1543 (arguments
5953d2b7
AK
1544 '(#:phases
1545 (modify-phases %standard-phases
1546 (add-before 'build 'pre-build
1547 (lambda* (#:key inputs #:allow-other-keys)
1548 (let ((gzip (assoc-ref %build-inputs "gzip"))
1549 (bzip2 (assoc-ref %build-inputs "bzip2")))
1550 (substitute* "src/libkeymap/findfile.c"
1551 (("gzip")
1552 (string-append gzip "/bin/gzip"))
1553 (("bzip2")
1554 (string-append bzip2 "/bin/bzip2"))))))
1555 (add-after 'install 'post-install
1556 (lambda* (#:key outputs #:allow-other-keys)
1557 ;; Make sure these programs find their comrades.
1558 (let* ((out (assoc-ref outputs "out"))
1559 (bin (string-append out "/bin")))
1560 (for-each (lambda (prog)
1561 (wrap-program (string-append bin "/" prog)
1562 `("PATH" ":" prefix (,bin))))
1563 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1564 (inputs `(("check" ,check)
f61e0e79
LC
1565 ("gzip" ,gzip)
1566 ("bzip2" ,bzip2)
b10e9ff6
LC
1567 ("pam" ,linux-pam)))
1568 (native-inputs `(("pkg-config" ,pkg-config)))
1569 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1570 (synopsis "Linux keyboard utilities and keyboard maps")
1571 (description
1572 "This package contains keytable files and keyboard utilities compatible
1573for systems using the Linux kernel. This includes commands such as
1574'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1575 (license license:gpl2+)))
de0b620e
LC
1576
1577(define-public inotify-tools
1578 (package
1579 (name "inotify-tools")
1580 (version "3.13")
1581 (source (origin
1582 (method url-fetch)
1583 (uri (string-append
1584 "mirror://sourceforge/inotify-tools/inotify-tools/"
1585 version "/inotify-tools-" version ".tar.gz"))
1586 (sha256
1587 (base32
1588 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1589 (build-system gnu-build-system)
1590 (home-page "http://inotify-tools.sourceforge.net/")
1591 (synopsis "Monitor file accesses")
1592 (description
1593 "The inotify-tools packages provides a C library and command-line tools
1594to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1595 (license license:gpl2+)))
e062d542
AE
1596
1597(define-public kmod
1598 (package
1599 (name "kmod")
ac52b72d 1600 (version "22")
e062d542
AE
1601 (source (origin
1602 (method url-fetch)
1603 (uri
1604 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1605 "kmod-" version ".tar.xz"))
1606 (sha256
1607 (base32
ac52b72d 1608 "10lzfkmnpq6a43a3gkx7x633njh216w0bjwz31rv8a1jlgg1sfxs"))
fc1adab1 1609 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1610 (build-system gnu-build-system)
1611 (native-inputs
1612 `(("pkg-config" ,pkg-config)))
1613 (inputs
f61e0e79
LC
1614 `(("xz" ,xz)
1615 ("zlib" ,zlib)))
e062d542
AE
1616 (arguments
1617 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1618 #:configure-flags '("--with-xz" "--with-zlib")
1619 #:phases (alist-cons-after
1620 'install 'install-modprobe&co
1621 (lambda* (#:key outputs #:allow-other-keys)
1622 (let* ((out (assoc-ref outputs "out"))
1623 (bin (string-append out "/bin")))
1624 (for-each (lambda (tool)
1625 (symlink "kmod"
1626 (string-append bin "/" tool)))
1627 '("insmod" "rmmod" "lsmod" "modprobe"
1628 "modinfo" "depmod"))))
1629 %standard-phases)))
e062d542
AE
1630 (home-page "https://www.kernel.org/")
1631 (synopsis "Kernel module tools")
35b9e423 1632 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1633kernel modules like insert, remove, list, check properties, resolve
1634dependencies and aliases.
1635
1636These tools are designed on top of libkmod, a library that is shipped with
1637kmod. The aim is to be compatible with tools, configurations and indices
1638from the module-init-tools project.")
3ac73271 1639 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1640
7fa715e7
LC
1641(define-public eudev
1642 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1643 (package
7fa715e7 1644 (name "eudev")
e75230c1 1645 (version "3.1.5")
7fa715e7
LC
1646 (source (origin
1647 (method url-fetch)
1648 (uri (string-append
1649 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1650 version ".tar.gz"))
1651 (sha256
1652 (base32
e75230c1 1653 "0akg9gcc3c2p56xbhlvbybqavcprly5q0bvk655zwl6d62j8an7p"))
fc1adab1 1654 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7
MW
1655 (build-system gnu-build-system)
1656 (native-inputs
1657 `(("pkg-config" ,pkg-config)
e75230c1
SB
1658 ("perl" ,perl)
1659 ("gperf" ,gperf)))
fe32c7f7 1660 (inputs
255f7308
LC
1661 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1662 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1663 ;; which contains the rules to do that.
1664 `(("util-linux" ,util-linux) ;for blkid
1665 ("kmod" ,kmod)))
e1921a38 1666 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1667 (synopsis "Userspace device management")
1668 (description "Udev is a daemon which dynamically creates and removes
1669device nodes from /dev/, handles hotplug events and loads drivers at boot
1670time.")
3ac73271 1671 (license license:gpl2+)))
7fa715e7 1672
66269d47
LC
1673(define-public lvm2
1674 (package
1675 (name "lvm2")
1676 (version "2.02.109")
1677 (source (origin
1678 (method url-fetch)
1679 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1680 version ".tgz"))
1681 (sha256
1682 (base32
1683 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1684 (modules '((guix build utils)))
1685 (snippet
1686 '(begin
1687 (use-modules (guix build utils))
1688
1689 ;; Honor sysconfdir.
1690 (substitute* "make.tmpl.in"
1691 (("confdir = .*$")
1692 "confdir = @sysconfdir@\n")
1693 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1694 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1695 (build-system gnu-build-system)
1696 (native-inputs
1697 `(("pkg-config" ,pkg-config)
1698 ("procps" ,procps))) ;tests use 'pgrep'
1699 (inputs
8fcaf8b1 1700 `(("udev" ,eudev)))
66269d47
LC
1701 (arguments
1702 '(#:phases (alist-cons-after
1703 'configure 'set-makefile-shell
1704 (lambda _
1705 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1706 ;; expected.
1707 (setenv "SHELL" (which "sh"))
1708
1709 ;; Replace /bin/sh with the right file name.
1710 (patch-makefile-SHELL "make.tmpl"))
1711 %standard-phases)
1712
1713 #:configure-flags (list (string-append "--sysconfdir="
1714 (assoc-ref %outputs "out")
1715 "/etc/lvm")
1716 "--enable-udev_sync"
f2817d43
LC
1717 "--enable-udev_rules"
1718
1719 ;; Make sure programs such as 'dmsetup' can
1720 ;; find libdevmapper.so.
1721 (string-append "LDFLAGS=-Wl,-rpath="
1722 (assoc-ref %outputs "out")
1723 "/lib"))
66269d47
LC
1724
1725 ;; The tests use 'mknod', which requires root access.
1726 #:tests? #f))
1727 (home-page "http://sourceware.org/lvm2/")
1728 (synopsis "Logical volume management for Linux")
1729 (description
1730 "LVM2 is the logical volume management tool set for Linux-based systems.
1731This package includes the user-space libraries and tools, including the device
1732mapper. Kernel components are part of Linux-libre.")
1733
1734 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1735 ;; Command-line tools are GPLv2.
3ac73271 1736 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1737
000f7559
DT
1738(define-public wireless-tools
1739 (package
1740 (name "wireless-tools")
1741 (version "30.pre9")
1742 (source (origin
1743 (method url-fetch)
1744 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1745 version ".tar.gz"))
1746 (sha256
1747 (base32
ec01f22d 1748 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1749 (snippet
c2099a4c
MW
1750 '(begin
1751 ;; Remove the older header files that are not free software.
1752 (for-each (lambda (n)
1753 (delete-file (format #f "wireless.~a.h" n)))
1754 '(10 11 12 13 14 15 16 17 18 19 20))
1755 #t))))
000f7559
DT
1756 (build-system gnu-build-system)
1757 (arguments
c2099a4c
MW
1758 `(#:make-flags
1759 (list (string-append "PREFIX=" %output)
1760 (string-append "INSTALL_MAN=" %output "/share/man")
1761 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1762 "BUILD_STATIC=")
1763 #:phases (modify-phases %standard-phases
1764 (delete 'configure))
000f7559
DT
1765 #:tests? #f))
1766 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1767 (description "Wireless Tools are used to manipulate the now-deprecated
1768Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1769Extension was an interface allowing you to set Wireless LAN specific
1770parameters and get the specific stats. It is deprecated in favor the nl80211
1771interface.")
000f7559 1772 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1773 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1774 ;; other files are distributed under gpl2.
3ac73271 1775 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1776
cc205dac
LC
1777(define-public crda
1778 (package
1779 (name "crda")
1780 (version "3.18")
1781 (source (origin
1782 (method url-fetch)
1783 (uri (string-append "mirror://kernel.org/software/network/crda/"
1784 "crda-" version ".tar.xz"))
1785 (sha256
1786 (base32
1787 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1788 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1789 (build-system gnu-build-system)
1790 (arguments
1791 '(#:phases (modify-phases %standard-phases
1792 (delete 'configure)
1793 (add-before
1794 'build 'no-werror-no-ldconfig
1795 (lambda _
1796 (substitute* "Makefile"
1797 (("-Werror") "")
1798 (("ldconfig") "true"))
1799 #t))
1800 (add-before
1801 'build 'set-regulator-db-file-name
1802 (lambda* (#:key inputs #:allow-other-keys)
1803 ;; Tell CRDA where to find our database.
1804 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1805 (substitute* "crda.c"
1806 (("\"/lib/crda/regulatory.bin\"")
1807 (string-append "\"" regdb
1808 "/lib/crda/regulatory.bin\"")))
1809 #t))))
1810 #:test-target "verify"
1811 #:make-flags (let ((out (assoc-ref %outputs "out"))
1812 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1813 (list "CC=gcc" "V=1"
1814
1815 ;; Disable signature-checking on 'regulatory.bin'.
1816 ;; The reason is that this simplifies maintenance
1817 ;; on our side (no need to manage a distro key
1818 ;; pair), and we can guarantee integrity of
1819 ;; 'regulatory.bin' by other means anyway, such as
1820 ;; 'guix gc --verify'. See
1821 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1822 ;; for a discssion.
1823 "USE_OPENSSL=0"
1824
1825 (string-append "PREFIX=" out)
1826 (string-append "SBINDIR=" out "/sbin/")
1827 (string-append "UDEV_RULE_DIR="
1828 out "/lib/udev/rules.d")
1829 (string-append "LDFLAGS=-Wl,-rpath="
1830 out "/lib -L.")
1831 (string-append "REG_BIN=" regdb
1832 "/lib/crda/regulatory.bin")))))
1833 (native-inputs `(("pkg-config" ,pkg-config)
1834 ("python" ,python-2)
1835 ("wireless-regdb" ,wireless-regdb)))
1836 (inputs `(("libnl" ,libnl)))
1837 (home-page
1838 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1839 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1840 (description
1841 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1842communication between the kernel Linux and user space for regulatory
1843compliance.")
3ac73271 1844 (license license:copyleft-next)))
cc205dac 1845
c80b4a3e
LC
1846(define-public wireless-regdb
1847 (package
1848 (name "wireless-regdb")
9a12ca77 1849 (version "2016.05.02")
c80b4a3e
LC
1850 (source (origin
1851 (method url-fetch)
1852 (uri (string-append
1853 "mirror://kernel.org/software/network/wireless-regdb/"
1854 "wireless-regdb-" version ".tar.xz"))
1855 (sha256
1856 (base32
9a12ca77 1857 "07n6gcwfbddz3awbdflv3dhxjszsqq2lrdwih0a0ahcliac4qry9"))
5568151f
LC
1858
1859 ;; We're building 'regulatory.bin' by ourselves.
1860 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
1861 (build-system gnu-build-system)
1862 (arguments
1863 '(#:phases (modify-phases %standard-phases
1864 (delete 'configure))
5568151f
LC
1865
1866 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1867 ;; is computed and can be equal to 'maintainer-clean'; when that
1868 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1869 ;; just built. Thus, build things sequentially.
1870 #:parallel-build? #f
1871
c80b4a3e
LC
1872 #:tests? #f ;no tests
1873 #:make-flags (let ((out (assoc-ref %outputs "out")))
1874 (list (string-append "PREFIX=" out)
1875 (string-append "LSB_ID=GuixSD")
1876 (string-append "DISTRO_PUBKEY=/dev/null")
1877 (string-append "DISTRO_PRIVKEY=/dev/null")
1878 (string-append "REGDB_PUBKEY=/dev/null")
1879
1880 ;; Leave that empty so that db2bin.py doesn't try
1881 ;; to sign 'regulatory.bin'. This allows us to
1882 ;; avoid managing a key pair for the whole distro.
1883 (string-append "REGDB_PRIVKEY=")))))
1884 (native-inputs `(("python" ,python-2)))
1885 (home-page
1886 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
1887 (synopsis "Wireless regulatory database")
1888 (description
1889 "This package contains the wireless regulatory database Central
1890Regulatory Database Agent (CRDA) daemon. The database contains information on
1891country-specific regulations for the wireless spectrum.")
3ac73271 1892 (license license:isc)))
c80b4a3e 1893
30016044
MW
1894(define-public lm-sensors
1895 (package
1896 (name "lm-sensors")
1897 (version "3.3.5")
1898 (source (origin
1899 (method url-fetch)
ee6a5d0e
AE
1900 (uri (list (string-append
1901 "ftp://ftp.netroedge.com/pub/lm-sensors/"
1902 "lm_sensors-" version ".tar.bz2")
1903 (string-append
1904 "http://pkgs.fedoraproject.org/repo/pkgs/"
1905 "lm_sensors/lm_sensors-3.3.5.tar.bz2/"
1906 "da506dedceb41822e64865f6ba34828a/"
1907 "lm_sensors-3.3.5.tar.bz2")))
30016044
MW
1908 (sha256
1909 (base32
1910 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
fc1adab1 1911 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
1912 (build-system gnu-build-system)
1913 (inputs `(("rrdtool" ,rrdtool)
1914 ("perl" ,perl)
1915 ("kmod" ,kmod)
1916 ("gnuplot" ,gnuplot)))
1917 (native-inputs `(("pkg-config" ,pkg-config)
1918 ("flex" ,flex)
1919 ("bison" ,bison)
1920 ("which" ,which)))
1921 (arguments
1922 `(#:tests? #f ; no 'check' target
1923 #:make-flags (list (string-append "PREFIX=" %output)
1924 (string-append "ETCDIR=" %output "/etc")
1925 (string-append "MANDIR=" %output "/share/man"))
1926 #:phases
1927 (alist-delete
1928 'configure
1929 (alist-cons-before
1930 'build 'patch-exec-paths
1931 (lambda* (#:key inputs outputs #:allow-other-keys)
1932 (substitute* "prog/detect/sensors-detect"
1933 (("`uname")
1934 (string-append "`" (assoc-ref inputs "coreutils")
1935 "/bin/uname"))
1936 (("(`|\")modprobe" all open-quote)
1937 (string-append open-quote
1938 (assoc-ref inputs "kmod")
1939 "/bin/modprobe")))
1940 (substitute* '("prog/pwm/pwmconfig"
1941 "prog/pwm/fancontrol")
1942 (("gnuplot")
1943 (string-append (assoc-ref inputs "gnuplot")
1944 "/bin/gnuplot"))
1945 (("cat ")
1946 (string-append (assoc-ref inputs "coreutils")
1947 "/bin/cat "))
1948 (("egrep ")
1949 (string-append (assoc-ref inputs "grep")
1950 "/bin/egrep "))
1951 (("sed -e")
1952 (string-append (assoc-ref inputs "sed")
1953 "/bin/sed -e"))
1954 (("cut -d")
1955 (string-append (assoc-ref inputs "coreutils")
1956 "/bin/cut -d"))
1957 (("sleep ")
1958 (string-append (assoc-ref inputs "coreutils")
1959 "/bin/sleep "))
1960 (("readlink -f")
1961 (string-append (assoc-ref inputs "coreutils")
1962 "/bin/readlink -f"))))
1963 %standard-phases))))
3a04d5d4 1964 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
1965 (synopsis "Utilities to read temperature/voltage/fan sensors")
1966 (description
35b9e423 1967 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
1968you to access information from temperature, voltage, and fan speed sensors.
1969It works with most newer systems.")
3ac73271 1970 (license license:gpl2+)))
b087d413 1971
f5b2a53d
RW
1972(define-public i2c-tools
1973 (package
1974 (name "i2c-tools")
1975 (version "3.1.1")
1976 (source (origin
1977 (method url-fetch)
1978 (uri (string-append
f32274a7 1979 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
1980 version ".tar.bz2"))
1981 (sha256
1982 (base32
1983 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1984 (build-system gnu-build-system)
1985 (arguments
1986 `(#:tests? #f ; no 'check' target
1987 #:make-flags (list (string-append "prefix=" %output)
1988 "CC=gcc")
1989 ;; no configure script
1990 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
1991 (inputs
1992 `(("perl" ,perl)))
f32274a7 1993 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
1994 (synopsis "I2C tools for Linux")
1995 (description
1996 "The i2c-tools package contains a heterogeneous set of I2C tools for
1997Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1998EEPROM decoding scripts, EEPROM programming tools, and a python module for
1999SMBus access.")
3ac73271 2000 (license license:gpl2+)))
f5b2a53d 2001
b087d413
MW
2002(define-public xsensors
2003 (package
2004 (name "xsensors")
2005 (version "0.70")
2006 (source (origin
2007 (method url-fetch)
2008 (uri (string-append
2009 "http://www.linuxhardware.org/xsensors/xsensors-"
2010 version ".tar.gz"))
2011 (sha256
2012 (base32
2013 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2014 (build-system gnu-build-system)
2015 (inputs `(("lm-sensors" ,lm-sensors)
2016 ("gtk" ,gtk+-2)))
2017 (native-inputs `(("pkg-config" ,pkg-config)))
2018 (arguments
2019 `(#:phases (alist-cons-before
2020 'configure 'enable-deprecated
2021 (lambda _
2022 (substitute* "src/Makefile.in"
2023 (("-DGDK_DISABLE_DEPRECATED") "")
2024 (("-DGTK_DISABLE_DEPRECATED") "")))
2025 (alist-cons-before
2026 'configure 'remove-Werror
2027 (lambda _
2028 (substitute* '("configure" "src/Makefile.in")
2029 (("-Werror") "")))
2030 %standard-phases))))
2031 (home-page "http://www.linuxhardware.org/xsensors/")
2032 (synopsis "Hardware health information viewer")
2033 (description
35b9e423 2034 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2035health such as temperature, voltage and fan speed and displays the information
2036in a digital read-out.")
3ac73271 2037 (license license:gpl2+)))
b62fe07f
LC
2038
2039(define-public perf
2040 (package
2041 (name "perf")
2042 (version (package-version linux-libre))
2043 (source (package-source linux-libre))
2044 (build-system gnu-build-system)
2045 (arguments
2046 '(#:phases (alist-replace
2047 'configure
2048 (lambda* (#:key inputs #:allow-other-keys)
2049 (setenv "SHELL_PATH" (which "bash"))
2050 (chdir "tools/perf"))
2051 %standard-phases)
2052 #:make-flags (list (string-append "DESTDIR="
2053 (assoc-ref %outputs "out"))
2af29d23
LC
2054 "WERROR=0"
2055
2056 ;; By default, 'config/Makefile' uses lib64 on
2057 ;; x86_64. Work around that.
2058 "lib=lib")
b62fe07f
LC
2059 #:tests? #f)) ;no tests
2060 (native-inputs
2061 `(("pkg-config" ,pkg-config)
2062 ("bison" ,bison)
2063 ("flex" ,flex)
2064
2065 ;; There are build scripts written in these languages.
2066 ("perl" ,perl)
2067 ("python" ,python-2)))
2068 (inputs
b1fb4b23 2069 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2070 ;; ("newt" ,newt)
6c030d10 2071 ("python" ,python-2) ;'perf' links against libpython
b62fe07f
LC
2072 ("elfutils" ,elfutils)
2073
d7ece67a
LC
2074 ;; Documentation.
2075 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2076 ("libxslt" ,libxslt)
2077 ("docbook-xml" ,docbook-xml)
2078 ("docbook-xsl" ,docbook-xsl)
2079 ("xmlto" ,xmlto)
2080 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2081 (home-page "https://perf.wiki.kernel.org/")
2082 (synopsis "Linux profiling with performance counters")
2083 (description
2084 "perf is a tool suite for profiling using hardware performance counters,
2085with support in the Linux kernel. perf can instrument CPU performance
2086counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2087of lightweight profiling. This package contains the user-land tools and in
2088particular the 'perf' command.")
2089 (license (package-license linux-libre))))
c09e60e4
DT
2090
2091(define-public pflask
2092 (package
2093 (name "pflask")
2094 (version "0.2")
2095 (source (origin
2096 (method url-fetch)
2097 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2098 version ".tar.gz"))
f586c877 2099 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2100 (sha256
2101 (base32
2102 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2103 (build-system cmake-build-system)
2104 (arguments
2105 '(#:tests? #f)) ; no tests
2106 (home-page "http://ghedo.github.io/pflask/")
2107 (synopsis "Simple tool for creating Linux namespace containers")
2108 (description "pflask is a simple tool for creating Linux namespace
2109containers. It can be used for running a command or even booting an OS inside
2110an isolated container, created with the help of Linux namespaces. It is
2111similar in functionality to chroot, although pflask provides better isolation
2112thanks to the use of namespaces.")
3ac73271 2113 (license license:bsd-2)))
288084d5
MW
2114
2115(define-public hdparm
2116 (package
2117 (name "hdparm")
2118 (version "9.45")
2119 (source (origin
2120 (method url-fetch)
de67e922 2121 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2122 name "-" version ".tar.gz"))
2123 (sha256
2124 (base32
2125 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2126 (build-system gnu-build-system)
2127 (arguments
2128 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2129 (list (string-append "binprefix=" out)
2130 (string-append "manprefix=" out)
2131 "CC=gcc"))
2132 #:phases (alist-delete 'configure %standard-phases)
2133 #:tests? #f)) ; no test suite
2134 (home-page "http://sourceforge.net/projects/hdparm/")
e881752c 2135 (synopsis "Tune hard disk parameters for high performance")
288084d5
MW
2136 (description
2137 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
e881752c 2138is for enabling irq-unmasking and IDE multiple-mode.")
3ac73271 2139 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2140
c755c854
MW
2141(define-public rfkill
2142 (package
2143 (name "rfkill")
2144 (version "0.5")
2145 (source (origin
2146 (method url-fetch)
2147 (uri (string-append "mirror://kernel.org/software/network/"
2148 name "/" name "-" version ".tar.xz"))
2149 (sha256
2150 (base32
2151 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2152 (build-system gnu-build-system)
2153 (arguments
2154 `(#:make-flags (list "CC=gcc"
2155 (string-append "PREFIX=" %output))
2156 #:phases (modify-phases %standard-phases
2157 (delete 'configure))
2158 #:tests? #f))
2159 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2160 (synopsis "Tool for enabling and disabling wireless devices")
2161 (description
2162 "rfkill is a simple tool for accessing the rfkill device interface,
2163which is used to enable and disable wireless networking devices, typically
2164WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2165 (license (license:non-copyleft "file://COPYING"
2166 "See COPYING in the distribution."))))
c755c854 2167
dc9bdb1e
ML
2168(define-public acpi
2169 (package
2170 (name "acpi")
2171 (version "1.7")
2172 (source (origin
2173 (method url-fetch)
de67e922
LF
2174 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2175 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2176 (sha256
2177 (base32
2178 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2179 (build-system gnu-build-system)
2180 (home-page "http://acpiclient.sourceforge.net")
2181 (synopsis "Display information on ACPI devices")
2182 (description "@code{acpi} attempts to replicate the functionality of the
2183\"old\" @code{apm} command on ACPI systems, including battery and thermal
2184information. It does not support ACPI suspending, only displays information
2185about ACPI devices.")
2186 (license license:gpl2+)))
2187
57a516d3
LC
2188(define-public acpid
2189 (package
2190 (name "acpid")
2191 (version "2.0.23")
2192 (source (origin
2193 (method url-fetch)
2194 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2195 version ".tar.xz"))
2196 (sha256
2197 (base32
2198 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2199 (build-system gnu-build-system)
2200 (home-page "http://sourceforge.net/projects/acpid2/")
2201 (synopsis "Daemon for delivering ACPI events to user-space programs")
2202 (description
2203 "acpid is designed to notify user-space programs of Advanced
2204Configuration and Power Interface (ACPI) events. acpid should be started
2205during the system boot, and will run as a background process. When an ACPI
2206event is received from the kernel, acpid will examine the list of rules
2207specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2208 (license license:gpl2+)))
37f5caec
TUBK
2209
2210(define-public sysfsutils
2211 (package
2212 (name "sysfsutils")
2213 (version "2.1.0")
2214 (source
2215 (origin
2216 (method url-fetch)
2217 (uri
2218 (string-append
2219 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2220 version ".tar.gz"))
2221 (sha256
2222 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2223 (build-system gnu-build-system)
2224 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2225 (synopsis "System utilities based on Linux sysfs")
2226 (description
69b4ffcf 2227 "These are a set of utilities built upon sysfs, a virtual filesystem in
37f5caec
TUBK
2228Linux kernel versions 2.5+ that exposes a system's device tree. The package
2229also contains the libsysfs library.")
2230 ;; The library is under lgpl2.1+ (all files say "or any later version").
2231 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2232 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2233
2234(define-public sysfsutils-1
2235 (package
2236 (inherit sysfsutils)
2237 (version "1.3.0")
2238 (source
2239 (origin
2240 (method url-fetch)
2241 (uri
2242 (string-append
2243 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2244 "/sysfsutils-" version ".tar.gz"))
2245 (sha256
2246 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2247 (modules '((guix build utils)))
2248 (snippet
2249 '(begin
2250 (substitute* "Makefile.in"
2251 (("includedir = /usr/include/sysfs")
2252 "includedir = @includedir@"))
2253 (substitute* "configure"
2254 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2255 (string-append "includedir='" orig "/sysfs'")))))))
2256 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2257
2258(define-public cpufrequtils
2259 (package
2260 (name "cpufrequtils")
2261 (version "0.3")
2262 (source
2263 (origin
2264 (method url-fetch)
2265 (uri
2266 (string-append
2267 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2268 version ".tar.gz"))
2269 (sha256
2270 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2271 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2272 (build-system gnu-build-system)
2273 (native-inputs
2274 `(("sysfsutils" ,sysfsutils-1)))
2275 (arguments
2276 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2277 (assoc-ref %outputs "out") "/lib"))))
2278 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2279 (synopsis "Utilities to get and set CPU frequency on Linux")
2280 (description
e881752c 2281 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2282information, and set the CPU frequency if supported, using the cpufreq
2283capabilities of the Linux kernel.")
3ac73271 2284 (license license:gpl2)))
0a588bf9
SB
2285
2286(define-public libraw1394
2287 (package
2288 (name "libraw1394")
2289 (version "2.1.0")
2290 (source (origin
2291 (method url-fetch)
2292 (uri (string-append
2293 "mirror://kernel.org/linux/libs/ieee1394/"
2294 name "-" version ".tar.xz"))
2295 (sha256
2296 (base32
2297 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2298 (build-system gnu-build-system)
2299 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2300 (synopsis "Interface library for the Linux IEEE1394 drivers")
2301 (description
2302 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2303the Linux IEEE-1394 subsystem, which provides direct access to the connected
23041394 buses to user space. Through libraw1394/raw1394, applications can directly
2305send to and receive from other nodes without requiring a kernel driver for the
2306protocol in question.")
3ac73271 2307 (license license:lgpl2.1+)))
68e3c29d
SB
2308
2309(define-public libavc1394
2310 (package
2311 (name "libavc1394")
2312 (version "0.5.4")
2313 (source (origin
2314 (method url-fetch)
de67e922 2315 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2316 name "-" version ".tar.gz"))
2317 (sha256
2318 (base32
2319 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2320 (build-system gnu-build-system)
2321 (native-inputs
2322 `(("pkg-config" ,pkg-config)))
2323 (propagated-inputs
2324 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2325 (home-page "http://sourceforge.net/projects/libavc1394/")
2326 (synopsis "AV/C protocol library for IEEE 1394")
2327 (description
2328 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2329the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2330 (license license:lgpl2.1+)))
3f7bf86a
SB
2331
2332(define-public libiec61883
2333 (package
2334 (name "libiec61883")
2335 (version "1.2.0")
2336 (source (origin
2337 (method url-fetch)
2338 (uri (string-append
2339 "mirror://kernel.org/linux/libs/ieee1394/"
2340 name "-" version ".tar.xz"))
2341 (sha256
2342 (base32
2343 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2344 (build-system gnu-build-system)
2345 (native-inputs
2346 `(("pkg-config" ,pkg-config)))
2347 (propagated-inputs
2348 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2349 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2350 (synopsis "Isochronous streaming media library for IEEE 1394")
2351 (description
2352 "The libiec61883 library provides a higher level API for streaming DV,
2353MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2354 (license license:lgpl2.1+)))
69159125
MW
2355
2356(define-public mdadm
2357 (package
2358 (name "mdadm")
30897c60 2359 (version "3.4")
69159125
MW
2360 (source (origin
2361 (method url-fetch)
2362 (uri (string-append
2363 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2364 version ".tar.xz"))
2365 (sha256
2366 (base32
30897c60 2367 "0248v9f28mrbwabl94ck22gfim29sqhkf70wrpfi52nk4x3bxl17"))))
69159125
MW
2368 (build-system gnu-build-system)
2369 (inputs
2370 `(("udev" ,eudev)))
2371 (arguments
2372 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2373 (list "INSTALL=install"
2374 "CHECK_RUN_DIR=0"
2375 ;; TODO: tell it where to find 'sendmail'
2376 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2377 (string-append "BINDIR=" out "/sbin")
2378 (string-append "MANDIR=" out "/share/man")
2379 (string-append "UDEVDIR=" out "/lib/udev")))
2380 #:phases (alist-cons-before
2381 'build 'patch-program-paths
2382 (lambda* (#:key inputs #:allow-other-keys)
2383 (let ((coreutils (assoc-ref inputs "coreutils")))
2384 (substitute* "udev-md-raid-arrays.rules"
2385 (("/usr/bin/(readlink|basename)" all program)
2386 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2387 (alist-cons-before
2388 'build 'remove-W-error
2389 (lambda _
2390 ;; We cannot build with -Werror on i686 due to a
2391 ;; 'sign-compare' warning in util.c.
2392 (substitute* "Makefile"
2393 (("-Werror") ""))
2394 #t)
2395 (alist-delete 'configure %standard-phases)))
69159125
MW
2396 ;;tests must be done as root
2397 #:tests? #f))
2398 (home-page "http://neil.brown.name/blog/mdadm")
2399 (synopsis "Tool for managing Linux Software RAID arrays")
2400 (description
2401 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2402assemble, report on, and monitor arrays. It can also move spares between raid
2403arrays when needed.")
3ac73271 2404 (license license:gpl2+)))
01ccdfb6
SB
2405
2406(define-public libaio
2407 (package
2408 (name "libaio")
2409 (version "0.3.110")
2410 (source (origin
2411 (method url-fetch)
2412 (uri (list
2413 (string-append "mirror://debian/pool/main/liba/libaio/"
2414 name "_" version ".orig.tar.gz")
2415 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2416 name "-" version ".tar.gz")))
2417 (sha256
2418 (base32
2419 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2420 (build-system gnu-build-system)
2421 (arguments
2422 '(#:make-flags
2423 (list "CC=gcc" (string-append "prefix=" %output))
2424 #:test-target "partcheck" ; need root for a full 'check'
2425 #:phases
2426 (alist-delete 'configure %standard-phases))) ; no configure script
2427 (home-page "http://lse.sourceforge.net/io/aio.html")
2428 (synopsis "Linux-native asynchronous I/O access library")
2429 (description
2430 "This library enables userspace to use Linux kernel asynchronous I/O
2431system calls, important for the performance of databases and other advanced
2432applications.")
3ac73271 2433 (license license:lgpl2.1+)))
eb7c43c3 2434
81b98756
RW
2435(define-public sbc
2436 (package
2437 (name "sbc")
2438 (version "1.3")
2439 (source (origin
2440 (method url-fetch)
2441 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2442 name "-" version ".tar.xz"))
2443 (sha256
2444 (base32
2445 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2446 (build-system gnu-build-system)
2447 (inputs
2448 `(("libsndfile" ,libsndfile)))
2449 (native-inputs
2450 `(("pkg-config" ,pkg-config)))
2451 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2452 (synopsis "Bluetooth subband audio codec")
2453 (description
2454 "The SBC is a digital audio encoder and decoder used to transfer data to
2455Bluetooth audio output devices like headphones or loudspeakers.")
2456 (license license:gpl2+)))
2457
eb7c43c3
DT
2458(define-public bluez
2459 (package
2460 (name "bluez")
c8092046 2461 (version "5.40")
eb7c43c3
DT
2462 (source (origin
2463 (method url-fetch)
2464 (uri (string-append
e9eb24b1 2465 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2466 version ".tar.xz"))
2467 (sha256
2468 (base32
c8092046 2469 "09ywk3lvgis0nbi0d5z8d4qp5r33lzwnd6bdakacmbsm420qpnns"))))
eb7c43c3
DT
2470 (build-system gnu-build-system)
2471 (arguments
2472 '(#:configure-flags
2473 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2474 (list "--sysconfdir=/etc"
2475 "--localstatedir=/var"
2476 "--enable-library"
53142109 2477 "--disable-systemd"
eb7c43c3
DT
2478 ;; Install dbus/udev files to the correct location.
2479 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2480 (string-append "--with-udevdir=" out "/lib/udev")))
2481 #:phases
2482 (modify-phases %standard-phases
2483 (add-after 'install 'post-install
2484 (lambda* (#:key inputs outputs #:allow-other-keys)
2485 (let* ((out (assoc-ref outputs "out"))
2486 (servicedir (string-append out "/share/dbus-1/services"))
2487 (service "obexd/src/org.bluez.obex.service")
2488 (rule (string-append
2489 out "/lib/udev/rules.d/97-hid2hci.rules")))
2490 ;; Install the obex dbus service file.
2491 (substitute* service
2492 (("/bin/false")
2493 (string-append out "/libexec/bluetooth/obexd")))
2494 (install-file service servicedir)
2495 ;; Fix paths in the udev rule.
2496 (substitute* rule
2497 (("hid2hci --method")
2498 (string-append out "/lib/udev/hid2hci --method"))
2499 (("/sbin/udevadm")
2500 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2501 #t))))))
eb7c43c3
DT
2502 (native-inputs
2503 `(("pkg-config" ,pkg-config)
2504 ("gettext" ,gnu-gettext)))
2505 (inputs
2506 `(("glib" ,glib)
2507 ("dbus" ,dbus)
2508 ("eudev" ,eudev)
2509 ("libical" ,libical)
2510 ("readline" ,readline)))
2511 (home-page "http://www.bluez.org/")
2512 (synopsis "Linux Bluetooth protocol stack")
2513 (description
2514 "BlueZ provides support for the core Bluetooth layers and protocols. It
2515is flexible, efficient and uses a modular implementation.")
3ac73271 2516 (license license:gpl2+)))
3d890318
LC
2517
2518(define-public fuse-exfat
2519 (package
2520 (name "fuse-exfat")
2521 (version "1.1.0")
2522 (source (origin
2523 (method url-fetch)
2524 (uri "https://docs.google.com/uc?export=download&\
2525id=0B7CLI-REKbE3VTdaa0EzTkhYdU0")
2526 (sha256
2527 (base32
2528 "0glmgwrf0nv09am54i6s35ksbvrywrwc51w6q32mv5by8475530r"))
2529 (file-name (string-append name "-" version ".tar.gz"))))
2530 (build-system gnu-build-system)
2531 (native-inputs
2532 `(("scons" ,scons)
2533 ("pkg-config" ,pkg-config)))
2534 (inputs
2535 `(("fuse" ,fuse)))
2536 (arguments
2537 '(#:tests? #f ;no test suite
2538
2539 ;; XXX: Factorize with 'exfat-utils'.
2540 #:phases (modify-phases %standard-phases
2541 (delete 'configure)
2542 (add-after 'unpack 'scons-propagate-environment
2543 (lambda _
2544 ;; Modify the SConstruct file to arrange for
2545 ;; environment variables to be propagated.
2546 (substitute* "SConstruct"
2547 (("^env = Environment\\(")
2548 "env = Environment(ENV=os.environ, "))))
2549 (replace 'build
2550 (lambda _
2551 (zero? (system* "scons"))))
2552 (replace 'install
2553 (lambda* (#:key outputs #:allow-other-keys)
2554 (let* ((out (assoc-ref outputs "out"))
2555 (bin (string-append out "/bin"))
2556 (man8 (string-append out
2557 "/share/man/man8")))
2558 (mkdir-p bin)
2559 (mkdir-p man8)
2560 (for-each (lambda (file)
2561 (copy-file
2562 file
2563 (string-append man8 "/"
2564 (basename file))))
2565 (find-files "." "\\.8$"))
2566 (zero? (system* "scons" "install"
2567 (string-append "DESTDIR="
2568 bin)))))))))
2569 (home-page "http://code.google.com/p/exfat/")
2570 (synopsis "Mount exFAT file systems")
2571 (description
2572 "This package provides a FUSE-based file system that provides read and
2573write access to exFAT devices.")
3ac73271 2574 (license license:gpl2+)))
53ec8d48
LC
2575
2576(define-public gpm
2577 (package
2578 (name "gpm")
2579 (version "1.20.7")
2580 (source (origin
2581 (method url-fetch)
2582 (uri (string-append
2583 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2584 version ".tar.bz2"))
2585 (sha256
2586 (base32
2587 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2588 (build-system gnu-build-system)
2589 (arguments
2590 '(#:phases (modify-phases %standard-phases
2591 (add-before 'configure 'bootstrap
2592 (lambda _
2593 ;; The tarball was not generated with 'make dist' so we
2594 ;; need to bootstrap things ourselves.
2595 (and (zero? (system* "./autogen.sh"))
2596 (begin
2597 (patch-makefile-SHELL "Makefile.include.in")
2598 #t)))))
2599
2600 ;; Make sure programs find libgpm.so.
2601 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2602 (assoc-ref %outputs "out")
2603 "/lib"))))
2604 (native-inputs
2605 `(("texinfo" ,texinfo)
2606 ("bison" ,bison)
2607 ("flex" ,flex)
2608 ("autoconf" ,autoconf)
2609 ("automake" ,automake)
2610 ("libtool" ,libtool)))
2611 (home-page "http://www.nico.schottelius.org/software/gpm/")
2612 (synopsis "Mouse support for the Linux console")
2613 (description
2614 "The GPM (general-purpose mouse) daemon is a mouse server for
2615applications running on the Linux console. It allows users to select items
2616and copy/paste text in the console and in xterm.")
3ac73271 2617 (license license:gpl2+)))
fc686f9a
TGR
2618
2619(define-public btrfs-progs
2620 (package
2621 (name "btrfs-progs")
5e814f63 2622 (version "4.7.2")
fc686f9a
TGR
2623 (source (origin
2624 (method url-fetch)
2625 (uri (string-append "mirror://kernel.org/linux/kernel/"
2626 "people/kdave/btrfs-progs/"
2627 "btrfs-progs-v" version ".tar.xz"))
2628 (sha256
2629 (base32
5e814f63 2630 "03z6zgvjb94jk0q1xx2hicznfxj5c8xyyw5xqmh05rpz8ghwk6zl"))))
fc686f9a 2631 (build-system gnu-build-system)
7cad981d
TGR
2632 (outputs '("out"
2633 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 2634 (arguments
7cad981d
TGR
2635 '(#:phases (modify-phases %standard-phases
2636 (add-after 'build 'build-static
2637 (lambda _ (zero? (system* "make" "static"))))
2638 (add-after 'install 'install-static
2639 (let ((staticbin (string-append (assoc-ref %outputs "static")
2640 "/bin")))
2641 (lambda _
2642 (zero? (system* "make"
2643 (string-append "bindir=" staticbin)
2644 "install-static"))))))
2645 #:test-target "test"
fc686f9a
TGR
2646 #:parallel-tests? #f)) ; tests fail when run in parallel
2647 (inputs `(("e2fsprogs" ,e2fsprogs)
2648 ("libblkid" ,util-linux)
7cad981d 2649 ("libblkid:static" ,util-linux "static")
fc686f9a 2650 ("libuuid" ,util-linux)
7cad981d 2651 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
2652 ("zlib" ,zlib)
2653 ("lzo" ,lzo)))
2654 (native-inputs `(("pkg-config" ,pkg-config)
2655 ("asciidoc" ,asciidoc)
2656 ("xmlto" ,xmlto)
2657 ;; For building documentation
2658 ("libxml2" ,libxml2)
2659 ("docbook-xml" ,docbook-xml)
48b7e4a6 2660 ("docbook-xsl" ,docbook-xsl)
49dbe696 2661 ;; For tests
48b7e4a6 2662 ("which" ,which)))
fc686f9a
TGR
2663 (home-page "https://btrfs.wiki.kernel.org/")
2664 (synopsis "Create and manage btrfs copy-on-write file systems")
2665 (description "Btrfs is a copy-on-write (CoW) filesystem for Linux aimed at
2666implementing advanced features while focusing on fault tolerance, repair and
2667easy administration.")
68bcac6b
LF
2668 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2669 ;; GPL2: Everything else.
2670 (license (list license:gpl2 license:gpl2+))))
08e9daf5
TGR
2671
2672(define-public freefall
2673 (package
2674 (name "freefall")
2675 (version (package-version linux-libre))
2676 (source (package-source linux-libre))
2677 (build-system gnu-build-system)
2678 (arguments
2679 '(#:phases (modify-phases %standard-phases
2680 (add-after 'unpack 'enter-subdirectory
2681 (lambda _
2682 (chdir "tools/laptop/freefall")))
2683 (delete 'configure)
2684 (add-before 'build 'increase-timeout
2685 (lambda _
2686 ;; The default of 2 seconds is too low: it assumes an
2687 ;; open lid and AC power without actually checking.
2688 (substitute* "freefall.c"
2689 (("alarm\\(2\\)") "alarm(5)")))))
2690 #:make-flags (list (string-append "PREFIX="
2691 (assoc-ref %outputs "out")))
2692 #:tests? #f)) ;no tests
2693 (home-page (package-home-page linux-libre))
2694 (synopsis "Free-fall protection for spinning laptop hard drives")
2695 (description
2696 "Prevents shock damage to the internal spinning hard drive(s) of some
2697HP and Dell laptops. When sudden movement is detected, all input/output
2698operations on the drive are suspended and its heads are parked on the ramp,
2699where they are less likely to cause damage to the spinning disc. Requires a
2700drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2701feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2702 (license license:gpl2)))
d17ae8c0
NG
2703
2704(define-public thinkfan
2705 (package
2706 (name "thinkfan")
2707 (version "0.9.3")
2708 (source (origin
2709 (method url-fetch)
2710 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 2711 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
2712 (sha256
2713 (base32
2714 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2715 (modules '((guix build utils)))
2716 ;; Fix erroneous man page location in Makefile leading to
2717 ;; a compilation failure.
2718 (snippet
2719 '(substitute* "CMakeLists.txt"
2720 (("thinkfan\\.1") "src/thinkfan.1")))))
2721 (build-system cmake-build-system)
2722 (arguments
2723 `(#:modules ((guix build cmake-build-system)
2724 (guix build utils)
2725 (srfi srfi-26))
2726 #:tests? #f ;no test target
2727 #:configure-flags
2728 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2729 `("-DUSE_ATASMART:BOOL=ON")
2730 #:phases
2731 (modify-phases %standard-phases
75e56aed
NG
2732 ;; Install scripts for various foreign init systems. Also fix
2733 ;; hard-coded path for daemon.
d17ae8c0
NG
2734 (add-after 'install 'install-rc-scripts
2735 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
2736 (let ((out (assoc-ref outputs "out"))
2737 (files (find-files
2738 (string-append "../thinkfan-" ,version "/rcscripts")
2739 ".*")))
2740 (substitute* files
2741 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2742 (string-append out "/sbin/" name)))
2743 (for-each (cute install-file <>
2744 (string-append out "/share/thinkfan"))
2745 files))
d17ae8c0
NG
2746 #t)))))
2747 (inputs
2748 `(("libatasmart" ,libatasmart)))
2749 (home-page "http://thinkfan.sourceforge.net/")
2750 (synopsis "Simple fan control program")
2751 (description
2752 "Thinkfan is a simple fan control program. It reads temperatures,
2753checks them against configured limits and switches to appropriate (also
2754pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2755other @code{hwmon} driver that enables temperature reading and fan control
2756from userspace.")
2757 (license license:gpl3+)))
91231156
LC
2758
2759(define-public ntfs-3g
2760 (package
2761 (name "ntfs-3g")
2762 (version "2016.2.22")
2763 (source (origin
2764 (method url-fetch)
2765 (uri (string-append "https://tuxera.com/opensource/"
2766 "ntfs-3g_ntfsprogs-" version ".tgz"))
2767 (sha256
2768 (base32
2769 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2770 (modules '((guix build utils)))
2771 (snippet
2772 ;; Install under $prefix.
2773 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2774 (("/sbin")
2775 "@sbindir@")))))
2776 (build-system gnu-build-system)
2777 (inputs `(("util-linux" ,util-linux)
2778 ("fuse" ,fuse))) ;libuuid
2779 (native-inputs `(("pkg-config" ,pkg-config)))
2780 (arguments
2781 '(#:configure-flags (list "--exec-prefix=${prefix}"
2782 "--with-fuse=external" ;use our own FUSE
2783 "--enable-mount-helper"
2784 "--enable-posix-acls"
2785 "--enable-xattr-mappings")))
2786 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2787 (synopsis "Read-write access to NTFS file systems")
2788 (description
2789 "NTFS-3G provides read-write access to NTFS file systems, which are
2790commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2791The package provides additional NTFS tools.")
2792 (license license:gpl2+)))
9b0942c1
DC
2793
2794(define-public rng-tools
2795 (package
2796 (name "rng-tools")
2797 (version "5")
2798 (source (origin
2799 (method url-fetch)
2800 (uri (string-append
2801 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2802 "rng-tools-" version ".tar.gz"))
2803 (sha256
2804 (base32
2805 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2806 (build-system gnu-build-system)
2807 (synopsis "Random number generator daemon")
2808 (description
2809 "Monitor a hardware random number generator, and supply entropy
2810from that to the system kernel's @file{/dev/random} machinery.")
2811 (home-page "http://sourceforge.net/projects/gkernel")
2812 ;; The source package is offered under the GPL2+, but the files
2813 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2814 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
2815
2816(define-public cpupower
2817 (package
2818 (name "cpupower")
2819 (version (package-version linux-libre))
2820 (source (package-source linux-libre))
2821 (build-system gnu-build-system)
2822 (arguments
2823 '(#:phases (modify-phases %standard-phases
2824 (add-after 'unpack 'enter-subdirectory
2825 (lambda _
2826 (chdir "tools/power/cpupower")))
2827 (delete 'configure)
2828 (add-before 'build 'fix-makefiles
2829 (lambda _
2830 (substitute* "Makefile"
2831 (("/usr/") "/")
2832 (("/bin/(install|pwd)" _ command) command))
2833 (substitute* "bench/Makefile"
2834 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2835 #:make-flags (let ((out (assoc-ref %outputs "out")))
2836 (list (string-append "DESTDIR=" out)
2837 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2838 "docdir=/share/doc/cpupower"
2839 "confdir=$(docdir)/examples"
2840 ;; The Makefile recommends the following changes
2841 "DEBUG=false"
2842 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
2843 #:tests? #f)) ;no tests
2844 (native-inputs `(("gettext" ,gnu-gettext)))
2845 (inputs `(("pciutils" ,pciutils)))
2846 (home-page (package-home-page linux-libre))
2847 (synopsis "CPU frequency and voltage scaling tools for Linux")
2848 (description
2849 "cpupower is a set of user-space tools that use the cpufreq feature of the
2850Linux kernel to retrieve and control processor features related to power saving,
2851such as frequency and voltage scaling.")
2852 (license license:gpl2)))
2b76f135
TGR
2853
2854(define-public haveged
2855 (package
2856 (name "haveged")
2857 (version "1.9.1")
2858 (source
2859 (origin
2860 (method url-fetch)
2861 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
2862 version ".tar.gz"))
2863 (sha256
2864 (base32
2865 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
2866 (build-system gnu-build-system)
2867 (home-page "http://www.issihosts.com/haveged")
2868 (synopsis "Entropy source for the Linux random number generator")
2869 (description
2870 "haveged generates an unpredictable stream of random numbers for use by
2871Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
2872standard mechanisms for filling the entropy pool may not be sufficient for
2873systems with high needs or limited user interaction, such as headless servers.
2874@command{haveged} runs as a privileged daemon, harvesting randomness from the
2875indirect effects of hardware events on hidden processor state using the HArdware
2876Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
2877its environment and provides the same built-in test suite for the output stream
2878as used on certified hardware security devices.")
2879 (license (list (license:non-copyleft "file://nist/mconf.h")
2880 (license:non-copyleft "file://nist/packtest.c")
2881 license:public-domain ; nist/dfft.c
2882 license:gpl3+)))) ; everything else
e385e957
TGR
2883
2884(define-public ecryptfs-utils
2885 (package
2886 (name "ecryptfs-utils")
2887 (version "111")
2888 (source
2889 (origin
2890 (method url-fetch)
2891 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
2892 version "/+download/ecryptfs-utils_"
2893 version ".orig.tar.gz"))
2894 (sha256
2895 (base32
2896 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
2897 (build-system gnu-build-system)
2898 (arguments
2899 `(#:configure-flags (list "--disable-pywrap")))
2900 (native-inputs
2901 `(("intltool" ,intltool)
2902 ("perl" ,perl) ; for pod2man
2903 ("pkg-config" ,pkg-config)))
2904 (inputs
2905 `(("keyutils" ,keyutils)
2906 ("linux-pam" ,linux-pam)
2907 ("nss" ,nss)))
2908 (home-page "http://ecryptfs.org/")
2909 (synopsis "eCryptfs cryptographic file system utilities")
2910 (description
2911 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
2912Each file's cryptographic meta-data is stored inside the file itself, along
2913with the encrypted contents. This allows individual encrypted files to be
2914copied between hosts and still be decrypted with the proper key. eCryptfs is a
2915native Linux file system, and has been part of the Linux kernel since version
29162.6.19. This package contains the userland utilities to manage it.")
2917 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
2918 ;; grant additional permission to link with OpenSSL.
2919 (license license:gpl2+)))