gnu: docker: Replace tini by tini-static.
[jackhill/guix/guix.git] / gnu / packages / admin.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2014, 2015, 2016, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2020, 2021 Eric Bavier <bavier@posteo.net>
6 ;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
7 ;;; Copyright © 2015 Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
8 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
9 ;;; Copyright © 2016, 2017, 2020 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
11 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2016 Peter Feigl <peter.feigl@nexoid.at>
14 ;;; Copyright © 2016 John J. Foerch <jjfoerch@earthlink.net>
15 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
16 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
19 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
20 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
21 ;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
22 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
24 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
25 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
26 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
27 ;;; Copyright © 2019,2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
28 ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
29 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
30 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
31 ;;; Copyright © 2019, 2021 Guillaume Le Vaillant <glv@posteo.net>
32 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
33 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
34 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
35 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
36 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
37 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
38 ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
39 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
40 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
41 ;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org>
42 ;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
43 ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
44 ;;;
45 ;;; This file is part of GNU Guix.
46 ;;;
47 ;;; GNU Guix is free software; you can redistribute it and/or modify it
48 ;;; under the terms of the GNU General Public License as published by
49 ;;; the Free Software Foundation; either version 3 of the License, or (at
50 ;;; your option) any later version.
51 ;;;
52 ;;; GNU Guix is distributed in the hope that it will be useful, but
53 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
54 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55 ;;; GNU General Public License for more details.
56 ;;;
57 ;;; You should have received a copy of the GNU General Public License
58 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
59
60 (define-module (gnu packages admin)
61 #:use-module (guix build-system cmake)
62 #:use-module (guix build-system emacs)
63 #:use-module (guix build-system glib-or-gtk)
64 #:use-module (guix build-system gnu)
65 #:use-module (guix build-system go)
66 #:use-module (guix build-system meson)
67 #:use-module (guix build-system perl)
68 #:use-module (guix build-system python)
69 #:use-module (guix build-system ruby)
70 #:use-module (guix build-system trivial)
71 #:use-module (guix download)
72 #:use-module (guix git-download)
73 #:use-module ((guix licenses) #:prefix license:)
74 #:use-module (guix packages)
75 #:use-module (guix utils)
76 #:use-module (gnu packages)
77 #:use-module (gnu packages algebra)
78 #:use-module (gnu packages autogen)
79 #:use-module (gnu packages autotools)
80 #:use-module (gnu packages base)
81 #:use-module (gnu packages bash)
82 #:use-module (gnu packages bison)
83 #:use-module (gnu packages boost)
84 #:use-module (gnu packages c)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages compression)
87 #:use-module (gnu packages cross-base)
88 #:use-module (gnu packages crypto)
89 #:use-module (gnu packages cryptsetup)
90 #:use-module (gnu packages cyrus-sasl)
91 #:use-module (gnu packages dns)
92 #:use-module (gnu packages elf)
93 #:use-module (gnu packages file)
94 #:use-module (gnu packages flex)
95 #:use-module (gnu packages gawk)
96 #:use-module (gnu packages gettext)
97 #:use-module (gnu packages gl)
98 #:use-module (gnu packages glib)
99 #:use-module (gnu packages gnome)
100 #:use-module (gnu packages gnupg)
101 #:use-module (gnu packages golang)
102 #:use-module (gnu packages groff)
103 #:use-module (gnu packages gtk)
104 #:use-module (gnu packages guile)
105 #:use-module (gnu packages hurd)
106 #:use-module (gnu packages image)
107 #:use-module (gnu packages imagemagick)
108 #:use-module (gnu packages inkscape)
109 #:use-module (gnu packages kerberos)
110 #:use-module (gnu packages libbsd)
111 #:use-module (gnu packages libftdi)
112 #:use-module (gnu packages libunwind)
113 #:use-module (gnu packages libusb)
114 #:use-module (gnu packages linux)
115 #:use-module (gnu packages lua)
116 #:use-module (gnu packages mail)
117 #:use-module (gnu packages man)
118 #:use-module (gnu packages mcrypt)
119 #:use-module (gnu packages mpi)
120 #:use-module (gnu packages ncurses)
121 #:use-module (gnu packages openldap)
122 #:use-module (gnu packages patchutils)
123 #:use-module (gnu packages pciutils)
124 #:use-module (gnu packages pcre)
125 #:use-module (gnu packages perl)
126 #:use-module (gnu packages perl-check)
127 #:use-module (gnu packages pkg-config)
128 #:use-module (gnu packages popt)
129 #:use-module (gnu packages python)
130 #:use-module (gnu packages python-crypto)
131 #:use-module (gnu packages python-web)
132 #:use-module (gnu packages python-xyz)
133 #:use-module (gnu packages qt)
134 #:use-module (gnu packages readline)
135 #:use-module (gnu packages ruby)
136 #:use-module (gnu packages serialization)
137 #:use-module (gnu packages sphinx)
138 #:use-module (gnu packages tcl)
139 #:use-module (gnu packages terminals)
140 #:use-module (gnu packages texinfo)
141 #:use-module (gnu packages tls)
142 #:use-module (gnu packages version-control)
143 #:use-module (gnu packages web)
144 #:use-module (gnu packages xdisorg)
145 #:use-module (gnu packages xml)
146 #:use-module (gnu packages xorg))
147
148 ;; This package uses su instead of sudo (because of SpaceFM).
149 (define-public ktsuss
150 (package
151 (name "ktsuss")
152 (version "2.1")
153 (source
154 (origin
155 (method git-fetch)
156 (uri
157 (git-reference
158 (url "https://github.com/nomius/ktsuss")
159 (commit version)))
160 (sha256
161 (base32 "0q9931f9hp47v1n8scli4bdg2rkjpf5jf8v7jj2gdn83aia1r2hz"))
162 (file-name (git-file-name name version))))
163 (build-system glib-or-gtk-build-system)
164 (arguments
165 `(#:phases
166 (modify-phases %standard-phases
167 (add-after 'unpack 'patch-file-names
168 (lambda _
169 (substitute* "configure.ac"
170 (("supath=`which su 2>/dev/null`")
171 "supath=/run/setuid-programs/su"))
172 #t)))))
173 (native-inputs
174 `(("autoconf" ,autoconf)
175 ("automake" ,automake)
176 ("libtool" ,libtool)
177 ("pkg-config" ,pkg-config)))
178 (inputs
179 `(("glib" ,glib)
180 ("gtk+" ,gtk+-2)))
181 (synopsis "Graphical front end for @command{su}")
182 (description
183 "Ktsuss stands for ``Keep the @command{su} simple, stupid''.
184 It is a graphical version of @command{su} written in C and GTK+ 2, with
185 simplicity in mind.")
186 (home-page "https://github.com/nomius/ktsuss")
187 (license license:bsd-3)))
188
189 (define-public aide
190 (package
191 (name "aide")
192 (version "0.16.2")
193 (source
194 (origin
195 (method url-fetch)
196 (uri (string-append "https://github.com/aide/aide/releases/download/v"
197 version "/aide-" version ".tar.gz"))
198 (sha256
199 (base32 "15xp47sz7kk1ciffw3f5xw2jg2mb2lqrbr3q6p4bkbz5dap9iy8p"))))
200 (build-system gnu-build-system)
201 (native-inputs
202 `(("bison" ,bison)
203 ("flex" ,flex)))
204 (inputs
205 `(("libgcrypt" ,libgcrypt)
206 ("libgpg-error" ,libgpg-error)
207 ("libmhash" ,libmhash)
208 ("pcre:static" ,pcre "static")
209 ("pcre" ,pcre)
210 ("zlib:static" ,zlib "static")
211 ("zlib" ,zlib)))
212 (synopsis "File and directory integrity checker")
213 (description
214 "AIDE (Advanced Intrusion Detection Environment) is a file and directory
215 integrity checker. It creates a database from the regular expression rules
216 that it finds from its configuration files. Once this database is initialized
217 it can be used to verify the integrity of the files. It has several message
218 digest algorithms that are used to check the integrity of files. All of the
219 usual file attributes can be checked for inconsistencies.")
220 (home-page "https://aide.github.io/")
221 (license license:gpl2+)))
222
223 (define-public progress
224 (package
225 (name "progress")
226 (version "0.16")
227 (source
228 (origin
229 (method git-fetch)
230 (uri (git-reference
231 (url "https://github.com/Xfennec/progress")
232 (commit (string-append "v" version))))
233 (sha256
234 (base32 "0gf10j9zd8spain94b5kigknwbdqajiy6fjsa5hhwsc1biz34hcj"))
235 (file-name (git-file-name name version))))
236 (build-system gnu-build-system)
237 (native-inputs
238 `(("pkg-config" ,pkg-config)
239 ("which" ,which)))
240 (inputs
241 `(("ncurses" ,ncurses)))
242 (arguments
243 `(#:tests? #f ; no test suite
244 #:make-flags
245 (let ((target ,(%current-target-system)))
246 (list ,(string-append "CC=" (cc-for-target))
247 (string-append "PKG_CONFIG="
248 (if target
249 (string-append target "-pkg-config")
250 "pkg-config"))
251 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
252 #:phases
253 (modify-phases %standard-phases
254 (delete 'configure)))) ; no configure script
255 (home-page "https://github.com/Xfennec/progress")
256 (synopsis "Program to view the progress of the coreutils commands")
257 (description "A program that looks for coreutils basic commands (cp, mv,
258 dd, tar, gzip/gunzip, cat, etc.) currently running on your system and displays
259 the percentage of copied data. It can also show estimated time and throughput,
260 and provides a \"top-like\" mode (monitoring).")
261 (license license:gpl3+)))
262
263 (define-public shepherd
264 (package
265 (name "shepherd")
266 (version "0.8.1")
267 (source (origin
268 (method url-fetch)
269 (uri (string-append "mirror://gnu/shepherd/shepherd-"
270 version ".tar.gz"))
271 (sha256
272 (base32
273 "0x9zr0x3xvk4qkb6jnda451d5iyrl06cz1bjzjsm0lxvjj3fabyk"))))
274 (build-system gnu-build-system)
275 (arguments
276 '(#:configure-flags '("--localstatedir=/var")
277 #:make-flags '("GUILE_AUTO_COMPILE=0")))
278 (native-inputs
279 `(("pkg-config" ,pkg-config)
280
281 ;; This is the Guile we use as a cross-compiler...
282 ("guile" ,guile-3.0)))
283 (inputs
284 ;; ... and this is the one that appears in shebangs when cross-compiling.
285 `(("guile" ,guile-3.0)
286
287 ;; The 'shepherd' command uses Readline when used interactively. It's
288 ;; an unusual use case though, so we don't propagate it.
289 ("guile-readline" ,guile-readline)))
290 (synopsis "System service manager")
291 (description
292 "The GNU Shepherd is a daemon-managing daemon, meaning that it supervises
293 the execution of system services, replacing similar functionality found in
294 typical init systems. It provides dependency-handling through a convenient
295 interface and is based on GNU Guile.")
296 (license license:gpl3+)
297 (home-page "https://www.gnu.org/software/shepherd/")))
298
299 (define-public guile2.2-shepherd
300 (package
301 (inherit shepherd)
302 (name "guile2.2-shepherd")
303 (native-inputs
304 `(("pkg-config" ,pkg-config)
305 ("guile" ,guile-2.2)))
306 (inputs
307 `(("guile" ,guile-2.2)
308 ("guile2.2-readline" ,guile2.2-readline)))))
309
310 (define-public guile3.0-shepherd
311 (deprecated-package "guile3.0-shepherd" shepherd))
312
313 (define-public guile2.0-shepherd
314 (package
315 (inherit shepherd)
316 (name "guile2.0-shepherd")
317 (native-inputs
318 `(("help2man" ,help2man)
319 ("pkg-config" ,pkg-config)
320 ("guile" ,guile-2.0)))
321 (inputs
322 `(("guile" ,guile-2.0)))
323 (arguments
324 `(#:phases
325 (modify-phases %standard-phases
326 (add-after 'unpack 'patch-source
327 (lambda _
328 ;; (ice-9 threads) isn't available in guile-2.0
329 (substitute* "modules/shepherd.scm"
330 ((".*\\(ice-9 threads\\).*") ""))
331 #t)))
332 ,@(package-arguments shepherd)))))
333
334 (define-public cfm
335 (package
336 (name "cfm")
337 (version "0.6.6")
338 (source
339 (origin
340 (method git-fetch)
341 (uri (git-reference
342 (url "https://github.com/WillEccles/cfm")
343 (commit (string-append "v" version))))
344 (file-name (git-file-name name version))
345 (sha256
346 (base32 "14gapia902f29wa4dlrrj8jcwcff9bfvyhjccw9ddy2gxx2g8wmr"))))
347 (build-system gnu-build-system)
348 (arguments
349 `(#:tests? #f ; no test suite
350 #:make-flags
351 (list (string-append "CC=" ,(cc-for-target))
352 (string-append "PREFIX=" (assoc-ref %outputs "out")))
353 #:phases
354 (modify-phases %standard-phases
355 ;; Keeping xdg-open optional avoids a size increase of 293%.
356 (delete 'configure)))) ; no configure script
357 (home-page "https://eccles.dev/cfm/")
358 (synopsis
359 "Simple terminal file manager with @command{vi}-inspired key bindings")
360 (description
361 "The Cactus File Manager (@command{cfm}) helps you manage your files
362 visually from a text terminal. It aims to be simple and fast, with key bindings
363 inspired by @command{vi}.")
364 (license license:mpl2.0)))
365
366 (define-public cloud-utils
367 (package
368 (name "cloud-utils")
369 (version "0.32")
370 (source
371 (origin
372 (method url-fetch)
373 (uri (string-append
374 "https://launchpad.net/cloud-utils/trunk/"
375 version "/+download/cloud-utils-" version ".tar.gz"))
376 (sha256
377 (base32
378 "0xxdi55lzw7j91zfajw7jhd2ilsqj2dy04i9brlk8j3pvb5ma8hk"))))
379 (build-system gnu-build-system)
380 (arguments
381 '(#:make-flags
382 (let ((out (assoc-ref %outputs "out")))
383 (list (string-append "BINDIR=" out "/bin")
384 (string-append "MANDIR=" out "/share/man/man1")
385 (string-append "DOCDIR=" out "/share/doc")))
386 #:phases
387 (modify-phases %standard-phases
388 (delete 'configure)
389 (delete 'check)
390 (add-after 'install 'wrap
391 (lambda* (#:key outputs inputs #:allow-other-keys)
392 (let ((growpart (string-append (assoc-ref outputs "out")
393 "/bin/growpart")))
394 (wrap-program growpart
395 `("PATH" ":" prefix (,(dirname (which "sfdisk"))
396 ,(dirname (which "readlink"))))))
397 #t)))))
398 (inputs
399 `(("python" ,python)
400 ("util-linux" ,util-linux))) ; contains sfdisk for growpart
401 (home-page "https://launchpad.net/cloud-utils")
402 (synopsis "Set of utilities for cloud computing environments")
403 (description
404 "This package contains a set of utilities for cloud computing
405 environments:
406
407 @itemize @bullet
408 @item @command{cloud-localds} Create a disk for cloud-init to utilize nocloud
409 @item @command{cloud-publish-image} Wrapper for cloud image publishing
410 @item @command{cloud-publish-tarball} Wrapper for publishing cloud tarballs
411 @item @command{cloud-publish-ubuntu} Import a Ubuntu cloud image
412 @item @command{ec2metadata} Query and display @acronym{EC2,Amazon Elastic
413 Compute Cloud} metadata
414 @item @command{growpart} Grow a partition to fill the device
415 @item @command{mount-image-callback} Mount a file and run a command
416 @item @command{resize-part-image} Resize a partition image to a new size
417 @item @command{ubuntu-cloudimg-query} Get the latest Ubuntu
418 @acronym{AMI,Amazon Machine Image}
419 @item @command{ubuntu-ec2-run} Run a @acronym{EC2,Amazon Elastic Compute
420 Cloud} instance using Ubuntu
421 @item @command{vcs-run} Obtain a repository, and run a command
422 @item @command{write-mime-multipart} Handle multipart
423 @acronym{MIME,Multipurpose Internet Mail Extensions} messages
424 @end itemize")
425 (license license:gpl3)))
426
427 (define-public daemontools
428 (package
429 (name "daemontools")
430 (version "0.76")
431 (source (origin
432 (method url-fetch)
433 (uri (string-append
434 "https://cr.yp.to/daemontools/"
435 "daemontools-" version ".tar.gz"))
436 (sha256
437 (base32
438 "07scvw88faxkscxi91031pjkpccql6wspk4yrlnsbrrb5c0kamd5"))))
439 (build-system gnu-build-system)
440 (arguments
441 `(#:tests? #f ;; No tests as far as I can tell.
442 #:phases
443 (modify-phases %standard-phases
444 (add-after 'unpack 'chdir
445 (lambda _
446 (chdir ,(string-append "daemontools-" version))
447 #t))
448 (delete 'configure)
449 (add-before 'build 'patch
450 (lambda _
451 (substitute* "src/error.h"
452 (("extern int errno;")
453 "#include <errno.h>"))
454 #t))
455 (replace 'build
456 (lambda _
457 (invoke "package/compile")))
458 (replace 'install
459 (lambda* (#:key outputs #:allow-other-keys)
460 (let* ((out (assoc-ref outputs "out"))
461 (bin (string-append out "/bin")))
462 (for-each (lambda (file)
463 (install-file file bin))
464 (find-files "command")))
465 #t)))))
466 (synopsis "Tools for managing UNIX style services")
467 (description
468 "@code{daemontools} is a collection of tools for managing UNIX
469 services.")
470 (license license:public-domain)
471 (home-page "https://cr.yp.to/daemontools.html")))
472
473 (define-public daemonize
474 (package
475 (name "daemonize")
476 (version "1.7.8")
477 (source
478 (origin
479 (method git-fetch)
480 (uri (git-reference
481 (url "https://github.com/bmc/daemonize")
482 (commit (string-append "release-" version))))
483 (file-name (git-file-name name version))
484 (sha256
485 (base32 "0w4g0iyssyw7dd0061881z8s5czcl01mz6v00znax57zfxjqpvnm"))))
486 (build-system gnu-build-system)
487 (arguments '(#:tests? #f)) ; No tests available.
488 (home-page "http://software.clapper.org/daemonize/")
489 (synopsis "Command line utility to run a program as a daemon")
490 (description
491 "daemonize runs a command as a Unix daemon. It will close all open file
492 descriptors, change working directory of the process to the root filesystem,
493 reset its umask, run in the background, ignore I/O signals, handle
494 @code{SIGCLD}, etc. Most programs that are designed to be run as daemons do
495 that work for themselves. However, you’ll occasionally run across one that
496 does not. When you must run a daemon program that does not properly make
497 itself into a true Unix daemon, you can use daemonize to force it to run as a
498 true daemon.")
499 (license license:bsd-3)))
500
501 (define-public dfc
502 (package
503 (name "dfc")
504 (version "3.1.1")
505 (source
506 (origin
507 (method url-fetch)
508 (uri (string-append
509 "https://projects.gw-computing.net/attachments/download/615/dfc-"
510 version ".tar.gz"))
511 (sha256
512 (base32
513 "0m1fd7l85ckb7bq4c5c3g257bkjglm8gq7x42pkmpp87fkknc94n"))))
514 (build-system cmake-build-system)
515 (arguments '(#:tests? #f)) ; There are no tests.
516 (native-inputs `(("gettext" ,gettext-minimal)))
517 (home-page "https://projects.gw-computing.net/projects/dfc")
518 (synopsis "Display file system space usage using graphs and colors")
519 (description
520 "dfc (df color) is a modern version of df. It uses colors, draws pretty
521 graphs and can export its output to different formats.")
522 (license license:bsd-3)))
523
524 (define-public facter
525 (package
526 (name "facter")
527 (version "4.0.52")
528 (source (origin
529 (method git-fetch)
530 (uri (git-reference
531 (url "https://github.com/puppetlabs/facter")
532 (commit version)))
533 (file-name (git-file-name name version))
534 (sha256
535 (base32
536 "05j4q87sak1f1isj7ngzr59h3j3xskfwjjwfv0xd7lhwcaxg3a3c"))))
537 (build-system ruby-build-system)
538 (arguments
539 `(#:phases
540 (modify-phases %standard-phases
541 (add-after 'unpack 'delete-facter-ng-gemspec
542 (lambda _
543 ;; XXX: ruby-build-system incorrectly finds
544 ;; facter-ng.gemspec from this directory and tries to
545 ;; build that instead of the proper facter.gemspec.
546 ;; Just delete it as a workaround, as it appears to
547 ;; only exist for backwards-compatibility after the
548 ;; facter-ng->facter rename.
549 (delete-file "agent/facter-ng.gemspec")
550 #t))
551 (add-after 'unpack 'embed-absolute-references
552 ;; Refer to absolute executable file names to avoid propagation.
553 (lambda* (#:key inputs #:allow-other-keys)
554 (substitute* (find-files "lib/facter/resolvers" "\\.rb$")
555 (("execute\\('(which |)([^ ']+)" _ _ name)
556 (string-append "execute('" (or (which name)
557 name))))
558 #t))
559 (delete 'check)
560 (add-after 'wrap 'check
561 (lambda* (#:key tests? outputs #:allow-other-keys)
562 ;; XXX: The test suite wants to run Bundler and
563 ;; complains that the gemspec is invalid. For now
564 ;; just make sure that we can run the wrapped
565 ;; executable directly.
566 (if tests?
567 (invoke (string-append (assoc-ref outputs "out")
568 "/bin/facter")
569 ;; Many facts depend on /sys, /etc/os-release,
570 ;; etc, so we only run a small sample.
571 "facterversion" "architecture"
572 "kernel" "kernelversion")
573 (format #t "tests disabled~%"))
574 #t)))))
575 (inputs
576 `(("ruby-hocon" ,ruby-hocon)
577 ("ruby-sys-filesystem" ,ruby-sys-filesystem)
578 ("ruby-thor" ,ruby-thor)
579
580 ;; For ‘embed-absolute-references’.
581 ("dmidecode" ,dmidecode)
582 ("inetutils" ,inetutils) ; for ‘hostname’
583 ("iproute" ,iproute)
584 ("pciutils" ,pciutils)
585 ("util-linux" ,util-linux)))
586 (synopsis "Collect and display system facts")
587 (description
588 "Facter is a tool that gathers basic facts about nodes (systems) such
589 as hardware details, network settings, OS type and version, and more. These
590 facts can be collected on the command line with the @command{facter} command
591 or via the @code{facter} Ruby library.")
592 (home-page "https://github.com/puppetlabs/facter-ng")
593 (license license:expat)))
594
595 (define-public ttyload
596 (let ((revision "1")
597 (commit "f9495372801ce4b4dad98ad854203e694c31c1eb"))
598 (package
599 (name "ttyload")
600 (version (git-version "0.5.3" revision commit))
601 (source
602 (origin
603 (method git-fetch)
604 (uri (git-reference
605 (url "https://github.com/lindes/ttyload")
606 (commit commit)))
607 (file-name (git-file-name name version))
608 (sha256
609 (base32 "0ldb7a13b9v876c6cbrs78pkizj64drnqx95z5shfbwgpwfhr4im"))))
610 (build-system gnu-build-system)
611 (arguments
612 `(#:tests? #f ; no tests
613 #:make-flags
614 (list (string-append "CC=" ,(cc-for-target)))
615 #:phases
616 (modify-phases %standard-phases
617 (delete 'configure)
618 (replace 'install
619 (lambda* (#:key outputs #:allow-other-keys)
620 (let* ((out (assoc-ref outputs "out"))
621 (bin (string-append out "/bin")))
622 (install-file "ttyload" bin)))))))
623 (home-page "https://www.daveltd.com/src/util/ttyload/")
624 (synopsis "Console based color-coded graphs of CPU load average")
625 (description
626 "Show graphs for 1 minute, 5 minute, 15 minute load averages on the
627 console.")
628 ;; This package uses a modified version of the "ISC License".
629 (license (license:non-copyleft "file://LICENSE")))))
630
631 (define-public htop
632 (package
633 (name "htop")
634 (version "3.0.5")
635 (source
636 (origin
637 (method git-fetch)
638 (uri (git-reference
639 (url "https://github.com/htop-dev/htop")
640 (commit version)))
641 (sha256
642 (base32 "10lp6cbfvigzp6pq5nwj3s3l4vs7cv92krz2r08nwrz8vl6rqdzp"))
643 (file-name (git-file-name name version))))
644 (build-system gnu-build-system)
645 (inputs
646 `(("ncurses" ,ncurses)))
647 (native-inputs
648 `(("autoconf" ,autoconf)
649 ("automake" ,automake)))
650 (home-page "https://htop.dev")
651 (synopsis "Interactive process viewer")
652 (description
653 "This is htop, an interactive process viewer. It is a text-mode
654 application (for console or X terminals) and requires ncurses.")
655 (license license:gpl2)))
656
657 (define-public bashtop
658 (package
659 (name "bashtop")
660 (version "0.9.25")
661 (source (origin
662 (method git-fetch)
663 (uri (git-reference
664 (url "https://github.com/aristocratos/bashtop")
665 (commit (string-append "v" version))))
666 (file-name (git-file-name name version))
667 (sha256
668 (base32
669 "07nlr6vmyb7yihaxj1fp424lmhwkdjl6mls92v90f6gsvikpa13v"))))
670 (build-system gnu-build-system)
671 (arguments
672 '(#:make-flags (list (string-append "PREFIX=" %output))
673 #:tests? #f ; bats test fails with loading load.bash
674 #:phases (modify-phases %standard-phases (delete 'configure))))
675 (home-page "https://github.com/aristocratos/bashtop")
676 (synopsis "Linux/OSX/FreeBSD resource monitor")
677 (description "Resource monitor that shows usage and stats for processor,
678 memory, disks, network and processes.")
679 (license license:asl2.0)))
680
681 (define-public bpytop
682 (package
683 (name "bpytop")
684 (version "1.0.65")
685 (source
686 (origin
687 (method url-fetch)
688 (uri (pypi-uri "bpytop" version))
689 (sha256
690 (base32 "1vq51vg2ygk2p738zi21v5chn908d4bd5zkb8s4fbgf4zqp425ny"))))
691 (build-system python-build-system)
692 (inputs
693 `(("python-psutil" ,python-psutil)))
694 (arguments
695 `(#:phases
696 (modify-phases %standard-phases
697 (add-after 'install 'install-themes
698 (lambda* (#:key outputs #:allow-other-keys)
699 (let ((themes (string-append (assoc-ref outputs "out")
700 "/lib/python"
701 ,(version-major+minor
702 (package-version python))
703 "/site-packages/bpytop-themes")))
704 (mkdir-p themes)
705 (copy-recursively "bpytop-themes" themes)))))))
706 (home-page
707 "https://github.com/aristocratos/bpytop")
708 (synopsis "Resource monitor")
709 (description "Resource monitor that shows usage and stats for processor,
710 memory, disks, network and processes. It's a Python port and continuation of
711 @command{bashtop}.")
712 (license license:asl2.0)))
713
714 (define-public pies
715 (package
716 (name "pies")
717 (version "1.5")
718 (source
719 (origin
720 (method url-fetch)
721 (uri (string-append "mirror://gnu/pies/pies-"
722 version ".tar.bz2"))
723 (sha256
724 (base32
725 "11j168qljsinaj5dwmg7nkm2z1aghi6gc3d0wf0pikflnh2q2wqf"))))
726 (build-system gnu-build-system)
727 (arguments
728 '(#:phases (modify-phases %standard-phases
729 (add-before 'build 'patch-/bin/sh
730 (lambda* (#:key inputs #:allow-other-keys)
731 ;; Use the right shell when executing user-provided
732 ;; shell commands.
733 (let ((bash (assoc-ref inputs "bash")))
734 (substitute* '("src/progman.c" "src/comp.c")
735 (("\"/bin/sh\"")
736 (string-append "\"" bash "/bin/sh\"")))
737 #t))))))
738 (home-page "https://www.gnu.org.ua/software/pies/")
739 (synopsis "Program invocation and execution supervisor")
740 (description
741 "GNU pies is a program that supervises the invocation and execution of
742 other programs. It reads the list of programs to be started from its
743 configuration file, executes them, and then monitors their status,
744 re-executing them as necessary.")
745 (license license:gpl3+)))
746
747 (define-public inetutils
748 (package
749 (name "inetutils")
750 (version "1.9.4")
751 (source (origin
752 (method url-fetch)
753 (uri (string-append "mirror://gnu/inetutils/inetutils-"
754 version ".tar.gz"))
755 (patches (search-patches "inetutils-hurd.patch"))
756 (sha256
757 (base32
758 "05n65k4ixl85dc6rxc51b1b732gnmm8xnqi424dy9f1nz7ppb3xy"))))
759 (build-system gnu-build-system)
760 (arguments
761 `(#:configure-flags '("--localstatedir=/var"
762
763 ;; Make sure 'PATH_PROCNET_DEV' gets defined when
764 ;; cross-compiling (by default it does not.)
765 ,@(if (%current-target-system)
766 '("--with-path-procnet-dev=/proc/net/dev")
767 '())
768 ,@(if (hurd-target?)
769 '("--disable-rcp"
770 "--disable-rexec"
771 "--disable-rexecd"
772 "--disable-rlogin"
773 "--disable-rlogind"
774 "--disable-rsh"
775 "--disable-rshd"
776 "--disable-uucpd"
777 "--disable-whois")
778 '()))
779 ;; On some systems, 'libls.sh' may fail with an error such as:
780 ;; "Failed to tell switch -a apart from -A".
781 #:parallel-tests? #f))
782 (inputs `(("ncurses" ,ncurses)
783 ("readline" ,readline))) ;for 'ftp'
784 (native-inputs (if (member (%current-system)
785 (package-supported-systems net-tools))
786 `(("netstat" ,net-tools)) ;for tests
787 '()))
788 (home-page "https://www.gnu.org/software/inetutils/")
789 (synopsis "Basic networking utilities")
790 (description
791 "Inetutils is a collection of common network programs, such as an ftp
792 client and server, a telnet client and server, an rsh client and server, and
793 hostname.")
794 (license license:gpl3+)))
795
796 (define-public shadow
797 (package
798 (name "shadow")
799 (version "4.8.1")
800 (source (origin
801 (method url-fetch)
802 (uri (string-append
803 "https://github.com/shadow-maint/shadow/releases/"
804 "download/" version "/shadow-" version ".tar.xz"))
805 (patches (search-patches "shadow-hurd-pctrl.patch"))
806 (sha256
807 (base32
808 "0qmfq50sdhz6xilgxvinblll8j2iqfl7hwk45bq744y4plq4dbd3"))))
809 (build-system gnu-build-system)
810 (arguments
811 `(;; Assume System V `setpgrp (void)', which is the default on GNU
812 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
813 #:configure-flags
814 '(,@(if (hurd-target?)
815 '()
816 '("--with-libpam"))
817 "ac_cv_func_setpgrp_void=yes")
818
819 #:phases
820 (modify-phases %standard-phases
821 (add-before 'build 'set-nscd-file-name
822 (lambda* (#:key inputs #:allow-other-keys)
823 ;; Use the right file name for nscd.
824 (let ((libc (assoc-ref inputs
825 ,(if (%current-target-system)
826 "cross-libc"
827 "libc"))))
828 (substitute* "lib/nscd.c"
829 (("/usr/sbin/nscd")
830 (string-append libc "/sbin/nscd")))
831 #t)))
832 (add-after 'install 'remove-groups
833 (lambda* (#:key outputs #:allow-other-keys)
834 ;; Remove `groups', which is already provided by Coreutils.
835 (let* ((out (assoc-ref outputs "out"))
836 (bin (string-append out "/bin"))
837 (man (string-append out "/share/man")))
838 (delete-file (string-append bin "/groups"))
839 (for-each delete-file (find-files man "^groups\\."))
840 #t))))))
841
842 (inputs
843 `(,@(if (hurd-target?)
844 '()
845 `(("linux-pam" ,linux-pam)))))
846 (home-page "https://github.com/shadow-maint/shadow")
847 (synopsis "Authentication-related tools such as passwd, su, and login")
848 (description
849 "Shadow provides a number of authentication-related tools, including:
850 login, passwd, su, groupadd, and useradd.")
851
852 ;; The `vipw' program is GPLv2+.
853 ;; libmisc/salt.c is public domain.
854 (license license:bsd-3)))
855
856 (define-public mingetty
857 (package
858 (name "mingetty")
859 (version "1.08")
860 (source (origin
861 (method url-fetch)
862 (uri (string-append "mirror://sourceforge/mingetty/mingetty/"
863 version "/mingetty-" version ".tar.gz"))
864 (sha256
865 (base32
866 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
867 (build-system gnu-build-system)
868 (arguments
869 `(#:phases
870 (modify-phases %standard-phases
871 (replace 'configure
872 (lambda* (#:key inputs outputs target #:allow-other-keys)
873 (let* ((out (assoc-ref outputs "out"))
874 (man8 (string-append out "/share/man/man8"))
875 (sbin (string-append out "/sbin"))
876 (shadow (assoc-ref inputs "shadow"))
877 (login (string-append shadow "/bin/login")))
878 (substitute* "Makefile"
879 ,@(if (%current-target-system)
880 '((("CC=.*$")
881 (string-append "CC=" target "-gcc\n")))
882 '())
883 (("^SBINDIR.*")
884 (string-append "SBINDIR = " out
885 "/sbin\n"))
886 (("^MANDIR.*")
887 (string-append "MANDIR = " out
888 "/share/man/man8\n")))
889
890 ;; Pick the right 'login' by default.
891 (substitute* "mingetty.c"
892 (("\"/bin/login\"")
893 (string-append "\"" login "\"")))
894
895 (mkdir-p sbin)
896 (mkdir-p man8))
897 #t)))
898 #:tests? #f)) ; no tests
899 (inputs `(("shadow" ,shadow)))
900
901 (home-page "https://sourceforge.net/projects/mingetty")
902 (synopsis "Getty for the text console")
903 (description
904 "Small console getty that is started on the Linux text console,
905 asks for a login name and then transfers over to @code{login}. It is extended
906 to allow automatic login and starting any app.")
907 (license license:gpl2+)))
908
909 (define-public net-base
910 (package
911 (name "net-base")
912 (version "5.3")
913 (source (origin
914 (method url-fetch)
915 (uri (string-append
916 "mirror://debian/pool/main/n/netbase/netbase_"
917 version ".tar.xz"))
918 (sha256
919 (base32
920 "12xqjwg3p4rzmmh2iib6sigm9l29y3dgk74mmnw64k84jnbwdxl1"))))
921 (build-system trivial-build-system)
922 (arguments
923 `(#:modules ((guix build utils))
924 #:builder (begin
925 (use-modules (guix build utils)
926 (srfi srfi-26))
927
928 (let* ((source (assoc-ref %build-inputs "source"))
929 (tar (assoc-ref %build-inputs "tar"))
930 (xz (assoc-ref %build-inputs "xz"))
931 (output (assoc-ref %outputs "out"))
932 (etc (string-append output "/etc")))
933 (setenv "PATH" (string-append xz "/bin"))
934 (invoke (string-append tar "/bin/tar") "xvf"
935 source)
936 (chdir ,(string-append "netbase-" version))
937 (mkdir-p etc)
938 (for-each copy-file
939 '("etc-services" "etc-protocols" "etc-rpc")
940 (map (cut string-append etc "/" <>)
941 '("services" "protocols" "rpc")))
942 #t))))
943 (native-inputs `(("tar" ,tar)
944 ("xz" ,xz)))
945 (synopsis "IANA protocol, port, and RPC number assignments")
946 (description
947 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
948 files, which contain information about the IANA-assigned port, protocol, and
949 ONC RPC numbers.")
950 (home-page "https://packages.debian.org/sid/netbase")
951 (license license:gpl2)))
952
953 (define-public netcat
954 (package
955 (name "netcat")
956 (version "0.7.1")
957 (source (origin
958 (method url-fetch)
959 (uri (string-append "mirror://sourceforge/netcat/netcat/" version
960 "/netcat-" version ".tar.bz2"))
961 (sha256
962 (base32
963 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
964 (build-system gnu-build-system)
965 (arguments
966 `(#:configure-flags
967 ;; By default, man and info pages are put in PREFIX/{man,info},
968 ;; but we want them in PREFIX/share/{man,info}.
969 (let ((out (assoc-ref %outputs "out")))
970 (list (string-append "--mandir=" out "/share/man")
971 (string-append "--infodir=" out "/share/info")))))
972 (home-page "http://netcat.sourceforge.net")
973 (synopsis "Read and write data over TCP/IP")
974 (description
975 "Netcat is a featured networking utility which reads and writes data
976 across network connections, using the TCP/IP protocol. It is designed to be a
977 reliable \"back-end\" tool that can be used directly or easily driven by other
978 programs and scripts. At the same time, it is a feature-rich network debugging
979 and exploration tool, since it can create almost any kind of connection you
980 would need and has several interesting built-in capabilities.")
981 (license license:gpl2+)))
982
983 (define-public netcat-openbsd
984 (package
985 (name "netcat-openbsd")
986 (version "1.217-2")
987 (source (origin
988 (method git-fetch)
989 (uri (git-reference
990 (url "https://salsa.debian.org/debian/netcat-openbsd.git")
991 (commit (string-append "debian/" version))))
992 (file-name (git-file-name name version))
993 (sha256
994 (base32
995 "19sr52ix14w344pv13ppb0c1wyg5dxhic1fw2q0s3qfmx57b9hhp"))))
996 (build-system gnu-build-system)
997 (arguments
998 `(#:tests? #f ; no test suite
999 #:make-flags
1000 (list (string-append "CC=" ,(cc-for-target)))
1001 #:phases
1002 (modify-phases %standard-phases
1003 (delete 'configure)
1004 (add-before 'build 'patch
1005 (lambda _
1006 (setenv "QUILT_PATCHES" "debian/patches")
1007 (invoke "quilt" "push" "-a")
1008 #t))
1009 (replace 'install
1010 (lambda* (#:key outputs #:allow-other-keys)
1011 (let* ((out (assoc-ref outputs "out"))
1012 (bin (string-append out "/bin"))
1013 (man (string-append out "/share/man/man1"))
1014 (doc (string-append out "/share/doc/netcat-openbsd-" ,version))
1015 (examples (string-append doc "/examples")))
1016 (install-file "nc" bin)
1017 (install-file "nc.1" man)
1018 (install-file "debian/copyright" doc)
1019 (copy-recursively "debian/examples" examples)
1020 #t))))))
1021 (inputs `(("libbsd" ,libbsd)))
1022 (native-inputs `(("pkg-config" ,pkg-config)
1023 ("quilt" ,quilt)))
1024 (home-page "https://packages.debian.org/sid/netcat-openbsd")
1025 (synopsis "Read and write data over TCP/IP")
1026 (description
1027 "Netcat is a simple Unix utility which reads and writes data across
1028 network connections using TCP or UDP protocol. It is designed to be a reliable
1029 \"back-end\" tool that can be used directly or easily driven by other programs
1030 and scripts. At the same time it is a feature-rich network debugging and
1031 exploration tool, since it can create almost any kind of connection you would
1032 need and has several interesting built-in capabilities.
1033
1034 This package contains the OpenBSD rewrite of netcat, including support for
1035 IPv6, proxies, and Unix sockets.")
1036 (license (list license:bsd-3
1037 license:bsd-2)))) ; atomicio.*, socks.c
1038
1039 (define-public sipcalc
1040 (package
1041 (name "sipcalc")
1042 (version "1.1.6")
1043 (source
1044 (origin
1045 (method url-fetch)
1046 (uri (string-append "http://www.routemeister.net/projects"
1047 "/sipcalc/files/sipcalc" "-" version ".tar.gz"))
1048 (sha256
1049 (base32
1050 "0mv3wndj4z2bsshh2k8d5sy3j8wxzgf8mzmmkvj1k8gpcz37dm6g"))))
1051 (build-system gnu-build-system)
1052 (home-page "https://www.routemeister.net/projects/sipcalc/")
1053 (synopsis "Command-line IP subnet calculator")
1054 (description
1055 "Sipcalc is an advanced command-line IP subnet calculator. It can take
1056 multiple forms of input (IPv4/IPv6/interface/hostname) and output a multitude
1057 of information about a given subnet.
1058
1059 Features include:
1060
1061 @itemize @bullet
1062 @item IPv4
1063 @itemize
1064 @item Retrieving of address information from interfaces.
1065 @item Classfull and CIDR output.
1066 @item Multiple address and netmask input and output formats (dotted quad, hex,
1067 number of bits).
1068 @item Output of broadcast address, network class, Cisco wildcard,
1069 hosts/range, network range.
1070 @item The ability to split a network based on a smaller netmask, now also with
1071 recursive runs on the generated subnets. (also IPv6)
1072 @end itemize
1073 @item IPv6
1074 @itemize
1075 @item Compressed and expanded input and output addresses.
1076 @item Standard IPv6 network output.
1077 @item v4 in v6 output.
1078 @item Reverse DNS address generation.
1079 @end itemize
1080 @end itemize\n")
1081 (license license:bsd-3)))
1082
1083 (define-public prips
1084 (package
1085 (name "prips")
1086 (version "1.1.1")
1087 (source
1088 (origin
1089 (method url-fetch)
1090 (uri (string-append "https://devel.ringlet.net/files/sys/"
1091 name "/" name "-" version ".tar.xz"))
1092 (sha256
1093 (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
1094 (build-system gnu-build-system)
1095 (arguments
1096 `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))
1097 #:test-target "test"
1098 #:phases (modify-phases %standard-phases
1099 (delete 'configure)
1100 (replace 'install
1101 (lambda* (#:key outputs #:allow-other-keys)
1102 (let ((out (assoc-ref outputs "out")))
1103 (install-file "prips"
1104 (string-append out "/bin"))))))))
1105 (native-inputs `(("perl-test-harness" ,perl-test-harness)))
1106 (synopsis "Tool that prints the IP addresses in a given range")
1107 (description "Prips can be used to print all of the IP addresses in
1108 a given range. This allows the enhancement of tools only work
1109 on one host at a time (e.g. whois).")
1110 (home-page "https://devel.ringlet.net/sysutils/prips/")
1111 (license license:gpl2+)))
1112
1113 (define-public alive
1114 (package
1115 (name "alive")
1116 (version "2.0.3")
1117 (source (origin
1118 (method url-fetch)
1119 (uri (string-append "mirror://gnu/alive/alive-"
1120 version ".tar.xz"))
1121 (sha256
1122 (base32
1123 "053hfp7s66lnilm1ii4jrjmy44wpa2cwwh6f0sl8cyz0mm813x4b"))))
1124 (build-system gnu-build-system)
1125 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
1126 (inputs `(("guile" ,guile-2.0)
1127 ("inetutils" ,inetutils)))
1128 (home-page "https://www.gnu.org/software/alive/")
1129 (synopsis "Autologin and keep-alive daemon")
1130 (description
1131 "GNU Alive sends periodic pings to a server, generally to keep a
1132 connection alive.")
1133 (license license:gpl3+)))
1134
1135 (define-public isc-dhcp
1136 (let* ((bind-major-version "9")
1137 (bind-minor-version "11")
1138 (bind-patch-version "32")
1139 (bind-release-type "") ; for patch release, use "-P"
1140 (bind-release-version "") ; for patch release, e.g. "6"
1141 (bind-version (string-append bind-major-version
1142 "."
1143 bind-minor-version
1144 "."
1145 bind-patch-version
1146 bind-release-type
1147 bind-release-version)))
1148 (package
1149 (name "isc-dhcp")
1150 (version "4.4.2-P1")
1151 (source (origin
1152 (method url-fetch)
1153 (uri (string-append "https://ftp.isc.org/isc/dhcp/"
1154 version "/dhcp-" version ".tar.gz"))
1155 (sha256
1156 (base32
1157 "06jsr0cg5rsmyibshrpcb9za0qgwvqccashdma7mlm1rflrh8pmh"))))
1158 (build-system gnu-build-system)
1159 (arguments
1160 `(#:parallel-build? #f
1161 #:configure-flags '("--with-randomdev=/dev/random")
1162 #:phases
1163 (modify-phases %standard-phases
1164 (add-after 'unpack 'replace-bundled-bind
1165 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1166 (delete-file "bind/bind.tar.gz")
1167 (copy-file (assoc-ref inputs "bind-source-tarball")
1168 "bind/bind.tar.gz")
1169 (chmod "bind/bind.tar.gz" #o644)
1170 (substitute* "bind/version.tmp"
1171 (("^MAJORVER=.*")
1172 (format #f "MAJORVER=~a\n" ,bind-major-version))
1173 (("^MINORVER=.*")
1174 (format #f "MINORVER=~a\n" ,bind-minor-version))
1175 (("^PATCHVER=.*")
1176 (format #f "PATCHVER=~a\n" ,bind-patch-version))
1177 (("^RELEASETYPE=.*")
1178 (format #f "RELEASETYPE=~a\n" ,bind-release-type))
1179 (("^RELEASEVER=.*")
1180 (format #f "RELEASEVER=~a\n" ,bind-release-version)))
1181 #t))
1182 ,@(if (%current-target-system)
1183 '((add-before 'configure 'fix-bind-cross-compilation
1184 (lambda _
1185 (substitute* "configure"
1186 (("--host=\\$host")
1187 "--host=$host_alias"))
1188 ;; BIND needs a native compiler because the DHCP
1189 ;; build system uses the built 'gen' executable.
1190 (setenv "BUILD_CC" "gcc")
1191 #t)))
1192 '())
1193 (add-after 'configure 'post-configure
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 ;; Point to the right client script, which will be
1196 ;; installed in a later phase.
1197 (substitute* "includes/dhcpd.h"
1198 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
1199 (let ((out (assoc-ref outputs "out")))
1200 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
1201 out "/libexec/dhclient-script"
1202 "\"\n"))))
1203
1204 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
1205 ;; we must patch shebangs in there and make sure the right
1206 ;; shell is used.
1207 (with-directory-excursion "bind"
1208 (substitute* "Makefile"
1209 (("\\./configure ")
1210 (let ((sh (which "sh")))
1211 (string-append "./configure CONFIG_SHELL="
1212 sh " SHELL=" sh " "))))
1213
1214 (let ((bind-directory (string-append "bind-" ,bind-version)))
1215 (invoke "tar" "xf" "bind.tar.gz")
1216 (for-each patch-shebang
1217 (find-files bind-directory ".*"))
1218 (substitute* (string-append bind-directory "/configure")
1219 (("/usr/bin/file")
1220 (which "file")))
1221 (invoke "tar" "cf" "bind.tar.gz"
1222 bind-directory
1223 ;; avoid non-determinism in the archive
1224 "--sort=name"
1225 "--mtime=@0"
1226 "--owner=root:0"
1227 "--group=root:0")))))
1228 (add-after 'install 'post-install
1229 (lambda* (#:key inputs outputs #:allow-other-keys)
1230 ;; Install the dhclient script for GNU/Linux and make sure
1231 ;; if finds all the programs it needs.
1232 (let* ((out (assoc-ref outputs "out"))
1233 (libexec (string-append out "/libexec"))
1234 (coreutils (assoc-ref inputs "coreutils*"))
1235 (inetutils (assoc-ref inputs "inetutils"))
1236 (net-tools (assoc-ref inputs "net-tools"))
1237 (sed (assoc-ref inputs "sed*")))
1238 (substitute* "client/scripts/linux"
1239 (("/sbin/ip")
1240 (string-append (assoc-ref inputs "iproute")
1241 "/sbin/ip")))
1242
1243 (mkdir-p libexec)
1244 (copy-file "client/scripts/linux"
1245 (string-append libexec "/dhclient-script"))
1246
1247 (wrap-program
1248 (string-append libexec "/dhclient-script")
1249 `("PATH" ":" prefix
1250 ,(map (lambda (dir)
1251 (string-append dir "/bin:"
1252 dir "/sbin"))
1253 (list inetutils net-tools coreutils sed))))
1254 #t))))))
1255
1256 (native-inputs
1257 `(("perl" ,perl)
1258 ("file" ,file)))
1259
1260 (inputs `(("inetutils" ,inetutils)
1261 ,@(if (hurd-target?) '()
1262 `(("net-tools" ,net-tools)
1263 ("iproute" ,iproute)))
1264
1265 ;; isc-dhcp bundles a copy of BIND, which has proved vulnerable
1266 ;; in the past. Use a BIND-VERSION of our choosing instead.
1267 ("bind-source-tarball"
1268 ,(origin
1269 (method url-fetch)
1270 (uri (string-append "https://ftp.isc.org/isc/bind9/"
1271 bind-version
1272 "/bind-" bind-version ".tar.gz"))
1273 (sha256
1274 (base32
1275 "0hhkb4d14hvly2751cxl2s2xyim3bri8qaisgkcm456xfi5wpy6b"))))
1276
1277 ("coreutils*" ,coreutils)
1278 ("sed*" ,sed)))
1279
1280 (home-page "https://www.isc.org/dhcp/")
1281 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
1282 (description
1283 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
1284 reference implementation of all aspects of DHCP, through a suite of DHCP
1285 tools: server, client, and relay agent.")
1286 (license license:mpl2.0)
1287 (properties '((cpe-name . "dhcp"))))))
1288
1289 (define-public libpcap
1290 (package
1291 (name "libpcap")
1292 (version "1.10.0")
1293 (source (origin
1294 (method url-fetch)
1295 (uri (string-append "https://www.tcpdump.org/release/libpcap-"
1296 version ".tar.gz"))
1297 (sha256
1298 (base32
1299 "07ibr6zzfh1wk5gqcbnlyh6v0dfmhpfd0fqj5y3yxvzf4ckb84ld"))))
1300 (build-system gnu-build-system)
1301 (native-inputs
1302 `(("bison" ,bison)
1303 ("flex" ,flex)))
1304 (arguments
1305 ;; There are some tests in testprogs/, but no automated test suite.
1306 '(#:tests? #f))
1307 (home-page "https://www.tcpdump.org")
1308 (synopsis "Network packet capture library")
1309 (description
1310 "libpcap is an interface for user-level packet capture. It provides a
1311 portable framework for low-level network monitoring. Applications include
1312 network statistics collection, security monitoring, network debugging, etc.")
1313 (license (list license:bsd-4 ; fad-*.c and several other source files
1314 license:bsd-3 ; pcap/, sockutils.* & others
1315 license:bsd-2)))) ; the rest
1316
1317 (define-public tcpdump
1318 (package
1319 (name "tcpdump")
1320 (version "4.99.0")
1321 (source (origin
1322 (method url-fetch)
1323 (uri (string-append "https://www.tcpdump.org/release/tcpdump-"
1324 version ".tar.gz"))
1325 (sha256
1326 (base32
1327 "0hmqh2fx8rgs9v1mk3vpywj61xvkifz260q685xllxr8jmxg3wlc"))))
1328 (build-system gnu-build-system)
1329 (inputs `(("libpcap" ,libpcap)
1330 ("openssl" ,openssl)))
1331 (native-inputs `(("perl" ,perl))) ; for tests
1332 (home-page "https://www.tcpdump.org/")
1333 (synopsis "Network packet analyzer")
1334 (description
1335 "Tcpdump is a command-line tool to analyze network traffic passing
1336 through the network interface controller.")
1337 (license license:bsd-3)))
1338
1339 (define-public jnettop
1340 (package
1341 (name "jnettop")
1342 (version "0.13.0")
1343 (source (origin
1344 (method url-fetch)
1345 (uri
1346 (string-append "https://web.archive.org/web/20161221100811/"
1347 "http://jnettop.kubs.info/dist/jnettop-"
1348 version ".tar.gz"))
1349 (sha256
1350 (base32
1351 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
1352 (build-system gnu-build-system)
1353 (native-inputs
1354 `(("pkg-config" ,pkg-config)))
1355 (inputs
1356 `(("glib" ,glib)
1357 ("ncurses" ,ncurses)
1358 ("libpcap" ,libpcap)))
1359 (home-page
1360 "https://web.archive.org/web/20160703195221/http://jnettop.kubs.info/wiki/")
1361 (synopsis "Visualize network traffic by bandwidth use")
1362 (description
1363 "Jnettop is a traffic visualiser, which captures traffic going
1364 through the host it is running from and displays streams sorted
1365 by bandwidth they use.")
1366 (license license:gpl2+)))
1367
1368 (define-public clusterssh
1369 (package
1370 (name "clusterssh")
1371 (version "4.13.2")
1372 (source (origin
1373 (method url-fetch)
1374 (uri (string-append "mirror://sourceforge/clusterssh/"
1375 "2.%20ClusterSSH%20Series%204/"
1376 "App-ClusterSSH-v" version ".tar.gz"))
1377 (sha256
1378 (base32
1379 "0rmk2p3f2wz1h092anidjclh212rv3gxyk0c641qk3frlrjnw6mp"))))
1380 (build-system perl-build-system)
1381 (arguments
1382 `(#:phases
1383 (modify-phases %standard-phases
1384 (add-after 'unpack 'refer-to-inputs
1385 (lambda* (#:key inputs #:allow-other-keys)
1386 (substitute* (list "lib/App/ClusterSSH/Config.pm"
1387 "t/15config.t")
1388 (("xterm")
1389 (which "xterm")))
1390 #t))
1391 (add-before 'check 'delete-failing-tests
1392 (lambda _
1393 ;; This checks whether all code is nicely formatted. The above
1394 ;; ‘refer-to-inputs’ phase breaks this pedantry, so disable it.
1395 (delete-file "t/perltidy.t")
1396 ;; Update the manifest so t/manifest.t happily passes.
1397 (substitute* "MANIFEST"
1398 (("t/perltidy.t\n") ""))
1399 #t))
1400 (add-after 'install 'augment-library-path
1401 (lambda* (#:key inputs outputs #:allow-other-keys)
1402 (let* ((out (assoc-ref outputs "out"))
1403 (bin (string-append out "/bin")))
1404 (with-directory-excursion bin
1405 (for-each
1406 (lambda (program)
1407 (wrap-program program
1408 `("PERL5LIB" ":" prefix
1409 ,(map (lambda (file-name)
1410 (string-append file-name
1411 "/lib/perl5/site_perl"))
1412 (cons out
1413 (map (lambda (input)
1414 (assoc-ref inputs input))
1415 ;; These may be propagated and hence
1416 ;; not explicitly listed as inputs.
1417 (list "perl-class-data-inheritable"
1418 "perl-devel-stacktrace"
1419 "perl-exception-class"
1420 "perl-tk"
1421 "perl-try-tiny"
1422 "perl-x11-protocol"
1423 "perl-x11-protocol-other")))))))
1424 (find-files "." ".*")))
1425 #t))))))
1426 (native-inputs
1427 `(("perl-cpan-changes" ,perl-cpan-changes)
1428 ("perl-file-slurp" ,perl-file-slurp)
1429 ("perl-file-which" ,perl-file-which)
1430 ("perl-module-build" ,perl-module-build)
1431 ("perl-readonly" ,perl-readonly)
1432 ("perl-test-differences" ,perl-test-differences)
1433 ("perl-test-distmanifest" ,perl-test-distmanifest)
1434 ("perl-test-perltidy" ,perl-test-perltidy)
1435 ("perl-test-pod" ,perl-test-pod)
1436 ("perl-test-pod-coverage" ,perl-test-pod-coverage)
1437 ("perl-test-trap" ,perl-test-trap)
1438 ("perltidy" ,perltidy)))
1439 (inputs
1440 `(("perl-exception-class" ,perl-exception-class)
1441 ("perl-sort-naturally" ,perl-sort-naturally)
1442 ("perl-tk" ,perl-tk)
1443 ("perl-try-tiny" ,perl-try-tiny)
1444 ("perl-x11-protocol" ,perl-x11-protocol)
1445 ("perl-x11-protocol-other" ,perl-x11-protocol-other)
1446 ("xterm" ,xterm)))
1447 ;; The clusterssh.sourceforge.net address requires login to view
1448 (home-page "https://sourceforge.net/projects/clusterssh/")
1449 (synopsis "Secure concurrent multi-server terminal control")
1450 (description
1451 "ClusterSSH controls a number of xterm windows via a single graphical
1452 console window to allow commands to be interactively run on multiple servers
1453 over ssh connections.")
1454 (license license:gpl2+)))
1455
1456 (define-public rename
1457 (package
1458 (name "rename")
1459 (version "1.10")
1460 (source (origin
1461 (method url-fetch)
1462 (uri (string-append
1463 "mirror://cpan/authors/id/R/RM/RMBARKER/File-Rename-"
1464 version ".tar.gz"))
1465 (sha256
1466 (base32
1467 "137m8s06r4n038ivlr5r1d9a7q9l7shmwpvnyx053r9ndhvbnkh5"))))
1468 (build-system perl-build-system)
1469 (arguments
1470 `(#:phases
1471 (modify-phases %standard-phases
1472 (add-after 'install 'find-itself
1473 ;; Fix run-time 'Can't locate File/Rename.pm in @INC' failure.
1474 (lambda* (#:key outputs #:allow-other-keys)
1475 (let* ((out (assoc-ref outputs "out"))
1476 (bin (string-append out "/bin")))
1477 (with-directory-excursion bin
1478 (for-each
1479 (lambda (program)
1480 (wrap-program program
1481 `("PERL5LIB" ":" prefix
1482 (,(string-append out "/lib/perl5/site_perl")))))
1483 (find-files "." ".*")))
1484 #t))))))
1485 (native-inputs
1486 `(("perl-module-build" ,perl-module-build)
1487 ("perl-test-pod" ,perl-test-pod)
1488 ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
1489 (home-page "https://metacpan.org/pod/distribution/File-Rename/rename.PL")
1490 (synopsis "Perl extension for renaming multiple files")
1491 (description
1492 "This package provides a Perl interface (@code{Perl::Rename}) as well
1493 as a command-line utility (@command{rename}) that can rename multiple files
1494 at once based on a Perl regular expression.")
1495 (license license:perl-license)))
1496
1497 (define-public rottlog
1498 (package
1499 (name "rottlog")
1500 (version "0.72.2")
1501 (source (origin
1502 (method url-fetch)
1503 (uri (string-append "mirror://gnu/rottlog/rottlog-"
1504 version ".tar.gz"))
1505 (sha256
1506 (base32
1507 "0751mb9l2f0jrk3vj6q8ilanifd121dliwk0c34g8k0dlzsv3kd7"))
1508 (modules '((guix build utils)))
1509 (snippet
1510 '(begin
1511 (substitute* "Makefile.in"
1512 (("-o \\$\\{LOG_OWN\\} -g \\$\\{LOG_GROUP\\}")
1513 ;; Don't try to chown root.
1514 "")
1515 (("mkdir -p \\$\\(ROTT_STATDIR\\)")
1516 ;; Don't attempt to create /var/lib/rottlog.
1517 "true"))
1518 #t))))
1519 (build-system gnu-build-system)
1520 (arguments
1521 `(#:configure-flags (list "ROTT_ETCDIR=/etc/rottlog" ;rc file location
1522 "--localstatedir=/var")
1523
1524 ;; Install example config files in OUT/etc.
1525 #:make-flags (list (string-append "ROTT_ETCDIR="
1526 (assoc-ref %outputs "out")
1527 "/etc"))
1528
1529 #:phases (modify-phases %standard-phases
1530 (add-after 'unpack 'patch-paths
1531 (lambda* (#:key inputs #:allow-other-keys)
1532 (substitute* "rc/rc"
1533 (("/usr/sbin/sendmail")
1534 (string-append (assoc-ref inputs "mailutils")
1535 "/bin/mail")))
1536 #t))
1537 (add-after 'unpack 'fix-configure
1538 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1539 ;; Replace outdated config.sub and config.guess:
1540 (for-each (lambda (file)
1541 (install-file
1542 (string-append
1543 (assoc-ref
1544 (or native-inputs inputs) "automake")
1545 "/share/automake-"
1546 ,(version-major+minor
1547 (package-version automake))
1548 "/" file) "."))
1549 '("config.sub" "config.guess"))
1550 #t))
1551 (add-after 'build 'set-packdir
1552 (lambda _
1553 ;; Set a default location for archived logs.
1554 (substitute* "rc/rc"
1555 (("packdir=\"\"")
1556 "packdir=\"/var/log\""))
1557 #t))
1558 (add-before 'install 'tweak-rc-weekly
1559 (lambda* (#:key inputs #:allow-other-keys)
1560 (substitute* "rc/weekly"
1561 (("/bin/kill")
1562 (string-append (assoc-ref inputs "coreutils*")
1563 "/bin/kill"))
1564 (("syslogd\\.pid")
1565 ;; The file is called 'syslog.pid' (no 'd').
1566 "syslog.pid"))
1567 #t))
1568 (add-after 'install 'install-info
1569 (lambda _
1570 (invoke "make" "install-info"))))))
1571 (native-inputs `(("texinfo" ,texinfo)
1572 ("automake" ,automake)
1573 ("util-linux" ,util-linux))) ; for 'cal'
1574 (inputs `(("coreutils*" ,coreutils)
1575 ("mailutils" ,mailutils)))
1576 (home-page "https://www.gnu.org/software/rottlog/")
1577 (synopsis "Log rotation and management")
1578 (description
1579 "GNU Rot[t]log is a program for managing log files. It is used to
1580 automatically rotate out log files when they have reached a given size or
1581 according to a given schedule. It can also be used to automatically compress
1582 and archive such logs. Rot[t]log will mail reports of its activity to the
1583 system administrator.")
1584 (license license:gpl3+)))
1585
1586 (define-public sudo
1587 (package
1588 (name "sudo")
1589 (version "1.9.7")
1590 (source (origin
1591 (method url-fetch)
1592 (uri
1593 (list (string-append "https://www.sudo.ws/sudo/dist/sudo-"
1594 version ".tar.gz")
1595 (string-append "ftp://ftp.sudo.ws/pub/sudo/OLD/sudo-"
1596 version ".tar.gz")))
1597 (sha256
1598 (base32
1599 "0jg5vf6hc0j2bh4vqwsb4jybhryrsh4kz97r1salvf4rcqnprgib"))
1600 (modules '((guix build utils)))
1601 (snippet
1602 '(begin
1603 (delete-file-recursively "lib/zlib")
1604 #t))))
1605 (build-system gnu-build-system)
1606 (outputs (list "out"))
1607 (arguments
1608 `(#:configure-flags
1609 (list (string-append "--docdir=" (assoc-ref %outputs "out")
1610 "/share/doc/" ,name "-" ,version)
1611
1612 "--with-logpath=/var/log/sudo.log"
1613 "--with-rundir=/var/run/sudo" ; must be cleaned up at boot time
1614 "--with-vardir=/var/db/sudo"
1615 "--with-iologdir=/var/log/sudo-io"
1616
1617 ;; 'visudo.c' expects _PATH_MV to be defined, but glibc doesn't
1618 ;; provide it.
1619 (string-append "CPPFLAGS=-D_PATH_MV='\""
1620 (assoc-ref %build-inputs "coreutils")
1621 "/bin/mv\"'"))
1622
1623 ;; Avoid non-determinism; see <http://bugs.gnu.org/21918>.
1624 #:parallel-build? #f
1625
1626 #:phases
1627 (modify-phases %standard-phases
1628 (add-before 'configure 'pre-configure
1629 (lambda _
1630 (substitute* "src/sudo_usage.h.in"
1631 ;; Do not capture 'configure' arguments since we would
1632 ;; unduly retain references, and also because the
1633 ;; CPPFLAGS above would close the string literal
1634 ;; prematurely.
1635 (("@CONFIGURE_ARGS@") "\"\""))
1636 (substitute* (find-files "." "Makefile\\.in")
1637 ;; Allow installation as non-root.
1638 (("-o [[:graph:]]+ -g [[:graph:]]+")
1639 "")
1640 ;; Don't try to create /etc/sudoers.
1641 (("^install: (.*)install-sudoers(.*)" _ before after)
1642 (string-append "install: " before after "\n"))
1643 ;; Don't try to create /run/sudo.
1644 (("\\$\\(DESTDIR\\)\\$\\(rundir\\)")
1645 "$(TMPDIR)/dummy")
1646 ;; Install example sudo{,_logsrvd}.conf to the right place.
1647 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
1648 "$(DESTDIR)/$(docdir)/examples")
1649 ;; Don't try to create /var/db/sudo.
1650 (("\\$\\(DESTDIR\\)\\$\\(vardir\\)")
1651 "$(TMPDIR)/dummy"))
1652
1653 ;; ‘Checking existing [/etc/]sudoers file for syntax errors’ is
1654 ;; not the task of the build system, and fails.
1655 (substitute* "plugins/sudoers/Makefile.in"
1656 (("^pre-install:" match)
1657 (string-append match "\ndisabled-" match)))
1658 #t)))
1659
1660 ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
1661 ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.
1662 #:tests? #f))
1663 (native-inputs
1664 ;; XXX TODO: Remove on next rebuild cycle.
1665 (if (hurd-target?)
1666 '()
1667 `(("groff" ,groff))))
1668 (inputs
1669 `(("coreutils" ,coreutils)
1670 ,@(if (hurd-target?)
1671 '()
1672 `(("linux-pam" ,linux-pam)))
1673 ("zlib" ,zlib)))
1674 (home-page "https://www.sudo.ws/")
1675 (synopsis "Run commands as root")
1676 (description
1677 "Sudo (su \"do\") allows a system administrator to delegate authority to
1678 give certain users (or groups of users) the ability to run some (or all)
1679 commands as root or another user while providing an audit trail of the
1680 commands and their arguments.")
1681
1682 ;; See <http://www.sudo.ws/sudo/license.html>.
1683 (license license:x11)))
1684
1685 (define-public opendoas
1686 (package
1687 (name "opendoas")
1688 (version "6.8.1")
1689 (source (origin
1690 (method git-fetch)
1691 (uri (git-reference
1692 (url "https://github.com/Duncaen/OpenDoas")
1693 (commit (string-append "v" version))))
1694 (file-name (git-file-name name version))
1695 (sha256
1696 (base32
1697 "0gfcssm21vdfg6kcrcc7hz1h4jmhy2zv29rfqyrrj3a6r9b5ah8p"))))
1698 (build-system gnu-build-system)
1699 (arguments
1700 `(#:phases
1701 (modify-phases %standard-phases
1702 (replace 'configure
1703 ;; The configure script doesn't accept most of the default flags.
1704 (lambda* (#:key configure-flags #:allow-other-keys)
1705 ;; The configure script can be told which compiler to use only
1706 ;; through environment variables.
1707 (setenv "CC" ,(cc-for-target))
1708 (apply invoke "./configure" configure-flags)))
1709 (add-before 'install 'fix-makefile
1710 (lambda* (#:key outputs #:allow-other-keys)
1711 (substitute* "GNUmakefile"
1712 (("^\tchown.*$") ""))
1713 #t)))
1714 #:configure-flags
1715 (list (string-append "--prefix=" (assoc-ref %outputs "out"))
1716 "--with-timestamp")
1717 ;; Compiler choice is not carried over from the configure script.
1718 #:make-flags
1719 (list (string-append "CC=" ,(cc-for-target)))
1720 #:tests? #f)) ; no test suite
1721 (native-inputs
1722 `(("bison" ,bison)))
1723 (home-page "https://github.com/Duncaen/OpenDoas")
1724 (synopsis "Portable version of OpenBSD's doas command")
1725 (description "Doas is a minimal replacement for the venerable sudo. It was
1726 initially written by Ted Unangst of the OpenBSD project to provide 95% of the
1727 features of sudo with a fraction of the codebase.")
1728 (license (list license:bsd-3 ; libbsd/*
1729 license:isc)))) ; everything else
1730
1731 (define-public wpa-supplicant-minimal
1732 (package
1733 (name "wpa-supplicant-minimal")
1734 (version "2.9")
1735 (source (origin
1736 (method url-fetch)
1737 (uri (string-append
1738 "https://w1.fi/releases/wpa_supplicant-"
1739 version ".tar.gz"))
1740 (sha256
1741 (base32
1742 "05qzak1mssnxcgdrafifxh9w86a4ha69qabkg4bsigk499xyxggw"))
1743 (modules '((guix build utils)))
1744 (snippet
1745 '(begin
1746 (substitute* "wpa_supplicant/defconfig"
1747 ;; Disable D-Bus to save ~14MiB on the closure size.
1748 (("^CONFIG_CTRL_IFACE_DBUS" line _)
1749 (string-append "#" line)))
1750 #t))
1751 (patches
1752 (search-patches "wpa-supplicant-CVE-2021-27803.patch"
1753 "wpa-supplicant-CVE-2021-30004.patch"))))
1754 (build-system gnu-build-system)
1755 (arguments
1756 `(#:phases
1757 (modify-phases %standard-phases
1758 (replace 'configure
1759 (lambda _
1760 (chdir "wpa_supplicant")
1761 (copy-file "defconfig" ".config")
1762 (let ((port (open-file ".config" "al")))
1763 (display "
1764 CONFIG_DEBUG_SYSLOG=y
1765
1766 CONFIG_TLS=openssl
1767
1768 CONFIG_DRIVER_NL80211=y
1769 CFLAGS += $(shell pkg-config libnl-3.0 --cflags)
1770 CONFIG_LIBNL32=y
1771 CONFIG_READLINE=y\n" port)
1772 (close-port port))
1773 ;; Make sure we have a pkg-config when cross compiling
1774 (substitute* '(".config"
1775 "Android.mk"
1776 "Makefile"
1777 "dbus/Makefile")
1778 (("pkg-config")
1779 (or (which "pkg-config")
1780 (which (string-append ,(%current-target-system)
1781 "-pkg-config")))))
1782 #t))
1783 (add-after 'install 'install-documentation
1784 (lambda* (#:key outputs #:allow-other-keys)
1785 (let* ((out (assoc-ref outputs "out"))
1786 (doc (string-append out "/share/doc/wpa-supplicant"))
1787 (man (string-append out "/share/man"))
1788 (man5 (string-append man "/man5"))
1789 (man8 (string-append man "/man8")))
1790 (define (copy-man-page target)
1791 (lambda (file)
1792 (install-file file target)))
1793
1794 (mkdir-p man5) (mkdir man8)
1795 (for-each (copy-man-page man5)
1796 (find-files "doc/docbook" "\\.5"))
1797 (for-each (copy-man-page man8)
1798 (find-files "doc/docbook" "\\.8"))
1799
1800 ;; wpa_supplicant.conf(5) does not explain all configuration
1801 ;; options but refers to the example config file, so install it
1802 ;; along with READMEs.
1803 (for-each (lambda (file)
1804 (install-file file doc))
1805 '("README" "README-DPP" "README-HS20"
1806 "README-P2P" "README-WPS"
1807 "wpa_supplicant.conf"))
1808 #t))))
1809
1810 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1811 (string-append "BINDIR=" (assoc-ref %outputs "out")
1812 "/sbin")
1813 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1814 "/lib"))
1815 #:tests? #f))
1816 (inputs
1817 `(("readline" ,readline)
1818 ("libnl" ,libnl)
1819 ("openssl" ,openssl)))
1820 (native-inputs
1821 `(("pkg-config" ,pkg-config)))
1822 (home-page "https://w1.fi/wpa_supplicant/")
1823 (synopsis "Connecting to WPA and WPA2-protected wireless networks")
1824 (description
1825 "wpa_supplicant is a WPA Supplicant with support for WPA and WPA2 (IEEE
1826 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in
1827 the client stations. It implements key negotiation with a WPA Authenticator
1828 and it controls the roaming and IEEE 802.11 authentication/association of the
1829 WLAN driver.
1830
1831 This package provides the @code{wpa_supplicant} daemon and the @code{wpa_cli}
1832 command.")
1833
1834 ;; In practice, this is linked against Readline, which makes it GPLv3+.
1835 (license license:bsd-3)
1836
1837 (properties `((cpe-name . "wpa_supplicant")))))
1838
1839 (define-public wpa-supplicant
1840 (package (inherit wpa-supplicant-minimal)
1841 (name "wpa-supplicant")
1842 (inputs `(("dbus" ,dbus)
1843 ,@(package-inputs wpa-supplicant-minimal)))
1844 (arguments
1845 (substitute-keyword-arguments (package-arguments wpa-supplicant-minimal)
1846 ((#:phases phases)
1847 `(modify-phases ,phases
1848 (add-after 'configure 'configure-for-dbus
1849 (lambda _
1850 (let ((port (open-file ".config" "al")))
1851 (display "
1852 CONFIG_CTRL_IFACE_DBUS_NEW=y
1853 CONFIG_CTRL_IFACE_DBUS_INTRO=y\n" port)
1854 (close-port port))
1855 #t))
1856 (add-after 'install-documentation 'install-dbus-conf
1857 (lambda* (#:key outputs #:allow-other-keys)
1858 (let* ((out (assoc-ref outputs "out"))
1859 (dir (string-append out "/etc/dbus-1/system.d")))
1860 (mkdir-p dir)
1861 (copy-file "dbus/dbus-wpa_supplicant.conf"
1862 (string-append dir "/wpa_supplicant.conf")))
1863 #t))))))))
1864
1865 (define-public wpa-supplicant-gui
1866 (package
1867 (inherit wpa-supplicant)
1868 (name "wpa-supplicant-gui")
1869 (inputs `(("qtbase" ,qtbase)
1870 ("qtsvg" ,qtsvg)
1871 ,@(package-inputs wpa-supplicant)))
1872 (native-inputs
1873 ;; For icons.
1874 `(("imagemagick" ,imagemagick)
1875 ("inkscape" ,inkscape)
1876 ,@(package-native-inputs wpa-supplicant)))
1877 (arguments
1878 `(#:phases (modify-phases %standard-phases
1879 (add-after 'unpack 'chdir
1880 (lambda _
1881 (chdir "wpa_supplicant/wpa_gui-qt4")
1882 #t))
1883 (delete 'configure)
1884 (replace 'build
1885 (lambda _
1886 (invoke "qmake" "wpa_gui.pro")
1887 (invoke "make" "-j" (number->string (parallel-job-count)))
1888 (invoke "make" "-C" "icons")))
1889 (replace 'install
1890 (lambda* (#:key inputs outputs #:allow-other-keys)
1891 (let ((out (assoc-ref outputs "out"))
1892 (qt '("qtbase" "qtsvg")))
1893 (install-file "wpa_gui" (string-append out "/bin"))
1894 (install-file "wpa_gui.desktop"
1895 (string-append out "/share/applications"))
1896 (copy-recursively "icons/hicolor"
1897 (string-append out "/share/icons/hicolor"))
1898 (wrap-program (string-append out "/bin/wpa_gui")
1899 `("QT_PLUGIN_PATH" ":" prefix
1900 ,(map (lambda (label)
1901 (string-append (assoc-ref inputs label)
1902 "/lib/qt5/plugins/"))
1903 qt)))
1904 #t))))))
1905 (synopsis "Graphical user interface for WPA supplicant")))
1906
1907 (define-public hostapd
1908 (package
1909 (name "hostapd")
1910 (version "2.9")
1911 (source (origin
1912 (method url-fetch)
1913 (uri (string-append "https://w1.fi/releases/hostapd-" version
1914 ".tar.gz"))
1915 (sha256
1916 (base32
1917 "1mrbvg4v7vm7mknf0n29mf88k3s4a4qj6r4d51wq8hmjj1m7s7c8"))
1918 (patches
1919 (search-patches "wpa-supplicant-CVE-2021-27803.patch"
1920 "wpa-supplicant-CVE-2021-30004.patch"))))
1921 (build-system gnu-build-system)
1922 (arguments
1923 `(#:phases
1924 (modify-phases %standard-phases
1925 (replace 'configure
1926 (lambda _
1927 ;; This is mostly copied from 'wpa-supplicant' above.
1928 (chdir "hostapd")
1929 (copy-file "defconfig" ".config")
1930 (let ((port (open-file ".config" "al")))
1931 (display "
1932 CONFIG_LIBNL32=y
1933 CONFIG_IEEE80211R=y
1934 CONFIG_IEEE80211N=y
1935 CONFIG_IEEE80211AC=y\n" port)
1936 (close-port port))
1937 #t))
1938 (add-after 'unpack 'patch-pkg-config
1939 (lambda _
1940 (substitute* "src/drivers/drivers.mak"
1941 (("pkg-config")
1942 (or (which "pkg-config")
1943 (string-append ,(%current-target-system)
1944 "-pkg-config"))))
1945 #t))
1946 (add-after 'install 'install-man-pages
1947 (lambda* (#:key outputs #:allow-other-keys)
1948 (let* ((out (assoc-ref outputs "out"))
1949 (man (string-append out "/share/man"))
1950 (man1 (string-append man "/man1"))
1951 (man8 (string-append man "/man8")))
1952 (define (copy-man-page target)
1953 (lambda (file)
1954 (install-file file target)))
1955
1956 (for-each (copy-man-page man1)
1957 (find-files "." "\\.1"))
1958 (for-each (copy-man-page man8)
1959 (find-files "." "\\.8"))
1960 #t))))
1961
1962 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1963 (string-append "BINDIR=" (assoc-ref %outputs "out")
1964 "/sbin")
1965 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1966 "/lib"))
1967 #:tests? #f))
1968 (native-inputs `(("pkg-config" ,pkg-config)))
1969
1970 ;; There's an optional dependency on SQLite.
1971 (inputs `(("openssl" ,openssl)
1972 ("libnl" ,libnl)))
1973 (home-page "https://w1.fi/hostapd/")
1974 (synopsis "Daemon for Wi-Fi access points and authentication servers")
1975 (description
1976 "hostapd is a user-space daemon for WiFi access points and authentication
1977 servers. It implements IEEE 802.11 access point management, IEEE
1978 802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS
1979 authentication server.")
1980
1981 ;; Same license as wpa_supplicant.
1982 (license license:bsd-3)))
1983
1984 (define-public wakelan
1985 (package
1986 (name "wakelan")
1987 (version "1.1")
1988 (source (origin
1989 (method url-fetch)
1990 (uri (string-append
1991 "ftp://ftp.gwdg.de/pub/linux/metalab/system/network/misc/wakelan-"
1992 version ".tar.gz"))
1993 (sha256
1994 (base32
1995 "0vydqpf44146ir6k87gmqaq6xy66xhc1gkr3nsd7jj3nhy7ypx9x"))))
1996 (build-system gnu-build-system)
1997 (arguments
1998 '(#:phases
1999 (modify-phases %standard-phases
2000 (replace 'configure
2001 (lambda* (#:key outputs #:allow-other-keys)
2002 (let ((out (assoc-ref outputs "out")))
2003 (mkdir-p (string-append out "/bin"))
2004 (mkdir-p (string-append out "/share/man/man1"))
2005
2006 ;; It's an old configure script that doesn't understand
2007 ;; the extra options we pass.
2008 (setenv "CONFIG_SHELL" (which "bash"))
2009 (invoke "./configure"
2010 (string-append "--prefix=" out)
2011 (string-append "--mandir=" out
2012 "/share/man"))))))
2013 #:tests? #f))
2014 (home-page "https://www.kernel.org") ; really, no home page
2015 (synopsis "Send a wake-on-LAN packet")
2016 (description
2017 "WakeLan broadcasts a properly formatted UDP packet across the local area
2018 network, which causes enabled computers to power on.")
2019 (license license:gpl2+)))
2020
2021 (define-public dmidecode
2022 (package
2023 (name "dmidecode")
2024 (version "3.3")
2025 (source
2026 (origin
2027 (method url-fetch)
2028 (uri (string-append "mirror://savannah/dmidecode/dmidecode-"
2029 version ".tar.xz"))
2030 (sha256
2031 (base32 "0m8lzg9rf1qssasiix672bxk5qwms90561g8hfkkhk31h2kkgiw2"))))
2032 (build-system gnu-build-system)
2033 (arguments
2034 `(#:tests? #f ; no 'check' target
2035 #:make-flags
2036 (list (string-append "CC=" ,(cc-for-target))
2037 (string-append "prefix="
2038 (assoc-ref %outputs "out")))
2039 #:phases
2040 (modify-phases %standard-phases
2041 (delete 'configure)))) ; no configure script
2042 (home-page "https://www.nongnu.org/dmidecode/")
2043 (synopsis "Read hardware information from the BIOS")
2044 (description
2045 "Dmidecode reports information about your system's hardware as described
2046 in your system BIOS according to the SMBIOS/DMI standard. This typically
2047 includes system manufacturer, model name, serial number, BIOS version, asset
2048 tag as well as a lot of other details of varying level of interest and
2049 reliability depending on the manufacturer. This will often include usage
2050 status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory
2051 module slots, and the list of I/O ports (e.g. serial, parallel, USB).")
2052 (license license:gpl2+)))
2053
2054 (define-public acpica
2055 (package
2056 (name "acpica")
2057 (version "20210331")
2058 (source (origin
2059 (method url-fetch)
2060 (uri (string-append
2061 "https://acpica.org/sites/acpica/files/acpica-unix2-"
2062 version ".tar.gz"))
2063 (sha256
2064 (base32
2065 "1h98pvc9iy1c49cid0ppjwk5zsy2m1xbvfqb72pkwkrd4rn35arx"))))
2066 (build-system gnu-build-system)
2067 (native-inputs `(("flex" ,flex)
2068 ("bison" ,bison)))
2069 (arguments
2070 `(#:make-flags (list (string-append "PREFIX=" %output)
2071 (string-append "CC=" ,(cc-for-target))
2072 "HOST=_LINUX"
2073 "OPT_CFLAGS=-Wall -fno-strict-aliasing")
2074 #:tests? #f ; no 'check' target
2075 #:phases (modify-phases %standard-phases (delete 'configure))))
2076 (home-page "https://acpica.org/")
2077 (synopsis "Tools for the development and debugging of ACPI tables")
2078 (description
2079 "The @acronym{ACPICA, ACPI Component Architecture} project provides an
2080 OS-independent reference implementation of the @acronym{ACPI, Advanced
2081 Configuration and Power Interface} specification. ACPICA code contains those
2082 portions of ACPI meant to be directly integrated into the host OS as a
2083 kernel-resident subsystem, and a small set of tools to assist in developing and
2084 debugging ACPI tables.
2085
2086 This package contains only the user-space tools needed for ACPI table
2087 development, not the kernel implementation of ACPI.")
2088 (license license:gpl2))) ; dual GPLv2/ACPICA Licence
2089
2090 (define-public s-tui
2091 (package
2092 (name "s-tui")
2093 (version "1.1.1")
2094 (source
2095 (origin
2096 (method url-fetch)
2097 (uri (pypi-uri "s-tui" version))
2098 (sha256
2099 (base32 "1clk59wf6v1lq33h4x5qwxvz5ng9mfkp1s6ynxa58w2raq8dbmy5"))))
2100 (build-system python-build-system)
2101 (inputs
2102 `(("python-psutil" ,python-psutil)
2103 ("python-urwid" ,python-urwid)))
2104 (home-page "https://github.com/amanusk/s-tui")
2105 (synopsis "Interactive terminal stress test and monitoring tool")
2106 (description
2107 "The Stress Terminal UI displays graphs of the CPU frequency,
2108 utilization, temperature and power.")
2109 (license license:gpl2+)))
2110
2111 (define-public stress
2112 (package
2113 (name "stress")
2114 (version "1.0.4")
2115 (source (origin
2116 (method url-fetch)
2117 (uri (string-append "mirror://debian/pool/main/s/stress/stress_"
2118 version ".orig.tar.gz"))
2119 (sha256
2120 (base32
2121 "0nw210jajk38m3y7h8s130ps2qsbz7j75wab07hi2r3hlz14yzh5"))))
2122 (build-system gnu-build-system)
2123 (home-page "https://packages.debian.org/sid/stress")
2124 (synopsis "Impose load on and stress test a computer system")
2125 (description
2126 "Stress is a tool that imposes a configurable amount of CPU, memory, I/O,
2127 or disk stress on a POSIX-compliant operating system and reports any errors it
2128 detects.
2129
2130 Stress is not a benchmark. It is a tool used by system administrators to
2131 evaluate how well their systems will scale, by kernel programmers to evaluate
2132 perceived performance characteristics, and by systems programmers to expose
2133 the classes of bugs which only or more frequently manifest themselves when the
2134 system is under heavy load.")
2135 (license license:gpl2+)))
2136
2137 (define-public detox
2138 (package
2139 (name "detox")
2140 (version "1.4.2")
2141 (source (origin
2142 (method git-fetch)
2143 (uri (git-reference
2144 (url "https://github.com/dharple/detox")
2145 (commit (string-append "v" version))))
2146 (file-name (git-file-name name version))
2147 (sha256
2148 (base32
2149 "0q16dvjbry573j4ayh9dwskdh1dxx8dk4rj94w6f2dcv4ww37is1"))))
2150 (build-system gnu-build-system)
2151 (native-inputs
2152 `(("autoconf" ,autoconf)
2153 ("automake" ,automake)
2154 ("flex" ,flex)))
2155 (arguments
2156 `(#:phases (modify-phases %standard-phases
2157 (add-after 'unpack 'delete-configure
2158 ;; The "configure" script is present, but otherwise the
2159 ;; project is not bootstrapped: missing install-sh and
2160 ;; Makefile.in, so delete it so the bootstrap phase will
2161 ;; take over.
2162 (lambda _ (delete-file "configure") #t))
2163 (replace 'check
2164 (lambda _
2165 (invoke "./tests/test.sh" "src/detox"))))))
2166 (home-page "https://github.com/dharple/detox")
2167 (synopsis "Clean up file names")
2168 (description
2169 "Detox is a program that renames files to make them easier to work with
2170 under Unix and related operating systems. Spaces and various other unsafe
2171 characters (such as \"$\") get replaced with \"_\". ISO 8859-1 (Latin-1)
2172 characters can be replaced as well, as can UTF-8 characters.")
2173 (license license:bsd-3)))
2174
2175 (define-public testdisk
2176 (package
2177 (name "testdisk")
2178 (version "7.1")
2179 (source (origin
2180 (method url-fetch)
2181 (uri (string-append "https://www.cgsecurity.org/testdisk-"
2182 version ".tar.bz2"))
2183 (sha256
2184 (base32
2185 "1zlh44w67py416hkvw6nrfmjickc2d43v51vcli5p374d5sw84ql"))))
2186 (build-system gnu-build-system)
2187 (inputs
2188 `(("ntfs-3g" ,ntfs-3g)
2189 ("util-linux" ,util-linux "lib")
2190 ("openssl" ,openssl)
2191 ;; FIXME: add reiserfs.
2192 ("zlib" ,zlib)
2193 ("e2fsprogs" ,e2fsprogs)
2194 ("libjpeg" ,libjpeg-turbo)
2195 ("ncurses" ,ncurses)))
2196 (home-page "https://www.cgsecurity.org/wiki/TestDisk")
2197 (synopsis "Data recovery tool")
2198 (description
2199 "TestDisk is a program for data recovery, primarily designed to help
2200 recover lost partitions and/or make non-booting disks bootable again.")
2201 (license license:gpl2+)))
2202
2203 (define-public tree
2204 (package
2205 (name "tree")
2206 (version "1.8.0")
2207 (source (origin
2208 (method url-fetch)
2209 (uri (string-append
2210 "http://mama.indstate.edu/users/ice/tree/src/tree-"
2211 version ".tgz"))
2212 (sha256
2213 (base32 "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi"))))
2214 (build-system gnu-build-system)
2215 (arguments
2216 '(#:phases (modify-phases %standard-phases (delete 'configure))
2217 #:tests? #f ; no check target
2218 #:make-flags (let ((out (assoc-ref %outputs "out")))
2219 (list (string-append "prefix=" out)))))
2220 (synopsis "Recursively list the contents of a directory")
2221 (description
2222 "Tree is a recursive directory listing command that produces a depth
2223 indented listing of files, which is colorized ala dircolors if the LS_COLORS
2224 environment variable is set and output is to tty.")
2225 (home-page "http://mama.indstate.edu/users/ice/tree/")
2226 (license license:gpl2+)))
2227
2228 (define-public lr
2229 (package
2230 (name "lr")
2231 (version "1.5.1")
2232 (source
2233 (origin
2234 (method git-fetch)
2235 (uri (git-reference
2236 (url "https://git.vuxu.org/lr/")
2237 (commit (string-append "v" version))))
2238 (file-name (git-file-name name version))
2239 (sha256
2240 (base32 "1wv2acm4r5y5gg6f64v2hiwpg1f3lnr4fy1a9zssw77fmdc7ys3j"))))
2241 (build-system gnu-build-system)
2242 (arguments
2243 `(#:tests? #f
2244 #:make-flags (list (string-append "CC=" ,(cc-for-target))
2245 (string-append "PREFIX=" %output))
2246 #:phases (modify-phases %standard-phases
2247 (delete 'configure))))
2248 (synopsis "Tool to generate customized file listings")
2249 (description
2250 "lr is a tool for generating file listings, which includes the best
2251 features of ls(1), find(1), stat(1) and du(1).")
2252 (home-page "https://git.vuxu.org/lr/about")
2253 (license license:expat)))
2254
2255 (define-public direvent
2256 (package
2257 (name "direvent")
2258 (version "5.2")
2259 (source (origin
2260 (method url-fetch)
2261 (uri (string-append "mirror://gnu/direvent/direvent-"
2262 version ".tar.gz"))
2263 (sha256
2264 (base32
2265 "0m9vi01b1km0cpknflyzsjnknbava0s1n6393b2bpjwyvb6j5613"))
2266 (modules '((guix build utils)))
2267 (snippet '(begin
2268 (substitute* "tests/testsuite"
2269 (("#![[:blank:]]?/bin/sh")
2270 "#!$SHELL"))
2271 #t))))
2272 (build-system gnu-build-system)
2273 (arguments
2274 '(#:phases
2275 (modify-phases %standard-phases
2276 (add-before 'build 'patch-/bin/sh
2277 (lambda* (#:key inputs #:allow-other-keys)
2278 ;; Use the right shell when executing the watcher and
2279 ;; user-provided shell commands.
2280 (let ((bash (assoc-ref inputs "bash")))
2281 (substitute* '("src/direvent.c" "src/progman.c")
2282 (("\"/bin/sh\"")
2283 (string-append "\"" bash "/bin/sh\"")))
2284
2285 ;; Adjust the 'shell.at' test accordingly.
2286 (substitute* "tests/testsuite"
2287 (("SHELL=/bin/sh")
2288 (string-append "SHELL=" bash "/bin/sh")))
2289
2290 #t))))))
2291 (home-page "https://www.gnu.org.ua/software/direvent/")
2292 (synopsis "Daemon to monitor directories for events such as file removal")
2293 (description
2294 "A daemon that monitors directories for events, such as creating,
2295 deleting or modifying files. It can monitor different sets of directories for
2296 different events. When an event is detected, direvent calls a specified
2297 external program with information about the event, such as the location
2298 within the file system where it occurred. Thus, \"direvent\" provides an
2299 easy way to react immediately if given files undergo changes, for example, to
2300 track changes in important system configuration files.")
2301 (license license:gpl3+)))
2302
2303 (define-public libcap-ng
2304 (package
2305 (name "libcap-ng")
2306 (version "0.8.2")
2307 (source (origin
2308 (method url-fetch)
2309 (uri (string-append
2310 "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-"
2311 version ".tar.gz"))
2312 (sha256
2313 (base32
2314 "1sasp1n154aqy9fz0knlb966svm7xg1zjhg1vr4q839bgjvq7h2j"))))
2315 (build-system gnu-build-system)
2316 (arguments
2317 `(#:configure-flags
2318 (list "--without-python")))
2319 (home-page "https://people.redhat.com/sgrubb/libcap-ng/")
2320 (synopsis "Library for more easily working with POSIX capabilities")
2321 (description
2322 "The libcap-ng library is intended to make programming with POSIX
2323 capabilities easier than the traditional libcap library. It includes
2324 utilities that can analyse all currently running applications and print out
2325 any capabilities and whether or not it has an open ended bounding set. The
2326 included utilities are designed to let admins and developers spot apps from
2327 various ways that may be running with too much privilege.")
2328 ;; The library is lgpl2.1+, but also ships some utils which are gpl2+.
2329 (license (list license:lgpl2.1+ license:gpl2+))))
2330
2331 (define-public smartmontools
2332 (package
2333 (name "smartmontools")
2334 (version "7.2")
2335 (source (origin
2336 (method url-fetch)
2337 (uri (string-append
2338 "mirror://sourceforge/smartmontools/smartmontools/"
2339 version "/smartmontools-" version ".tar.gz"))
2340 (sha256
2341 (base32
2342 "1mlc25sd5rgj5xmzcllci47inmfdw7cp185fday6hc9rwqkqmnaw"))))
2343 (build-system gnu-build-system)
2344 (inputs `(("libcap-ng" ,libcap-ng)))
2345 (home-page "https://www.smartmontools.org/")
2346 (synopsis "S.M.A.R.T. harddisk control and monitoring tools")
2347 (description
2348 "The smartmontools package contains utility programs to control and
2349 monitor storage systems using the Self-Monitoring, Analysis and Reporting
2350 Technology System (@dfn{S.M.A.R.T.}) built into most modern ATA and SCSI hard
2351 disks. In many cases, these utilities will provide advanced warning of disk
2352 degradation and failure.")
2353 (license license:gpl2+)))
2354
2355 (define-public fdupes
2356 (package
2357 (name "fdupes")
2358 (version "2.1.2")
2359 (source
2360 (origin
2361 (method url-fetch)
2362 (uri (string-append "https://github.com/adrianlopezroche/fdupes/"
2363 "releases/download/v" version "/"
2364 "fdupes-" version ".tar.gz"))
2365 (sha256
2366 (base32 "1g9p50xhi2sp0hqxml4w2k0kq9jv988q2yxm347z5349dlxvap6d"))))
2367 (build-system gnu-build-system)
2368 (inputs
2369 `(("ncurses" ,ncurses)
2370 ("pcre2" ,pcre2)))
2371 (home-page "https://github.com/adrianlopezroche/fdupes")
2372 (synopsis "Identify duplicate files")
2373 (description
2374 "fdupes is a program for identifying duplicate files residing within
2375 specified directories.")
2376 (license license:expat)))
2377
2378 (define-public graphios
2379 (package
2380 (name "graphios")
2381 (version "2.0.3")
2382 (source
2383 (origin
2384 (method url-fetch)
2385 (uri (pypi-uri "graphios" version))
2386 (sha256
2387 (base32
2388 "1h87hvc315wg6lklbf4l7csd3n5pgljwrfli1p3nasdi0izgn66i"))))
2389 (build-system python-build-system)
2390 (arguments
2391 ;; Be warned: Building with Python 3 succeeds, but the build process
2392 ;; throws a syntax error that is ignored.
2393 `(#:python ,python-2
2394 #:phases
2395 (modify-phases %standard-phases
2396 (add-before 'build 'fix-setup.py
2397 (lambda* (#:key outputs #:allow-other-keys)
2398 ;; Fix hardcoded, unprefixed file names.
2399 (let ((out (assoc-ref outputs "out")))
2400 (substitute* '("setup.py")
2401 (("/etc") (string-append out "/etc"))
2402 (("/usr") out)
2403 (("distro_ver = .*") "distro_ver = ''"))
2404 #t))))))
2405 (home-page "https://github.com/shawn-sterling/graphios")
2406 (synopsis "Emit Nagios metrics to Graphite, Statsd, and Librato")
2407 (description
2408 "Graphios is a script to emit nagios perfdata to various upstream metrics
2409 processing and time-series systems. It's currently compatible with Graphite,
2410 Statsd, Librato and InfluxDB. Graphios can emit Nagios metrics to any number
2411 of supported upstream metrics systems simultaneously.")
2412 (license license:gpl2+)))
2413
2414 (define-public ansible
2415 (package
2416 (name "ansible")
2417 (version "2.9.18")
2418 (source
2419 (origin
2420 (method url-fetch)
2421 (uri (pypi-uri "ansible" version))
2422 (sha256
2423 (base32 "0g6rsnh02zq5nizamgakl2wvgz7hk1lpnjn9akldrcpa55vygzjm"))))
2424 (build-system python-build-system)
2425 (native-inputs
2426 `(("python-bcrypt" ,python-bcrypt)
2427 ("python-pynacl" ,python-pynacl)
2428 ("python-httplib2" ,python-httplib2)
2429 ("python-passlib" ,python-passlib)
2430 ("python-nose" ,python-nose)
2431 ("python-mock" ,python-mock)
2432 ("python-jinja2" ,python-jinja2)
2433 ("python-pyyaml" ,python-pyyaml)
2434 ("python-paramiko" ,python-paramiko)))
2435 (inputs
2436 `(("python-cryptography" ,python-cryptography)
2437 ("python-jinja2" ,python-jinja2)
2438 ("python-pyyaml" ,python-pyyaml)
2439 ("python-paramiko" ,python-paramiko)))
2440 (arguments
2441 `(#:phases
2442 (modify-phases %standard-phases
2443 ;; Several ansible commands (ansible-config, ansible-console, etc.)
2444 ;; are just symlinks to a single ansible executable. The ansible
2445 ;; executable behaves differently based on the value of
2446 ;; sys.argv[0]. This does not work well with our wrap phase, and
2447 ;; therefore the following two phases are required as a workaround.
2448 (add-after 'unpack 'hide-wrapping
2449 (lambda _
2450 ;; Overwrite sys.argv[0] to hide the wrapper script from it.
2451 (substitute* "bin/ansible"
2452 (("import traceback" all)
2453 (string-append all "
2454 import re
2455 sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
2456 ")))
2457 #t))
2458 (add-after 'install 'replace-symlinks
2459 (lambda* (#:key outputs #:allow-other-keys)
2460 ;; Replace symlinks with duplicate copies of the ansible
2461 ;; executable.
2462 (let ((out (assoc-ref outputs "out")))
2463 (for-each
2464 (lambda (subprogram)
2465 (delete-file (string-append out "/bin/ansible-" subprogram))
2466 (copy-file (string-append out "/bin/ansible")
2467 (string-append out "/bin/ansible-" subprogram)))
2468 (list "config" "console" "doc" "galaxy"
2469 "inventory" "playbook" "pull" "vault")))
2470 #t)))))
2471 (home-page "https://www.ansible.com/")
2472 (synopsis "Radically simple IT automation")
2473 (description "Ansible is a radically simple IT automation system. It
2474 handles configuration management, application deployment, cloud provisioning,
2475 ad hoc task execution, and multinode orchestration---including trivializing
2476 things like zero-downtime rolling updates with load balancers.")
2477 (license license:gpl3+)))
2478
2479 (define-public debops
2480 (package
2481 (name "debops")
2482 (version "1.1.0")
2483 (source
2484 (origin
2485 (method git-fetch)
2486 (uri (git-reference
2487 (url "https://github.com/debops/debops")
2488 (commit (string-append "v" version))))
2489 (file-name (git-file-name name version))
2490 (sha256
2491 (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5"))
2492 (patches
2493 (search-patches "debops-constants-for-external-program-names.patch"
2494 "debops-debops-defaults-fall-back-to-less.patch"))))
2495 (build-system python-build-system)
2496 (native-inputs
2497 `(("git" ,git)))
2498 (inputs
2499 `(("ansible" ,ansible)
2500 ("encfs" ,encfs)
2501 ("fuse" ,fuse)
2502 ("util-linux" ,util-linux) ;; for umount
2503 ("findutils" ,findutils)
2504 ("gnupg" ,gnupg)
2505 ("which" ,which)))
2506 (propagated-inputs
2507 `(("python-future" ,python-future)
2508 ("python-distro" ,python-distro)))
2509 (arguments
2510 `(#:tests? #f
2511 #:phases
2512 (modify-phases %standard-phases
2513 (add-after 'unpack 'nuke-debops-update
2514 (lambda _
2515 (chmod "bin/debops-update" #o755) ; FIXME work-around git-fetch issue
2516 (with-output-to-file "bin/debops-update"
2517 (lambda ()
2518 (format #t "#!/bin/sh
2519 echo 'debops is installed via guix. guix-update is useless in this case.
2520 Please use `guix package -u debops` instead.'")))
2521 #t))
2522 ;; patch shebangs only in actuall scripts, not in files included in
2523 ;; roles (which are to be delivered to the targte systems)
2524 (delete `patch-generated-file-shebangs)
2525 (replace 'patch-source-shebangs
2526 (lambda _
2527 (for-each patch-shebang
2528 (find-files "bin"
2529 (lambda (file stat)
2530 ;; Filter out symlinks.
2531 (eq? 'regular (stat:type stat)))
2532 #:stat lstat))))
2533 (add-after 'unpack 'fix-paths
2534 (lambda _
2535 (define (substitute-program-names file)
2536 ;; e.g. ANSIBLE_PLAYBOOK = '/gnu/store/…/bin/ansible-playbook'
2537 (for-each
2538 (lambda (name)
2539 (let ((varname (string-upcase
2540 (string-map
2541 (lambda (c) (if (char=? c #\-) #\_ c))
2542 name))))
2543 (substitute* file
2544 (((string-append "^(" varname " = )'.*'") line prefix)
2545 (string-append prefix "'" (which name) "'")))))
2546 '("ansible-playbook" "encfs" "find" "fusermount"
2547 "umount" "gpg" "ansible" "which")))
2548 (for-each substitute-program-names
2549 '("bin/debops"
2550 "bin/debops-padlock"
2551 "bin/debops-task"
2552 "debops/__init__.py"
2553 "debops/cmds/__init__.py"))
2554 #t)))))
2555 (home-page "https://www.debops.org/")
2556 (synopsis "Collection of general-purpose Ansible roles")
2557 (description "The Ansible roles provided by that can be used to manage
2558 Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can
2559 be used to apply the provided roles in a controlled way, using Ansible
2560 inventory groups.
2561
2562 The roles are written with a high customization in mind, which can be done
2563 using Ansible inventory. This way the role and playbook code can be shared
2564 between multiple environments, with different configuration in to each one.
2565
2566 Services can be managed on a single host, or spread between multiple hosts.
2567 DebOps provides support for different SQL and NoSQL databases, web servers,
2568 programming languages and specialized applications useful in a data center
2569 environment or in a cluster. The project can also be used to deploy
2570 virtualization environments using KVM/libvirt, Docker or LXC technologies to
2571 manage virtual machines and/or containers.")
2572 (license license:gpl3+)))
2573
2574 (define-public emacs-ansible-doc
2575 (let ((commit "86083a7bb2ed0468ca64e52076b06441a2f8e9e0"))
2576 (package
2577 (name "emacs-ansible-doc")
2578 (version (git-version "0.4" "1" commit))
2579 (source
2580 (origin
2581 (method git-fetch)
2582 (uri (git-reference
2583 (url "https://github.com/lunaryorn/ansible-doc.el")
2584 (commit commit)))
2585 (file-name (git-file-name name version))
2586 (sha256
2587 (base32
2588 "0lap404ch74w99n3xip176jr42b38xhyzkfnkyqg0g3wk2cd3aq8"))))
2589 (build-system emacs-build-system)
2590 ;; Unmaintained by upstream.
2591 (home-page "https://github.com/lunaryorn/ansible-doc.el")
2592 (synopsis "Ansible documentation for Emacs")
2593 (description
2594 "This package provides an Ansible documentation for GNU Emacs.
2595
2596 @code{ansible-doc} allows you to view the documentation of an Ansible
2597 module and @code{ansible-doc-mode} minor mode adds documentation
2598 lookup to YAML Mode. You could enable the mode with @code{(add-hook
2599 'yaml-mode-hook #'ansible-doc-mode)}.")
2600 (license license:gpl3+))))
2601
2602 (define-public cpulimit
2603 (package
2604 (name "cpulimit")
2605 (version "0.2")
2606 (source
2607 (origin
2608 (method git-fetch)
2609 (uri (git-reference
2610 (url "https://github.com/opsengine/cpulimit")
2611 (commit (string-append "v" version))))
2612 (file-name (git-file-name name version))
2613 (sha256
2614 (base32 "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh"))))
2615 (build-system gnu-build-system)
2616 (arguments
2617 `(#:phases (modify-phases %standard-phases
2618 (delete 'configure)
2619 (replace 'build
2620 (lambda* (#:key make-flags #:allow-other-keys)
2621 (apply invoke "make" "-Csrc" make-flags)))
2622 (replace 'check
2623 (lambda* (#:key tests? make-flags #:allow-other-keys)
2624 (when tests?
2625 (apply invoke "make" "-Ctests" make-flags))
2626 #t))
2627 (replace 'install
2628 (lambda* (#:key outputs #:allow-other-keys)
2629 (let* ((out (assoc-ref outputs "out"))
2630 (bin (string-append out "/bin")))
2631 (install-file "src/cpulimit" bin))
2632 #t)))
2633 #:make-flags (list (string-append "CC=" ,(cc-for-target)))))
2634 (home-page "https://github.com/opsengine/cpulimit")
2635 (synopsis "Limit CPU usage")
2636 (description
2637 "Cpulimit limits the CPU usage of a process. It does not change the nice
2638 value or other scheduling priority settings, but the real CPU usage, and is
2639 able to adapt itself dynamically to the overall system load. Children
2640 processes and threads of the specified process may optionally share the same
2641 limits.")
2642 (license license:gpl2+)))
2643
2644 (define-public autojump
2645 (package
2646 (name "autojump")
2647 (version "22.5.3")
2648 (source
2649 (origin
2650 (method git-fetch)
2651 (uri (git-reference
2652 (url "https://github.com/wting/autojump")
2653 (commit (string-append "release-v" version))))
2654 (file-name (git-file-name name version))
2655 (sha256
2656 (base32 "1rgpsh70manr2dydna9da4x7p8ahii7dgdgwir5fka340n1wrcws"))))
2657 (build-system gnu-build-system)
2658 (native-inputs ; for tests
2659 `(("python-mock" ,python-mock)
2660 ("python-pytest" ,python-pytest)))
2661 (inputs
2662 `(("python" ,python-wrapper)))
2663 (arguments
2664 `(#:phases
2665 (modify-phases %standard-phases
2666 (add-after 'unpack 'make-git-checkout-writable
2667 ;; ‘install.py’ modifies files before installing them.
2668 (lambda _
2669 (for-each make-file-writable (find-files "."))
2670 #t))
2671 (delete 'configure)
2672 (delete 'build)
2673 (replace 'check
2674 (lambda _
2675 (invoke "python" "tests/unit/autojump_utils_test.py")))
2676 (replace 'install
2677 (lambda* (#:key outputs #:allow-other-keys)
2678 (setenv "SHELL" (which "bash"))
2679 (invoke "python" "install.py"
2680 (string-append "--destdir="
2681 (assoc-ref outputs "out"))))))))
2682 (home-page "https://github.com/wting/autojump")
2683 (synopsis "Shell extension for file system navigation")
2684 (description
2685 "Autojump provides a faster way to navigate your file system, with a \"cd
2686 command that learns\". It works by maintaining a database of the directories
2687 you use the most from the command line and allows you to \"jump\" to
2688 frequently used directories by typing only a small pattern.")
2689 (license license:gpl3+)))
2690
2691 (define-public fasd
2692 (package
2693 (name "fasd")
2694 (version "1.0.1")
2695 (source (origin
2696 (method git-fetch)
2697 (uri (git-reference
2698 (url "https://github.com/clvv/fasd")
2699 (commit version)))
2700 (file-name (git-file-name name version))
2701 (sha256
2702 (base32
2703 "1awi71jdv3mhjrmar2d4z1i90kn7apd7aq1w31sh6w4yibz9kiyj"))))
2704 (build-system gnu-build-system)
2705 (arguments
2706 `(#:phases (modify-phases %standard-phases
2707 (delete 'configure)) ;no configuration
2708 #:tests? #f ;no tests
2709 #:make-flags (list (string-append "PREFIX=" %output))))
2710 (home-page "https://github.com/clvv/fasd")
2711 (synopsis "Quick access to files and directories for shells")
2712 (description
2713 "Fasd (pronounced similar to \"fast\") is a command-line productivity
2714 booster. Fasd offers quick access to files and directories for POSIX shells.
2715 It is inspired by tools like autojump, z, and v. Fasd keeps track of files
2716 and directories you have accessed so that you can quickly reference them in
2717 the command line.")
2718 (license license:x11)))
2719
2720 (define-public iftop
2721 (package
2722 (name "iftop")
2723 (version "1.0pre4")
2724 (source (origin
2725 (method url-fetch)
2726 (uri (string-append "http://www.ex-parrot.com/~pdw/iftop/download"
2727 "/iftop-" version ".tar.gz"))
2728 (sha256
2729 (base32
2730 "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp"))))
2731 (build-system gnu-build-system)
2732 (inputs
2733 `(("libpcap" ,libpcap)
2734 ("ncurses" ,ncurses)))
2735 (synopsis "Monitor network usage")
2736 (description "Iftop does for network usage what @command{top} does
2737 for CPU usage. It listens to network traffic on a named interface and
2738 displays a table of current bandwidth usage by pairs of hosts.")
2739 (home-page "http://www.ex-parrot.com/~pdw/iftop/")
2740 (license license:gpl2+)))
2741
2742 (define-public munge
2743 (package
2744 (name "munge")
2745 (version "0.5.14")
2746 (source (origin
2747 (method url-fetch)
2748 (uri (string-append "https://github.com/dun/munge/releases/"
2749 "download/munge-" version "/munge-"
2750 version ".tar.xz"))
2751 (sha256
2752 (base32
2753 "0h06sghb4rqvv1ywyd6mzsmbcgh712v6ygrff0gzm440y4ca41k6"))
2754 (modules '((guix build utils)))
2755 (snippet
2756 '(begin
2757 ;; Don't insist on write access to /var.
2758 (substitute* "src/etc/Makefile.in"
2759 (("\\$\\(INSTALL\\)(.*)localstatedir" _ middle)
2760 (string-append "-$(INSTALL)" middle "localstatedir"))
2761 (("\\$\\(MKDIR_P\\) .*(local|run)statedir.*")
2762 ""))
2763 #t))))
2764 (inputs
2765 `(("openssl" ,openssl)
2766 ("libgcrypt" ,libgcrypt)))
2767 (build-system gnu-build-system)
2768 (arguments
2769 '(#:configure-flags
2770 (list "--localstatedir=/var"
2771 (string-append "--with-pkgconfigdir="
2772 (assoc-ref %outputs "out") "/lib/pkgconfig"))
2773 #:phases
2774 (modify-phases %standard-phases
2775 ;; XXX Many test series fail. Some might be fixable, others do no-no
2776 ;; things like invoking ‘sudo’.
2777 (add-after 'unpack 'skip-failing-tests
2778 (lambda _
2779 (for-each (lambda (test)
2780 (substitute* "t/Makefile.in"
2781 (((string-append test "\\.t ")) "")))
2782 (list "0100-munged-lock"
2783 "0010-basic"
2784 "0011-munged-cmdline"
2785 "0012-munge-cmdline"
2786 "0013-unmunge-cmdline"
2787 "0101-munged-security-socket"
2788 "0102-munged-security-keyfile"
2789 "0103-munged-security-logfile"
2790 "0110-munged-origin-addr"))
2791 #t)))))
2792 (home-page "https://dun.github.io/munge/")
2793 (synopsis "Cluster computing authentication service")
2794 (description
2795 "Munge is an authentication service for creating and validating
2796 credentials. It allows a process to authenticate the UID and GID of another
2797 local or remote process within a group of hosts having common users and
2798 groups. These hosts form a security realm that is defined by a shared
2799 cryptographic key. Clients within this security realm can create and validate
2800 credentials without the use of root privileges, reserved ports, or
2801 platform-specific methods.")
2802 (license license:gpl3+)))
2803
2804 (define-public audit
2805 (package
2806 (name "audit")
2807 (home-page "https://people.redhat.com/sgrubb/audit/")
2808 (version "2.8.5")
2809 (source (origin
2810 (method url-fetch)
2811 (uri (string-append home-page "audit-" version ".tar.gz"))
2812 (sha256
2813 (base32
2814 "1dzcwb2q78q7x41shcachn7f4aksxbxd470yk38zh03fch1l2p8f"))))
2815 (build-system gnu-build-system)
2816 (arguments
2817 `(#:configure-flags (list "--with-python=no"
2818 "--disable-static")))
2819 (inputs
2820 `(("openldap" ,openldap)
2821 ("gnutls" ,gnutls)
2822 ("sasl" ,cyrus-sasl)))
2823 (synopsis "User-space component to the Linux auditing system")
2824 (description
2825 "auditd is the user-space component to the Linux auditing system, which
2826 allows logging of system calls made by user-land processes. It's responsible
2827 for writing audit records to the disk. Viewing the logs is done with the
2828 @code{ausearch} or @code{aureport} utilities. Configuring the audit rules is
2829 done with the @code{auditctl} utility.")
2830 (license license:gpl2+)))
2831
2832 (define-public nmap
2833 (package
2834 (name "nmap")
2835 (version "7.80")
2836 (source (origin
2837 (method url-fetch)
2838 (uri (string-append "https://nmap.org/dist/nmap-" version
2839 ".tar.bz2"))
2840 (sha256
2841 (base32
2842 "1aizfys6l9f9grm82bk878w56mg0zpkfns3spzj157h98875mypw"))
2843 (modules '((guix build utils)))
2844 (snippet
2845 '(begin
2846 (for-each delete-file-recursively
2847 ;; Remove bundled lua, pcap, and pcre libraries.
2848 ;; FIXME: Remove bundled liblinear once packaged.
2849 '("liblua"
2850 "libpcap"
2851 "libpcre"
2852 ;; Remove pre-compiled binares.
2853 "mswin32"))
2854 #t))))
2855 (build-system gnu-build-system)
2856 (inputs
2857 `(("openssl" ,openssl)
2858 ("libpcap" ,libpcap)
2859 ("pcre" ,pcre)
2860 ("lua" ,lua)
2861 ("zlib" ,zlib) ;for NSE compression support
2862
2863 ;; For 'ndiff'.
2864 ("python" ,python-2)))
2865
2866 ;; TODO Add zenmap output.
2867 (outputs '("out" "ndiff"))
2868 (arguments
2869 `(#:configure-flags '("--without-zenmap")
2870 #:phases
2871 (modify-phases %standard-phases
2872 (add-after 'configure 'patch-Makefile
2873 (lambda _
2874 (substitute* "Makefile"
2875 ;; Do not attempt to build lua.
2876 (("build-dnet build-lua") "build-dnet"))
2877 #t))
2878 (replace 'install
2879 (lambda* (#:key outputs #:allow-other-keys)
2880 (define (make out . args)
2881 (apply invoke "make"
2882 (string-append "prefix=" out)
2883 args))
2884 (define (python-path dir)
2885 (string-append dir "/lib/python"
2886 ,(version-major+minor
2887 (package-version python))
2888 "/site-packages"))
2889 (let ((out (assoc-ref outputs "out"))
2890 (ndiff (assoc-ref outputs "ndiff")))
2891 (for-each mkdir-p (list out ndiff))
2892 (make out
2893 "install-nmap"
2894 "install-nse"
2895 "install-ncat"
2896 "install-nping")
2897 (make ndiff "install-ndiff")
2898 (wrap-program (string-append ndiff "/bin/ndiff")
2899 `("PYTHONPATH" prefix
2900 (,(python-path ndiff)))))
2901 #t))
2902 ;; These are the tests that do not require network access.
2903 (replace 'check
2904 (lambda _ (invoke "make"
2905 "check-nse"
2906 "check-ndiff"
2907 "check-dns"))))
2908 ;; Nmap can't cope with out-of-source building.
2909 #:out-of-source? #f))
2910 (home-page "https://nmap.org/")
2911 (synopsis "Network discovery and security auditing tool")
2912 (description
2913 "Nmap (\"Network Mapper\") is a network discovery and security auditing
2914 tool. It is also useful for tasks such as network inventory, managing service
2915 upgrade schedules, and monitoring host or service uptime. It also provides an
2916 advanced netcat implementation (ncat), a utility for comparing scan
2917 results (ndiff), and a packet generation and response analysis tool (nping).")
2918 ;; This package uses nmap's bundled versions of libdnet and liblinear, which
2919 ;; both use a 3-clause BSD license.
2920 (license (list license:nmap license:bsd-3))))
2921
2922 (define-public dstat
2923 (package
2924 (name "dstat")
2925 (version "0.7.4")
2926 (source
2927 (origin
2928 (method git-fetch)
2929 (uri (git-reference
2930 (url "https://github.com/dstat-real/dstat")
2931 (commit (string-append "v" version))))
2932 (file-name (git-file-name "dstat" version))
2933 (sha256
2934 (base32 "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v"))
2935 (patches (search-patches "dstat-fix-crash-when-specifying-delay.patch"
2936 "dstat-skip-devices-without-io.patch"))))
2937 (build-system gnu-build-system)
2938 (arguments
2939 `(#:tests? #f ; no make check
2940 #:make-flags
2941 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2942 #:phases
2943 (modify-phases %standard-phases
2944 (add-after 'unpack 'fix-python3-DeprecationWarning
2945 (lambda _
2946 (substitute* "dstat"
2947 (("collections") "collections.abc"))
2948 #t))
2949 (delete 'configure) ; no configure script
2950 (add-after 'install 'wrap
2951 (lambda* (#:key outputs #:allow-other-keys)
2952 (let ((out (assoc-ref outputs "out")))
2953 (wrap-program (string-append out "/bin/dstat")
2954 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
2955 #t))))))
2956 (inputs
2957 `(("python" ,python-wrapper)
2958 ("python-six" ,python-six)))
2959 (synopsis "Versatile resource statistics tool")
2960 (description "Dstat is a versatile replacement for @command{vmstat},
2961 @command{iostat}, @command{netstat}, and @command{ifstat}. Dstat overcomes
2962 some of their limitations and adds some extra features, more counters and
2963 flexibility. Dstat is handy for monitoring systems during performance tuning
2964 tests, benchmarks or troubleshooting.
2965
2966 Dstat allows you to view all of your system resources in real-time, you can,
2967 e.g., compare disk utilization in combination with interrupts from your IDE
2968 controller, or compare the network bandwidth numbers directly with the disk
2969 throughput (in the same interval).")
2970 (home-page "http://dag.wiee.rs/home-made/dstat/")
2971 (license license:gpl2+)))
2972
2973 (define-public thefuck
2974 (package
2975 (name "thefuck")
2976 (version "3.30")
2977 (source
2978 (origin
2979 (method git-fetch)
2980 (uri (git-reference
2981 (url "https://github.com/nvbn/thefuck")
2982 (commit version)))
2983 (file-name (git-file-name name version))
2984 (sha256
2985 (base32 "0fnf78956pwhb9cgv1jmgypnkma5xzflkivfrkfiadbgin848yfg"))
2986 (patches (search-patches "thefuck-test-environ.patch"))))
2987 (build-system python-build-system)
2988 (arguments
2989 '(#:phases
2990 (modify-phases %standard-phases
2991 (delete 'check)
2992 (add-after 'install 'check
2993 (lambda* (#:key inputs outputs #:allow-other-keys)
2994 ;; Tests look for installed package
2995 (add-installed-pythonpath inputs outputs)
2996 ;; Some tests need write access to $HOME.
2997 (setenv "HOME" "/tmp")
2998 (invoke "py.test" "-v")
2999 #t)))))
3000 (propagated-inputs
3001 `(("python-colorama" ,python-colorama)
3002 ("python-decorator" ,python-decorator)
3003 ("python-psutil" ,python-psutil)
3004 ("python-pyte" ,python-pyte)
3005 ("python-six" ,python-six)))
3006 (native-inputs
3007 `(("go" ,go)
3008 ("python-mock" ,python-mock)
3009 ("python-pytest" ,python-pytest)
3010 ("python-pytest-mock" ,python-pytest-mock)))
3011 (home-page "https://github.com/nvbn/thefuck")
3012 (synopsis "Correct mistyped console command")
3013 (description
3014 "The Fuck tries to match a rule for a previous, mistyped command, creates
3015 a new command using the matched rule, and runs it.")
3016 (license license:x11)))
3017
3018 (define-public di
3019 (package
3020 (name "di")
3021 (version "4.50")
3022 (source
3023 (origin
3024 (method url-fetch)
3025 (uri (string-append "mirror://sourceforge/diskinfo-di/di-" version ".tar.gz"))
3026 (sha256
3027 (base32 "0aj9ldkvmj8fmrk685vd2gagz0q8lwsn2nfbx6r6mza94mn8pw42"))))
3028 (build-system gnu-build-system)
3029 (arguments
3030 `(#:tests? #f ; obscure test failures
3031 #:phases
3032 (modify-phases %standard-phases
3033 (delete 'configure) ; no configure script
3034 (add-before 'build 'setup-environment
3035 (lambda* (#:key outputs #:allow-other-keys)
3036 (setenv "CC" ,(cc-for-target))
3037 (setenv "prefix" (assoc-ref outputs "out"))
3038 #t)))
3039 #:make-flags (list "--environment-overrides")))
3040 (home-page "https://gentoo.com/di/")
3041 (synopsis "Advanced df like disk information utility")
3042 (description
3043 "@code{di} is a disk information utility, displaying everything that your
3044 @code{df} command does and more. It features the ability to display your disk
3045 usage in whatever format you prefer. It is designed to be highly portable and
3046 produce uniform output across heterogeneous networks.")
3047 (license license:zlib)))
3048
3049 (define-public cbatticon
3050 (package
3051 (name "cbatticon")
3052 (version "1.6.10")
3053 (source
3054 (origin
3055 (method git-fetch)
3056 (uri (git-reference
3057 (url "https://github.com/valr/cbatticon")
3058 (commit version)))
3059 (sha256
3060 (base32 "0ivm2dzhsa9ir25ry418r2qg2llby9j7a6m3arbvq5c3kaj8m9jr"))
3061 (file-name (git-file-name name version))))
3062 (build-system gnu-build-system)
3063 (arguments
3064 `(#:tests? #f ; no tests
3065 #:make-flags
3066 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3067 ,(string-append "CC=" (cc-for-target)))
3068 #:phases
3069 (modify-phases %standard-phases
3070 (delete 'configure)))) ; no configure script
3071 (inputs
3072 `(("gtk+" ,gtk+)
3073 ("gettext" ,gettext-minimal)
3074 ("libnotify" ,libnotify)))
3075 (native-inputs
3076 `(("pkg-config" ,pkg-config)))
3077 (synopsis "Lightweight battery icon for the system tray")
3078 (description "cbatticon is a lightweight battery icon that displays
3079 the status of your battery in the system tray.")
3080 (home-page "https://github.com/valr/cbatticon")
3081 (license license:gpl2+)))
3082
3083 (define-public interrobang
3084 (let ((revision "1")
3085 (commit "896543735e1c99144765fdbd7b6e6b5afbd8b881"))
3086 (package
3087 (name "interrobang")
3088 (version (git-version "0.0.0" revision commit))
3089 (source
3090 (origin
3091 (method git-fetch)
3092 (uri (git-reference
3093 (url "https://github.com/TrilbyWhite/interrobang")
3094 (commit commit)))
3095 (file-name (git-file-name name version))
3096 (sha256
3097 (base32 "1n13m70p1hfba5dy3i8hfclbr6k9q3d9dai3dg4jvhdhmxcpjzdf"))))
3098 (build-system gnu-build-system)
3099 (arguments
3100 `(#:tests? #f ; no tests
3101 #:phases
3102 (modify-phases %standard-phases
3103 (delete 'configure)) ; no configure script
3104 #:make-flags (list (string-append "PREFIX="
3105 (assoc-ref %outputs "out")))))
3106 (inputs
3107 `(("libx11" ,libx11)))
3108 (native-inputs
3109 `(("pkg-config" ,pkg-config)))
3110 (synopsis "Scriptable launcher menu")
3111 (description "Interrobang is a scriptable launcher menu with a customizable
3112 shortcut syntax and completion options.")
3113 (home-page "https://github.com/TrilbyWhite/interrobang")
3114 (license license:gpl3+))))
3115
3116 (define-public pam-krb5
3117 (package
3118 (name "pam-krb5")
3119 (version "4.8")
3120 (source (origin
3121 (method url-fetch)
3122 (uri
3123 (list (string-append
3124 "https://archives.eyrie.org/software/kerberos/"
3125 "pam-krb5-" version ".tar.xz")
3126 (string-append
3127 "https://archives.eyrie.org/software/ARCHIVE/"
3128 "pam-krb5/pam-krb5-" version ".tar.xz")))
3129 (patches (search-patches "pam-krb5-CVE-2020-10595.patch"))
3130 (sha256
3131 (base32
3132 "1qjp8i1s9bz7g6kiqrkzzkxn5pfspa4sy53b6z40fqmdf9przdfb"))))
3133 (build-system gnu-build-system)
3134 (arguments
3135 `(#:phases
3136 (modify-phases %standard-phases
3137 (add-before 'configure 'disable-tests
3138 (lambda _
3139 ;; The build container seems to interfere with some tests.
3140 (substitute* "tests/TESTS"
3141 (("module/basic\n") ""))
3142 (substitute* "tests/TESTS"
3143 (("pam-util/vector\n") ""))
3144 #t)))))
3145 (inputs
3146 `(("linux-pam" ,linux-pam)
3147 ("mit-krb5" ,mit-krb5)))
3148 (native-inputs
3149 `(("perl" ,perl)
3150 ("perl-test-pod" ,perl-test-pod))) ; required for tests
3151 (synopsis "Kerberos PAM module")
3152 (description
3153 "Pam-krb5 is a Kerberos PAM module for either MIT Kerberos or Heimdal.
3154 It supports ticket refreshing by screen savers, configurable
3155 authorization handling, authentication of non-local accounts for network
3156 services, password changing, and password expiration, as well as all the
3157 standard expected PAM features. It works correctly with OpenSSH, even
3158 with @code{ChallengeResponseAuthentication} and @code{PrivilegeSeparation}
3159 enabled, and supports extensive configuration either by PAM options or in
3160 krb5.conf or both. PKINIT is supported with recent versions of both MIT
3161 Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
3162 (home-page "https://www.eyrie.org/~eagle/software/pam-krb5/")
3163 ;; Dual licenced under a homebrew non-copyleft OR GPL (any version)
3164 ;; However, the tarball does not contain a copy of the GPL, so unless
3165 ;; we put one in, we cannot distribute it under GPL without violating
3166 ;; clause requiring us to give all recipients a copy.
3167 (license license:gpl1+)))
3168
3169 (define (sunxi-tools-source version)
3170 (origin
3171 (method git-fetch)
3172 (uri (git-reference
3173 (url "https://github.com/linux-sunxi/sunxi-tools")
3174 (commit (string-append "v" version))))
3175 (sha256
3176 (base32 "04f3jqg8ww4jxsf9c6ddcdgy2xbhkyp0b3l5f1hvvbv94p81rjxd"))
3177 (patches
3178 (search-patches "sunxi-tools-remove-sys-io.patch"))
3179 (modules '((guix build utils)))
3180 (snippet
3181 ;; Remove binaries contained in the tarball which are only for the
3182 ;; target and can be regenerated anyway.
3183 '(begin
3184 (delete-file-recursively "bin")
3185 #t))
3186 (file-name (git-file-name "sunxi-tools" version))))
3187
3188 (define sunxi-target-tools
3189 (package
3190 (name "sunxi-target-tools")
3191 (version "1.4.2")
3192 (build-system gnu-build-system)
3193 (source
3194 (sunxi-tools-source version))
3195 (arguments
3196 `(#:system "armhf-linux"
3197 #:tests? #f
3198 #:make-flags (list (string-append "PREFIX="
3199 (assoc-ref %outputs "out"))
3200 (string-append "CROSS_COMPILE=")
3201 "CC=gcc")
3202 #:phases
3203 (modify-phases %standard-phases
3204 (delete 'configure)
3205 (replace 'build
3206 (lambda* (#:key make-flags #:allow-other-keys)
3207 (apply invoke "make" "target-tools" make-flags)))
3208 (replace 'install
3209 (lambda* (#:key make-flags #:allow-other-keys)
3210 (apply invoke "make" "install-target-tools"
3211 make-flags))))))
3212 (home-page "https://github.com/linux-sunxi/sunxi-tools")
3213 (synopsis "Hardware management tools for Allwinner computers")
3214 (description "This package contains tools for Allwinner devices:
3215 @enumerate
3216 @item @command{sunxi-meminfo}: Prints memory bus settings.
3217 @end enumerate")
3218 (license license:gpl2+)))
3219
3220 (define-public sunxi-tools
3221 (package
3222 (name "sunxi-tools")
3223 (version "1.4.2")
3224 (source
3225 (sunxi-tools-source version))
3226 (native-inputs
3227 `(("sunxi-target-tools" ,sunxi-target-tools)
3228 ("pkg-config" ,pkg-config)))
3229 (inputs
3230 `(("libusb" ,libusb)))
3231 (build-system gnu-build-system)
3232 (arguments
3233 `(#:tests? #f ; no tests exist
3234 #:make-flags (list (string-append "PREFIX="
3235 (assoc-ref %outputs "out"))
3236 (string-append "CROSS_COMPILE=disabled")
3237 "CC=gcc")
3238 #:phases
3239 (modify-phases %standard-phases
3240 (delete 'configure)
3241 (replace 'build
3242 (lambda* (#:key make-flags #:allow-other-keys)
3243 (apply invoke "make" "tools" "misc" make-flags)))
3244 (replace 'install
3245 (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
3246 ;; Those tools have been built for armhf but are part of the
3247 ;; installation in the upstream package. So do the same
3248 ;; here.
3249 (copy-recursively (assoc-ref inputs "sunxi-target-tools")
3250 (assoc-ref outputs "out"))
3251 (apply invoke "make" "install-tools" "install-misc"
3252 make-flags))))))
3253 (home-page "https://github.com/linux-sunxi/sunxi-tools")
3254 (synopsis "Hardware management tools for Allwinner computers")
3255 (description "This package contains tools for Allwinner devices:
3256 @enumerate
3257 @item @command{sunxi-fexc}, @command{bin2fex}, @command{fex2bin}: Compile
3258 a textual description of a board (.fex) to a binary representation (.bin).
3259 @item @command{sunxi-fel}: Puts an Allwinner device into FEL mode which
3260 makes it register as a special USB device (rather than USB host).
3261 You can then connect it to another computer and flash it from there.
3262 @item @command{sunxi-nand-part}: Partitions NAND flash.
3263 @item @command{sunxi-bootinfo}: Reads out boot0 and boot1 (Allwinner
3264 bootloader) parameters.
3265 @item @command{sunxi-pio}: Sets GPIO parameters and oscillates a GPIO
3266 in order to be able to find it.
3267 @item @command{sunxi-meminfo}: Prints memory bus settings.
3268 @item @command{sunxi-nand-image-builder}: Prepares raw NAND images.
3269 @end enumerate")
3270 (license license:gpl2+)))
3271
3272 (define-public sedsed
3273 (package
3274 (name "sedsed")
3275 (version "1.1")
3276 (source
3277 (origin
3278 (method git-fetch)
3279 (uri (git-reference
3280 (url "https://github.com/aureliojargas/sedsed")
3281 (commit (string-append "v" version))))
3282 (file-name (git-file-name name version))
3283 (sha256
3284 (base32 "05cl35mwljdb9ynbbsfa8zx6ig8r0xncbg2cir9vwn5manndjj18"))))
3285 (build-system python-build-system)
3286 (arguments
3287 `(#:tests? #f ; no tests
3288 #:phases
3289 (modify-phases %standard-phases
3290 (add-after 'unpack 'patch-sed-in
3291 (lambda _
3292 (substitute* "sedsed.py"
3293 (("sedbin = 'sed'")
3294 (string-append "sedbin = '" (which "sed") "'")))
3295 #t))
3296 (delete 'build)
3297 (replace 'install
3298 (lambda* (#:key outputs #:allow-other-keys)
3299 (let* ((out (assoc-ref outputs "out"))
3300 (bin (string-append out "/bin")))
3301 ;; Just one file to copy around
3302 (install-file "sedsed.py" bin)
3303 #t)))
3304 (add-after 'wrap 'symlink
3305 ;; Create 'sedsed' symlink to "sedsed.py".
3306 (lambda* (#:key outputs #:allow-other-keys)
3307 (let* ((out (assoc-ref outputs "out"))
3308 (bin (string-append out "/bin"))
3309 (sed (string-append bin "/sedsed"))
3310 (sedpy (string-append bin "/sedsed.py")))
3311 (symlink sedpy sed)
3312 #t))))))
3313 (home-page "https://aurelio.net/projects/sedsed")
3314 (synopsis "Sed sed scripts")
3315 (description
3316 "@code{sedsed} can debug, indent, tokenize and HTMLize your @command{sed}
3317 script.
3318
3319 In debug mode, it reads your script and adds extra commands to it. When
3320 executed you can see the data flow between the commands, revealing all the
3321 magic sed performs on its internal buffers.
3322
3323 In indent mode, your script is reformatted with standard spacing.
3324
3325 In tokenize mode, you can see the elements of every command you use.
3326
3327 In HTMLize mode, your script is converted to a beautiful colored HTML file,
3328 with all the commands and parameters identified for your viewing pleasure.
3329
3330 With sedsed you can master any sed script. No more secrets, no more hidden
3331 buffers.")
3332 (license license:expat)))
3333
3334 (define-public igt-gpu-tools
3335 (package
3336 (name "igt-gpu-tools")
3337 (version "1.25")
3338 (source
3339 (origin
3340 (method git-fetch)
3341 (uri (git-reference
3342 (url "https://gitlab.freedesktop.org/drm/igt-gpu-tools.git")
3343 (commit (string-append "igt-gpu-tools-" version))))
3344 (file-name (git-file-name name version))
3345 (sha256
3346 (base32 "1lvhkdhilw0fn4nzkpfwvrhiv8d92h811qs2v6ac3p5w7v86a9zm"))))
3347 (build-system meson-build-system)
3348 (arguments
3349 `(#:tests? #f)) ; many of the tests try to load kernel modules
3350 (inputs
3351 `(("cairo" ,cairo)
3352 ("elfutils" ,elfutils) ; libdw
3353 ("eudev" ,eudev)
3354 ("kmod" ,kmod)
3355 ("libdrm" ,libdrm)
3356 ("libpciaccess" ,libpciaccess)
3357 ("libunwind" ,libunwind)
3358 ("procps" ,procps)))
3359 (native-inputs
3360 `(("bison" ,bison)
3361 ("flex" ,flex)
3362 ("pkg-config" ,pkg-config)))
3363 (home-page "https://gitlab.freedesktop.org/drm/igt-gpu-tools")
3364 (synopsis "Tools for development and testing of the Intel DRM driver")
3365 (description "IGT GPU Tools is a collection of tools for development and
3366 testing of the Intel DRM driver. There are many macro-level test suites that
3367 get used against the driver, including xtest, rendercheck, piglit, and
3368 oglconform, but failures from those can be difficult to track down to kernel
3369 changes, and many require complicated build procedures or specific testing
3370 environments to get useful results. Therefore, IGT GPU Tools includes
3371 low-level tools and tests specifically for development and testing of the
3372 Intel DRM Driver.")
3373 (supported-systems '("i686-linux" "x86_64-linux"))
3374 (license license:expat)))
3375
3376 (define-public fabric
3377 (package
3378 (name "fabric")
3379 (version "1.14.1")
3380 (source
3381 (origin
3382 (method url-fetch)
3383 (uri (pypi-uri "Fabric" version))
3384 (sha256
3385 (base32
3386 "1a3ndlpdw6bhn8fcw1jgznl117a8pnr84az9rb5fwnrypf1ph2b6"))))
3387 (build-system python-build-system)
3388 (arguments
3389 `(#:python ,python-2 ; Python 2 only
3390 #:phases
3391 (modify-phases %standard-phases
3392 (replace 'check
3393 (lambda _
3394 (invoke
3395 "nosetests" "-v" "tests/"
3396 ;; This test hangs indefinitely when run on a single core VM
3397 ;; (see GNU bug #26647 and Debian bug #850230).
3398 "--exclude=test_nested_execution_with_explicit_ports"
3399 ;; This test randomly fails in certain environments causing too
3400 ;; much noise to be useful (see Debian bug #854686).
3401 "--exclude=test_should_use_sentinel_for_tasks_that_errored"))))))
3402 (native-inputs
3403 `(("python2-fudge" ,python2-fudge) ; Requires < 1.0
3404 ("python2-jinja2" ,python2-jinja2) ; Requires < 3.0
3405 ("python2-nose" ,python2-nose) ; Requires < 2.0
3406 ("python2-pynacl" ,python2-pynacl)
3407 ("python2-bcrypt" ,python2-bcrypt)))
3408 (propagated-inputs
3409 `(("python2-paramiko" ,python2-paramiko)))
3410 (home-page "https://www.fabfile.org/")
3411 (synopsis "Simple Pythonic remote execution and deployment tool")
3412 (description
3413 "Fabric is designed to upload files and run shell commands on a number of
3414 servers in parallel or serially. These commands are grouped in tasks (which
3415 are regular Python functions) and specified in a @dfn{fabfile}.
3416
3417 It is similar to Capistrano, except it's implemented in Python and doesn't
3418 expect you to be deploying Rails applications. Fabric is a simple, Pythonic
3419 tool for remote execution and deployment.")
3420 (license license:bsd-2)))
3421
3422 (define-public neofetch
3423 (package
3424 (name "neofetch")
3425 (version "7.1.0")
3426 (source (origin
3427 (method git-fetch)
3428 (uri (git-reference
3429 (url "https://github.com/dylanaraps/neofetch")
3430 (commit version)))
3431 (file-name (git-file-name name version))
3432 (sha256
3433 (base32
3434 "0i7wpisipwzk0j62pzaigbiq42y1mn4sbraz4my2jlz6ahwf00kv"))))
3435 (build-system gnu-build-system)
3436 (arguments
3437 `(#:tests? #f ; there are no tests
3438 #:make-flags
3439 (list (string-append "PREFIX=" %output))
3440 #:phases
3441 (modify-phases %standard-phases
3442 (delete 'configure)))) ; no configure script
3443 (home-page "https://github.com/dylanaraps/neofetch")
3444 (synopsis "System information script")
3445 (description "Neofetch is a command-line system information tool written in
3446 Bash. Neofetch displays information about your system next to an image, your OS
3447 logo, or any ASCII file of your choice. The main purpose of Neofetch is to be
3448 used in screenshots to show other users what operating system or distribution
3449 you are running, what theme or icon set you are using, etc.")
3450 (license license:expat)))
3451
3452 (define-public screenfetch
3453 (package
3454 (name "screenfetch")
3455 (version "3.9.1")
3456 (source (origin
3457 (method git-fetch)
3458 (uri (git-reference
3459 (url "https://github.com/KittyKatt/screenFetch")
3460 (commit (string-append "v" version))))
3461 (file-name (git-file-name name version))
3462 (sha256
3463 (base32
3464 "04l8aqr474pb115nagn9f6y48jw92n1qfszgw7dbhgl4mpn95lcr"))))
3465 (build-system trivial-build-system)
3466 (arguments
3467 `(#:modules ((guix build utils))
3468 #:builder
3469 (begin
3470 (use-modules (guix build utils))
3471 (let ((source (assoc-ref %build-inputs "source"))
3472 (out (assoc-ref %outputs "out")))
3473 (mkdir-p (string-append out "/bin/"))
3474 (copy-file (string-append source "/screenfetch-dev")
3475 (string-append out "/bin/screenfetch"))
3476 (install-file (string-append source "/screenfetch.1")
3477 (string-append out "/man/man1/"))
3478 (install-file (string-append source "/COPYING")
3479 (string-append out "/share/doc/" ,name "-" ,version))
3480 (substitute* (string-append out "/bin/screenfetch")
3481 (("/usr/bin/env bash")
3482 (string-append (assoc-ref %build-inputs "bash")
3483 "/bin/bash")))
3484 (wrap-program
3485 (string-append out "/bin/screenfetch")
3486 `("PATH" ":" prefix
3487 (,(string-append (assoc-ref %build-inputs "bc") "/bin:"
3488 (assoc-ref %build-inputs "scrot") "/bin:"
3489 (assoc-ref %build-inputs "xdpyinfo") "/bin"
3490 (assoc-ref %build-inputs "xprop") "/bin"))))
3491 (substitute* (string-append out "/bin/screenfetch")
3492 (("#!#f")
3493 (string-append "#!" (assoc-ref %build-inputs "bash")
3494 "/bin/bash")))))))
3495 (inputs
3496 `(("bash" ,bash)
3497 ("bc" ,bc)
3498 ("scrot" ,scrot)
3499 ("xdpyinfo" ,xdpyinfo)
3500 ("xprop" ,xprop)))
3501 (home-page "https://github.com/KittyKatt/screenFetch")
3502 (synopsis "System information script")
3503 (description "Bash screenshot information tool which can be used to
3504 generate those nifty terminal theme information and ASCII distribution logos in
3505 everyone's screenshots nowadays.")
3506 (license license:gpl3)))
3507
3508 (define-public ufetch
3509 (let ((commit "98b622023e03fe24dbc137e9a68104dfe1fbd04a")
3510 (revision "1"))
3511 (package
3512 (name "ufetch")
3513 (version (git-version "0.2" revision commit))
3514 (source (origin
3515 (method git-fetch)
3516 (uri (git-reference
3517 (url "https://gitlab.com/jschx/ufetch.git")
3518 (commit commit)))
3519 (file-name (git-file-name name version))
3520 (sha256
3521 (base32
3522 "09c4zmikza16xpydinnqbi3hmcibfrrn10wij7j0j1wv1pj2sl2l"))))
3523 (build-system trivial-build-system)
3524 (inputs
3525 `(("bash" ,bash)
3526 ("tput" ,ncurses)))
3527 (arguments
3528 `(#:modules ((guix build utils))
3529 #:builder
3530 (begin
3531 (use-modules (guix build utils))
3532 (let* ((source (assoc-ref %build-inputs "source"))
3533 (output (assoc-ref %outputs "out"))
3534 (bindir (string-append output "/bin"))
3535 (docdir (string-append output "/share/doc/ufetch-" ,version))
3536 (tput (string-append (assoc-ref %build-inputs "tput") "/bin/tput")))
3537 (install-file (string-append source "/LICENSE") docdir)
3538 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
3539 (mkdir-p bindir)
3540 (for-each (lambda (src)
3541 (let ((dst (string-append bindir "/" (basename src))))
3542 (copy-file src dst)
3543 (patch-shebang dst)
3544 (substitute* dst (("tput") tput))))
3545 (find-files source "ufetch-[[:alpha:]]*$"))
3546 ;; Note: the `ufetch` we create below will only work if run under
3547 ;; the Guix System. I.e. a user trying to run `ufetch` on a
3548 ;; foreign distro will not get great results. The `screenfetch`
3549 ;; program does actual runtime detection of the operating system,
3550 ;; and would be a better choice in such a situation.
3551 (symlink "ufetch-guix" (string-append bindir "/ufetch"))))))
3552 (home-page "https://gitlab.com/jschx/ufetch")
3553 (synopsis "Tiny system info")
3554 (description "This package provides a tiny system info utility.")
3555 (license license:isc))))
3556
3557 (define-public pfetch
3558 (let ((commit "e18a0959ab98b963744755ec4687e59dc11db3c5")
3559 (revision "0"))
3560 (package
3561 (name "pfetch")
3562 (version (git-version "0.7.0" revision commit))
3563 (source (origin
3564 (method git-fetch)
3565 (uri (git-reference
3566 (url "https://github.com/dylanaraps/pfetch")
3567 (commit commit)))
3568 (file-name (git-file-name name version))
3569 (sha256
3570 (base32
3571 "1md40av6i3xvvwig5jzhy4kf3s5sgxxk35r0vcyrjd8qyndk927l"))))
3572 (build-system trivial-build-system)
3573 (inputs `(("bash" ,bash)))
3574 (arguments
3575 `(#:modules ((guix build utils))
3576 #:builder
3577 (begin
3578 (use-modules (guix build utils))
3579 (let* ((source (lambda (f)
3580 (string-append (assoc-ref %build-inputs "source") "/" f)))
3581 (output (assoc-ref %outputs "out"))
3582 (docdir (string-append output "/share/doc/pfetch-" ,version)))
3583 (install-file (source "LICENSE.md") docdir)
3584 (install-file (source "README.md") docdir)
3585 (install-file (source "pfetch") (string-append output "/bin"))
3586 (patch-shebang
3587 (string-append output "/bin/pfetch")
3588 (list (string-append (assoc-ref %build-inputs "bash") "/bin")))
3589 #t))))
3590 (home-page "https://github.com/dylanaraps/pfetch")
3591 (synopsis "System information tool")
3592 (description "This package provides a simple, configurable system
3593 information tool.")
3594 (license license:expat))))
3595
3596 (define-public nnn
3597 (package
3598 (name "nnn")
3599 (version "4.1.1")
3600 (source
3601 (origin
3602 (method url-fetch)
3603 (uri (string-append "https://github.com/jarun/nnn/releases/download/v"
3604 version "/nnn-v" version ".tar.gz"))
3605 (sha256
3606 (base32 "1fnf35s3b2nfp18s712n5vhg6idx4rfgwdfv74nc2933v9l2dq7h"))))
3607 (build-system gnu-build-system)
3608 (inputs
3609 `(("ncurses" ,ncurses)
3610 ("readline" ,readline)))
3611 (native-inputs
3612 `(("pkg-config" ,pkg-config)))
3613 (arguments
3614 `(#:tests? #f ; no tests
3615 #:phases
3616 (modify-phases %standard-phases
3617 (delete 'configure)) ; no configure script
3618 #:make-flags
3619 (list
3620 (string-append "PREFIX="
3621 (assoc-ref %outputs "out"))
3622 (string-append "CC=" ,(cc-for-target))
3623 (string-append "PKG_CONFIG=" ,(pkg-config-for-target)))))
3624 (home-page "https://github.com/jarun/nnn")
3625 (synopsis "Terminal file browser")
3626 (description
3627 "@command{nnn} is a fork of @command{noice}, a fast and minimal text
3628 terminal file browser with keyboard shortcuts for navigation, opening files and
3629 running tasks. There is no configuration file and MIME associations are
3630 hard-coded.")
3631 (license license:bsd-2)))
3632
3633 (define-public thermald
3634 (package
3635 (name "thermald")
3636 (version "2.4.5")
3637 (source
3638 (origin
3639 (method git-fetch)
3640 (uri (git-reference
3641 (url "https://github.com/intel/thermal_daemon")
3642 (commit (string-append "v" version))))
3643 (file-name (git-file-name name version))
3644 (sha256
3645 (base32 "1y8s0cpjm01bz4isp3ksvnrbhpp3phivdhsb0w2kxhv09sfxkc5g"))))
3646 (build-system gnu-build-system)
3647 (arguments
3648 `(#:configure-flags
3649 (let ((out (assoc-ref %outputs "out")))
3650 (list (string-append "--with-dbus-sys-dir="
3651 out "/etc/dbus-1/system.d")
3652 "--localstatedir=/var"))
3653 #:make-flags
3654 (list "V=1") ; log build commands
3655 #:phases
3656 (modify-phases %standard-phases
3657 (add-before 'bootstrap 'no-early-./configure
3658 (lambda _
3659 (setenv "NO_CONFIGURE" "yet"))))))
3660 (native-inputs
3661 `(("autoconf" ,autoconf)
3662 ("autoconf-archive" ,autoconf-archive)
3663 ("automake" ,automake)
3664 ("glib" ,glib "bin") ; for glib-genmarshal, etc.
3665 ("gtk-doc" ,gtk-doc)
3666 ("pkg-config" ,pkg-config)))
3667 (inputs
3668 `(("dbus-glib" ,dbus-glib)
3669 ("libevdev" ,libevdev)
3670 ("libxml2" ,libxml2)
3671 ("upower" ,upower)
3672 ("xz" ,xz)))
3673 (home-page "https://01.org/linux-thermal-daemon/")
3674 (synopsis "CPU scaling for thermal management")
3675 (description "The Linux Thermal Daemon helps monitor and control temperature
3676 on systems running the Linux kernel.")
3677 ;; arm and aarch64 don't have cpuid.h.
3678 (supported-systems '("i686-linux" "x86_64-linux"))
3679 (license license:gpl2)))
3680
3681 (define-public masscan
3682 (package
3683 (name "masscan")
3684 (version "1.0.5")
3685 (source
3686 (origin
3687 (method git-fetch)
3688 (uri (git-reference
3689 (url "https://github.com/robertdavidgraham/masscan")
3690 (commit version)))
3691 (file-name (git-file-name name version))
3692 (sha256
3693 (base32 "0q0c7bsf0pbl8napry1qyg0gl4pd8wn872h4mz9b56dx4rx90vqg"))))
3694 (build-system gnu-build-system)
3695 (inputs
3696 `(("libpcap" ,libpcap)))
3697 (arguments
3698 `(#:test-target "regress"
3699 #:make-flags
3700 (list (string-append "CC=" ,(cc-for-target))
3701 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3702 #:phases
3703 (modify-phases %standard-phases
3704 (delete 'configure) ; no ./configure script
3705 (add-after 'unpack 'patch-path
3706 (lambda* (#:key outputs inputs #:allow-other-keys)
3707 (let* ((out (assoc-ref outputs "out"))
3708 (pcap (assoc-ref inputs "libpcap")))
3709 (substitute* "src/rawsock-pcap.c"
3710 (("libpcap.so") (string-append pcap "/lib/libpcap.so")))
3711 #t))))))
3712 (synopsis "TCP port scanner")
3713 (description "MASSCAN is an asynchronous TCP port scanner. It can detect
3714 open ports, and also complete the TCP connection and interact with the remote
3715 application, collecting the information received.")
3716 (home-page "https://github.com/robertdavidgraham/masscan")
3717 ;; 'src/siphash24.c' is the SipHash reference implementation, which
3718 ;; bears a CC0 Public Domain Dedication.
3719 (license license:agpl3+)))
3720
3721 (define-public hungrycat
3722 (package
3723 (name "hungrycat")
3724 (version "0.4.1")
3725 (source (origin
3726 (method url-fetch)
3727 (uri (string-append "https://github.com/jwilk/hungrycat/"
3728 "releases/download/" version "/"
3729 "hungrycat-" version ".tar.gz"))
3730 (sha256
3731 (base32
3732 "03fc1zsrf99lvxa7b4ps6pbi43304wbxh1f6ci4q0vkal370yfwh"))))
3733 (build-system gnu-build-system)
3734 (native-inputs
3735 ;; For tests.
3736 `(("python" ,python-wrapper)
3737 ("python-nose" ,python-nose)))
3738 (arguments
3739 `(#:test-target "test"))
3740 (synopsis "A single tool that combines @command{cat} & @command{rm}")
3741 (description
3742 "hungrycat prints the contents of a file to standard output, while
3743 simultaneously freeing the disk space it occupied. It is useful if you need
3744 to process a large file, don't have enough space to store both the input and
3745 output files, and don't need the input file afterwards.
3746 While similar in principle to running @command{cat} immediately followed by
3747 @command{rm}, @command{hungrycat} actually frees blocks as soon as they are
3748 printed instead of after the entire file has been read, which is often too
3749 late.")
3750 (home-page "https://jwilk.net/software/hungrycat")
3751 (license license:expat)))
3752
3753 (define-public launchmon
3754 (package
3755 (name "launchmon")
3756 (version "1.0.2")
3757 (source (origin
3758 (method url-fetch)
3759 (uri (string-append
3760 "https://github.com/LLNL/LaunchMON/releases/download/v"
3761 version "/launchmon-v" version ".tar.gz"))
3762 (sha256
3763 (base32
3764 "0fm3nd9mydm9v2bf7bh01dbgrfnpwkapxa3dsvy3x1z0rz61qc0x"))
3765 (modules '((guix build utils)))
3766 (snippet
3767 '(begin
3768 ;; Fix build failure with GCC 7 due to a conversion error.
3769 ;; Remove for versions > 1.0.2.
3770 (substitute* "launchmon/src/linux/lmon_api/lmon_coloc_spawner.cxx"
3771 ((" lmonpl = '\\\\0'")
3772 " *lmonpl = '\\0'"))
3773 #t))))
3774 (build-system gnu-build-system)
3775 (inputs
3776 `(("mpi" ,openmpi)
3777 ("munge" ,munge)
3778 ("boost" ,boost)
3779 ("libelf" ,libelf)
3780 ("libgcrypt" ,libgcrypt)
3781 ("libgpg-error" ,libgpg-error)))
3782 (synopsis "Infrastructue for large scale tool daemon launching")
3783 (description
3784 "LaunchMON is a software infrastructure that enables HPC run-time
3785 tools to co-locate tool daemons with a parallel job. Its API allows a
3786 tool to identify all the remote processes of a job and to scalably
3787 launch daemons into the relevant nodes.")
3788 (home-page "https://github.com/LLNL/LaunchMON")
3789 (supported-systems '("i686-linux" "x86_64-linux"))
3790 (license license:lgpl2.1)))
3791
3792 (define-public spindle
3793 (package
3794 (name "spindle")
3795 (version "0.10")
3796 (source (origin
3797 ;; We use git checkout to avoid github auto-generated tarballs
3798 (method git-fetch)
3799 (uri (git-reference
3800 (url "https://github.com/hpc/Spindle")
3801 (commit (string-append "v" version))))
3802 (file-name (git-file-name name version))
3803 (sha256
3804 (base32
3805 "15n3ay0qq81r5v7fif61q1vdjcq44pp2nynkh3fvbzc9fj3c39wd"))))
3806 (build-system gnu-build-system)
3807 (arguments '(#:configure-flags '("--enable-sec-launchmon"
3808 "--enable-sec-munge"
3809 "--enable-sec-none")))
3810 (inputs
3811 `(("mpi" ,openmpi)
3812 ("munge" ,munge)
3813 ("launchmon" ,launchmon)
3814 ("libgcrypt" ,libgcrypt)))
3815 (synopsis "Scalable library loading in HPC environments")
3816 (description
3817 "Spindle is a tool for improving the performance of dynamic library and
3818 Python loading in HPC environments.")
3819 (home-page "https://github.com/hpc/Spindle")
3820 ;; This package supports x86_64 and PowerPC64
3821 (supported-systems '("x86_64-linux"))
3822 (license license:lgpl2.1)))
3823
3824 (define-public inxi-minimal
3825 (let ((real-name "inxi"))
3826 (package
3827 (name "inxi-minimal")
3828 (version "3.3.04-1")
3829 (source
3830 (origin
3831 (method git-fetch)
3832 (uri (git-reference
3833 (url "https://github.com/smxi/inxi")
3834 (commit version)))
3835 (file-name (git-file-name real-name version))
3836 (sha256
3837 (base32 "1rrhycp8i43yf9wi80n4pq2hkfhvb2rg1srz8if28bh6fhhasjzw"))))
3838 (build-system trivial-build-system)
3839 (inputs
3840 `(("bash" ,bash-minimal)
3841 ("perl" ,perl)
3842 ("procps" ,procps)))
3843 (native-inputs
3844 `(("gzip" ,gzip)))
3845 (arguments
3846 `(#:modules ((guix build utils))
3847 #:builder
3848 (begin
3849 (use-modules (guix build utils)
3850 (ice-9 match)
3851 (srfi srfi-26))
3852 (setenv "PATH" (string-append
3853 (assoc-ref %build-inputs "bash") "/bin" ":"
3854 (assoc-ref %build-inputs "gzip") "/bin" ":"
3855 (assoc-ref %build-inputs "perl") "/bin" ":"))
3856 (copy-recursively (assoc-ref %build-inputs "source")
3857 ,(string-append real-name "-" version))
3858 (with-directory-excursion ,(string-append real-name "-" version)
3859 (with-fluids ((%default-port-encoding #f))
3860 (substitute* "inxi" (("/usr/bin/env perl") (which "perl"))))
3861 (let ((bin (string-append %output "/bin")))
3862 (install-file "inxi" bin)
3863 (wrap-program (string-append bin "/inxi")
3864 `("PATH" ":" =
3865 ("$PATH"
3866 ,@(map (lambda (input)
3867 (match input
3868 ((name . store)
3869 (let ((store-append
3870 (cut string-append store <>)))
3871 (cond
3872 ((member name '("util-linux"))
3873 (string-append (store-append "/bin") ":"
3874 (store-append "/sbin")))
3875 ((member name '("dmidecode" "iproute2"))
3876 (store-append "/sbin"))
3877 (else (store-append "/bin")))))))
3878 %build-inputs)))
3879 `("PERL5LIB" ":" =
3880 ,(delete
3881 ""
3882 (map (match-lambda
3883 (((? (cut string-prefix? "perl-" <>) name) . dir)
3884 (string-append dir "/lib/perl5/site_perl"))
3885 (_ ""))
3886 %build-inputs)))))
3887 (invoke "gzip" "inxi.1")
3888 (install-file "inxi.1.gz"
3889 (string-append %output "/share/man/man1")))
3890 #t)))
3891 (home-page "https://smxi.org/docs/inxi.htm")
3892 (synopsis "Full-featured system information script")
3893 (description "Inxi is a system information script that can display
3894 various things about your hardware and software to users in an IRC chatroom or
3895 support forum. It runs with the @code{/exec} command in most IRC clients.")
3896 (license license:gpl3+))))
3897
3898 (define-public inxi
3899 (package
3900 (inherit inxi-minimal)
3901 (name "inxi")
3902 (inputs
3903 `(("dmidecode" ,dmidecode)
3904 ("file" ,file)
3905 ("bind:utils" ,isc-bind "utils") ; dig
3906 ("gzip" ,gzip)
3907 ("iproute2" ,iproute) ; ip
3908 ("kmod" ,kmod) ; modinfo
3909 ("lm-sensors" ,lm-sensors)
3910 ("mesa-utils" ,mesa-utils)
3911 ("pciutils" ,pciutils)
3912 ("tar" ,tar)
3913 ("tree" ,tree)
3914 ("util-linux" ,util-linux) ; lsblk
3915 ("usbutils" ,usbutils) ; lsusb
3916 ("wmctrl" ,wmctrl)
3917 ("xdpyinfo" ,xdpyinfo)
3918 ("xprop" ,xprop)
3919 ("xrandr" ,xrandr)
3920 ("coreutils" ,coreutils) ; uptime
3921 ("inetutils" ,inetutils) ; ifconfig
3922 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
3923 ("perl-http-tiny" ,perl-http-tiny)
3924 ("perl-io-socket-ssl" ,perl-io-socket-ssl)
3925 ("perl-json-xs" ,perl-json-xs)
3926 ("perl-time-hires" ,perl-time-hires)
3927 ("lvm2" ,lvm2) ; lvs
3928 ("mdadm" ,mdadm)
3929 ;; TODO: Add more inputs:
3930 ;; ipmi-sensors
3931 ;; hddtemp
3932 ;; perl-xml-dumper
3933 ;; ipmitool
3934 ,@(package-inputs inxi-minimal)))))
3935
3936 (define-public pscircle
3937 (package
3938 (name "pscircle")
3939 (version "1.3.1")
3940 (source
3941 (origin
3942 (method git-fetch)
3943 (uri (git-reference
3944 (url "https://gitlab.com/mildlyparallel/pscircle.git")
3945 (commit (string-append "v" version))))
3946 (file-name (git-file-name name version))
3947 (sha256
3948 (base32 "1sm99423hh90kr4wdjqi9sdrrpk65j2vz2hzj65zcxfxyr6khjci"))))
3949 (build-system meson-build-system)
3950 (native-inputs
3951 `(("pkg-config" ,pkg-config)))
3952 (inputs
3953 `(("cairo" ,cairo)
3954 ("libpng" ,libpng)
3955 ("libx11" ,libx11)))
3956 (home-page "https://gitlab.com/mildlyparallel/pscircle")
3957 (synopsis "Visualize Linux processes in a form of radial tree")
3958 (description
3959 "@code{pscircle} visualizes Linux processes in the form of a radial tree.")
3960 (license license:gpl2+)))
3961
3962 (define-public python-pyudev
3963 (package
3964 (name "python-pyudev")
3965 (version "0.22.0")
3966 (source
3967 (origin
3968 (method url-fetch)
3969 (uri (pypi-uri "pyudev" version))
3970 (sha256
3971 (base32
3972 "0xmj6l08iih2js9skjqpv4w7y0dhxyg91zmrs6v5aa65gbmipfv9"))))
3973 (build-system python-build-system)
3974 (arguments
3975 `(#:tests? #f ; Tests require /sys
3976 #:phases
3977 (modify-phases %standard-phases
3978 (add-after 'unpack 'patch-ctypes-udev
3979 (lambda* (#:key inputs outputs #:allow-other-keys)
3980 (let ((eudev (assoc-ref inputs "eudev")))
3981 (substitute* "src/pyudev/core.py"
3982 (("'udev'")
3983 (string-append "'" eudev "/lib/libudev.so'")))
3984 (substitute* "src/pyudev/_ctypeslib/utils.py"
3985 ;; Use absolute paths instead of keys.
3986 (("= find_library") "= "))
3987 #t))))))
3988 (inputs
3989 `(("eudev" ,eudev)))
3990 (propagated-inputs
3991 `(("python-six" ,python-six)))
3992 (native-inputs
3993 `(("python-docutils" ,python-docutils)
3994 ("python-hypothesis" ,python-hypothesis)
3995 ("python-mock" ,python-mock)
3996 ("python-pytest" ,python-pytest)
3997 ("python-sphinx" ,python-sphinx)))
3998 (home-page "https://pyudev.readthedocs.io/")
3999 (synopsis "Python udev binding")
4000 (description "This package provides @code{udev} bindings for Python.")
4001 (license license:lgpl2.1)))
4002
4003 (define-public vmtouch
4004 (package
4005 (name "vmtouch")
4006 (version "1.3.1")
4007 (source
4008 (origin
4009 (method git-fetch)
4010 (uri (git-reference
4011 (url "https://github.com/hoytech/vmtouch/")
4012 (commit (string-append "v" version))))
4013 (file-name (git-file-name name version))
4014 (sha256
4015 (base32 "08da6apzfkfjwasn4dxrlfxqfx7arl28apdzac5nvm0fhvws0dxk"))))
4016 (build-system gnu-build-system)
4017 (native-inputs
4018 `(("perl" ,perl)))
4019 (arguments
4020 `(#:tests? #f ; no tests
4021 #:make-flags
4022 (list
4023 (string-append "CC=" ,(cc-for-target))
4024 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4025 #:phases
4026 (modify-phases %standard-phases
4027 (delete 'configure))))
4028 (home-page "https://github.com/hoytech/vmtouch/")
4029 (synopsis "Portable file system cache diagnostics and control")
4030 (description
4031 "vmtouch is a tool for learning about and controlling the file system
4032 cache of unix and unix-like systems.")
4033 (license license:bsd-3)))
4034
4035 (define-public solaar
4036 (package
4037 (name "solaar")
4038 (version "1.0.6")
4039 (source (origin
4040 (method git-fetch)
4041 (uri (git-reference
4042 (url "https://github.com/pwr-Solaar/Solaar")
4043 (commit version)))
4044 (file-name (git-file-name name version))
4045 (sha256
4046 (base32
4047 "04zclzfc31l2fj5shcsngnmcvcmmhnc567l3wb9yfhs8k39k9kb2"))))
4048 (build-system python-build-system)
4049 (arguments
4050 `(#:phases
4051 (modify-phases %standard-phases
4052 (add-before 'build 'setenv-PATH
4053 (lambda _
4054 (setenv "PYTHONPATH" (string-append "lib:" (getenv "PYTHONPATH")))
4055 #t)))))
4056 (propagated-inputs
4057 `(("python-pygobject" ,python-pygobject)
4058 ("python-pyudev" ,python-pyudev)
4059
4060 ;; For GUI.
4061 ("python-pyyaml" ,python-pyyaml)
4062 ("python-psutil" ,python-psutil)
4063 ("python-xlib" ,python-xlib)
4064 ("gtk+" ,gtk+)
4065 ("python-pygobject" ,python-pygobject)))
4066 (home-page "https://pwr-solaar.github.io/Solaar/")
4067 (synopsis "Linux devices manager for the Logitech Unifying Receiver")
4068 (description "This package provides tools to manage clients of the
4069 Logitech Unifying Receiver.")
4070 (license license:gpl2)))
4071
4072 (define-public lynis
4073 (package
4074 (name "lynis")
4075 ;; Also update the ‘lynis-sdk’ input to the commit matching this release.
4076 (version "3.0.4")
4077 (source
4078 (origin
4079 (method git-fetch)
4080 (uri (git-reference
4081 (url "https://github.com/CISOfy/lynis")
4082 (commit version)))
4083 (file-name (git-file-name name version))
4084 (sha256
4085 (base32 "1i556d8xpas6k5k3ad0xvc6ihxnw27nzrjkf14759jkcqrbpb4gy"))
4086 (modules '((guix build utils)))
4087 (snippet
4088 '(begin
4089 ;; Remove proprietary plugins. As of now, all plugins supplied with
4090 ;; lynis are proprietary. In the future, if free plugins are
4091 ;; provided, whitelist them from deletion.
4092 (for-each delete-file (find-files "plugins"))
4093 #t))))
4094 (build-system gnu-build-system)
4095 (native-inputs
4096 `(;; For tests
4097 ("lynis-sdk"
4098 ,(origin
4099 (method git-fetch)
4100 (uri (git-reference
4101 (url "https://github.com/CISOfy/lynis-sdk")
4102 (commit "a4087770b7ee794901c5135673e006e8f84bfd3d")))
4103 (file-name (git-file-name "lynis-sdk" version))
4104 (sha256
4105 (base32 "00wikqydhrjcn0ampgr4qjg30y12as1gm23z94bs72ff035lhcpw"))))))
4106 (arguments
4107 `(#:phases
4108 (modify-phases %standard-phases
4109 (replace 'configure
4110 (lambda* (#:key inputs outputs #:allow-other-keys)
4111 (substitute* "lynis"
4112 (("/usr/share/lynis")
4113 (string-append (assoc-ref outputs "out") "/share/lynis")))
4114 (substitute* "include/functions"
4115 (("/usr/local/etc/lynis")
4116 (string-append (assoc-ref outputs "out") "/etc/lynis")))
4117 #t))
4118 (delete 'build)
4119 (replace 'install
4120 (lambda* (#:key outputs #:allow-other-keys)
4121 (let ((out (assoc-ref outputs "out")))
4122 (install-file "lynis" (string-append out "/bin/"))
4123 (install-file "default.prf" (string-append out "/etc/lynis"))
4124 (for-each
4125 (lambda (dir)
4126 (copy-recursively dir (string-append out "/share/lynis/" dir)))
4127 (list "db" "include" "plugins"))
4128 (install-file "lynis.8" (string-append out "/share/man/man8"))
4129 #t)))
4130 (replace 'check
4131 (lambda* (#:key inputs #:allow-other-keys)
4132 (copy-recursively (assoc-ref inputs "lynis-sdk") "../lynis-sdk")
4133 (setenv "LANG" "en_US.UTF-8")
4134 (let ((lynis-dir (getcwd)))
4135 (with-directory-excursion "../lynis-sdk"
4136 (substitute* "config"
4137 (("\\.\\./lynis") lynis-dir))
4138 (substitute* "unit-tests/tests-language-translations.sh"
4139 (("\\.\\./lynis") lynis-dir))
4140 (invoke "sh" "lynis-devkit" "run" "unit-tests"))))))))
4141 (home-page "https://cisofy.com/lynis/")
4142 (synopsis "Security auditing tool")
4143 (description "Lynis is a security auditing tool. It performs an in-depth
4144 security scan and runs on the system itself. The primary goal is to test
4145 security defenses and provide tips for further system hardening. It will also
4146 scan for general system information, vulnerable software packages, and
4147 possible configuration issues.")
4148 (license license:gpl3+)))
4149
4150 (define-public ngrep
4151 (package
4152 (name "ngrep")
4153 (version "1.47")
4154 (source
4155 (origin
4156 (method git-fetch)
4157 (uri (git-reference
4158 (url "https://github.com/jpr5/ngrep/")
4159 (commit (string-append "V" (string-replace-substring version "." "_")))))
4160 (file-name (git-file-name name version))
4161 (sha256
4162 (base32
4163 "1x2fyd7wdqlj1r76ilal06cl2wmbz0ws6i3ys204sbjh1cj6dcl7"))))
4164 (build-system gnu-build-system)
4165 (inputs
4166 `(("libpcap" ,libpcap)))
4167 (arguments
4168 `(#:tests? #f ;; No tests.
4169 #:configure-flags (list (string-append "--with-pcap-includes="
4170 (assoc-ref %build-inputs "libpcap")
4171 "/include/pcap"))))
4172 (home-page "https://github.com/jpr5/ngrep/")
4173 (synopsis "Grep-like utility to search for network packets on an interface")
4174 (description "@command{ngrep} is like GNU grep applied to the network
4175 layer. It's a PCAP-based tool that allows you to specify an extended regular
4176 or hexadecimal expression to match against data payloads of packets. It
4177 understands many kinds of protocols, including IPv4/6, TCP, UDP, ICMPv4/6,
4178 IGMP and Raw, across a wide variety of interface types, and understands BPF
4179 filter logic in the same fashion as more common packet sniffing tools, such as
4180 tcpdump and snoop.")
4181 (license license:bsd-3)))
4182
4183 (define-public pam-mount
4184 (package
4185 (name "pam-mount")
4186 (version "2.18")
4187 (source
4188 (origin
4189 (method url-fetch)
4190 (uri (string-append "mirror://sourceforge/pam-mount/pam_mount/"
4191 "pam_mount-" version ".tar.xz"))
4192 (sha256
4193 (base32 "0832nh2qf9pisgwnbgx6hkylx5d7i416l19y3ly4ifv7k1p7mxqa"))))
4194 (build-system gnu-build-system)
4195 (native-inputs
4196 `(("perl" ,perl)
4197 ("pkg-config" ,pkg-config)))
4198 (inputs
4199 `(("cryptsetup" ,cryptsetup)
4200 ("libhx" ,libhx)
4201 ("libxml2" ,libxml2)
4202 ("linux-pam" ,linux-pam)
4203 ("lvm2" ,lvm2)
4204 ("openssl" ,openssl)
4205 ("pcre2" ,pcre2)
4206 ("libmount" ,util-linux "lib")
4207 ("util-linux" ,util-linux)))
4208 (arguments
4209 `(#:configure-flags
4210 (list (string-append "--with-slibdir=" %output "/lib")
4211 (string-append "--with-ssbindir=" %output "/sbin"))
4212 #:phases
4213 (modify-phases %standard-phases
4214 (add-after 'unpack 'fix-program-paths
4215 (lambda* (#:key inputs outputs #:allow-other-keys)
4216 (let ((util-linux (assoc-ref inputs "util-linux"))
4217 (out (assoc-ref outputs "out")))
4218 (substitute* "src/mtcrypt.c"
4219 (("\"mount\";")
4220 (string-append "\"" util-linux "/bin/mount\";"))
4221 (("\"umount\";")
4222 (string-append "\"" util-linux "/bin/umount\";"))
4223 (("\"fsck\",")
4224 (string-append "\"" util-linux "/sbin/fsck\",")))
4225 (substitute* "src/rdconf1.c"
4226 (("\"mount\", \"")
4227 (string-append "\"" util-linux "/bin/mount\", \""))
4228 (("\"umount\", \"")
4229 (string-append "\"" util-linux "/bin/umount\", \""))
4230 (("\"fsck\", \"")
4231 (string-append "\"" util-linux "/sbin/fsck\", \""))
4232 (("\"pmvarrun\", \"")
4233 (string-append "\"" out "/sbin/pmvarrun\", \""))))
4234 #t)))))
4235 (home-page "http://pam-mount.sourceforge.net")
4236 (synopsis "PAM module to mount volumes for a user session")
4237 (description
4238 "Pam-mount is a PAM module that can mount volumes when a user logs in.
4239 It supports mounting local filesystems of any kind the normal mount utility
4240 supports. It can also mount encrypted LUKS volumes using the password
4241 supplied by the user when logging in.")
4242 (license (list license:gpl2+ license:lgpl2.1+))))
4243
4244 (define-public jc
4245 (package
4246 (name "jc")
4247 (version "1.13.4")
4248 (source
4249 (origin
4250 ;; The PyPI tarball lacks the test suite.
4251 (method git-fetch)
4252 (uri (git-reference
4253 (url "https://github.com/kellyjonbrazil/jc")
4254 (commit (string-append "v" version))))
4255 (file-name (git-file-name name version))
4256 (sha256
4257 (base32 "0rwvyyrdnw43pixp8h51rncq2inc9pbbj1j2191y5si00pjw34zr"))))
4258 (build-system python-build-system)
4259 (propagated-inputs
4260 `(("python-pygments" ,python-pygments)
4261 ("python-ruamel.yaml" ,python-ruamel.yaml)
4262 ("python-xmltodict" ,python-xmltodict)))
4263 (home-page "https://github.com/kellyjonbrazil/jc")
4264 (synopsis "Convert the output of command-line tools to JSON")
4265 (description "@code{jc} JSONifies the output of many CLI tools and
4266 file-types for easier parsing in scripts.")
4267 (license license:expat)))
4268
4269 (define-public jtbl
4270 (package
4271 (name "jtbl")
4272 (version "1.1.6")
4273 (source (origin
4274 (method git-fetch)
4275 (uri (git-reference
4276 (url "https://github.com/kellyjonbrazil/jtbl")
4277 (commit (string-append "v" version))))
4278 (file-name (git-file-name name version))
4279 (sha256
4280 (base32
4281 "1zzd7rd63xva50f22d1rfja4r302aizrafarhwm67vv181swvdya"))))
4282 (build-system python-build-system)
4283 (inputs
4284 `(("python-tabulate" ,python-tabulate)))
4285 (home-page "https://github.com/kellyjonbrazil/jtbl")
4286 (synopsis "Command-line tool to print JSON data as a table in the terminal")
4287 (description "@code{jtbl} accepts piped JSON data from stdin and outputs a
4288 text table representation to stdout.")
4289 (license license:expat)))
4290
4291 (define-public hosts
4292 (package
4293 (name "hosts")
4294 (version "3.6.3")
4295 (source (origin
4296 (method git-fetch)
4297 (uri (git-reference
4298 (url "https://github.com/xwmx/hosts")
4299 (commit version)))
4300 (file-name (git-file-name name version))
4301 (sha256
4302 (base32
4303 "1ni4z89kxzgwm26hhx908g04f2h0fypy7lgfa0rvsz8d0wslgcsn"))))
4304 (build-system trivial-build-system)
4305 (inputs
4306 `(("bats" ,bats) ;for test
4307 ("awk" ,gawk)
4308 ("bash" ,bash)
4309 ("coreutils" ,coreutils)
4310 ("diffutils" ,diffutils)
4311 ("grep" ,grep)
4312 ("ncurses" ,ncurses) ;tput
4313 ("sed" ,sed)))
4314 (arguments
4315 `(#:modules ((guix build utils))
4316 #:builder
4317 (begin
4318 (use-modules (guix build utils))
4319 ;; copy source
4320 (copy-recursively (assoc-ref %build-inputs "source") ".")
4321 ;; patch-shebang phase
4322 (setenv "PATH"
4323 (string-append (assoc-ref %build-inputs "bash") "/bin"
4324 ":" (assoc-ref %build-inputs "awk") "/bin"
4325 ":" (assoc-ref %build-inputs "coreutils") "/bin"
4326 ":" (assoc-ref %build-inputs "diffutils") "/bin"
4327 ":" (assoc-ref %build-inputs "grep") "/bin"
4328 ":" (assoc-ref %build-inputs "ncurses") "/bin"
4329 ":" (assoc-ref %build-inputs "sed") "/bin"
4330 ":" "/run/setuid-programs"
4331 ":" (getenv "PATH")))
4332 (substitute* "hosts"
4333 (("#!/usr/bin/env bash")
4334 (string-append "#!" (which "bash")
4335 "\nPATH=" (getenv "PATH"))))
4336 ;; check phase
4337 (setenv "TERM" "linux") ;set to tty for test
4338 (invoke (string-append (assoc-ref %build-inputs "bats") "/bin/bats")
4339 "test")
4340 ;; install phase
4341 (install-file "hosts" (string-append %output "/bin"))
4342 (let ((bash-completion
4343 (string-append %output "/etc/bash_completion.d")))
4344 (mkdir-p bash-completion)
4345 (copy-file "etc/hosts-completion.bash"
4346 (string-append bash-completion "/hosts")))
4347 (let ((zsh-completion
4348 (string-append %output "/share/zsh/site-functions")))
4349 (mkdir-p zsh-completion)
4350 (copy-file "etc/hosts-completion.zsh"
4351 (string-append zsh-completion "/_hosts")))
4352 (let ((doc (string-append %output "/share/doc/" ,name "-" ,version)))
4353 (mkdir-p doc)
4354 (install-file "LICENSE" doc)
4355 (install-file "README.md" doc))
4356 #t)))
4357 (home-page "https://github.com/xwmx/hosts/")
4358 (synopsis "Script for editing a foreign distro's @file{/etc/hosts} file")
4359 (description "Hosts is a command line program for managing
4360 @file{/etc/hosts} entries. On Guix System, @file{/etc/hosts} is managed from
4361 the system configuration; hosts only works when using the Guix package manager
4362 on a foreign distro. @command{hosts} works with existing hosts files and
4363 entries, providing commands to add, remove, comment, and search.")
4364 (license license:expat)))
4365
4366 (define-public nmrpflash
4367 (package
4368 (name "nmrpflash")
4369 (version "0.9.15")
4370 (source
4371 (origin
4372 (method git-fetch)
4373 (uri
4374 (git-reference
4375 (url "https://github.com/jclehner/nmrpflash")
4376 (commit (string-append "v" version))))
4377 (sha256
4378 (base32 "0ssfls1sfh8w748qsnkfgndlpw395100x2yynzbk5jd56scxvp20"))
4379 (file-name (git-file-name name version))))
4380 (build-system gnu-build-system)
4381 (native-inputs
4382 `(("pkg-config" ,pkg-config)))
4383 (inputs
4384 `(("libnl" ,libnl)
4385 ("libpcap" ,libpcap)))
4386 (arguments
4387 `(#:tests? #f ; None exist
4388 #:make-flags
4389 (list (string-append "CC=" ,(cc-for-target))
4390 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4391 #:phases
4392 (modify-phases %standard-phases
4393 (delete 'configure)
4394 (add-before 'install 'prepare-install
4395 (lambda* (#:key outputs #:allow-other-keys)
4396 (mkdir-p (string-append (assoc-ref outputs "out") "/bin"))
4397 #t)))))
4398 (home-page "https://github.com/jclehner/nmrpflash")
4399 (synopsis "Netgear unbrick utility")
4400 (description "This package provides a utility to flash a new firmware
4401 image to a Netgear device. It has been tested on Netgear EX2700, EX6120,
4402 EX6150v2, DNG3700v2, R6100, R6220, R7000, D7000, WNR3500, R6400, R6800,
4403 R8000, R8500, WNDR3800, but is likely to be compatible with many other
4404 Netgear devices.")
4405 (license license:gpl3+)))
4406
4407 (define-public atop
4408 (package
4409 (name "atop")
4410 (version "2.5.0")
4411 (source (origin
4412 (method url-fetch)
4413 (uri (string-append "https://www.atoptool.nl/download/atop-"
4414 version ".tar.gz"))
4415 (sha256
4416 (base32
4417 "0crzz4i2nabyh7d6xg7fvl65qls87nbca5ihidp3nijhrrbi14ab"))))
4418 (build-system gnu-build-system)
4419 (arguments
4420 `(#:tests? #f ; no test suite
4421 #:make-flags
4422 (list (string-append "CC=" ,(cc-for-target))
4423 ;; The installer requires a choice between systemd or SysV.
4424 "systemdinstall"
4425 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
4426 (string-append "BINPATH=/bin")
4427 (string-append "SBINPATH=/sbin")
4428 (string-append "SYSDPATH=/etc/systemd/system")
4429 (string-append "PMPATHD=/etc/systemd/system-sleep")
4430 (string-append "MAN1PATH=/share/man/man1")
4431 (string-append "MAN5PATH=/share/man/man5")
4432 (string-append "MAN8PATH=/share/man/man8")
4433 ;; Or else it tries to create /var/log/atop...
4434 (string-append "LOGPATH="))
4435 #:phases
4436 (modify-phases %standard-phases
4437 (delete 'configure) ; No ./configure script
4438 (add-before 'build 'patch-build
4439 (lambda* (#:key outputs #:allow-other-keys)
4440 (substitute* "Makefile"
4441 ;; We don't need to chown things in the build environment.
4442 (("chown.*$") "")
4443 ;; We can't toggle the setuid bit in the build environment.
4444 (("chmod 04711") "chmod 0711")
4445 ;; Otherwise, it creates a blank configuration file as a "default".
4446 (("touch.*DEFPATH)/atop") "")
4447 (("chmod.*DEFPATH)/atop") ""))
4448 #t)))))
4449 (inputs
4450 `(("ncurses" ,ncurses)
4451 ("python" ,python-wrapper) ; for `atopgpud`
4452 ("zlib" ,zlib)))
4453 (home-page "https://www.atoptool.nl/")
4454 (synopsis "Linux performance monitoring console")
4455 (description "Atop is an ASCII full-screen performance monitor for Linux
4456 that is capable of reporting the activity of all processes (even processes have
4457 finished during the monitoring interval), daily logging of system and process
4458 activity for long-term analysis, highlighting overloaded system resources by
4459 using colors, etc. At regular intervals, it shows system-level activity related
4460 to the CPU, memory, swap, disks (including LVM) and network layers, and for
4461 every process (and thread) it shows e.g. the CPU utilization, memory growth,
4462 disk utilization, priority, username, state, and exit code.")
4463 (license license:gpl2+)))
4464
4465 ;; TODO: Unvendor u-root (pkg: forth, golang, testutil).
4466 (define fiano
4467 (package
4468 (name "fiano")
4469 (version "5.0.0")
4470 (source (origin
4471 (method git-fetch)
4472 (uri (git-reference
4473 (url "https://github.com/linuxboot/fiano.git")
4474 (commit (string-append "v" version))))
4475 (file-name (string-append name "-" version "-checkout"))
4476 (sha256
4477 (base32
4478 "03ihdwwhb7g6bihx141cn0924sjs5ps6q3ps58pk1cg0g0srrr9h"))
4479 (modules '((guix build utils)))
4480 (snippet
4481 '(begin
4482 (delete-file-recursively "vendor/golang.org")
4483 (delete-file-recursively "vendor/github.com")
4484 #t))))
4485 (build-system go-build-system)
4486 (arguments
4487 `(#:import-path "github.com/linuxboot/fiano"
4488 #:unpack-path "github.com/linuxboot/fiano"))
4489 (native-inputs
4490 `())
4491 (inputs
4492 `(("go-golang-org-x-text" ,go-golang-org-x-text)
4493 ("go-github.com-ulikunitz-xz" ,go-github.com-ulikunitz-xz)))
4494 (synopsis "UEFI image editor")
4495 (description "This package provides a command-line UEFI image editor.")
4496 (home-page "https://github.com/linuxboot/fiano")
4497 (license license:bsd-3)))
4498
4499 (define-public fiano-utk
4500 (package
4501 (inherit fiano)
4502 (name "fiano-utk")
4503 (arguments
4504 `(#:import-path "github.com/linuxboot/fiano/cmds/utk"
4505 #:unpack-path "github.com/linuxboot/fiano"))))
4506
4507 (define-public fiano-fmap
4508 (package
4509 (inherit fiano)
4510 (name "fiano-fmap")
4511 (arguments
4512 `(#:import-path "github.com/linuxboot/fiano/cmds/fmap"
4513 #:unpack-path "github.com/linuxboot/fiano"))))
4514
4515 (define-public novena-eeprom
4516 (package
4517 (name "novena-eeprom")
4518 (version "2.3")
4519 (source (origin
4520 (method git-fetch)
4521 (uri (git-reference
4522 (url "https://github.com/xobs/novena-eeprom.git")
4523 (commit (string-append "v" version))))
4524 (file-name (string-append name "-" version "-checkout"))
4525 (sha256
4526 (base32
4527 "00pd71mg0g20v0820ggp3ghf9nyj5s4wavaz9mkmrmsr91hcnf7i"))))
4528 (build-system gnu-build-system)
4529 (arguments
4530 `(#:tests? #f ; No tests exist
4531 #:make-flags
4532 (list (string-append "CC=" ,(cc-for-target)))
4533 #:phases
4534 (modify-phases %standard-phases
4535 (delete 'configure)
4536 (replace 'install
4537 (lambda* (#:key outputs #:allow-other-keys)
4538 (let* ((out (assoc-ref outputs "out"))
4539 (out-bin (string-append out "/bin"))
4540 (out-share-man (string-append out "/share/man/man8")))
4541 (install-file "novena-eeprom" out-bin)
4542 (install-file "novena-eeprom.8" out-share-man)))))))
4543 (inputs
4544 `(("i2c-tools" ,i2c-tools)))
4545 (synopsis "Novena EEPROM editor")
4546 (description "This package provides an editor for the Novena EEPROM.
4547 Novena boards contain a device-dependent descriptive EEPROM that defines
4548 various parameters such as serial number, MAC address, and featureset.
4549 This program allows you to view and manipulate this EEPROM list.")
4550 (home-page "https://github.com/xobs/novena-eeprom/")
4551 (supported-systems '("armhf-linux"))
4552 (license license:bsd-3)))
4553
4554 (define-public lrzsz
4555 (package
4556 (name "lrzsz")
4557 (version "0.12.20")
4558 (source (origin
4559 (method url-fetch)
4560 (uri (string-append "https://www.ohse.de/uwe/releases/lrzsz-"
4561 version ".tar.gz"))
4562 (sha256
4563 (base32
4564 "1wcgfa9fsigf1gri74gq0pa7pyajk12m4z69x7ci9c6x9fqkd2y2"))))
4565 (build-system gnu-build-system)
4566 (arguments
4567 `(#:phases
4568 (modify-phases %standard-phases
4569 (replace 'configure
4570 (lambda* (#:key outputs #:allow-other-keys)
4571 (setenv "CONFIG_SHELL" (which "bash"))
4572 (invoke "./configure"
4573 (string-append "--prefix="
4574 (assoc-ref outputs "out"))))))))
4575 (synopsis "Implementation of XMODEM/YMODEM/ZMODEM transfer protocols")
4576 (description "This package provides programs that transfer files using
4577 the XMODEM/YMODEM/ZMODEM file transfer protocols.")
4578 (home-page "https://ohse.de/uwe/software/lrzsz.html")
4579 (license license:gpl2+)))
4580
4581 (define-public nq
4582 (package
4583 (name "nq")
4584 (version "0.4")
4585 (source
4586 (origin
4587 (method git-fetch)
4588 (uri (git-reference
4589 (url "https://github.com/leahneukirchen/nq")
4590 (commit (string-append "v" version))))
4591 (file-name (git-file-name name version))
4592 (sha256
4593 (base32 "0sdamjzvmf6cxhjmd1rjvn7zm6k10fp5n6vabyxd3yl30cgrxw2i"))))
4594 (build-system gnu-build-system)
4595 (native-inputs
4596 `(("perl" ,perl)))
4597 (arguments
4598 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
4599 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4600 #:phases
4601 (modify-phases %standard-phases
4602 (delete 'configure))))
4603 (synopsis "Unix command line queue utility")
4604 (description
4605 "@code{nq} can create very lightweight job queue systems which require no
4606 setup, maintenance, supervision, or any long-running processes.")
4607 (home-page "https://github.com/leahneukirchen/nq")
4608 (license license:public-domain)))