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