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