gnu: Add fail2ban.
[jackhill/guix/guix.git] / gnu / packages / admin.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
fe83583b 2;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
340c7033 3;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
dad963a4 4;;; Copyright © 2014, 2015, 2016, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
1949c8b2 5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2020, 2021, 2022 Eric Bavier <bavier@posteo.net>
d0457553 6;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
15926aec 7;;; Copyright © 2015 Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
8d801045 8;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
3728ed7c 9;;; Copyright © 2016, 2017, 2020 Leo Famulari <leo@famulari.name>
f1957fc1 10;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
d10fa5c7 11;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
2e09516e 12;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
1a0346f0 13;;; Copyright © 2016 Peter Feigl <peter.feigl@nexoid.at>
61402398 14;;; Copyright © 2016 John J. Foerch <jjfoerch@earthlink.net>
3c986a7d 15;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
0bb09847 16;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <me@tobias.gr>
1b5b24c9
BS
17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
6e75ea48 19;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
94551439 20;;; Copyright © 2017 Christine Lemmer-Webber <cwebber@dustycloud.org>
f8cbe98e 21;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
ba8551ec 22;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
3ebf2c29 23;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
abde01f2 24;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
ce3fef9f 25;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
4b3ff362 26;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
a20ede32 27;;; Copyright © 2019,2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
e8134442 28;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
6eb1d20b 29;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
37760623 30;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
73db69be 31;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
994d8ce3 32;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
73656471 33;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
1a9b3faa 34;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
84873830 35;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
913c8897 36;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
248af684 37;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
0a3226e8 38;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
18e79929 39;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
861ba525 40;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
c7be46b7 41;;; Copyright © 2021 qblade <qblade@protonmail.com>
53240608 42;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org>
b9986cac 43;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
296e2308 44;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
eb939109 45;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
83bf3c63 46;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
7256d9d2 47;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
c08d56a1 48;;; Copyright © 2021 muradm <mail@muradm.net>
167b8f29 49;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com>
0ba4e94e 50;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
85e3ed2b 51;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
ff12cf5e 52;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
544a886a 53;;; Copyright © 2022 Roman Riabenko <roman@riabenko.com>
1df895b0 54;;;
233e7676 55;;; This file is part of GNU Guix.
1df895b0 56;;;
233e7676 57;;; GNU Guix is free software; you can redistribute it and/or modify it
1df895b0
LC
58;;; under the terms of the GNU General Public License as published by
59;;; the Free Software Foundation; either version 3 of the License, or (at
60;;; your option) any later version.
61;;;
233e7676 62;;; GNU Guix is distributed in the hope that it will be useful, but
1df895b0
LC
63;;; WITHOUT ANY WARRANTY; without even the implied warranty of
64;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65;;; GNU General Public License for more details.
66;;;
67;;; You should have received a copy of the GNU General Public License
233e7676 68;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1df895b0 69
4aeea896 70(define-module (gnu packages admin)
c08d56a1 71 #:use-module (guix build-system cargo)
fbc1a58f 72 #:use-module (guix build-system cmake)
2b6164f0 73 #:use-module (guix build-system emacs)
ddb0fef5 74 #:use-module (guix build-system glib-or-gtk)
1df895b0 75 #:use-module (guix build-system gnu)
a94214f6 76 #:use-module (guix build-system go)
b19f3337 77 #:use-module (guix build-system meson)
d1ce1125 78 #:use-module (guix build-system perl)
4ecfbda7 79 #:use-module (guix build-system python)
2d2d5b29 80 #:use-module (guix build-system ruby)
c773aba8 81 #:use-module (guix build-system trivial)
1b36f758
TGR
82 #:use-module (guix download)
83 #:use-module (guix git-download)
65fdb84d 84 #:use-module (guix gexp)
1b36f758
TGR
85 #:use-module ((guix licenses) #:prefix license:)
86 #:use-module (guix packages)
87 #:use-module (guix utils)
59a43334 88 #:use-module (gnu packages)
67648704 89 #:use-module (gnu packages algebra)
ddb0fef5 90 #:use-module (gnu packages autogen)
1b36f758 91 #:use-module (gnu packages autotools)
c73d4c92 92 #:use-module (gnu packages base)
bbc94ed0 93 #:use-module (gnu packages bash)
1b36f758
TGR
94 #:use-module (gnu packages bison)
95 #:use-module (gnu packages boost)
cd2ce8ab 96 #:use-module (gnu packages c)
ac257f12 97 #:use-module (gnu packages check)
1b36f758 98 #:use-module (gnu packages compression)
c08d56a1 99 #:use-module (gnu packages crates-io)
1b36f758 100 #:use-module (gnu packages cross-base)
6eb1d20b 101 #:use-module (gnu packages crypto)
cd2ce8ab 102 #:use-module (gnu packages cryptsetup)
d7e7494b 103 #:use-module (gnu packages curl)
3d7a157c 104 #:use-module (gnu packages cyrus-sasl)
bbc94ed0 105 #:use-module (gnu packages dns)
1b36f758 106 #:use-module (gnu packages elf)
bbc94ed0 107 #:use-module (gnu packages file)
1b36f758 108 #:use-module (gnu packages flex)
167b8f29 109 #:use-module (gnu packages freedesktop)
ceb233bb 110 #:use-module (gnu packages gawk)
1b36f758
TGR
111 #:use-module (gnu packages gettext)
112 #:use-module (gnu packages gl)
113 #:use-module (gnu packages glib)
114 #:use-module (gnu packages gnome)
115 #:use-module (gnu packages gnupg)
a48cf78a 116 #:use-module (gnu packages golang)
1b36f758
TGR
117 #:use-module (gnu packages groff)
118 #:use-module (gnu packages gtk)
f15164e7 119 #:use-module (gnu packages guile)
d4172bab 120 #:use-module (gnu packages guile-xyz)
c0a5cd1b 121 #:use-module (gnu packages hurd)
1b36f758 122 #:use-module (gnu packages image)
050e5756
MB
123 #:use-module (gnu packages imagemagick)
124 #:use-module (gnu packages inkscape)
1b36f758
TGR
125 #:use-module (gnu packages kerberos)
126 #:use-module (gnu packages libbsd)
127 #:use-module (gnu packages libftdi)
128 #:use-module (gnu packages libunwind)
129 #:use-module (gnu packages libusb)
130 #:use-module (gnu packages linux)
131 #:use-module (gnu packages lua)
85e3ed2b 132 #:use-module (gnu packages m4)
72861d8e 133 #:use-module (gnu packages mail)
1b36f758
TGR
134 #:use-module (gnu packages man)
135 #:use-module (gnu packages mcrypt)
136 #:use-module (gnu packages mpi)
137 #:use-module (gnu packages ncurses)
d7e7494b 138 #:use-module (gnu packages networking)
1b36f758
TGR
139 #:use-module (gnu packages openldap)
140 #:use-module (gnu packages patchutils)
141 #:use-module (gnu packages pciutils)
d0457553 142 #:use-module (gnu packages pcre)
c73d4c92 143 #:use-module (gnu packages perl)
5ccde207 144 #:use-module (gnu packages perl-check)
87216303 145 #:use-module (gnu packages pkg-config)
0ba4e94e 146 #:use-module (gnu packages polkit)
b36fcf95 147 #:use-module (gnu packages popt)
1a0346f0 148 #:use-module (gnu packages python)
cc6f4912 149 #:use-module (gnu packages python-crypto)
1b2f753d 150 #:use-module (gnu packages python-web)
44d10b1f 151 #:use-module (gnu packages python-xyz)
050e5756 152 #:use-module (gnu packages qt)
1b36f758 153 #:use-module (gnu packages readline)
2d2d5b29 154 #:use-module (gnu packages ruby)
83bf3c63 155 #:use-module (gnu packages selinux)
d8a046d5 156 #:use-module (gnu packages serialization)
d7e7494b 157 #:use-module (gnu packages sqlite)
83bf3c63 158 #:use-module (gnu packages ssh)
9d0c291e 159 #:use-module (gnu packages sphinx)
1b36f758 160 #:use-module (gnu packages tcl)
2468ca04 161 #:use-module (gnu packages terminals)
fccf2fe0 162 #:use-module (gnu packages texinfo)
83bf3c63 163 #:use-module (gnu packages time)
1b36f758
TGR
164 #:use-module (gnu packages tls)
165 #:use-module (gnu packages version-control)
166 #:use-module (gnu packages web)
d10fa5c7 167 #:use-module (gnu packages xdisorg)
3ebf2c29 168 #:use-module (gnu packages xml)
1b36f758 169 #:use-module (gnu packages xorg))
f15164e7 170
a632eeb8 171;; This package uses su instead of sudo (because of SpaceFM).
ddb0fef5
RG
172(define-public ktsuss
173 (package
174 (name "ktsuss")
175 (version "2.1")
176 (source
177 (origin
178 (method git-fetch)
179 (uri
180 (git-reference
b0e7b699 181 (url "https://github.com/nomius/ktsuss")
ddb0fef5
RG
182 (commit version)))
183 (sha256
184 (base32 "0q9931f9hp47v1n8scli4bdg2rkjpf5jf8v7jj2gdn83aia1r2hz"))
185 (file-name (git-file-name name version))))
186 (build-system glib-or-gtk-build-system)
187 (arguments
a632eeb8 188 `(#:phases
ddb0fef5 189 (modify-phases %standard-phases
c53886a5
RG
190 (add-after 'unpack 'patch-file-names
191 (lambda _
ddb0fef5 192 (substitute* "configure.ac"
c53886a5 193 (("supath=`which su 2>/dev/null`")
a632eeb8 194 "supath=/run/setuid-programs/su"))
ddb0fef5
RG
195 #t)))))
196 (native-inputs
8394619b 197 (list autoconf automake libtool pkg-config))
ddb0fef5 198 (inputs
8394619b 199 (list glib gtk+-2))
ddb0fef5
RG
200 (synopsis "Graphical front end for @command{su}")
201 (description
202 "Ktsuss stands for ``Keep the @command{su} simple, stupid''.
203It is a graphical version of @command{su} written in C and GTK+ 2, with
204simplicity in mind.")
205 (home-page "https://github.com/nomius/ktsuss")
206 (license license:bsd-3)))
207
c1f73569
RW
208(define-public aide
209 (package
210 (name "aide")
c3f4505e 211 (version "0.16.2")
737300be
TGR
212 (source
213 (origin
214 (method url-fetch)
215 (uri (string-append "https://github.com/aide/aide/releases/download/v"
216 version "/aide-" version ".tar.gz"))
217 (sha256
c3f4505e 218 (base32 "15xp47sz7kk1ciffw3f5xw2jg2mb2lqrbr3q6p4bkbz5dap9iy8p"))))
c1f73569
RW
219 (build-system gnu-build-system)
220 (native-inputs
8394619b 221 (list bison flex))
c1f73569 222 (inputs
e3196755
LC
223 (list libgcrypt
224 libgpg-error
225 libmhash
226 `(,pcre "static")
227 pcre
228 `(,zlib "static")
229 zlib))
c1f73569
RW
230 (synopsis "File and directory integrity checker")
231 (description
232 "AIDE (Advanced Intrusion Detection Environment) is a file and directory
233integrity checker. It creates a database from the regular expression rules
234that it finds from its configuration files. Once this database is initialized
235it can be used to verify the integrity of the files. It has several message
236digest algorithms that are used to check the integrity of files. All of the
237usual file attributes can be checked for inconsistencies.")
737300be 238 (home-page "https://aide.github.io/")
c1f73569
RW
239 (license license:gpl2+)))
240
4971d5d0
RJ
241(define-public progress
242 (package
243 (name "progress")
5a948f31 244 (version "0.16")
4b6456ce
TGR
245 (source
246 (origin
247 (method git-fetch)
248 (uri (git-reference
b0e7b699 249 (url "https://github.com/Xfennec/progress")
4b6456ce
TGR
250 (commit (string-append "v" version))))
251 (sha256
5a948f31 252 (base32 "0gf10j9zd8spain94b5kigknwbdqajiy6fjsa5hhwsc1biz34hcj"))
4b6456ce 253 (file-name (git-file-name name version))))
4971d5d0 254 (build-system gnu-build-system)
eec9c4a7 255 (native-inputs
8394619b 256 (list pkg-config which))
4971d5d0 257 (inputs
8394619b 258 (list ncurses))
4971d5d0 259 (arguments
4b6456ce 260 `(#:tests? #f ; no test suite
b97b8b44
TGR
261 #:make-flags
262 (let ((target ,(%current-target-system)))
263 (list ,(string-append "CC=" (cc-for-target))
264 (string-append "PKG_CONFIG="
265 (if target
266 (string-append target "-pkg-config")
267 "pkg-config"))
268 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
4971d5d0
RJ
269 #:phases
270 (modify-phases %standard-phases
4b6456ce 271 (delete 'configure)))) ; no configure script
4971d5d0
RJ
272 (home-page "https://github.com/Xfennec/progress")
273 (synopsis "Program to view the progress of the coreutils commands")
274 (description "A program that looks for coreutils basic commands (cp, mv,
275dd, tar, gzip/gunzip, cat, etc.) currently running on your system and displays
276the percentage of copied data. It can also show estimated time and throughput,
277and provides a \"top-like\" mode (monitoring).")
278 (license license:gpl3+)))
279
d4172bab 280(define-public shepherd-0.8
133056bd
LC
281 (package
282 (name "shepherd")
3f9c62d1 283 (version "0.8.1")
133056bd
LC
284 (source (origin
285 (method url-fetch)
9fb1ca08 286 (uri (string-append "mirror://gnu/shepherd/shepherd-"
133056bd
LC
287 version ".tar.gz"))
288 (sha256
289 (base32
79be6a98
MB
290 "0x9zr0x3xvk4qkb6jnda451d5iyrl06cz1bjzjsm0lxvjj3fabyk"))
291 (modules '((guix build utils)))
292 (snippet
293 '(begin
294 ;; Build with -O1 to work around <https://bugs.gnu.org/48368>.
295 (substitute* "Makefile.in"
296 (("compile --target")
297 "compile -O1 --target"))))))
133056bd
LC
298 (build-system gnu-build-system)
299 (arguments
55b4120f
EF
300 '(#:configure-flags '("--localstatedir=/var")
301 #:make-flags '("GUILE_AUTO_COMPILE=0")))
425ab478 302 (native-inputs
8394619b
LC
303 (list pkg-config
304 ;; This is the Guile we use as a cross-compiler...
305 guile-3.0))
425ab478
LC
306 (inputs
307 ;; ... and this is the one that appears in shebangs when cross-compiling.
8394619b
LC
308 (list guile-3.0
309 ;; The 'shepherd' command uses Readline when used interactively. It's
310 ;; an unusual use case though, so we don't propagate it.
311 guile-readline))
133056bd
LC
312 (synopsis "System service manager")
313 (description
314 "The GNU Shepherd is a daemon-managing daemon, meaning that it supervises
315the execution of system services, replacing similar functionality found in
316typical init systems. It provides dependency-handling through a convenient
317interface and is based on GNU Guile.")
318 (license license:gpl3+)
9fb1ca08 319 (home-page "https://www.gnu.org/software/shepherd/")))
e932d371 320
d4172bab
LC
321;; Update on the next rebuild cycle.
322(define-public shepherd shepherd-0.8)
323
324(define-public shepherd-0.9
139a9887
LC
325 (package
326 (inherit shepherd)
8a588eb8 327 (version "0.9.1")
d4172bab
LC
328 (source (origin
329 (method url-fetch)
330 (uri (string-append "mirror://gnu/shepherd/shepherd-"
331 version ".tar.gz"))
332 (sha256
333 (base32
0483c71c
LC
334 "0l2arn6gsyw88xk9phxnyplvv1mn8sqp3ipgyyb0nszdzvxlgd36"))
335 (modules '((guix build utils)))
336 (snippet
337 ;; Avoid continuation barriers so (@ (fibers) sleep) can be
338 ;; called from a service's 'stop' method
339 '(substitute* "modules/shepherd/service.scm"
340 (("call-with-blocked-asyncs") ;in 'stop' method
341 "(lambda (thunk) (thunk))")
342 (("\\(for-each-service\n") ;in 'shutdown-services'
343 "((lambda (proc)
344 (for-each proc
345 (fold-services cons '())))\n")))))
6e174c4e
LC
346 (arguments
347 (list #:configure-flags #~'("--localstatedir=/var")
348 #:make-flags #~'("GUILE_AUTO_COMPILE=0")
349 #:phases (if (%current-target-system)
350 #~(modify-phases %standard-phases
351 (add-before 'configure 'set-fibers-directory
352 (lambda _
353 ;; When cross-compiling, refer to the target
354 ;; Fibers, not the native one.
355 (substitute* '("herd.in" "shepherd.in")
356 (("%FIBERS_SOURCE_DIRECTORY%")
357 #$(file-append
358 (this-package-input "guile-fibers")
359 "/share/guile/site/3.0"))
360 (("%FIBERS_OBJECT_DIRECTORY%")
361 #$(file-append
362 (this-package-input "guile-fibers")
363 "/lib/guile/3.0/site-ccache"))))))
364 #~%standard-phases)))
365 (native-inputs (list pkg-config guile-3.0
366 guile-fibers-1.1)) ;for cross-compilation
d4172bab
LC
367 (inputs (list guile-3.0 guile-fibers-1.1))))
368
369(define-public guile2.2-shepherd
370 (package
371 (inherit shepherd-0.9)
b6bee63b 372 (name "guile2.2-shepherd")
d4172bab
LC
373 (native-inputs (list pkg-config guile-2.2))
374 (inputs (list guile-2.2 guile2.2-fibers))))
b6bee63b 375
76812463
LC
376(define-public guile2.0-shepherd
377 (package
378 (inherit shepherd)
379 (name "guile2.0-shepherd")
380 (native-inputs
8394619b 381 (list help2man pkg-config guile-2.0))
76812463 382 (inputs
8394619b 383 (list guile-2.0))
dbd94d96
EF
384 (arguments
385 `(#:phases
386 (modify-phases %standard-phases
387 (add-after 'unpack 'patch-source
388 (lambda _
389 ;; (ice-9 threads) isn't available in guile-2.0
390 (substitute* "modules/shepherd.scm"
391 ((".*\\(ice-9 threads\\).*") ""))
392 #t)))
393 ,@(package-arguments shepherd)))))
76812463 394
8e4d44ad
TGR
395(define-public cfm
396 (package
397 (name "cfm")
398 (version "0.6.6")
399 (source
400 (origin
401 (method git-fetch)
402 (uri (git-reference
403 (url "https://github.com/WillEccles/cfm")
404 (commit (string-append "v" version))))
405 (file-name (git-file-name name version))
406 (sha256
407 (base32 "14gapia902f29wa4dlrrj8jcwcff9bfvyhjccw9ddy2gxx2g8wmr"))))
408 (build-system gnu-build-system)
409 (arguments
410 `(#:tests? #f ; no test suite
411 #:make-flags
412 (list (string-append "CC=" ,(cc-for-target))
413 (string-append "PREFIX=" (assoc-ref %outputs "out")))
414 #:phases
415 (modify-phases %standard-phases
416 ;; Keeping xdg-open optional avoids a size increase of 293%.
417 (delete 'configure)))) ; no configure script
418 (home-page "https://eccles.dev/cfm/")
419 (synopsis
420 "Simple terminal file manager with @command{vi}-inspired key bindings")
421 (description
422 "The Cactus File Manager (@command{cfm}) helps you manage your files
423visually from a text terminal. It aims to be simple and fast, with key bindings
424inspired by @command{vi}.")
425 (license license:mpl2.0)))
426
bf949323
CB
427(define-public cloud-utils
428 (package
429 (name "cloud-utils")
0e5e26dc 430 (version "0.33")
bf949323
CB
431 (source
432 (origin
433 (method url-fetch)
434 (uri (string-append
435 "https://launchpad.net/cloud-utils/trunk/"
436 version "/+download/cloud-utils-" version ".tar.gz"))
437 (sha256
438 (base32
f00ccdcb 439 "0xxdi55lzw7j91zfajw7jhd2ilsqj2dy04i9brlk8j3pvb5ma8hk"))))
bf949323
CB
440 (build-system gnu-build-system)
441 (arguments
d6d06ee2
TGR
442 '(#:modules
443 ((guix build gnu-build-system)
444 (guix build utils)
445 (srfi srfi-26))
446 #:make-flags
bf949323
CB
447 (let ((out (assoc-ref %outputs "out")))
448 (list (string-append "BINDIR=" out "/bin")
449 (string-append "MANDIR=" out "/share/man/man1")
450 (string-append "DOCDIR=" out "/share/doc")))
451 #:phases
452 (modify-phases %standard-phases
453 (delete 'configure)
454 (delete 'check)
455 (add-after 'install 'wrap
456 (lambda* (#:key outputs inputs #:allow-other-keys)
457 (let ((growpart (string-append (assoc-ref outputs "out")
458 "/bin/growpart")))
459 (wrap-program growpart
d6d06ee2
TGR
460 `("PATH" ":" prefix
461 ,(map dirname
462 (map (cut search-input-file inputs <>)
463 (list "bin/readlink"
464 "sbin/sfdisk")))))))))))
bf949323 465 (inputs
d6d06ee2
TGR
466 (list coreutils ; for readlink
467 python
468 util-linux)) ; sfdisk for growpart
bf949323
CB
469 (home-page "https://launchpad.net/cloud-utils")
470 (synopsis "Set of utilities for cloud computing environments")
471 (description
472 "This package contains a set of utilities for cloud computing
473environments:
474
475@itemize @bullet
476@item @command{cloud-localds} Create a disk for cloud-init to utilize nocloud
477@item @command{cloud-publish-image} Wrapper for cloud image publishing
478@item @command{cloud-publish-tarball} Wrapper for publishing cloud tarballs
479@item @command{cloud-publish-ubuntu} Import a Ubuntu cloud image
480@item @command{ec2metadata} Query and display @acronym{EC2,Amazon Elastic
481 Compute Cloud} metadata
482@item @command{growpart} Grow a partition to fill the device
483@item @command{mount-image-callback} Mount a file and run a command
484@item @command{resize-part-image} Resize a partition image to a new size
485@item @command{ubuntu-cloudimg-query} Get the latest Ubuntu
486 @acronym{AMI,Amazon Machine Image}
487@item @command{ubuntu-ec2-run} Run a @acronym{EC2,Amazon Elastic Compute
488 Cloud} instance using Ubuntu
489@item @command{vcs-run} Obtain a repository, and run a command
490@item @command{write-mime-multipart} Handle multipart
491 @acronym{MIME,Multipurpose Internet Mail Extensions} messages
492@end itemize")
493 (license license:gpl3)))
494
db341bfa
CB
495(define-public daemontools
496 (package
497 (name "daemontools")
498 (version "0.76")
499 (source (origin
500 (method url-fetch)
501 (uri (string-append
213114a7
TGR
502 "https://cr.yp.to/daemontools/"
503 "daemontools-" version ".tar.gz"))
db341bfa
CB
504 (sha256
505 (base32
506 "07scvw88faxkscxi91031pjkpccql6wspk4yrlnsbrrb5c0kamd5"))))
507 (build-system gnu-build-system)
508 (arguments
509 `(#:tests? #f ;; No tests as far as I can tell.
510 #:phases
511 (modify-phases %standard-phases
512 (add-after 'unpack 'chdir
513 (lambda _
213114a7 514 (chdir ,(string-append "daemontools-" version))
cb8ba848 515 #t))
db341bfa
CB
516 (delete 'configure)
517 (add-before 'build 'patch
518 (lambda _
519 (substitute* "src/error.h"
520 (("extern int errno;")
cb8ba848
MW
521 "#include <errno.h>"))
522 #t))
db341bfa
CB
523 (replace 'build
524 (lambda _
525 (invoke "package/compile")))
526 (replace 'install
527 (lambda* (#:key outputs #:allow-other-keys)
528 (let* ((out (assoc-ref outputs "out"))
529 (bin (string-append out "/bin")))
530 (for-each (lambda (file)
531 (install-file file bin))
cb8ba848
MW
532 (find-files "command")))
533 #t)))))
db341bfa
CB
534 (synopsis "Tools for managing UNIX style services")
535 (description
536 "@code{daemontools} is a collection of tools for managing UNIX
537services.")
538 (license license:public-domain)
539 (home-page "https://cr.yp.to/daemontools.html")))
540
296e2308
W
541(define-public daemonize
542 (package
543 (name "daemonize")
544 (version "1.7.8")
545 (source
546 (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url "https://github.com/bmc/daemonize")
550 (commit (string-append "release-" version))))
551 (file-name (git-file-name name version))
552 (sha256
553 (base32 "0w4g0iyssyw7dd0061881z8s5czcl01mz6v00znax57zfxjqpvnm"))))
554 (build-system gnu-build-system)
555 (arguments '(#:tests? #f)) ; No tests available.
1e42c76c 556 (home-page "https://software.clapper.org/daemonize/")
296e2308
W
557 (synopsis "Command line utility to run a program as a daemon")
558 (description
559 "daemonize runs a command as a Unix daemon. It will close all open file
560descriptors, change working directory of the process to the root filesystem,
561reset its umask, run in the background, ignore I/O signals, handle
562@code{SIGCLD}, etc. Most programs that are designed to be run as daemons do
563that work for themselves. However, you’ll occasionally run across one that
564does not. When you must run a daemon program that does not properly make
565itself into a true Unix daemon, you can use daemonize to force it to run as a
566true daemon.")
567 (license license:bsd-3)))
568
fbc1a58f
CR
569(define-public dfc
570 (package
571 (name "dfc")
48167ccd 572 (version "3.1.1")
fbc1a58f
CR
573 (source
574 (origin
575 (method url-fetch)
576 (uri (string-append
eeb8b0e6 577 "https://projects.gw-computing.net/attachments/download/615/dfc-"
fbc1a58f
CR
578 version ".tar.gz"))
579 (sha256
580 (base32
48167ccd 581 "0m1fd7l85ckb7bq4c5c3g257bkjglm8gq7x42pkmpp87fkknc94n"))))
fbc1a58f
CR
582 (build-system cmake-build-system)
583 (arguments '(#:tests? #f)) ; There are no tests.
b94a6ca0 584 (native-inputs `(("gettext" ,gettext-minimal)))
eeb8b0e6 585 (home-page "https://projects.gw-computing.net/projects/dfc")
fbc1a58f
CR
586 (synopsis "Display file system space usage using graphs and colors")
587 (description
588 "dfc (df color) is a modern version of df. It uses colors, draws pretty
589graphs and can export its output to different formats.")
f61e0e79 590 (license license:bsd-3)))
fbc1a58f 591
2d2d5b29
MB
592(define-public facter
593 (package
594 (name "facter")
acbcc0c4 595 (version "4.0.52")
2d2d5b29
MB
596 (source (origin
597 (method git-fetch)
598 (uri (git-reference
44d66cf7 599 (url "https://github.com/puppetlabs/facter")
2d2d5b29
MB
600 (commit version)))
601 (file-name (git-file-name name version))
602 (sha256
603 (base32
acbcc0c4 604 "05j4q87sak1f1isj7ngzr59h3j3xskfwjjwfv0xd7lhwcaxg3a3c"))))
2d2d5b29
MB
605 (build-system ruby-build-system)
606 (arguments
c43c4d8b
TGR
607 `(#:phases
608 (modify-phases %standard-phases
609 (add-after 'unpack 'delete-facter-ng-gemspec
610 (lambda _
611 ;; XXX: ruby-build-system incorrectly finds
612 ;; facter-ng.gemspec from this directory and tries to
613 ;; build that instead of the proper facter.gemspec.
614 ;; Just delete it as a workaround, as it appears to
615 ;; only exist for backwards-compatibility after the
616 ;; facter-ng->facter rename.
617 (delete-file "agent/facter-ng.gemspec")
618 #t))
619 (add-after 'unpack 'embed-absolute-references
620 ;; Refer to absolute executable file names to avoid propagation.
621 (lambda* (#:key inputs #:allow-other-keys)
44d66cf7 622 (substitute* (find-files "lib/facter/resolvers" "\\.rb$")
c43c4d8b
TGR
623 (("execute\\('(which |)([^ ']+)" _ _ name)
624 (string-append "execute('" (or (which name)
625 name))))
626 #t))
627 (delete 'check)
628 (add-after 'wrap 'check
629 (lambda* (#:key tests? outputs #:allow-other-keys)
630 ;; XXX: The test suite wants to run Bundler and
631 ;; complains that the gemspec is invalid. For now
632 ;; just make sure that we can run the wrapped
633 ;; executable directly.
634 (if tests?
635 (invoke (string-append (assoc-ref outputs "out")
636 "/bin/facter")
637 ;; Many facts depend on /sys, /etc/os-release,
638 ;; etc, so we only run a small sample.
639 "facterversion" "architecture"
640 "kernel" "kernelversion")
641 (format #t "tests disabled~%"))
642 #t)))))
2d2d5b29 643 (inputs
c43c4d8b 644 `(("ruby-hocon" ,ruby-hocon)
2d2d5b29 645 ("ruby-sys-filesystem" ,ruby-sys-filesystem)
c43c4d8b
TGR
646 ("ruby-thor" ,ruby-thor)
647
648 ;; For ‘embed-absolute-references’.
649 ("dmidecode" ,dmidecode)
650 ("inetutils" ,inetutils) ; for ‘hostname’
651 ("iproute" ,iproute)
652 ("pciutils" ,pciutils)
653 ("util-linux" ,util-linux)))
2d2d5b29
MB
654 (synopsis "Collect and display system facts")
655 (description
656 "Facter is a tool that gathers basic facts about nodes (systems) such
657as hardware details, network settings, OS type and version, and more. These
658facts can be collected on the command line with the @command{facter} command
659or via the @code{facter} Ruby library.")
660 (home-page "https://github.com/puppetlabs/facter-ng")
661 (license license:expat)))
662
861ba525
SR
663(define-public ttyload
664 (let ((revision "1")
665 (commit "f9495372801ce4b4dad98ad854203e694c31c1eb"))
666 (package
667 (name "ttyload")
668 (version (git-version "0.5.3" revision commit))
669 (source
670 (origin
671 (method git-fetch)
672 (uri (git-reference
673 (url "https://github.com/lindes/ttyload")
674 (commit commit)))
675 (file-name (git-file-name name version))
676 (sha256
677 (base32 "0ldb7a13b9v876c6cbrs78pkizj64drnqx95z5shfbwgpwfhr4im"))))
678 (build-system gnu-build-system)
679 (arguments
680 `(#:tests? #f ; no tests
681 #:make-flags
682 (list (string-append "CC=" ,(cc-for-target)))
683 #:phases
684 (modify-phases %standard-phases
685 (delete 'configure)
686 (replace 'install
687 (lambda* (#:key outputs #:allow-other-keys)
688 (let* ((out (assoc-ref outputs "out"))
689 (bin (string-append out "/bin")))
690 (install-file "ttyload" bin)))))))
691 (home-page "https://www.daveltd.com/src/util/ttyload/")
692 (synopsis "Console based color-coded graphs of CPU load average")
693 (description
694 "Show graphs for 1 minute, 5 minute, 15 minute load averages on the
695console.")
696 ;; This package uses a modified version of the "ISC License".
697 (license (license:non-copyleft "file://LICENSE")))))
698
340c7033
CR
699(define-public htop
700 (package
611ee0c9 701 (name "htop")
142d136a 702 (version "3.2.1")
9925a234
TGR
703 (source
704 (origin
705 (method git-fetch)
706 (uri (git-reference
707 (url "https://github.com/htop-dev/htop")
708 (commit version)))
709 (sha256
142d136a 710 (base32 "0yfmkw3y4qyd42svhpiijif7krvmnb8z88y6h9g4fwf7sfynq2rk"))
9925a234 711 (file-name (git-file-name name version))))
611ee0c9
MB
712 (build-system gnu-build-system)
713 (inputs
8394619b 714 (list ncurses))
611ee0c9 715 (native-inputs
e3196755 716 (list autoconf automake python-minimal-wrapper)) ; for scripts/MakeHeader.py
9925a234 717 (home-page "https://htop.dev")
611ee0c9
MB
718 (synopsis "Interactive process viewer")
719 (description
720 "This is htop, an interactive process viewer. It is a text-mode
340c7033 721application (for console or X terminals) and requires ncurses.")
611ee0c9 722 (license license:gpl2)))
340c7033 723
6bbd0fd2
MR
724(define-public bashtop
725 (package
726 (name "bashtop")
727 (version "0.9.25")
728 (source (origin
729 (method git-fetch)
730 (uri (git-reference
731 (url "https://github.com/aristocratos/bashtop")
732 (commit (string-append "v" version))))
733 (file-name (git-file-name name version))
734 (sha256
735 (base32
736 "07nlr6vmyb7yihaxj1fp424lmhwkdjl6mls92v90f6gsvikpa13v"))))
737 (build-system gnu-build-system)
738 (arguments
739 '(#:make-flags (list (string-append "PREFIX=" %output))
740 #:tests? #f ; bats test fails with loading load.bash
741 #:phases (modify-phases %standard-phases (delete 'configure))))
742 (home-page "https://github.com/aristocratos/bashtop")
743 (synopsis "Linux/OSX/FreeBSD resource monitor")
744 (description "Resource monitor that shows usage and stats for processor,
745memory, disks, network and processes.")
746 (license license:asl2.0)))
747
18e79929
ZJ
748(define-public bpytop
749 (package
750 (name "bpytop")
be70ca27 751 (version "1.0.68")
18e79929
ZJ
752 (source
753 (origin
754 (method url-fetch)
755 (uri (pypi-uri "bpytop" version))
756 (sha256
be70ca27 757 (base32 "1clvajbv7pzlya9s1xs6dvjic8rv3kx7aqiwnjxapiypx246gdjk"))))
18e79929 758 (build-system python-build-system)
15903eaa 759 (inputs
8394619b 760 (list python-psutil))
5b401ed0
MR
761 (arguments
762 `(#:phases
763 (modify-phases %standard-phases
2a302714
MR
764 ;; sanity-check phase fail, but the application seems to be working
765 (delete 'sanity-check)
5b401ed0
MR
766 (add-after 'install 'install-themes
767 (lambda* (#:key outputs #:allow-other-keys)
768 (let ((themes (string-append (assoc-ref outputs "out")
769 "/lib/python"
770 ,(version-major+minor
771 (package-version python))
772 "/site-packages/bpytop-themes")))
773 (mkdir-p themes)
ada62041 774 (copy-recursively "themes" themes)))))))
18e79929
ZJ
775 (home-page
776 "https://github.com/aristocratos/bpytop")
777 (synopsis "Resource monitor")
778 (description "Resource monitor that shows usage and stats for processor,
de5da4db 779memory, disks, network and processes. It's a Python port and continuation of
18e79929
ZJ
780@command{bashtop}.")
781 (license license:asl2.0)))
782
1df895b0
LC
783(define-public pies
784 (package
785 (name "pies")
8189ce17 786 (version "1.7")
1df895b0
LC
787 (source
788 (origin
a9764b7d
LC
789 (method url-fetch)
790 (uri (string-append "mirror://gnu/pies/pies-"
791 version ".tar.bz2"))
792 (sha256
793 (base32
8189ce17 794 "0ajcah2y6n55qc0ckspcx0hfpm1yb2xa1apcyij7mclic4q2y330"))))
1df895b0 795 (build-system gnu-build-system)
a9764b7d
LC
796 (arguments
797 '(#:phases (modify-phases %standard-phases
798 (add-before 'build 'patch-/bin/sh
799 (lambda* (#:key inputs #:allow-other-keys)
800 ;; Use the right shell when executing user-provided
801 ;; shell commands.
802 (let ((bash (assoc-ref inputs "bash")))
3fb666bd 803 (substitute* '("src/progman.c" "src/comp.c")
a9764b7d 804 (("\"/bin/sh\"")
8189ce17 805 (string-append "\"" bash "/bin/sh\"")))))))))
56cb6f1d 806 (home-page "https://www.gnu.org.ua/software/pies/")
f50d2669 807 (synopsis "Program invocation and execution supervisor")
1df895b0 808 (description
79c311b8 809 "GNU pies is a program that supervises the invocation and execution of
a22dc0c4
LC
810other programs. It reads the list of programs to be started from its
811configuration file, executes them, and then monitors their status,
812re-executing them as necessary.")
f61e0e79 813 (license license:gpl3+)))
1df895b0
LC
814
815(define-public inetutils
816 (package
817 (name "inetutils")
4f4b749e 818 (version "2.0")
01eafd38
LC
819 (source (origin
820 (method url-fetch)
821 (uri (string-append "mirror://gnu/inetutils/inetutils-"
822 version ".tar.gz"))
823 (sha256
824 (base32
4f4b749e 825 "0j1nb69bhg29cm4xkqqjh2ln1zqcj2lnpm92v638lpwrs11dypxl"))))
1df895b0 826 (build-system gnu-build-system)
483188b7 827 (arguments
e4015e57
LC
828 `(#:configure-flags '("--localstatedir=/var"
829
830 ;; Make sure 'PATH_PROCNET_DEV' gets defined when
831 ;; cross-compiling (by default it does not.)
832 ,@(if (%current-target-system)
833 '("--with-path-procnet-dev=/proc/net/dev")
3d3ca76f
JN
834 '())
835 ,@(if (hurd-target?)
836 '("--disable-rcp"
837 "--disable-rexec"
838 "--disable-rexecd"
839 "--disable-rlogin"
840 "--disable-rlogind"
841 "--disable-rsh"
842 "--disable-rshd"
843 "--disable-uucpd"
844 "--disable-whois")
e4015e57 845 '()))
15e71674
MO
846 ;; Make sure that canonical "coreutils" package is not referred.
847 #:make-flags
848 (list (string-append "CPPFLAGS=-DPATHDEF_CP=\\\""
849 (assoc-ref %build-inputs "coreutils*")
850 "/bin/cp\\\""))
ed6a21b4
MB
851 ;; On some systems, 'libls.sh' may fail with an error such as:
852 ;; "Failed to tell switch -a apart from -A".
853 #:parallel-tests? #f))
15e71674 854 (inputs `(("coreutils*" ,coreutils)
c773ce09 855 ("shadow" ,shadow) ;for login (used in telnetd and rlogind)
15e71674 856 ("ncurses" ,ncurses)
6f5d28f9 857 ("readline" ,readline))) ;for 'ftp'
3d3ca76f
JN
858 (native-inputs (if (member (%current-system)
859 (package-supported-systems net-tools))
860 `(("netstat" ,net-tools)) ;for tests
861 '()))
6fd52309 862 (home-page "https://www.gnu.org/software/inetutils/")
f50d2669 863 (synopsis "Basic networking utilities")
1df895b0 864 (description
a22dc0c4 865 "Inetutils is a collection of common network programs, such as an ftp
e048de60
LF
866client and server, a telnet client and server, an rsh client and server, and
867hostname.")
f61e0e79 868 (license license:gpl3+)))
9a9e72d5
LC
869
870(define-public shadow
871 (package
872 (name "shadow")
7ecc2e3d 873 (version "4.9")
9a9e72d5 874 (source (origin
ca2a55d4
SB
875 (method url-fetch)
876 (uri (string-append
4153ef23 877 "https://github.com/shadow-maint/shadow/releases/"
7ecc2e3d 878 "download/v" version "/shadow-" version ".tar.xz"))
ca2a55d4
SB
879 (sha256
880 (base32
7ecc2e3d 881 "0i4iijbshnwnsrskxzrh18xgmzff0hdpsnnkmyc2gdn1x4n1zv7y"))))
9a9e72d5
LC
882 (build-system gnu-build-system)
883 (arguments
ce6223e6 884 `(;; Assume System V `setpgrp (void)', which is the default on GNU
9a9e72d5 885 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
52701a3d 886 #:configure-flags
4f8d5e63
EF
887 '(,@(if (hurd-target?)
888 '()
889 '("--with-libpam"))
f09563ab 890 "shadow_cv_logdir=/var/log"
4f8d5e63 891 "ac_cv_func_setpgrp_void=yes")
52701a3d 892 #:phases
893 (modify-phases %standard-phases
7ecc2e3d
MC
894 (add-after 'unpack 'fix-linking-to-pam
895 (lambda _
896 ;; There's a build system problem in 4.9 that causes link
897 ;; failures with the pam libraries (see:
898 ;; https://github.com/shadow-maint/shadow/issues/407).
899 (substitute* "libsubid/Makefile.in"
900 (("\\$\\(LIBTCB\\)" all)
901 (string-append all " $(LIBPAM)")))))
994d8ce3
MO
902 ,@(if (%current-target-system)
903 '((add-before 'configure 'set-runtime-shell
904 (lambda* (#:key inputs #:allow-other-keys)
905 (let ((shell (string-append
906 (assoc-ref inputs "bash")
907 "/bin/bash")))
908 (setenv "RUNTIME_SHELL" shell)
909 (substitute* "configure.ac"
910 (("\\$SHELL")
911 "$RUNTIME_SHELL"))))))
912 '())
52701a3d 913 (add-before 'build 'set-nscd-file-name
914 (lambda* (#:key inputs #:allow-other-keys)
915 ;; Use the right file name for nscd.
ce6223e6
LC
916 (let ((libc (assoc-ref inputs
917 ,(if (%current-target-system)
918 "cross-libc"
919 "libc"))))
52701a3d 920 (substitute* "lib/nscd.c"
921 (("/usr/sbin/nscd")
7ecc2e3d 922 (string-append libc "/sbin/nscd"))))))
52701a3d 923 (add-after 'install 'remove-groups
924 (lambda* (#:key outputs #:allow-other-keys)
925 ;; Remove `groups', which is already provided by Coreutils.
926 (let* ((out (assoc-ref outputs "out"))
927 (bin (string-append out "/bin"))
928 (man (string-append out "/share/man")))
929 (delete-file (string-append bin "/groups"))
7ecc2e3d 930 (for-each delete-file (find-files man "^groups\\."))))))))
4f8d5e63
EF
931 (inputs
932 `(,@(if (hurd-target?)
933 '()
994d8ce3
MO
934 `(("linux-pam" ,linux-pam)))
935 ,@(if (%current-target-system)
936 `(("bash" ,bash-minimal))
937 '())))
1f6dd7e9 938 (home-page "https://github.com/shadow-maint/shadow")
9a9e72d5
LC
939 (synopsis "Authentication-related tools such as passwd, su, and login")
940 (description
941 "Shadow provides a number of authentication-related tools, including:
942login, passwd, su, groupadd, and useradd.")
943
fe83583b
LC
944 (properties '((hidden? . #t))) ;see below
945
9a9e72d5
LC
946 ;; The `vipw' program is GPLv2+.
947 ;; libmisc/salt.c is public domain.
f61e0e79 948 (license license:bsd-3)))
1e151896 949
fe83583b
LC
950(define-public shadow-with-man-pages
951 ;; TODO: Merge with 'shadow' on the next core-updates cycle.
952 (package/inherit shadow
953 (properties '()) ;not hidden
954 (arguments
955 (substitute-keyword-arguments (package-arguments shadow)
956 ((#:phases phases '%standard-phases)
957 `(modify-phases ,phases
958 (add-after 'install 'install-man-pages
959 (lambda _
960 ;; The top-level Makefile.am wrongfully has "SUBDIRS += man"
961 ;; under "if ENABLE_REGENERATE_MAN", even though prebuilt man
962 ;; pages are available. Thus, install them manually.
963 (invoke "make" "-C" "man" "install")))))))))
964
1e151896
LC
965(define-public mingetty
966 (package
967 (name "mingetty")
968 (version "1.08")
969 (source (origin
970 (method url-fetch)
de67e922
LF
971 (uri (string-append "mirror://sourceforge/mingetty/mingetty/"
972 version "/mingetty-" version ".tar.gz"))
1e151896
LC
973 (sha256
974 (base32
975 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
976 (build-system gnu-build-system)
977 (arguments
dc1d3cde
KK
978 `(#:phases
979 (modify-phases %standard-phases
980 (replace 'configure
ba0e1406 981 (lambda* (#:key inputs outputs target #:allow-other-keys)
dc1d3cde
KK
982 (let* ((out (assoc-ref outputs "out"))
983 (man8 (string-append out "/share/man/man8"))
984 (sbin (string-append out "/sbin"))
985 (shadow (assoc-ref inputs "shadow"))
986 (login (string-append shadow "/bin/login")))
987 (substitute* "Makefile"
ba0e1406
MO
988 ,@(if (%current-target-system)
989 '((("CC=.*$")
990 (string-append "CC=" target "-gcc\n")))
991 '())
dc1d3cde
KK
992 (("^SBINDIR.*")
993 (string-append "SBINDIR = " out
994 "/sbin\n"))
995 (("^MANDIR.*")
996 (string-append "MANDIR = " out
997 "/share/man/man8\n")))
998
999 ;; Pick the right 'login' by default.
1000 (substitute* "mingetty.c"
1001 (("\"/bin/login\"")
1002 (string-append "\"" login "\"")))
1003
1004 (mkdir-p sbin)
1005 (mkdir-p man8))
1006 #t)))
1e151896 1007 #:tests? #f)) ; no tests
8394619b 1008 (inputs (list shadow))
1e151896 1009
3b3b60d0 1010 (home-page "https://sourceforge.net/projects/mingetty")
1e151896
LC
1011 (synopsis "Getty for the text console")
1012 (description
1013 "Small console getty that is started on the Linux text console,
36a4366d
EF
1014asks for a login name and then transfers over to @code{login}. It is extended
1015to allow automatic login and starting any app.")
f61e0e79 1016 (license license:gpl2+)))
c773aba8
LC
1017
1018(define-public net-base
1019 (package
1020 (name "net-base")
db719df7 1021 (version "5.3")
c773aba8
LC
1022 (source (origin
1023 (method url-fetch)
1024 (uri (string-append
34af3684 1025 "mirror://debian/pool/main/n/netbase/netbase_"
db719df7 1026 version ".tar.xz"))
c773aba8
LC
1027 (sha256
1028 (base32
db719df7 1029 "12xqjwg3p4rzmmh2iib6sigm9l29y3dgk74mmnw64k84jnbwdxl1"))))
c773aba8
LC
1030 (build-system trivial-build-system)
1031 (arguments
1032 `(#:modules ((guix build utils))
f6e4fbad
MD
1033 ;; This package consists solely of architecture-independent
1034 ;; tables. Cross-compilation is pointless! Make sure we'll
1035 ;; always get the same derivation.
1036 #:target #f
1037 #:allowed-references ()
c773aba8
LC
1038 #:builder (begin
1039 (use-modules (guix build utils)
1040 (srfi srfi-26))
1041
1042 (let* ((source (assoc-ref %build-inputs "source"))
1043 (tar (assoc-ref %build-inputs "tar"))
db719df7 1044 (xz (assoc-ref %build-inputs "xz"))
c773aba8
LC
1045 (output (assoc-ref %outputs "out"))
1046 (etc (string-append output "/etc")))
db719df7 1047 (setenv "PATH" (string-append xz "/bin"))
e3cfef22
MW
1048 (invoke (string-append tar "/bin/tar") "xvf"
1049 source)
c773aba8
LC
1050 (chdir ,(string-append "netbase-" version))
1051 (mkdir-p etc)
1052 (for-each copy-file
1053 '("etc-services" "etc-protocols" "etc-rpc")
1054 (map (cut string-append etc "/" <>)
1055 '("services" "protocols" "rpc")))
1056 #t))))
8394619b 1057 (native-inputs (list tar xz))
c773aba8
LC
1058 (synopsis "IANA protocol, port, and RPC number assignments")
1059 (description
1060 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
1061files, which contain information about the IANA-assigned port, protocol, and
e881752c 1062ONC RPC numbers.")
eeb8b0e6 1063 (home-page "https://packages.debian.org/sid/netbase")
f61e0e79 1064 (license license:gpl2)))
94c4a58a
LC
1065
1066(define-public netcat
1067 (package
1068 (name "netcat")
1069 (version "0.7.1")
1070 (source (origin
1071 (method url-fetch)
de67e922
LF
1072 (uri (string-append "mirror://sourceforge/netcat/netcat/" version
1073 "/netcat-" version ".tar.bz2"))
94c4a58a
LC
1074 (sha256
1075 (base32
1076 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
1077 (build-system gnu-build-system)
0e4e89c2
MW
1078 (arguments
1079 `(#:configure-flags
1080 ;; By default, man and info pages are put in PREFIX/{man,info},
1081 ;; but we want them in PREFIX/share/{man,info}.
1082 (let ((out (assoc-ref %outputs "out")))
1083 (list (string-append "--mandir=" out "/share/man")
1084 (string-append "--infodir=" out "/share/info")))))
94c4a58a
LC
1085 (home-page "http://netcat.sourceforge.net")
1086 (synopsis "Read and write data over TCP/IP")
1087 (description
1088 "Netcat is a featured networking utility which reads and writes data
1089across network connections, using the TCP/IP protocol. It is designed to be a
1090reliable \"back-end\" tool that can be used directly or easily driven by other
35b9e423 1091programs and scripts. At the same time, it is a feature-rich network debugging
94c4a58a
LC
1092and exploration tool, since it can create almost any kind of connection you
1093would need and has several interesting built-in capabilities.")
f61e0e79 1094 (license license:gpl2+)))
d038cac1 1095
37760623
AG
1096(define-public netcat-openbsd
1097 (package
1098 (name "netcat-openbsd")
09e885d8 1099 (version "1.218-5")
37760623
AG
1100 (source (origin
1101 (method git-fetch)
1102 (uri (git-reference
1103 (url "https://salsa.debian.org/debian/netcat-openbsd.git")
1104 (commit (string-append "debian/" version))))
1105 (file-name (git-file-name name version))
1106 (sha256
1107 (base32
09e885d8 1108 "0hpbmz9m2q22a6qgbn9590z2x96xgffim8g0m1v47mariz3pqhlc"))))
37760623
AG
1109 (build-system gnu-build-system)
1110 (arguments
ae58ebba 1111 `(#:tests? #f ; no test suite
37760623 1112 #:make-flags
aea2a0f9 1113 (list (string-append "CC=" ,(cc-for-target)))
37760623
AG
1114 #:phases
1115 (modify-phases %standard-phases
1116 (delete 'configure)
1117 (add-before 'build 'patch
1118 (lambda _
1119 (setenv "QUILT_PATCHES" "debian/patches")
ef9797c6 1120 (invoke "quilt" "push" "-a")))
37760623
AG
1121 (replace 'install
1122 (lambda* (#:key outputs #:allow-other-keys)
1123 (let* ((out (assoc-ref outputs "out"))
1124 (bin (string-append out "/bin"))
1125 (man (string-append out "/share/man/man1"))
1126 (doc (string-append out "/share/doc/netcat-openbsd-" ,version))
1127 (examples (string-append doc "/examples")))
1128 (install-file "nc" bin)
1129 (install-file "nc.1" man)
1130 (install-file "debian/copyright" doc)
ef9797c6 1131 (copy-recursively "debian/examples" examples)))))))
8394619b
LC
1132 (inputs (list libbsd))
1133 (native-inputs (list pkg-config quilt))
37760623
AG
1134 (home-page "https://packages.debian.org/sid/netcat-openbsd")
1135 (synopsis "Read and write data over TCP/IP")
1136 (description
1137 "Netcat is a simple Unix utility which reads and writes data across
1138network connections using TCP or UDP protocol. It is designed to be a reliable
1139\"back-end\" tool that can be used directly or easily driven by other programs
1140and scripts. At the same time it is a feature-rich network debugging and
1141exploration tool, since it can create almost any kind of connection you would
1142need and has several interesting built-in capabilities.
1143
1144This package contains the OpenBSD rewrite of netcat, including support for
1145IPv6, proxies, and Unix sockets.")
1146 (license (list license:bsd-3
1147 license:bsd-2)))) ; atomicio.*, socks.c
1148
1023bd85
TGR
1149(define-public nmon
1150 (package
1151 (name "nmon")
1152 (version "16n")
1153 (source
1154 (origin
1155 (method url-fetch)
1156 (uri (string-append "mirror://sourceforge/nmon/lmon" version ".c"))
1157 (sha256
1158 (base32 "1wpm2f30414b87kpbr9hbidblr5cmfby5skwqd0fkpi5v712q0f0"))))
1159 (build-system gnu-build-system)
1160 (arguments
1161 (list #:tests? #f ; no test suite
1162 #:phases
1163 #~(modify-phases %standard-phases
1164 (replace 'unpack
1165 (lambda _
1166 (copy-file #$(package-source this-package) "lmon.c")))
1167 (delete 'configure) ; no build system
1168 (replace 'build
1169 ;; There is an example ‘Makefile’ in the .c file.
1170 (lambda _
1171 ;; These #defines aren't well-documented and, e.g., POWER was
1172 ;; not actually tested on every possible TARGET-POWERPC?.
882cbfa0 1173 (let* ((system #$(cond ((target-x86?) "X86")
1023bd85
TGR
1174 ((target-arm?) "ARM")
1175 ((target-powerpc?) "POWER")
1176 (else "CROSS_FINGERS"))))
1177 (format #t "Building for ~a~%" system)
1178 (invoke #$(cc-for-target) "-o" "nmon" "lmon.c"
1179 "-g" "-Wall" "-D" system
1180 "-lncurses" "-lm"))))
1181 (replace 'install
1182 (lambda _
1183 (let ((bin (string-append #$output "/bin"))
1184 (man1 (string-append #$output "/share/man/man1")))
1185 (install-file "nmon" bin)
1186 (mkdir-p man1)
1187 (copy-file #$(this-package-native-input "man-page")
1188 (string-append man1 "/nmon.1"))))))))
1189 (native-inputs
1190 (list `("man-page"
1191 ,(origin
1192 ;; There is no man page upstream, so install Debian's.
1193 (method url-fetch)
1194 (uri (string-append "https://salsa.debian.org/carnil/nmon/"
1195 "-/raw/debian/" version "+debian-1/"
1196 "debian/nmon.1"))
1197 (sha256
1198 (base32
1199 "1gpvd2kjyhs18sh6sga5bk9wj8s78blfd4c0m38r0wl92jx2yv1b"))))))
1200 (inputs
1201 (list ncurses))
1202 (home-page "http://nmon.sourceforge.net/")
1203 (synopsis
1204 "Monitor system performance in a terminal or to a @file{.csv} log file")
1205 (description
1206 "@acronym{Nmon, Nigel's performance monitor} is yet another system monitor
1207useful in systems administration, debugging, tuning, and benchmarking.
1208
1209The configurable ncurses interface displays all the classic resource usage
1210statistics (CPU, memory, network, disk, ...) as real-time graphs or numbers.
1211It can also list the processes responsible in a @command{top}-like table.
1212
1213A less common nmon feature is its ability to create highly detailed log files
1214in @acronym{CSV, comma-separated values} format. These can be imported into
1215spreadsheets or fed straight into an @acronym{RRD, round-robin database} using
1216@command{rrdtool} for further analyisis, or to create colourful graphs.")
1217 (license license:gpl3+)))
1218
8d0edc82
OP
1219(define-public sipcalc
1220 (package
1221 (name "sipcalc")
1222 (version "1.1.6")
1223 (source
1224 (origin
1225 (method url-fetch)
1226 (uri (string-append "http://www.routemeister.net/projects"
1227 "/sipcalc/files/sipcalc" "-" version ".tar.gz"))
1228 (sha256
1229 (base32
1230 "0mv3wndj4z2bsshh2k8d5sy3j8wxzgf8mzmmkvj1k8gpcz37dm6g"))))
1231 (build-system gnu-build-system)
720aa977 1232 (home-page "https://www.routemeister.net/projects/sipcalc/")
8d0edc82
OP
1233 (synopsis "Command-line IP subnet calculator")
1234 (description
1235 "Sipcalc is an advanced command-line IP subnet calculator. It can take
1236multiple forms of input (IPv4/IPv6/interface/hostname) and output a multitude
1237of information about a given subnet.
1238
1239Features include:
1240
1241@itemize @bullet
1242@item IPv4
1243@itemize
1244@item Retrieving of address information from interfaces.
1245@item Classfull and CIDR output.
1246@item Multiple address and netmask input and output formats (dotted quad, hex,
1247number of bits).
1248@item Output of broadcast address, network class, Cisco wildcard,
1249hosts/range, network range.
1250@item The ability to split a network based on a smaller netmask, now also with
1251recursive runs on the generated subnets. (also IPv6)
1252@end itemize
1253@item IPv6
1254@itemize
1255@item Compressed and expanded input and output addresses.
1256@item Standard IPv6 network output.
1257@item v4 in v6 output.
1258@item Reverse DNS address generation.
1259@end itemize
1260@end itemize\n")
1261 (license license:bsd-3)))
1262
b9986cac 1263(define-public prips
1264 (package
1265 (name "prips")
1266 (version "1.1.1")
1267 (source
1268 (origin
1269 (method url-fetch)
1270 (uri (string-append "https://devel.ringlet.net/files/sys/"
1271 name "/" name "-" version ".tar.xz"))
1272 (sha256
1273 (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
1274 (build-system gnu-build-system)
1275 (arguments
1276 `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))
1277 #:test-target "test"
1278 #:phases (modify-phases %standard-phases
1279 (delete 'configure)
1280 (replace 'install
1281 (lambda* (#:key outputs #:allow-other-keys)
1282 (let ((out (assoc-ref outputs "out")))
1283 (install-file "prips"
1284 (string-append out "/bin"))))))))
8394619b 1285 (native-inputs (list perl-test-harness))
b9986cac 1286 (synopsis "Tool that prints the IP addresses in a given range")
1287 (description "Prips can be used to print all of the IP addresses in
1288 a given range. This allows the enhancement of tools only work
1289 on one host at a time (e.g. whois).")
1290 (home-page "https://devel.ringlet.net/sysutils/prips/")
1291 (license license:gpl2+)))
1292
d038cac1
LC
1293(define-public alive
1294 (package
1295 (name "alive")
2e09516e 1296 (version "2.0.5")
d038cac1
LC
1297 (source (origin
1298 (method url-fetch)
1299 (uri (string-append "mirror://gnu/alive/alive-"
2e09516e 1300 version ".tar.lz"))
d038cac1
LC
1301 (sha256
1302 (base32
2e09516e 1303 "12ahlxbbrynm6md8qc872qr795lqpfkr8kwlsig40i4nznzkvkwl"))))
d038cac1
LC
1304 (build-system gnu-build-system)
1305 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
2e09516e
EF
1306 (inputs
1307 (list guile-3.0
1308 inetutils))
1309 (native-inputs
1310 (list lzip))
6fd52309 1311 (home-page "https://www.gnu.org/software/alive/")
d038cac1
LC
1312 (synopsis "Autologin and keep-alive daemon")
1313 (description
1314 "GNU Alive sends periodic pings to a server, generally to keep a
1315connection alive.")
f61e0e79 1316 (license license:gpl3+)))
c73d4c92
LC
1317
1318(define-public isc-dhcp
6548b1e1 1319 (let* ((bind-major-version "9")
4e2432d1 1320 (bind-minor-version "11")
3076e695 1321 (bind-patch-version "37")
f7780fdf
MW
1322 (bind-release-type "") ; for patch release, use "-P"
1323 (bind-release-version "") ; for patch release, e.g. "6"
6548b1e1
MW
1324 (bind-version (string-append bind-major-version
1325 "."
1326 bind-minor-version
1327 "."
1328 bind-patch-version
1329 bind-release-type
1330 bind-release-version)))
1331 (package
1332 (name "isc-dhcp")
388e0390 1333 (version "4.4.3")
6548b1e1
MW
1334 (source (origin
1335 (method url-fetch)
8198b3db 1336 (uri (string-append "https://ftp.isc.org/isc/dhcp/"
6548b1e1
MW
1337 version "/dhcp-" version ".tar.gz"))
1338 (sha256
1339 (base32
388e0390 1340 "062q2g8cj2zv0zv22x6pg21m21bdlscxkg3li0ac0pm0qasccghf"))))
6548b1e1
MW
1341 (build-system gnu-build-system)
1342 (arguments
e54465ff 1343 `(#:parallel-build? #f
445013b6 1344 #:configure-flags '("--with-randomdev=/dev/random")
e54465ff 1345 #:phases
6548b1e1
MW
1346 (modify-phases %standard-phases
1347 (add-after 'unpack 'replace-bundled-bind
f7780fdf 1348 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6548b1e1
MW
1349 (delete-file "bind/bind.tar.gz")
1350 (copy-file (assoc-ref inputs "bind-source-tarball")
1351 "bind/bind.tar.gz")
1352 (chmod "bind/bind.tar.gz" #o644)
1353 (substitute* "bind/version.tmp"
1354 (("^MAJORVER=.*")
1355 (format #f "MAJORVER=~a\n" ,bind-major-version))
1356 (("^MINORVER=.*")
1357 (format #f "MINORVER=~a\n" ,bind-minor-version))
1358 (("^PATCHVER=.*")
1359 (format #f "PATCHVER=~a\n" ,bind-patch-version))
1360 (("^RELEASETYPE=.*")
1361 (format #f "RELEASETYPE=~a\n" ,bind-release-type))
1362 (("^RELEASEVER=.*")
d3f195f7 1363 (format #f "RELEASEVER=~a\n" ,bind-release-version)))))
f8cbe98e
MB
1364 ,@(if (%current-target-system)
1365 '((add-before 'configure 'fix-bind-cross-compilation
1366 (lambda _
1367 (substitute* "configure"
1368 (("--host=\\$host")
1369 "--host=$host_alias"))
1370 ;; BIND needs a native compiler because the DHCP
1371 ;; build system uses the built 'gen' executable.
d3f195f7 1372 (setenv "BUILD_CC" "gcc"))))
f8cbe98e 1373 '())
3344567b
EF
1374 (add-before 'build 'update-config-scripts
1375 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1376 (for-each (lambda (file)
1377 (install-file
1378 (search-input-file
1379 (or native-inputs inputs)
1380 (string-append "/bin/" file)) "."))
1381 '("config.guess" "config.sub"))
1382 (for-each (lambda (file)
1383 (install-file
1384 (search-input-file
1385 (or native-inputs inputs)
1386 (string-append "/bin/" file))
1387 (string-append "bind/bind-" ,bind-version)))
1388 '("config.guess" "config.sub"))))
6548b1e1
MW
1389 (add-after 'configure 'post-configure
1390 (lambda* (#:key outputs #:allow-other-keys)
1391 ;; Point to the right client script, which will be
1392 ;; installed in a later phase.
1393 (substitute* "includes/dhcpd.h"
1394 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
1395 (let ((out (assoc-ref outputs "out")))
1396 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
1397 out "/libexec/dhclient-script"
1398 "\"\n"))))
c73d4c92 1399
6548b1e1
MW
1400 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
1401 ;; we must patch shebangs in there and make sure the right
1402 ;; shell is used.
1403 (with-directory-excursion "bind"
1404 (substitute* "Makefile"
f7780fdf 1405 (("\\./configure ")
6548b1e1
MW
1406 (let ((sh (which "sh")))
1407 (string-append "./configure CONFIG_SHELL="
f7780fdf 1408 sh " SHELL=" sh " "))))
c73d4c92 1409
6548b1e1 1410 (let ((bind-directory (string-append "bind-" ,bind-version)))
d6acc9f8 1411 (invoke "tar" "xf" "bind.tar.gz")
6548b1e1
MW
1412 (for-each patch-shebang
1413 (find-files bind-directory ".*"))
f7780fdf
MW
1414 (substitute* (string-append bind-directory "/configure")
1415 (("/usr/bin/file")
1416 (which "file")))
d6acc9f8
MW
1417 (invoke "tar" "cf" "bind.tar.gz"
1418 bind-directory
1419 ;; avoid non-determinism in the archive
1420 "--sort=name"
1421 "--mtime=@0"
1422 "--owner=root:0"
1423 "--group=root:0")))))
6548b1e1 1424 (add-after 'install 'post-install
d3f195f7 1425 (lambda* (#:key inputs outputs #:allow-other-keys)
6548b1e1
MW
1426 ;; Install the dhclient script for GNU/Linux and make sure
1427 ;; if finds all the programs it needs.
1428 (let* ((out (assoc-ref outputs "out"))
1429 (libexec (string-append out "/libexec"))
17f168fc 1430 (coreutils (assoc-ref inputs "coreutils*"))
6548b1e1
MW
1431 (inetutils (assoc-ref inputs "inetutils"))
1432 (net-tools (assoc-ref inputs "net-tools"))
17f168fc 1433 (sed (assoc-ref inputs "sed*")))
6548b1e1
MW
1434 (substitute* "client/scripts/linux"
1435 (("/sbin/ip")
bc64d955 1436 (search-input-file inputs "/sbin/ip")))
c73d4c92 1437
6548b1e1
MW
1438 (mkdir-p libexec)
1439 (copy-file "client/scripts/linux"
1440 (string-append libexec "/dhclient-script"))
c73d4c92 1441
6548b1e1
MW
1442 (wrap-program
1443 (string-append libexec "/dhclient-script")
1444 `("PATH" ":" prefix
1445 ,(map (lambda (dir)
1446 (string-append dir "/bin:"
1447 dir "/sbin"))
d3f195f7 1448 (list inetutils net-tools coreutils sed))))))))))
c73d4c92 1449
f7780fdf 1450 (native-inputs
4ba35ccd 1451 (list config perl file))
c73d4c92 1452
6548b1e1 1453 (inputs `(("inetutils" ,inetutils)
d3f195f7 1454 ("bash" ,(canonical-package bash-minimal)) ;for wrap-program
9ec263b4
JN
1455 ,@(if (hurd-target?) '()
1456 `(("net-tools" ,net-tools)
1457 ("iproute" ,iproute)))
dc343935 1458
4bcc3908
TGR
1459 ;; isc-dhcp bundles a copy of BIND, which has proved vulnerable
1460 ;; in the past. Use a BIND-VERSION of our choosing instead.
6548b1e1
MW
1461 ("bind-source-tarball"
1462 ,(origin
1463 (method url-fetch)
8198b3db 1464 (uri (string-append "https://ftp.isc.org/isc/bind9/"
6548b1e1
MW
1465 bind-version
1466 "/bind-" bind-version ".tar.gz"))
1467 (sha256
1468 (base32
3076e695 1469 "1zsszgxs9043dfpxb6xs1iwk9jg7nxkl5pbawj8dlshnxkkzp3hd"))))
c73d4c92 1470
17f168fc
MO
1471 ("coreutils*" ,coreutils)
1472 ("sed*" ,sed)))
6548b1e1 1473
ee206133 1474 (home-page "https://www.isc.org/dhcp/")
6548b1e1
MW
1475 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
1476 (description
1477 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
c73d4c92
LC
1478reference implementation of all aspects of DHCP, through a suite of DHCP
1479tools: server, client, and relay agent.")
4e2432d1 1480 (license license:mpl2.0)
159a5e01 1481 (properties '((cpe-name . "dhcp"))))))
02c86a5e 1482
785c96fb
GLV
1483(define-public radvd
1484 (package
1485 (name "radvd")
1486 (version "2.19")
1487 (source
1488 (origin
1489 (method git-fetch)
1490 (uri (git-reference
1491 (url "https://github.com/radvd-project/radvd")
1492 (commit (string-append "v" version))))
1493 (file-name (git-file-name name version))
1494 (sha256
1495 (base32 "1df827m3vkjq2bcs5y9wg2cygvpdwl8ppl446qqhyym584gz54nl"))))
1496 (build-system gnu-build-system)
1497 (native-inputs
8394619b
LC
1498 (list autoconf
1499 automake
1500 bison
1501 check
1502 flex
1503 pkg-config))
785c96fb
GLV
1504 (arguments
1505 `(#:configure-flags '("--with-check")))
1506 (home-page "https://radvd.litech.org/")
1507 (synopsis "IPv6 Router Advertisement Daemon")
1508 (description
1509 "The Router Advertisement Daemon (radvd) is run on systems acting as IPv6
1510routers. It sends Router Advertisement messages specified by RFC 2461
1511periodically and when requested by a node sending a Router Solicitation
1512message. These messages are required for IPv6 stateless autoconfiguration.")
1513 (license (license:non-copyleft "file://COPYRIGHT"))))
1514
02c86a5e
LC
1515(define-public libpcap
1516 (package
1517 (name "libpcap")
3e908bb5 1518 (version "1.10.1")
02c86a5e
LC
1519 (source (origin
1520 (method url-fetch)
eeb8b0e6 1521 (uri (string-append "https://www.tcpdump.org/release/libpcap-"
02c86a5e
LC
1522 version ".tar.gz"))
1523 (sha256
1524 (base32
3e908bb5 1525 "1m5x26vlbymp90k1qh0w3nj2nxzyvfrmfmwpj17k81dgri55ya7d"))))
02c86a5e 1526 (build-system gnu-build-system)
24dd949c 1527 (native-inputs
8394619b 1528 (list bison flex))
24dd949c
TGR
1529 (arguments
1530 ;; There are some tests in testprogs/, but no automated test suite.
49dc5bb7
TGR
1531 `(#:tests? #f
1532 #:phases
1533 (modify-phases %standard-phases
1534 (add-after 'unpack 'omit-static-library
1535 ;; Neither build nor install libpcap.a.
1536 (lambda _
1537 (substitute* "Makefile.in"
1538 ((" libpcap\\.a") "")
1539 ((" install-archive ") " ")))))))
eeb8b0e6 1540 (home-page "https://www.tcpdump.org")
02c86a5e
LC
1541 (synopsis "Network packet capture library")
1542 (description
1543 "libpcap is an interface for user-level packet capture. It provides a
1544portable framework for low-level network monitoring. Applications include
1545network statistics collection, security monitoring, network debugging, etc.")
24dd949c
TGR
1546 (license (list license:bsd-4 ; fad-*.c and several other source files
1547 license:bsd-3 ; pcap/, sockutils.* & others
1548 license:bsd-2)))) ; the rest
02c86a5e 1549
1da34f5a
LC
1550(define-public tcpdump
1551 (package
1552 (name "tcpdump")
eca228eb 1553 (version "4.99.1")
1da34f5a
LC
1554 (source (origin
1555 (method url-fetch)
eeb8b0e6 1556 (uri (string-append "https://www.tcpdump.org/release/tcpdump-"
73a2ef36 1557 version ".tar.gz"))
1da34f5a
LC
1558 (sha256
1559 (base32
eca228eb 1560 "1ghfs5gifzrk3813zf9zalfbjs70wg6llz6q31k180r7zf2nkcvr"))))
1da34f5a 1561 (build-system gnu-build-system)
8394619b
LC
1562 (inputs (list libpcap openssl))
1563 (native-inputs (list perl)) ; for tests
eeb8b0e6 1564 (home-page "https://www.tcpdump.org/")
1da34f5a
LC
1565 (synopsis "Network packet analyzer")
1566 (description
1567 "Tcpdump is a command-line tool to analyze network traffic passing
1568through the network interface controller.")
f61e0e79 1569 (license license:bsd-3)))
1da34f5a 1570
02c86a5e
LC
1571(define-public jnettop
1572 (package
1573 (name "jnettop")
1574 (version "0.13.0")
1575 (source (origin
1576 (method url-fetch)
53923b0f
BH
1577 (uri
1578 (string-append "https://web.archive.org/web/20161221100811/"
1579 "http://jnettop.kubs.info/dist/jnettop-"
1580 version ".tar.gz"))
02c86a5e
LC
1581 (sha256
1582 (base32
1583 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
1584 (build-system gnu-build-system)
1585 (native-inputs
8394619b 1586 (list pkg-config))
02c86a5e 1587 (inputs
8394619b 1588 (list glib ncurses libpcap))
53923b0f
BH
1589 (home-page
1590 "https://web.archive.org/web/20160703195221/http://jnettop.kubs.info/wiki/")
02c86a5e
LC
1591 (synopsis "Visualize network traffic by bandwidth use")
1592 (description
1593 "Jnettop is a traffic visualiser, which captures traffic going
1594through the host it is running from and displays streams sorted
1595by bandwidth they use.")
f61e0e79 1596 (license license:gpl2+)))
87216303
EB
1597
1598(define-public clusterssh
1599 (package
1600 (name "clusterssh")
c5829179 1601 (version "4.13.2")
87216303
EB
1602 (source (origin
1603 (method url-fetch)
1604 (uri (string-append "mirror://sourceforge/clusterssh/"
c5829179
KK
1605 "2.%20ClusterSSH%20Series%204/"
1606 "App-ClusterSSH-v" version ".tar.gz"))
87216303
EB
1607 (sha256
1608 (base32
c5829179
KK
1609 "0rmk2p3f2wz1h092anidjclh212rv3gxyk0c641qk3frlrjnw6mp"))))
1610 (build-system perl-build-system)
12ea2571
TGR
1611 (arguments
1612 `(#:phases
1613 (modify-phases %standard-phases
1614 (add-after 'unpack 'refer-to-inputs
1615 (lambda* (#:key inputs #:allow-other-keys)
1616 (substitute* (list "lib/App/ClusterSSH/Config.pm"
1617 "t/15config.t")
1618 (("xterm")
1619 (which "xterm")))
1620 #t))
1621 (add-before 'check 'delete-failing-tests
1622 (lambda _
1623 ;; This checks whether all code is nicely formatted. The above
1624 ;; ‘refer-to-inputs’ phase breaks this pedantry, so disable it.
1625 (delete-file "t/perltidy.t")
1626 ;; Update the manifest so t/manifest.t happily passes.
1627 (substitute* "MANIFEST"
1628 (("t/perltidy.t\n") ""))
332a2765
TGR
1629 #t))
1630 (add-after 'install 'augment-library-path
1631 (lambda* (#:key inputs outputs #:allow-other-keys)
1632 (let* ((out (assoc-ref outputs "out"))
1633 (bin (string-append out "/bin")))
1634 (with-directory-excursion bin
1635 (for-each
1636 (lambda (program)
1637 (wrap-program program
1638 `("PERL5LIB" ":" prefix
1639 ,(map (lambda (file-name)
1640 (string-append file-name
1641 "/lib/perl5/site_perl"))
1642 (cons out
1643 (map (lambda (input)
1644 (assoc-ref inputs input))
1645 ;; These may be propagated and hence
1646 ;; not explicitly listed as inputs.
1647 (list "perl-class-data-inheritable"
1648 "perl-devel-stacktrace"
1649 "perl-exception-class"
1650 "perl-tk"
1651 "perl-try-tiny"
1652 "perl-x11-protocol"
1653 "perl-x11-protocol-other")))))))
1654 (find-files "." ".*")))
1655 #t))))))
c5829179 1656 (native-inputs
8394619b
LC
1657 (list perl-cpan-changes
1658 perl-file-slurp
1659 perl-file-which
1660 perl-module-build
1661 perl-readonly
1662 perl-test-differences
1663 perl-test-distmanifest
1664 perl-test-perltidy
1665 perl-test-pod
1666 perl-test-pod-coverage
1667 perl-test-trap
1668 perltidy))
12ea2571 1669 (inputs
8394619b
LC
1670 (list perl-exception-class
1671 perl-sort-naturally
1672 perl-tk
1673 perl-try-tiny
1674 perl-x11-protocol
1675 perl-x11-protocol-other
1676 xterm))
87216303 1677 ;; The clusterssh.sourceforge.net address requires login to view
3b3b60d0 1678 (home-page "https://sourceforge.net/projects/clusterssh/")
87216303
EB
1679 (synopsis "Secure concurrent multi-server terminal control")
1680 (description
1681 "ClusterSSH controls a number of xterm windows via a single graphical
1682console window to allow commands to be interactively run on multiple servers
1683over ssh connections.")
f61e0e79 1684 (license license:gpl2+)))
fccf2fe0 1685
0ba4e94e
PH
1686(define-public realmd
1687 (package
1688 (name "realmd")
1689 (version "0.17.0")
1690 (source
1691 (origin
1692 (method git-fetch)
1693 (uri (git-reference
1694 (url "https://github.com/freedesktop/realmd")
1695 (commit version)))
1696 (file-name (git-file-name name version))
1697 (sha256
1698 (base32
1699 "1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"))))
1700 (build-system gnu-build-system)
1701 (arguments
1702 `(#:configure-flags '("--with-systemd-unit-dir=no"
1703 "--with-systemd-journal=no"
1704 "--with-distro=GNU guix"
1705 "--disable-doc")
1706 #:phases
1707 (modify-phases %standard-phases
1708 (add-before 'install 'fix-service
1709 (lambda* (#:key outputs #:allow-other-keys)
1710 ;; GNU Guix does not have service config file, therefore we remove
1711 ;; the line that copies the file.
1712 (substitute* "Makefile"
1713 ((".*/service/realmd-.*") "")))))))
1714 (native-inputs
1715 `(("autoconf" ,autoconf)
1716 ("automake" ,automake)
1717 ("glib-bin" ,glib "bin")
1718 ("intltool" ,intltool)
1719 ("pkg-config" ,pkg-config)
1720 ("python" ,python)))
1721 (inputs
8394619b 1722 (list glib mit-krb5 openldap polkit))
0ba4e94e
PH
1723 (synopsis "DBus service for network authentication")
1724 (description "This package provides an on demand system DBus service.
1725It allows callers to configure network authentication and domain membership
1726in a standard way. Realmd discovers information about the domain or realm
1727automatically and does not require complicated configuration in order to join
1728a domain or realm. Dbus system service that manages discovery and enrollment in
1729realms/domains like Active Directory or IPA.")
1730 (home-page "https://www.freedesktop.org/software/realmd/")
1731 (license license:lgpl2.1+)))
1732
d1ce1125
MB
1733(define-public rename
1734 (package
1735 (name "rename")
0db873dd 1736 (version "1.10")
d1ce1125
MB
1737 (source (origin
1738 (method url-fetch)
1739 (uri (string-append
1740 "mirror://cpan/authors/id/R/RM/RMBARKER/File-Rename-"
1741 version ".tar.gz"))
1742 (sha256
1743 (base32
0db873dd 1744 "137m8s06r4n038ivlr5r1d9a7q9l7shmwpvnyx053r9ndhvbnkh5"))))
d1ce1125 1745 (build-system perl-build-system)
e6dcf9ca
TGR
1746 (arguments
1747 `(#:phases
1748 (modify-phases %standard-phases
1749 (add-after 'install 'find-itself
1750 ;; Fix run-time 'Can't locate File/Rename.pm in @INC' failure.
1751 (lambda* (#:key outputs #:allow-other-keys)
1752 (let* ((out (assoc-ref outputs "out"))
1753 (bin (string-append out "/bin")))
1754 (with-directory-excursion bin
1755 (for-each
1756 (lambda (program)
1757 (wrap-program program
1758 `("PERL5LIB" ":" prefix
1759 (,(string-append out "/lib/perl5/site_perl")))))
1760 (find-files "." ".*")))
1761 #t))))))
d1ce1125 1762 (native-inputs
8394619b 1763 (list perl-module-build perl-test-pod perl-test-pod-coverage))
d1ce1125
MB
1764 (home-page "https://metacpan.org/pod/distribution/File-Rename/rename.PL")
1765 (synopsis "Perl extension for renaming multiple files")
1766 (description
1767 "This package provides a Perl interface (@code{Perl::Rename}) as well
1768as a command-line utility (@command{rename}) that can rename multiple files
1769at once based on a Perl regular expression.")
1770 (license license:perl-license)))
1771
fccf2fe0
LC
1772(define-public rottlog
1773 (package
1774 (name "rottlog")
1775 (version "0.72.2")
1776 (source (origin
1777 (method url-fetch)
1778 (uri (string-append "mirror://gnu/rottlog/rottlog-"
1779 version ".tar.gz"))
1780 (sha256
1781 (base32
1782 "0751mb9l2f0jrk3vj6q8ilanifd121dliwk0c34g8k0dlzsv3kd7"))
1783 (modules '((guix build utils)))
1784 (snippet
6cbee49d
MW
1785 '(begin
1786 (substitute* "Makefile.in"
1787 (("-o \\$\\{LOG_OWN\\} -g \\$\\{LOG_GROUP\\}")
1788 ;; Don't try to chown root.
1789 "")
1790 (("mkdir -p \\$\\(ROTT_STATDIR\\)")
1791 ;; Don't attempt to create /var/lib/rottlog.
1792 "true"))
1793 #t))))
fccf2fe0
LC
1794 (build-system gnu-build-system)
1795 (arguments
ef9652ef 1796 `(#:configure-flags (list "ROTT_ETCDIR=/etc/rottlog" ;rc file location
fccf2fe0 1797 "--localstatedir=/var")
268ad34e
LC
1798
1799 ;; Install example config files in OUT/etc.
1800 #:make-flags (list (string-append "ROTT_ETCDIR="
1801 (assoc-ref %outputs "out")
1802 "/etc"))
1803
8dc0ecae 1804 #:phases (modify-phases %standard-phases
d436c6b5 1805 (add-after 'unpack 'patch-paths
72861d8e 1806 (lambda* (#:key inputs #:allow-other-keys)
d436c6b5 1807 (substitute* "rc/rc"
72861d8e 1808 (("/usr/sbin/sendmail")
bc64d955 1809 (search-input-file inputs "/bin/mail")))
d436c6b5 1810 #t))
ef9652ef
MO
1811 (add-after 'unpack 'fix-configure
1812 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1813 ;; Replace outdated config.sub and config.guess:
1814 (for-each (lambda (file)
1815 (install-file
1816 (string-append
1817 (assoc-ref
1818 (or native-inputs inputs) "automake")
1819 "/share/automake-"
1820 ,(version-major+minor
1821 (package-version automake))
1822 "/" file) "."))
1823 '("config.sub" "config.guess"))
1824 #t))
11e74634
JN
1825 (add-after 'build 'set-packdir
1826 (lambda _
1827 ;; Set a default location for archived logs.
1828 (substitute* "rc/rc"
1829 (("packdir=\"\"")
1830 "packdir=\"/var/log\""))
1831 #t))
309e523e 1832 (add-before 'install 'tweak-rc-weekly
d81b89bf 1833 (lambda* (#:key inputs #:allow-other-keys)
309e523e
LC
1834 (substitute* "rc/weekly"
1835 (("/bin/kill")
a3a6931c 1836 (search-input-file inputs "/bin/kill"))
309e523e
LC
1837 (("syslogd\\.pid")
1838 ;; The file is called 'syslog.pid' (no 'd').
a3a6931c 1839 "syslog.pid"))))
8dc0ecae
LC
1840 (add-after 'install 'install-info
1841 (lambda _
cb8ba848 1842 (invoke "make" "install-info"))))))
8394619b 1843 (native-inputs (list texinfo automake util-linux)) ; for 'cal'
a3a6931c 1844 (inputs (list coreutils mailutils))
6fd52309 1845 (home-page "https://www.gnu.org/software/rottlog/")
fccf2fe0
LC
1846 (synopsis "Log rotation and management")
1847 (description
1848 "GNU Rot[t]log is a program for managing log files. It is used to
1849automatically rotate out log files when they have reached a given size or
1850according to a given schedule. It can also be used to automatically compress
1851and archive such logs. Rot[t]log will mail reports of its activity to the
1852system administrator.")
f61e0e79 1853 (license license:gpl3+)))
e1485c7b
LC
1854
1855(define-public sudo
1856 (package
1857 (name "sudo")
3589537d 1858 (version "1.9.11p3")
e1485c7b
LC
1859 (source (origin
1860 (method url-fetch)
1861 (uri
6baa83d2 1862 (list (string-append "https://www.sudo.ws/sudo/dist/sudo-"
e1485c7b
LC
1863 version ".tar.gz")
1864 (string-append "ftp://ftp.sudo.ws/pub/sudo/OLD/sudo-"
1865 version ".tar.gz")))
1866 (sha256
1867 (base32
3589537d 1868 "0w0z9w4vnhjsc4jjghi6wlyv4v055hsy38ncb67p08b7yp9fg1s6"))
6b7f1b6c
MB
1869 (modules '((guix build utils)))
1870 (snippet
6cbee49d 1871 '(begin
aa6a3976 1872 (delete-file-recursively "lib/zlib")))))
e1485c7b 1873 (build-system gnu-build-system)
165e0918 1874 (outputs (list "out"))
e1485c7b 1875 (arguments
0086ec73 1876 `(#:configure-flags
6fa393e2
TGR
1877 (list (string-append "--docdir=" (assoc-ref %outputs "out")
1878 "/share/doc/" ,name "-" ,version)
1879
1880 "--with-logpath=/var/log/sudo.log"
8e950ee9 1881 "--with-rundir=/var/run/sudo" ; must be cleaned up at boot time
0086ec73
LC
1882 "--with-vardir=/var/db/sudo"
1883 "--with-iologdir=/var/log/sudo-io"
1884
1885 ;; 'visudo.c' expects _PATH_MV to be defined, but glibc doesn't
1886 ;; provide it.
1887 (string-append "CPPFLAGS=-D_PATH_MV='\""
1888 (assoc-ref %build-inputs "coreutils")
1889 "/bin/mv\"'"))
511495fb
LC
1890
1891 ;; Avoid non-determinism; see <http://bugs.gnu.org/21918>.
1892 #:parallel-build? #f
1893
7fae2063
TGR
1894 #:phases
1895 (modify-phases %standard-phases
1896 (add-before 'configure 'pre-configure
1897 (lambda _
1898 (substitute* "src/sudo_usage.h.in"
1899 ;; Do not capture 'configure' arguments since we would
1900 ;; unduly retain references, and also because the
1901 ;; CPPFLAGS above would close the string literal
1902 ;; prematurely.
1903 (("@CONFIGURE_ARGS@") "\"\""))
1904 (substitute* (find-files "." "Makefile\\.in")
6f6dbf2a 1905 ;; Allow installation as non-root.
7fae2063 1906 (("-o [[:graph:]]+ -g [[:graph:]]+")
7fae2063 1907 "")
6f6dbf2a 1908 ;; Don't try to create /etc/sudoers.
7fae2063 1909 (("^install: (.*)install-sudoers(.*)" _ before after)
7fae2063 1910 (string-append "install: " before after "\n"))
6f6dbf2a 1911 ;; Don't try to create /run/sudo.
7fae2063 1912 (("\\$\\(DESTDIR\\)\\$\\(rundir\\)")
7fae2063 1913 "$(TMPDIR)/dummy")
6f6dbf2a
TGR
1914 ;; Install example sudo{,_logsrvd}.conf to the right place.
1915 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
1916 "$(DESTDIR)/$(docdir)/examples")
1917 ;; Don't try to create /var/db/sudo.
7fae2063 1918 (("\\$\\(DESTDIR\\)\\$\\(vardir\\)")
4b052c6a 1919 "$(TMPDIR)/dummy"))
cbaf756c
TGR
1920
1921 ;; ‘Checking existing [/etc/]sudoers file for syntax errors’ is
1922 ;; not the task of the build system, and fails.
1923 (substitute* "plugins/sudoers/Makefile.in"
1924 (("^pre-install:" match)
aa6a3976 1925 (string-append match "\ndisabled-" match))))))
e1485c7b
LC
1926
1927 ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
1928 ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.
1929 #:tests? #f))
913c8897 1930 (native-inputs
8394619b 1931 (list groff))
e1485c7b 1932 (inputs
452244e6 1933 `(("coreutils" ,coreutils)
0e2abaca
EF
1934 ,@(if (hurd-target?)
1935 '()
1936 `(("linux-pam" ,linux-pam)))
452244e6 1937 ("zlib" ,zlib)))
6baa83d2 1938 (home-page "https://www.sudo.ws/")
e1485c7b
LC
1939 (synopsis "Run commands as root")
1940 (description
1941 "Sudo (su \"do\") allows a system administrator to delegate authority to
1942give certain users (or groups of users) the ability to run some (or all)
1943commands as root or another user while providing an audit trail of the
1944commands and their arguments.")
1945
1946 ;; See <http://www.sudo.ws/sudo/license.html>.
f61e0e79 1947 (license license:x11)))
952298d7 1948
248af684
MS
1949(define-public opendoas
1950 (package
1951 (name "opendoas")
a0a3ff72 1952 (version "6.8.2")
248af684
MS
1953 (source (origin
1954 (method git-fetch)
1955 (uri (git-reference
b0e7b699 1956 (url "https://github.com/Duncaen/OpenDoas")
248af684
MS
1957 (commit (string-append "v" version))))
1958 (file-name (git-file-name name version))
1959 (sha256
1960 (base32
a0a3ff72 1961 "1qrin7x9vcprk5pwjbr3w8z2qj8hk6xbvxicdhlk27xr6vcr1qzn"))))
248af684
MS
1962 (build-system gnu-build-system)
1963 (arguments
1964 `(#:phases
1965 (modify-phases %standard-phases
eb939109
BW
1966 (add-before 'configure 'pre-configure
1967 (lambda* (#:key outputs #:allow-other-keys)
1968 (substitute* "GNUmakefile"
1969 (("^\tchown.*$") ""))
a0a3ff72 1970 ;; OpenDoas looks for binaries in safepath when a rule specifies a
eb939109
BW
1971 ;; relative command, such as “permit keepenv :wheel cmd guix”.
1972 (substitute* "doas.c"
1973 (("safepath =" match)
1974 (string-append match " \""
1975 "/run/setuid-programs:"
1976 "/run/current-system/profile/bin:"
1977 "/run/current-system/profile/sbin:"
a0a3ff72 1978 "\" ")))))
248af684
MS
1979 (replace 'configure
1980 ;; The configure script doesn't accept most of the default flags.
1981 (lambda* (#:key configure-flags #:allow-other-keys)
8d2ee4c5 1982 ;; The configure script can be told which compiler to use only
248af684
MS
1983 ;; through environment variables.
1984 (setenv "CC" ,(cc-for-target))
eb939109 1985 (apply invoke "./configure" configure-flags))))
248af684
MS
1986 #:configure-flags
1987 (list (string-append "--prefix=" (assoc-ref %outputs "out"))
248af684
MS
1988 "--with-timestamp")
1989 ;; Compiler choice is not carried over from the configure script.
1990 #:make-flags
1991 (list (string-append "CC=" ,(cc-for-target)))
1992 #:tests? #f)) ; no test suite
1993 (native-inputs
8394619b 1994 (list bison))
248af684
MS
1995 (home-page "https://github.com/Duncaen/OpenDoas")
1996 (synopsis "Portable version of OpenBSD's doas command")
1997 (description "Doas is a minimal replacement for the venerable sudo. It was
1998initially written by Ted Unangst of the OpenBSD project to provide 95% of the
1999features of sudo with a fraction of the codebase.")
2000 (license (list license:bsd-3 ; libbsd/*
2001 license:isc)))) ; everything else
2002
1ce6f43a 2003(define-public wpa-supplicant-minimal
952298d7 2004 (package
1ce6f43a 2005 (name "wpa-supplicant-minimal")
d331bd0a 2006 (version "2.10")
952298d7
LC
2007 (source (origin
2008 (method url-fetch)
2009 (uri (string-append
eeb8b0e6 2010 "https://w1.fi/releases/wpa_supplicant-"
aeb1ed1a 2011 version ".tar.gz"))
952298d7
LC
2012 (sha256
2013 (base32
d331bd0a 2014 "0bvvw7bx149a57llzrwzlpggyym84f8jdd4abwsk0f2b2pjpmpr0"))
aeb1ed1a
MB
2015 (modules '((guix build utils)))
2016 (snippet
2017 '(begin
2018 (substitute* "wpa_supplicant/defconfig"
2019 ;; Disable D-Bus to save ~14MiB on the closure size.
2020 (("^CONFIG_CTRL_IFACE_DBUS" line _)
2021 (string-append "#" line)))
d331bd0a 2022 #t))))
952298d7
LC
2023 (build-system gnu-build-system)
2024 (arguments
8ec5adce 2025 `(#:phases
dc1d3cde
KK
2026 (modify-phases %standard-phases
2027 (replace 'configure
8ec5adce 2028 (lambda _
dc1d3cde
KK
2029 (chdir "wpa_supplicant")
2030 (copy-file "defconfig" ".config")
2031 (let ((port (open-file ".config" "al")))
2032 (display "
952298d7 2033 CONFIG_DEBUG_SYSLOG=y
40b4c6d6 2034
aeb1ed1a 2035 CONFIG_TLS=openssl
61bdd0d8 2036
952298d7
LC
2037 CONFIG_DRIVER_NL80211=y
2038 CFLAGS += $(shell pkg-config libnl-3.0 --cflags)
2039 CONFIG_LIBNL32=y
2040 CONFIG_READLINE=y\n" port)
cb8ba848 2041 (close-port port))
8ec5adce
EF
2042 ;; Make sure we have a pkg-config when cross compiling
2043 (substitute* '(".config"
2044 "Android.mk"
2045 "Makefile"
2046 "dbus/Makefile")
2047 (("pkg-config")
2048 (or (which "pkg-config")
2049 (which (string-append ,(%current-target-system)
2050 "-pkg-config")))))
cb8ba848 2051 #t))
3b165f2a 2052 (add-after 'install 'install-documentation
dc1d3cde
KK
2053 (lambda* (#:key outputs #:allow-other-keys)
2054 (let* ((out (assoc-ref outputs "out"))
3b165f2a 2055 (doc (string-append out "/share/doc/wpa-supplicant"))
dc1d3cde
KK
2056 (man (string-append out "/share/man"))
2057 (man5 (string-append man "/man5"))
2058 (man8 (string-append man "/man8")))
2059 (define (copy-man-page target)
2060 (lambda (file)
2061 (install-file file target)))
2062
2063 (mkdir-p man5) (mkdir man8)
2064 (for-each (copy-man-page man5)
2065 (find-files "doc/docbook" "\\.5"))
2066 (for-each (copy-man-page man8)
2067 (find-files "doc/docbook" "\\.8"))
3b165f2a
TL
2068
2069 ;; wpa_supplicant.conf(5) does not explain all configuration
2070 ;; options but refers to the example config file, so install it
2071 ;; along with READMEs.
2072 (for-each (lambda (file)
2073 (install-file file doc))
2074 '("README" "README-DPP" "README-HS20"
2075 "README-P2P" "README-WPS"
2076 "wpa_supplicant.conf"))
dc1d3cde 2077 #t))))
952298d7 2078
8ec5adce 2079 #:make-flags (list (string-append "CC=" ,(cc-for-target))
952298d7
LC
2080 (string-append "BINDIR=" (assoc-ref %outputs "out")
2081 "/sbin")
2082 (string-append "LIBDIR=" (assoc-ref %outputs "out")
2083 "/lib"))
2084 #:tests? #f))
2085 (inputs
8394619b 2086 (list readline libnl openssl))
952298d7 2087 (native-inputs
8394619b 2088 (list pkg-config))
eeb8b0e6 2089 (home-page "https://w1.fi/wpa_supplicant/")
952298d7
LC
2090 (synopsis "Connecting to WPA and WPA2-protected wireless networks")
2091 (description
2092 "wpa_supplicant is a WPA Supplicant with support for WPA and WPA2 (IEEE
2093802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in
2094the client stations. It implements key negotiation with a WPA Authenticator
2095and it controls the roaming and IEEE 802.11 authentication/association of the
2096WLAN driver.
2097
36a4366d
EF
2098This package provides the @code{wpa_supplicant} daemon and the @code{wpa_cli}
2099command.")
952298d7
LC
2100
2101 ;; In practice, this is linked against Readline, which makes it GPLv3+.
107b081e
LC
2102 (license license:bsd-3)
2103
2104 (properties `((cpe-name . "wpa_supplicant")))))
c6b76405 2105
4fb7e0de 2106(define-public wpa-supplicant
1ce6f43a 2107 (package (inherit wpa-supplicant-minimal)
4fb7e0de 2108 (name "wpa-supplicant")
8394619b
LC
2109 (inputs (modify-inputs (package-inputs wpa-supplicant-minimal)
2110 (prepend dbus)))
4fb7e0de 2111 (arguments
1ce6f43a 2112 (substitute-keyword-arguments (package-arguments wpa-supplicant-minimal)
4fb7e0de 2113 ((#:phases phases)
dc1d3cde
KK
2114 `(modify-phases ,phases
2115 (add-after 'configure 'configure-for-dbus
2116 (lambda _
2117 (let ((port (open-file ".config" "al")))
2118 (display "
4fb7e0de
MW
2119 CONFIG_CTRL_IFACE_DBUS_NEW=y
2120 CONFIG_CTRL_IFACE_DBUS_INTRO=y\n" port)
dc1d3cde
KK
2121 (close-port port))
2122 #t))
3b165f2a 2123 (add-after 'install-documentation 'install-dbus-conf
dc1d3cde
KK
2124 (lambda* (#:key outputs #:allow-other-keys)
2125 (let* ((out (assoc-ref outputs "out"))
544a886a
RR
2126 (interfaces (string-append out "/etc/dbus-1/system.d"))
2127 (services (string-append out
2128 "/share/dbus-1/system-services")))
2129 (mkdir-p interfaces)
dc1d3cde 2130 (copy-file "dbus/dbus-wpa_supplicant.conf"
544a886a
RR
2131 (string-append interfaces "/wpa_supplicant.conf"))
2132 (mkdir-p services)
2133 (copy-file "dbus/fi.w1.wpa_supplicant1.service"
2134 (string-append services
2135 "/fi.w1.wpa_supplicant1.service")))
dc1d3cde 2136 #t))))))))
4fb7e0de 2137
050e5756
MB
2138(define-public wpa-supplicant-gui
2139 (package
2140 (inherit wpa-supplicant)
2141 (name "wpa-supplicant-gui")
8394619b 2142 (inputs (modify-inputs (package-inputs wpa-supplicant)
1ef04fb2 2143 (prepend qtbase-5 qtsvg-5)))
050e5756
MB
2144 (native-inputs
2145 ;; For icons.
8394619b 2146 (modify-inputs (package-native-inputs wpa-supplicant)
023259c4 2147 (prepend imagemagick inkscape/stable)))
050e5756
MB
2148 (arguments
2149 `(#:phases (modify-phases %standard-phases
2150 (add-after 'unpack 'chdir
2151 (lambda _
2152 (chdir "wpa_supplicant/wpa_gui-qt4")
2153 #t))
2154 (delete 'configure)
2155 (replace 'build
2156 (lambda _
2157 (invoke "qmake" "wpa_gui.pro")
2158 (invoke "make" "-j" (number->string (parallel-job-count)))
2159 (invoke "make" "-C" "icons")))
2160 (replace 'install
2161 (lambda* (#:key inputs outputs #:allow-other-keys)
2162 (let ((out (assoc-ref outputs "out"))
1ef04fb2 2163 (qt '("qtbase" "qtsvg-5")))
050e5756
MB
2164 (install-file "wpa_gui" (string-append out "/bin"))
2165 (install-file "wpa_gui.desktop"
2166 (string-append out "/share/applications"))
2167 (copy-recursively "icons/hicolor"
2168 (string-append out "/share/icons/hicolor"))
2169 (wrap-program (string-append out "/bin/wpa_gui")
2170 `("QT_PLUGIN_PATH" ":" prefix
2171 ,(map (lambda (label)
2172 (string-append (assoc-ref inputs label)
2173 "/lib/qt5/plugins/"))
2174 qt)))
2175 #t))))))
2176 (synopsis "Graphical user interface for WPA supplicant")))
2177
56038bac
LC
2178(define-public hostapd
2179 (package
2180 (name "hostapd")
07efa9df 2181 (version "2.10")
56038bac
LC
2182 (source (origin
2183 (method url-fetch)
2184 (uri (string-append "https://w1.fi/releases/hostapd-" version
2185 ".tar.gz"))
2186 (sha256
2187 (base32
07efa9df 2188 "0pcik0a6yin9nib02frjhaglmg44hwik086iwg1751b7kdwpqvi0"))))
56038bac
LC
2189 (build-system gnu-build-system)
2190 (arguments
a41fee18
TGR
2191 (list #:phases
2192 #~(modify-phases %standard-phases
2193 (replace 'configure
2194 (lambda _
2195 ;; This is mostly copied from 'wpa-supplicant' above.
2196 (chdir "hostapd")
2197 (copy-file "defconfig" ".config")
2198 (let ((port (open-file ".config" "al")))
2199 (display "CONFIG_LIBNL32=y
2200 CONFIG_IEEE80211R=y
2201 CONFIG_IEEE80211N=y
2202 CONFIG_IEEE80211AC=y\n" port)
2203 (close-port port))))
2204 (add-after 'unpack 'patch-pkg-config
2205 (lambda _
2206 (substitute* "src/drivers/drivers.mak"
2207 (("pkg-config")
2208 #$(pkg-config-for-target)))))
2209 (add-after 'install 'install-man-pages
2210 (lambda* (#:key outputs #:allow-other-keys)
2211 (let* ((man (string-append #$output "/share/man"))
2212 (man1 (string-append man "/man1"))
2213 (man8 (string-append man "/man8")))
2214 (define (copy-man-page target)
2215 (lambda (file)
2216 (install-file file target)))
2217 (for-each (copy-man-page man1)
2218 (find-files "." "\\.1"))
2219 (for-each (copy-man-page man8)
2220 (find-files "." "\\.8"))))))
2221 #:make-flags
2222 #~(list (string-append "CC=" #$(cc-for-target))
2223 (string-append "BINDIR=" #$output "/sbin")
2224 (string-append "LIBDIR=" #$output "/lib"))
2225 #:tests? #f))
8394619b 2226 (native-inputs (list pkg-config))
56038bac
LC
2227
2228 ;; There's an optional dependency on SQLite.
8394619b 2229 (inputs (list openssl libnl))
56038bac
LC
2230 (home-page "https://w1.fi/hostapd/")
2231 (synopsis "Daemon for Wi-Fi access points and authentication servers")
2232 (description
2233 "hostapd is a user-space daemon for WiFi access points and authentication
2234servers. It implements IEEE 802.11 access point management, IEEE
2235802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS
2236authentication server.")
2237
2238 ;; Same license as wpa_supplicant.
2239 (license license:bsd-3)))
2240
c6b76405
LC
2241(define-public wakelan
2242 (package
2243 (name "wakelan")
2244 (version "1.1")
2245 (source (origin
2246 (method url-fetch)
2247 (uri (string-append
2248 "ftp://ftp.gwdg.de/pub/linux/metalab/system/network/misc/wakelan-"
2249 version ".tar.gz"))
2250 (sha256
2251 (base32
2252 "0vydqpf44146ir6k87gmqaq6xy66xhc1gkr3nsd7jj3nhy7ypx9x"))))
2253 (build-system gnu-build-system)
2254 (arguments
dc1d3cde
KK
2255 '(#:phases
2256 (modify-phases %standard-phases
2257 (replace 'configure
2258 (lambda* (#:key outputs #:allow-other-keys)
2259 (let ((out (assoc-ref outputs "out")))
2260 (mkdir-p (string-append out "/bin"))
2261 (mkdir-p (string-append out "/share/man/man1"))
2262
2263 ;; It's an old configure script that doesn't understand
2264 ;; the extra options we pass.
2265 (setenv "CONFIG_SHELL" (which "bash"))
cb8ba848
MW
2266 (invoke "./configure"
2267 (string-append "--prefix=" out)
2268 (string-append "--mandir=" out
2269 "/share/man"))))))
c6b76405 2270 #:tests? #f))
eeb8b0e6 2271 (home-page "https://www.kernel.org") ; really, no home page
c6b76405
LC
2272 (synopsis "Send a wake-on-LAN packet")
2273 (description
2274 "WakeLan broadcasts a properly formatted UDP packet across the local area
2275network, which causes enabled computers to power on.")
f61e0e79 2276 (license license:gpl2+)))
d43f4296
LC
2277
2278(define-public dmidecode
2279 (package
2280 (name "dmidecode")
e36fa380 2281 (version "3.4")
6f19c32b
TGR
2282 (source
2283 (origin
2284 (method url-fetch)
2285 (uri (string-append "mirror://savannah/dmidecode/dmidecode-"
2286 version ".tar.xz"))
2287 (sha256
e36fa380 2288 (base32 "04i2ahvqinkrnzfsbswplv9wff36xf9b3snvriwrjz26v18sijs3"))))
d43f4296
LC
2289 (build-system gnu-build-system)
2290 (arguments
06d2e722
TGR
2291 (list #:tests? #f ; no 'check' target
2292 #:make-flags
2293 #~(list (string-append "CC=" #$(cc-for-target))
2294 (string-append "prefix=" #$output))
2295 #:phases
2296 #~(modify-phases %standard-phases
2297 (delete 'configure)))) ; no configure script
340978d7 2298 (home-page "https://www.nongnu.org/dmidecode/")
d43f4296
LC
2299 (synopsis "Read hardware information from the BIOS")
2300 (description
2301 "Dmidecode reports information about your system's hardware as described
2302in your system BIOS according to the SMBIOS/DMI standard. This typically
2303includes system manufacturer, model name, serial number, BIOS version, asset
2304tag as well as a lot of other details of varying level of interest and
2305reliability depending on the manufacturer. This will often include usage
2306status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory
2307module slots, and the list of I/O ports (e.g. serial, parallel, USB).")
f61e0e79 2308 (license license:gpl2+)))
42dc3af5 2309
13c8c2bf
MW
2310(define-public acpica
2311 (package
2312 (name "acpica")
0bb09847 2313 (version "20220331")
13c8c2bf
MW
2314 (source (origin
2315 (method url-fetch)
2316 (uri (string-append
2317 "https://acpica.org/sites/acpica/files/acpica-unix2-"
4bacf9ce 2318 version ".tar.gz"))
13c8c2bf
MW
2319 (sha256
2320 (base32
0bb09847 2321 "0yjcl00nnnlw01sz6a1i5d3v75gr17mkbxkxfx2v344al33abk8w"))))
13c8c2bf 2322 (build-system gnu-build-system)
8394619b 2323 (native-inputs (list flex bison))
13c8c2bf 2324 (arguments
12110f94
EF
2325 `(#:make-flags (list (string-append "PREFIX=" %output)
2326 (string-append "CC=" ,(cc-for-target))
13c8c2bf
MW
2327 "HOST=_LINUX"
2328 "OPT_CFLAGS=-Wall -fno-strict-aliasing")
e56feffe 2329 #:tests? #f ; no 'check' target
dc1d3cde 2330 #:phases (modify-phases %standard-phases (delete 'configure))))
6c441efc 2331 (home-page "https://acpica.org/")
018be4ca 2332 (synopsis "Tools for the development and debugging of ACPI tables")
13c8c2bf 2333 (description
4d1e4af4
TGR
2334 "The @acronym{ACPICA, ACPI Component Architecture} project provides an
2335OS-independent reference implementation of the @acronym{ACPI, Advanced
2336Configuration and Power Interface} specification. ACPICA code contains those
2337portions of ACPI meant to be directly integrated into the host OS as a
2338kernel-resident subsystem, and a small set of tools to assist in developing and
2339debugging ACPI tables.
2340
2341This package contains only the user-space tools needed for ACPI table
13c8c2bf 2342development, not the kernel implementation of ACPI.")
e56feffe 2343 (license license:gpl2))) ; dual GPLv2/ACPICA Licence
4cf7bd2b 2344
bee9f97e
CB
2345(define-public s-tui
2346 (package
2347 (name "s-tui")
3e12376b 2348 (version "1.1.3")
bee9f97e
CB
2349 (source
2350 (origin
2351 (method url-fetch)
2352 (uri (pypi-uri "s-tui" version))
2353 (sha256
3e12376b 2354 (base32 "1l2ik5iwmb8vxa2aqdy62zfy3zfzbpq5a0pgpka2vvlw9ivpqy5p"))))
bee9f97e
CB
2355 (build-system python-build-system)
2356 (inputs
8394619b 2357 (list python-psutil python-urwid))
bee9f97e
CB
2358 (home-page "https://github.com/amanusk/s-tui")
2359 (synopsis "Interactive terminal stress test and monitoring tool")
2360 (description
2361 "The Stress Terminal UI displays graphs of the CPU frequency,
2362utilization, temperature and power.")
2363 (license license:gpl2+)))
2364
4cf7bd2b
MW
2365(define-public stress
2366 (package
2367 (name "stress")
ecc7de52 2368 (version "1.0.5")
4cf7bd2b
MW
2369 (source (origin
2370 (method url-fetch)
2371 (uri (string-append "mirror://debian/pool/main/s/stress/stress_"
2372 version ".orig.tar.gz"))
2373 (sha256
2374 (base32
ecc7de52 2375 "09shpd85g8dvpiw0mnwykss676g0s7lbi8ab37xjinb5lfff960p"))))
4cf7bd2b 2376 (build-system gnu-build-system)
ecc7de52 2377 (native-inputs
8394619b 2378 (list autoconf automake))
abf7fed5 2379 (home-page "https://packages.debian.org/sid/stress")
9e771e3b 2380 (synopsis "Impose load on and stress test a computer system")
4cf7bd2b 2381 (description
35b9e423 2382 "Stress is a tool that imposes a configurable amount of CPU, memory, I/O,
4cf7bd2b
MW
2383or disk stress on a POSIX-compliant operating system and reports any errors it
2384detects.
2385
35b9e423 2386Stress is not a benchmark. It is a tool used by system administrators to
4cf7bd2b
MW
2387evaluate how well their systems will scale, by kernel programmers to evaluate
2388perceived performance characteristics, and by systems programmers to expose
2389the classes of bugs which only or more frequently manifest themselves when the
2390system is under heavy load.")
f61e0e79 2391 (license license:gpl2+)))
b36fcf95 2392
04632218
TGR
2393(define-public stress-ng
2394 (package
2395 (name "stress-ng")
2396 (version "0.13.10")
2397 (source
2398 (origin
2399 (method git-fetch)
2400 (uri (git-reference
2401 (url "https://github.com/ColinIanKing/stress-ng")
2402 (commit (string-append "V" version))))
2403 (file-name (git-file-name name version))
2404 (sha256
2405 (base32 "1z9vjn2131iv3pwrh04z6r5ygi1qgad5bi3jhghcvc3v1b4k5ran"))))
2406 (build-system gnu-build-system)
2407 (arguments
2408 (list #:make-flags
2409 #~(list (string-append "CC=" #$(cc-for-target))
2410 (string-append "BINDIR=" #$output "/bin")
2411 ;; XXX Really: MAN1DIR, or man pages won't be found.
2412 (string-append "MANDIR=" #$output "/share/man/man1")
2413 (string-append "JOBDIR=" #$output
2414 "/share/stress-ng/example-jobs")
2415 (string-append "BASHDIR=" #$output
2416 "/share/bash-completion/completions"))
2417 #:test-target "lite-test"
2418 #:phases
2419 #~(modify-phases %standard-phases
2420 (delete 'configure) ; no configure script
2421 (add-after 'check 'check-a-little-harder
2422 ;; XXX Guix supports only one #:test-target. Run more tests.
2423 (lambda* (#:key tests? #:allow-other-keys #:rest args)
2424 (when tests?
2425 (substitute* "debian/tests/fast-test-all"
2426 (("EXCLUDE=\"" exclude=)
2427 (string-append exclude=
2428 ;; Fails if host kernel denies ptracing.
2429 "ptrace ")))
2430 (apply (assoc-ref %standard-phases 'check)
2431 `(,@args #:test-target "fast-test-all"))))))))
2432 (inputs
2433 (list keyutils
2434 kmod
2435 libaio
2436 libbsd
2437 libcap
2438 libgcrypt
2439 zlib))
2440 (home-page "https://github.com/ColinIanKing/stress-ng")
2441 (synopsis "Load and stress-test a computer system in various ways")
2442 (description
2443 "stress-ng stress-tests a computer system by exercising both physical
2444subsystems as operating system kernel interfaces. It can stress the CPU, cache,
2445disk, memory, socket and pipe I/O, scheduling, and much more, in various
2446selectable ways. This can trip hardware issues such as thermal overruns as well
2447as operating system bugs that occur only when a system is being thrashed hard.
2448
2449You can also measure test throughput rates, which can be useful to observe
2450performance changes across different operating system releases or types of
2451hardware. However, stress-ng is not a benchmark. Use it with caution: some of
2452the tests can make poorly designed hardware run dangerously hot or make the
2453whole system lock up.
2454
2455Compared to its inspiration, @command{stress}, @command{stress-ng} offers many
2456additional options such as the number of bogo operations to run, execution
2457metrics, verification of memory and computational operations, and considerably
2458more stress mechanisms.")
2459 (license license:gpl2+)))
2460
b36fcf95
EB
2461(define-public detox
2462 (package
2463 (name "detox")
99df1b2a 2464 (version "1.4.5")
b36fcf95 2465 (source (origin
c2d512d3
EB
2466 (method git-fetch)
2467 (uri (git-reference
b0e7b699 2468 (url "https://github.com/dharple/detox")
c2d512d3 2469 (commit (string-append "v" version))))
f1d4d79f 2470 (file-name (git-file-name name version))
b36fcf95
EB
2471 (sha256
2472 (base32
99df1b2a 2473 "116bgpbkh3c96h6vq0880rmnpb5kbnnlvvkpsrcib6928bj8lfvi"))))
b36fcf95 2474 (build-system gnu-build-system)
c2d512d3 2475 (native-inputs
8394619b 2476 (list autoconf automake flex))
b36fcf95 2477 (arguments
1a06cafc 2478 `(#:phases (modify-phases %standard-phases
c2d512d3
EB
2479 (add-after 'unpack 'delete-configure
2480 ;; The "configure" script is present, but otherwise the
2481 ;; project is not bootstrapped: missing install-sh and
2482 ;; Makefile.in, so delete it so the bootstrap phase will
2483 ;; take over.
1a06cafc
EB
2484 (lambda _ (delete-file "configure") #t))
2485 (replace 'check
2486 (lambda _
2487 (invoke "./tests/test.sh" "src/detox"))))))
c2d512d3 2488 (home-page "https://github.com/dharple/detox")
e881752c 2489 (synopsis "Clean up file names")
b36fcf95
EB
2490 (description
2491 "Detox is a program that renames files to make them easier to work with
2492under Unix and related operating systems. Spaces and various other unsafe
2493characters (such as \"$\") get replaced with \"_\". ISO 8859-1 (Latin-1)
2494characters can be replaced as well, as can UTF-8 characters.")
f61e0e79 2495 (license license:bsd-3)))
c4492a16 2496
15926aec
AS
2497(define-public tree
2498 (package
2499 (name "tree")
3aaab0c9 2500 (version "2.0.2")
15926aec
AS
2501 (source (origin
2502 (method url-fetch)
2503 (uri (string-append
2504 "http://mama.indstate.edu/users/ice/tree/src/tree-"
2505 version ".tgz"))
2506 (sha256
3aaab0c9 2507 (base32 "1bzfkr3kmn2v5x7ljir691fr9hhjvjxqsfz0fc5fgi6ki0fklsbx"))))
15926aec
AS
2508 (build-system gnu-build-system)
2509 (arguments
2d3bec89
EF
2510 (list
2511 #:phases
2512 #~(modify-phases %standard-phases
2513 (delete 'configure)) ; No configure script.
2514 #:tests? #f ; No check target.
2515 #:make-flags
2516 #~(list (string-append "PREFIX=" #$output)
2517 (string-append "CC=" #$(cc-for-target)))))
15926aec
AS
2518 (synopsis "Recursively list the contents of a directory")
2519 (description
2520 "Tree is a recursive directory listing command that produces a depth
2521indented listing of files, which is colorized ala dircolors if the LS_COLORS
2522environment variable is set and output is to tty.")
2523 (home-page "http://mama.indstate.edu/users/ice/tree/")
2524 (license license:gpl2+)))
2525
e693927a
SR
2526(define-public lr
2527 (package
2528 (name "lr")
2529 (version "1.5.1")
2530 (source
2531 (origin
2532 (method git-fetch)
2533 (uri (git-reference
2534 (url "https://git.vuxu.org/lr/")
2535 (commit (string-append "v" version))))
2536 (file-name (git-file-name name version))
2537 (sha256
2538 (base32 "1wv2acm4r5y5gg6f64v2hiwpg1f3lnr4fy1a9zssw77fmdc7ys3j"))))
2539 (build-system gnu-build-system)
2540 (arguments
2541 `(#:tests? #f
2542 #:make-flags (list (string-append "CC=" ,(cc-for-target))
2543 (string-append "PREFIX=" %output))
2544 #:phases (modify-phases %standard-phases
2545 (delete 'configure))))
2546 (synopsis "Tool to generate customized file listings")
2547 (description
2548 "lr is a tool for generating file listings, which includes the best
2549features of ls(1), find(1), stat(1) and du(1).")
2550 (home-page "https://git.vuxu.org/lr/about")
2551 (license license:expat)))
2552
c2619e10
LC
2553(define-public direvent
2554 (package
2555 (name "direvent")
a0c6b558 2556 (version "5.3")
c2619e10
LC
2557 (source (origin
2558 (method url-fetch)
2559 (uri (string-append "mirror://gnu/direvent/direvent-"
2560 version ".tar.gz"))
2561 (sha256
2562 (base32
a0c6b558 2563 "15y4jk5vlcd003bvf42c6z9zd4gz4pwqpwaapqmyk7x4gnksh1cl"))))
c2619e10
LC
2564 (build-system gnu-build-system)
2565 (arguments
65fdb84d
TGR
2566 (list #:phases
2567 #~(modify-phases %standard-phases
a0c6b558 2568 (add-before 'build 'substitute-file-names
65fdb84d
TGR
2569 (lambda* (#:key inputs #:allow-other-keys)
2570 ;; Use the right shell when executing the watcher and
2571 ;; user-provided shell commands.
2572 (let ((bash (assoc-ref inputs "bash")))
2573 (substitute* '("src/direvent.c" "src/progman.c")
2574 (("\"/bin/sh\"")
a0c6b558 2575 (string-append "\"" bash "/bin/sh\""))))
65fdb84d 2576
a0c6b558
TGR
2577 ;; Adjust the test suite similarly.
2578 (substitute* "tests/testsuite"
2579 (("(SHELL=|#![[:space:]]*)/bin/sh" _ prefix)
2580 (string-append prefix (which "sh")))
2581 (("/bin/kill")
2582 (which "kill"))))))))
1977e857 2583 (home-page "https://www.gnu.org.ua/software/direvent/")
c2619e10
LC
2584 (synopsis "Daemon to monitor directories for events such as file removal")
2585 (description
2586 "A daemon that monitors directories for events, such as creating,
35b9e423 2587deleting or modifying files. It can monitor different sets of directories for
c2619e10
LC
2588different events. When an event is detected, direvent calls a specified
2589external program with information about the event, such as the location
c5779c93
LC
2590within the file system where it occurred. Thus, \"direvent\" provides an
2591easy way to react immediately if given files undergo changes, for example, to
c2619e10 2592track changes in important system configuration files.")
f61e0e79 2593 (license license:gpl3+)))
da6c3749
TUBK
2594
2595(define-public libcap-ng
2596 (package
2597 (name "libcap-ng")
ef2a2401 2598 (version "0.8.3")
da6c3749
TUBK
2599 (source (origin
2600 (method url-fetch)
2601 (uri (string-append
eeb8b0e6 2602 "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-"
da6c3749
TUBK
2603 version ".tar.gz"))
2604 (sha256
2605 (base32
ef2a2401 2606 "0ba9dfga7chwf6lf7a03x1a30fgdy2pb4r7pnn1jzfr2is2gdmmy"))))
da6c3749 2607 (build-system gnu-build-system)
dd935df2
TGR
2608 (arguments
2609 `(#:configure-flags
644a9667
TGR
2610 (list "--disable-static"
2611 "--without-python")))
4a2982a1 2612 (home-page "https://people.redhat.com/sgrubb/libcap-ng/")
da6c3749
TUBK
2613 (synopsis "Library for more easily working with POSIX capabilities")
2614 (description
2615 "The libcap-ng library is intended to make programming with POSIX
2616capabilities easier than the traditional libcap library. It includes
2617utilities that can analyse all currently running applications and print out
2618any capabilities and whether or not it has an open ended bounding set. The
2619included utilities are designed to let admins and developers spot apps from
2620various ways that may be running with too much privilege.")
2621 ;; The library is lgpl2.1+, but also ships some utils which are gpl2+.
f61e0e79 2622 (license (list license:lgpl2.1+ license:gpl2+))))
d02f2cc4
TUBK
2623
2624(define-public smartmontools
2625 (package
2626 (name "smartmontools")
da7fde00 2627 (version "7.2")
d02f2cc4
TUBK
2628 (source (origin
2629 (method url-fetch)
2630 (uri (string-append
2631 "mirror://sourceforge/smartmontools/smartmontools/"
2632 version "/smartmontools-" version ".tar.gz"))
2633 (sha256
2634 (base32
da7fde00 2635 "1mlc25sd5rgj5xmzcllci47inmfdw7cp185fday6hc9rwqkqmnaw"))))
d02f2cc4 2636 (build-system gnu-build-system)
023b3ca6
TGR
2637 (arguments
2638 (list #:make-flags
2639 #~(list "BUILD_INFO=\"(Guix)\"")))
8394619b 2640 (inputs (list libcap-ng))
51b6a1dd 2641 (home-page "https://www.smartmontools.org/")
d02f2cc4
TUBK
2642 (synopsis "S.M.A.R.T. harddisk control and monitoring tools")
2643 (description
2644 "The smartmontools package contains utility programs to control and
2645monitor storage systems using the Self-Monitoring, Analysis and Reporting
c115b2db
TGR
2646Technology System (@dfn{S.M.A.R.T.}) built into most modern ATA and SCSI hard
2647disks. In many cases, these utilities will provide advanced warning of disk
d02f2cc4 2648degradation and failure.")
f61e0e79 2649 (license license:gpl2+)))
6efd0823
RW
2650
2651(define-public fdupes
2652 (package
2653 (name "fdupes")
5a9f2ae1 2654 (version "2.1.2")
6efd0823
RW
2655 (source
2656 (origin
5a9f2ae1
TGR
2657 (method url-fetch)
2658 (uri (string-append "https://github.com/adrianlopezroche/fdupes/"
2659 "releases/download/v" version "/"
2660 "fdupes-" version ".tar.gz"))
6efd0823 2661 (sha256
5a9f2ae1 2662 (base32 "1g9p50xhi2sp0hqxml4w2k0kq9jv988q2yxm347z5349dlxvap6d"))))
6efd0823 2663 (build-system gnu-build-system)
5a9f2ae1 2664 (inputs
8394619b 2665 (list ncurses pcre2))
6efd0823
RW
2666 (home-page "https://github.com/adrianlopezroche/fdupes")
2667 (synopsis "Identify duplicate files")
2668 (description
2669 "fdupes is a program for identifying duplicate files residing within
2670specified directories.")
2671 (license license:expat)))
4ecfbda7 2672
83bf3c63 2673(define-public ansible-core
8d801045 2674 (package
83bf3c63 2675 (name "ansible-core")
90cd653a 2676 (version "2.11.6")
8d801045
ED
2677 (source
2678 (origin
2679 (method url-fetch)
83bf3c63 2680 (uri (pypi-uri "ansible-core" version))
8d801045 2681 (sha256
90cd653a 2682 (base32 "0fih7nxszni8imi5sywsifd976v77ydhip43pzg7dd65qy1h5mck"))))
8d801045 2683 (build-system python-build-system)
01cb4d47 2684 (arguments
83bf3c63
MC
2685 `(#:modules ((guix build python-build-system)
2686 (guix build utils)
2687 (ice-9 ftw))
2688 #:phases
01cb4d47
AI
2689 (modify-phases %standard-phases
2690 ;; Several ansible commands (ansible-config, ansible-console, etc.)
83bf3c63
MC
2691 ;; are just symlinks to a single ansible executable. The ansible
2692 ;; executable behaves differently based on the value of sys.argv[0].
2693 ;; This does not work well with our wrap phase, and therefore the
2694 ;; following two phases are required as a workaround.
01cb4d47
AI
2695 (add-after 'unpack 'hide-wrapping
2696 (lambda _
2697 ;; Overwrite sys.argv[0] to hide the wrapper script from it.
2698 (substitute* "bin/ansible"
2699 (("import traceback" all)
2700 (string-append all "
2701import re
2702sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
83bf3c63 2703")))))
ba8551ec 2704 (add-after 'install 'replace-symlinks
01cb4d47 2705 (lambda* (#:key outputs #:allow-other-keys)
ba8551ec 2706 ;; Replace symlinks with duplicate copies of the ansible
83bf3c63
MC
2707 ;; executable so that sys.argv[0] has the correct value.
2708 (define bin (string-append (assoc-ref outputs "out") "/bin"))
2709 (with-directory-excursion bin
01cb4d47 2710 (for-each
83bf3c63
MC
2711 (lambda (ansible-symlink)
2712 (delete-file ansible-symlink)
2713 (copy-file "ansible" ansible-symlink))
2714 (scandir "." (lambda (x)
2715 (and (eq? 'symlink (stat:type (lstat x)))
2716 (string-prefix? "ansible-" x)
2717 (string=? "ansible" (readlink x)))))))))
2718 (add-after 'unpack 'preserve-pythonpath
2719 (lambda _
2720 (substitute* "test/lib/ansible_test/_internal/ansible_util.py"
2721 (("PYTHONPATH=get_ansible_python_path\\(args\\)" all)
91bb9cb3 2722 (string-append all "+ ':' + os.environ['GUIX_PYTHONPATH']")))))
83bf3c63
MC
2723 (add-after 'unpack 'patch-paths
2724 (lambda* (#:key inputs outputs #:allow-other-keys)
2725 (substitute* "lib/ansible/module_utils/compat/selinux.py"
2726 (("libselinux.so.1" name)
2727 (string-append (assoc-ref inputs "libselinux")
2728 "/lib/" name)))
2729 (substitute* "test/units/modules/test_async_wrapper.py"
2730 (("/usr/bin/python")
2731 (which "python")))))
2732 (replace 'check
2733 ;; The environment for the test suite can be tricky to get right.
2734 ;; The environment used for Ansible's CI defined in the following
2735 ;; Dockerfile can be used as a reference:
2736 ;; https://raw.githubusercontent.com/ansible/
2737 ;; default-test-container/master/Dockerfile.
2738 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
2739 (when tests?
2740 ;; Otherwise Ansible fails to create its config directory.
2741 (setenv "HOME" "/tmp")
2742 (setenv "PATH" (string-append (getenv "PATH") ":"
2743 (assoc-ref outputs "out") "/bin"))
2744 (add-installed-pythonpath inputs outputs)
2745 ;; This test module messes up with sys.path and causes many
2746 ;; test failures.
2747 (delete-file "test/units/_vendor/test_vendor.py")
2748 ;; The test fails when run in the container, for reasons
2749 ;; unknown.
2750 (delete-file "test/units/utils/test_display.py")
2751 ;; This test fail for reasons unknown.
2752 (delete-file "test/units/cli/test_adhoc.py")
2753 ;; The test suite needs to be run with 'ansible-test', which
2754 ;; does some extra environment setup. Taken from
2755 ;; https://raw.githubusercontent.com/ansible/ansible/\
2756 ;; devel/test/utils/shippable/shippable.sh.
2757 (invoke "ansible-test" "units" "-v")))))))
2758 (native-inputs
8394619b
LC
2759 (list openssh
2760 openssl
2761 python-mock
2762 python-pycrypto
2763 python-pytest
2764 python-pytest-forked
2765 python-pytest-mock
2766 python-pytest-xdist
2767 python-pytz))
83bf3c63 2768 (inputs ;optional dependencies captured in wrap scripts
8394619b
LC
2769 (list libselinux python-paramiko python-passlib python-pexpect
2770 sshpass))
83bf3c63 2771 (propagated-inputs ;core dependencies listed in egg-info/requires.txt
8394619b
LC
2772 (list python-cryptography
2773 python-jinja2
2774 python-pyyaml
2775 python-packaging ;for version number parsing
2776 python-resolvelib-0.5))
ff18d0f1 2777 (home-page "https://www.ansible.com/")
8d801045 2778 (synopsis "Radically simple IT automation")
83bf3c63
MC
2779 (description "Ansible aims to be a radically simple IT automation system.
2780It handles configuration management, application deployment, cloud
2781provisioning, ad-hoc task execution, network automation, and multi-node
2782orchestration. Ansible facilitates complex changes like zero-downtime rolling
2783updates with load balancers. This package is the core of Ansible, which
2784provides the following commands:
2785@itemize
2786@item ansible
2787@item ansible-config
2788@item ansible-connection
2789@item ansible-console
2790@item ansible-doc
2791@item ansible-galaxy
2792@item ansible-inventory
2793@item ansible-playbook
2794@item ansible-pull
2795@item ansible-test
2796@item ansible-vault
2797@end itemize")
2798 (license license:gpl3+)))
2799
8d801045
ED
2800(define-public ansible
2801 (package
2802 (name "ansible")
4e3ef1d6 2803 (version "4.7.0")
8d801045
ED
2804 (source
2805 (origin
2806 (method url-fetch)
697e86dd 2807 (uri (pypi-uri "ansible" version))
8d801045 2808 (sha256
4e3ef1d6 2809 (base32 "0aab9id6dqfw2111r731c7y1p77dpzczynmgl4d989p3a7n54z0b"))))
8d801045 2810 (build-system python-build-system)
019bf963 2811 (propagated-inputs
8394619b 2812 (list ansible-core))
e91a5258
MC
2813 ;; The Ansible collections are found by ansible-core via the Python search
2814 ;; path; the following search path ensures that they are found even when
2815 ;; Python is not present in the profile.
019bf963
MC
2816 (native-search-paths
2817 ;; XXX: Attempting to use (package-native-search-paths python)
2818 ;; here would cause an error about python being an unbound
2819 ;; variable in the tests/cpan.scm test.
2820 (list (search-path-specification
e91a5258 2821 (variable "GUIX_PYTHONPATH")
87624540 2822 (files (list "lib/python3.9/site-packages")))))
ff18d0f1 2823 (home-page "https://www.ansible.com/")
8d801045 2824 (synopsis "Radically simple IT automation")
019bf963
MC
2825 (description "Ansible aims to be a radically simple IT automation system.
2826It handles configuration management, application deployment, cloud
2827provisioning, ad-hoc task execution, network automation, and multi-node
2828orchestration. Ansible facilitates complex changes like zero-downtime rolling
2829updates with load balancers. This package provides a curated set of
2830community-maintained Ansible collections, which contain playbooks, roles,
2831modules and plugins that extend Ansible.")
8d801045 2832 (license license:gpl3+)))
44157e9f 2833
6eb1d20b
HG
2834(define-public debops
2835 (package
2836 (name "debops")
2837 (version "1.1.0")
2838 (source
2839 (origin
2840 (method git-fetch)
2841 (uri (git-reference
2842 (url "https://github.com/debops/debops")
2843 (commit (string-append "v" version))))
2844 (file-name (git-file-name name version))
2845 (sha256
2846 (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5"))
2847 (patches
2848 (search-patches "debops-constants-for-external-program-names.patch"
2849 "debops-debops-defaults-fall-back-to-less.patch"))))
2850 (build-system python-build-system)
2851 (native-inputs
8394619b 2852 (list git))
6eb1d20b 2853 (inputs
8394619b
LC
2854 (list ansible
2855 encfs
2856 fuse
2857 util-linux ;; for umount
2858 findutils
2859 gnupg
2860 which))
6eb1d20b 2861 (propagated-inputs
8394619b 2862 (list python-future python-distro))
6eb1d20b
HG
2863 (arguments
2864 `(#:tests? #f
2865 #:phases
2866 (modify-phases %standard-phases
2867 (add-after 'unpack 'nuke-debops-update
2868 (lambda _
2869 (chmod "bin/debops-update" #o755) ; FIXME work-around git-fetch issue
2870 (with-output-to-file "bin/debops-update"
2871 (lambda ()
2872 (format #t "#!/bin/sh
2873echo 'debops is installed via guix. guix-update is useless in this case.
2874Please use `guix package -u debops` instead.'")))
2875 #t))
2876 ;; patch shebangs only in actuall scripts, not in files included in
2877 ;; roles (which are to be delivered to the targte systems)
2878 (delete `patch-generated-file-shebangs)
2879 (replace 'patch-source-shebangs
2880 (lambda _
2881 (for-each patch-shebang
2882 (find-files "bin"
2883 (lambda (file stat)
2884 ;; Filter out symlinks.
2885 (eq? 'regular (stat:type stat)))
2886 #:stat lstat))))
2887 (add-after 'unpack 'fix-paths
2888 (lambda _
2889 (define (substitute-program-names file)
2890 ;; e.g. ANSIBLE_PLAYBOOK = '/gnu/store/…/bin/ansible-playbook'
2891 (for-each
2892 (lambda (name)
2893 (let ((varname (string-upcase
2894 (string-map
2895 (lambda (c) (if (char=? c #\-) #\_ c))
2896 name))))
2897 (substitute* file
2898 (((string-append "^(" varname " = )'.*'") line prefix)
2899 (string-append prefix "'" (which name) "'")))))
2900 '("ansible-playbook" "encfs" "find" "fusermount"
2901 "umount" "gpg" "ansible" "which")))
2902 (for-each substitute-program-names
2903 '("bin/debops"
2904 "bin/debops-padlock"
2905 "bin/debops-task"
2906 "debops/__init__.py"
2907 "debops/cmds/__init__.py"))
2908 #t)))))
2909 (home-page "https://www.debops.org/")
2910 (synopsis "Collection of general-purpose Ansible roles")
2911 (description "The Ansible roles provided by that can be used to manage
2912Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can
2913be used to apply the provided roles in a controlled way, using Ansible
2914inventory groups.
2915
2916The roles are written with a high customization in mind, which can be done
2917using Ansible inventory. This way the role and playbook code can be shared
2918between multiple environments, with different configuration in to each one.
2919
2920Services can be managed on a single host, or spread between multiple hosts.
2921DebOps provides support for different SQL and NoSQL databases, web servers,
2922programming languages and specialized applications useful in a data center
2923environment or in a cluster. The project can also be used to deploy
2924virtualization environments using KVM/libvirt, Docker or LXC technologies to
2925manage virtual machines and/or containers.")
2926 (license license:gpl3+)))
2927
2b6164f0
OP
2928(define-public emacs-ansible-doc
2929 (let ((commit "86083a7bb2ed0468ca64e52076b06441a2f8e9e0"))
2930 (package
2931 (name "emacs-ansible-doc")
2932 (version (git-version "0.4" "1" commit))
2933 (source
2934 (origin
2935 (method git-fetch)
2936 (uri (git-reference
2937 (url "https://github.com/lunaryorn/ansible-doc.el")
2938 (commit commit)))
2939 (file-name (git-file-name name version))
2940 (sha256
2941 (base32
2942 "0lap404ch74w99n3xip176jr42b38xhyzkfnkyqg0g3wk2cd3aq8"))))
2943 (build-system emacs-build-system)
2944 ;; Unmaintained by upstream.
2945 (home-page "https://github.com/lunaryorn/ansible-doc.el")
2946 (synopsis "Ansible documentation for Emacs")
2947 (description
2948 "This package provides an Ansible documentation for GNU Emacs.
2949
2950@code{ansible-doc} allows you to view the documentation of an Ansible
2951module and @code{ansible-doc-mode} minor mode adds documentation
2952lookup to YAML Mode. You could enable the mode with @code{(add-hook
2953'yaml-mode-hook #'ansible-doc-mode)}.")
2954 (license license:gpl3+))))
2955
44157e9f
EB
2956(define-public cpulimit
2957 (package
2958 (name "cpulimit")
2959 (version "0.2")
2960 (source
2961 (origin
aa372292
TGR
2962 (method git-fetch)
2963 (uri (git-reference
b0e7b699 2964 (url "https://github.com/opsengine/cpulimit")
aa372292
TGR
2965 (commit (string-append "v" version))))
2966 (file-name (git-file-name name version))
44157e9f 2967 (sha256
1949c8b2
EB
2968 (base32 "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh"))
2969 (patches (search-patches "cpulimit-with-glib-2.32.patch"))))
44157e9f
EB
2970 (build-system gnu-build-system)
2971 (arguments
2972 `(#:phases (modify-phases %standard-phases
2973 (delete 'configure)
cb8ba848 2974 (replace 'build
6e26bd5b
EF
2975 (lambda* (#:key make-flags #:allow-other-keys)
2976 (apply invoke "make" "-Csrc" make-flags)))
cb8ba848 2977 (replace 'check
d4560e0b
EF
2978 (lambda* (#:key tests? make-flags #:allow-other-keys)
2979 (when tests?
2980 (apply invoke "make" "-Ctests" make-flags))
2981 #t))
cb8ba848
MW
2982 (replace 'install
2983 (lambda* (#:key outputs #:allow-other-keys)
2984 (let* ((out (assoc-ref outputs "out"))
2985 (bin (string-append out "/bin")))
2986 (install-file "src/cpulimit" bin))
6e26bd5b
EF
2987 #t)))
2988 #:make-flags (list (string-append "CC=" ,(cc-for-target)))))
44157e9f
EB
2989 (home-page "https://github.com/opsengine/cpulimit")
2990 (synopsis "Limit CPU usage")
2991 (description
2992 "Cpulimit limits the CPU usage of a process. It does not change the nice
2993value or other scheduling priority settings, but the real CPU usage, and is
2994able to adapt itself dynamically to the overall system load. Children
2995processes and threads of the specified process may optionally share the same
2996limits.")
2997 (license license:gpl2+)))
2328b47c
EB
2998
2999(define-public autojump
3000 (package
3001 (name "autojump")
0e684357 3002 (version "22.5.3")
2328b47c
EB
3003 (source
3004 (origin
24d459ce
TGR
3005 (method git-fetch)
3006 (uri (git-reference
b0e7b699 3007 (url "https://github.com/wting/autojump")
24d459ce
TGR
3008 (commit (string-append "release-v" version))))
3009 (file-name (git-file-name name version))
2328b47c 3010 (sha256
0e684357 3011 (base32 "1rgpsh70manr2dydna9da4x7p8ahii7dgdgwir5fka340n1wrcws"))))
2328b47c 3012 (build-system gnu-build-system)
24d459ce 3013 (native-inputs ; for tests
8394619b 3014 (list python-mock python-pytest))
2328b47c
EB
3015 (inputs
3016 `(("python" ,python-wrapper)))
3017 (arguments
eb9dda9c
KK
3018 `(#:phases
3019 (modify-phases %standard-phases
24d459ce
TGR
3020 (add-after 'unpack 'make-git-checkout-writable
3021 ;; ‘install.py’ modifies files before installing them.
3022 (lambda _
3023 (for-each make-file-writable (find-files "."))
3024 #t))
eb9dda9c
KK
3025 (delete 'configure)
3026 (delete 'build)
3027 (replace 'check
3028 (lambda _
3029 (invoke "python" "tests/unit/autojump_utils_test.py")))
3030 (replace 'install
3031 (lambda* (#:key outputs #:allow-other-keys)
3032 (setenv "SHELL" (which "bash"))
3033 (invoke "python" "install.py"
3034 (string-append "--destdir="
3035 (assoc-ref outputs "out"))))))))
2328b47c 3036 (home-page "https://github.com/wting/autojump")
8f65585b 3037 (synopsis "Shell extension for file system navigation")
2328b47c 3038 (description
8f65585b 3039 "Autojump provides a faster way to navigate your file system, with a \"cd
2328b47c
EB
3040command that learns\". It works by maintaining a database of the directories
3041you use the most from the command line and allows you to \"jump\" to
3042frequently used directories by typing only a small pattern.")
3043 (license license:gpl3+)))
765973cd 3044
1ca0ac1e
EB
3045(define-public fasd
3046 (package
3047 (name "fasd")
3048 (version "1.0.1")
3049 (source (origin
3050 (method git-fetch)
3051 (uri (git-reference
b0e7b699 3052 (url "https://github.com/clvv/fasd")
1ca0ac1e
EB
3053 (commit version)))
3054 (file-name (git-file-name name version))
3055 (sha256
3056 (base32
3057 "1awi71jdv3mhjrmar2d4z1i90kn7apd7aq1w31sh6w4yibz9kiyj"))))
3058 (build-system gnu-build-system)
3059 (arguments
3060 `(#:phases (modify-phases %standard-phases
3061 (delete 'configure)) ;no configuration
3062 #:tests? #f ;no tests
3063 #:make-flags (list (string-append "PREFIX=" %output))))
3064 (home-page "https://github.com/clvv/fasd")
3065 (synopsis "Quick access to files and directories for shells")
3066 (description
3067 "Fasd (pronounced similar to \"fast\") is a command-line productivity
3068booster. Fasd offers quick access to files and directories for POSIX shells.
3069It is inspired by tools like autojump, z, and v. Fasd keeps track of files
3070and directories you have accessed so that you can quickly reference them in
3071the command line.")
3072 (license license:x11)))
3073
765973cd
LF
3074(define-public iftop
3075 (package
3076 (name "iftop")
3077 (version "1.0pre4")
3078 (source (origin
3079 (method url-fetch)
3080 (uri (string-append "http://www.ex-parrot.com/~pdw/iftop/download"
3081 "/iftop-" version ".tar.gz"))
3082 (sha256
3083 (base32
3084 "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp"))))
3085 (build-system gnu-build-system)
3086 (inputs
8394619b 3087 (list libpcap ncurses))
57c54bff
LF
3088 (arguments
3089 ;; Fix build failure with GCC 10
9cfb0ef4 3090 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
765973cd
LF
3091 (synopsis "Monitor network usage")
3092 (description "Iftop does for network usage what @command{top} does
3093for CPU usage. It listens to network traffic on a named interface and
3094displays a table of current bandwidth usage by pairs of hosts.")
3095 (home-page "http://www.ex-parrot.com/~pdw/iftop/")
d4e21fbb 3096 (license license:gpl2+)))
f1957fc1
PP
3097
3098(define-public munge
3099 (package
3100 (name "munge")
5ee0e013 3101 (version "0.5.14")
f1957fc1
PP
3102 (source (origin
3103 (method url-fetch)
b52ae4de
EF
3104 (uri (string-append "https://github.com/dun/munge/releases/"
3105 "download/munge-" version "/munge-"
3106 version ".tar.xz"))
f1957fc1
PP
3107 (sha256
3108 (base32
5ee0e013 3109 "0h06sghb4rqvv1ywyd6mzsmbcgh712v6ygrff0gzm440y4ca41k6"))
8d080506
LC
3110 (modules '((guix build utils)))
3111 (snippet
3112 '(begin
3113 ;; Don't insist on write access to /var.
3114 (substitute* "src/etc/Makefile.in"
3115 (("\\$\\(INSTALL\\)(.*)localstatedir" _ middle)
5ee0e013
TGR
3116 (string-append "-$(INSTALL)" middle "localstatedir"))
3117 (("\\$\\(MKDIR_P\\) .*(local|run)statedir.*")
3118 ""))
8d080506 3119 #t))))
f1957fc1 3120 (inputs
8394619b 3121 (list openssl libgcrypt))
f1957fc1 3122 (build-system gnu-build-system)
5ee0e013 3123 (arguments
b103d8e4 3124 `(#:configure-flags
5ee0e013
TGR
3125 (list "--localstatedir=/var"
3126 (string-append "--with-pkgconfigdir="
b103d8e4
EF
3127 (assoc-ref %outputs "out") "/lib/pkgconfig")
3128 (string-append "--with-libgcrypt-prefix="
3129 (assoc-ref %build-inputs "libgcrypt"))
3130 ,@(if (%current-target-system)
3131 ;; Assume yes on pipes when cross compiling.
3132 `("ac_cv_file__dev_spx=yes"
3133 "x_ac_cv_check_fifo_recvfd=yes")
3134 '()))
5ee0e013
TGR
3135 #:phases
3136 (modify-phases %standard-phases
3137 ;; XXX Many test series fail. Some might be fixable, others do no-no
3138 ;; things like invoking ‘sudo’.
3139 (add-after 'unpack 'skip-failing-tests
3140 (lambda _
3141 (for-each (lambda (test)
3142 (substitute* "t/Makefile.in"
3143 (((string-append test "\\.t ")) "")))
3144 (list "0100-munged-lock"
3145 "0010-basic"
3146 "0011-munged-cmdline"
3147 "0012-munge-cmdline"
3148 "0013-unmunge-cmdline"
3149 "0101-munged-security-socket"
3150 "0102-munged-security-keyfile"
3151 "0103-munged-security-logfile"
3152 "0110-munged-origin-addr"))
3153 #t)))))
b52ae4de 3154 (home-page "https://dun.github.io/munge/")
f1957fc1
PP
3155 (synopsis "Cluster computing authentication service")
3156 (description
3157 "Munge is an authentication service for creating and validating
3158credentials. It allows a process to authenticate the UID and GID of another
3159local or remote process within a group of hosts having common users and
3160groups. These hosts form a security realm that is defined by a shared
3161cryptographic key. Clients within this security realm can create and validate
3162credentials without the use of root privileges, reserved ports, or
3163platform-specific methods.")
3164 (license license:gpl3+)))
3d7a157c
RW
3165
3166(define-public audit
3167 (package
3168 (name "audit")
00f81f83 3169 (home-page "https://people.redhat.com/sgrubb/audit/")
28741add 3170 (version "3.0.8")
3d7a157c
RW
3171 (source (origin
3172 (method url-fetch)
fe2f0166 3173 (uri (string-append home-page "audit-" version ".tar.gz"))
3d7a157c
RW
3174 (sha256
3175 (base32
28741add 3176 "04w9m9ffvi58z11i344wa1hji9ba68cdklrkizhiwf39mnwxkx5m"))))
3d7a157c 3177 (build-system gnu-build-system)
3d7a157c 3178 (arguments
8938b369
MB
3179 `(#:configure-flags (list "--with-python=no"
3180 "--disable-static")))
3d7a157c 3181 (inputs
65574767 3182 (list openldap gnutls cyrus-sasl))
3d7a157c
RW
3183 (synopsis "User-space component to the Linux auditing system")
3184 (description
4b6ce80a
TGR
3185 "This is the user-space component to the Linux auditing system, which
3186allows logging of system calls made by user-land processes. @command{auditd} is
3187responsible for writing audit records to the disk. Viewing the logs is done
3188with the @code{ausearch} or @code{aureport} utilities. Configuring the audit
3189rules is done with the @code{auditctl} utility.")
3d7a157c 3190 (license license:gpl2+)))
d0457553
TUBK
3191
3192(define-public nmap
3193 (package
3194 (name "nmap")
a91ad29d 3195 (version "7.92")
d0457553
TUBK
3196 (source (origin
3197 (method url-fetch)
3198 (uri (string-append "https://nmap.org/dist/nmap-" version
3199 ".tar.bz2"))
3200 (sha256
3201 (base32
a91ad29d 3202 "18bifn67kz2wxkbnfwcrin2xrhc6qf4p2bvxfqb2a2vbi8pryix5"))
d0457553
TUBK
3203 (modules '((guix build utils)))
3204 (snippet
6cbee49d
MW
3205 '(begin
3206 (for-each delete-file-recursively
3207 ;; Remove bundled lua, pcap, and pcre libraries.
3208 ;; FIXME: Remove bundled liblinear once packaged.
3209 '("liblua"
3210 "libpcap"
3211 "libpcre"
3212 ;; Remove pre-compiled binares.
a91ad29d 3213 "mswin32"))))))
d0457553
TUBK
3214 (build-system gnu-build-system)
3215 (inputs
3216 `(("openssl" ,openssl)
3217 ("libpcap" ,libpcap)
3218 ("pcre" ,pcre)
3219 ("lua" ,lua)
069d0b7f
MB
3220 ("zlib" ,zlib) ;for NSE compression support
3221
d0457553
TUBK
3222 ;; For 'ndiff'.
3223 ("python" ,python-2)))
3224
3225 ;; TODO Add zenmap output.
3226 (outputs '("out" "ndiff"))
3227 (arguments
cc729d25 3228 `(#:configure-flags '("--without-zenmap")
d0457553
TUBK
3229 #:phases
3230 (modify-phases %standard-phases
f4dc22bc
MB
3231 (add-after 'configure 'patch-Makefile
3232 (lambda _
3233 (substitute* "Makefile"
3234 ;; Do not attempt to build lua.
a91ad29d 3235 (("build-dnet build-lua") "build-dnet"))))
d0457553
TUBK
3236 (replace 'install
3237 (lambda* (#:key outputs #:allow-other-keys)
3238 (define (make out . args)
cb8ba848
MW
3239 (apply invoke "make"
3240 (string-append "prefix=" out)
3241 args))
d0457553 3242 (define (python-path dir)
cc729d25
EF
3243 (string-append dir "/lib/python"
3244 ,(version-major+minor
3245 (package-version python))
3246 "/site-packages"))
d0457553
TUBK
3247 (let ((out (assoc-ref outputs "out"))
3248 (ndiff (assoc-ref outputs "ndiff")))
3249 (for-each mkdir-p (list out ndiff))
3250 (make out
3251 "install-nmap"
3252 "install-nse"
3253 "install-ncat"
3254 "install-nping")
3255 (make ndiff "install-ndiff")
3256 (wrap-program (string-append ndiff "/bin/ndiff")
d42245d4 3257 `("GUIX_PYTHONPATH" prefix
a91ad29d 3258 (,(python-path ndiff)))))))
d0457553
TUBK
3259 ;; These are the tests that do not require network access.
3260 (replace 'check
e4fe344a
EF
3261 (lambda* (#:key tests? #:allow-other-keys)
3262 (when tests?
3263 (invoke "make"
3264 "check-nse"
3265 "check-ndiff"
3266 "check-dns")))))
d0457553
TUBK
3267 ;; Nmap can't cope with out-of-source building.
3268 #:out-of-source? #f))
3269 (home-page "https://nmap.org/")
3270 (synopsis "Network discovery and security auditing tool")
3271 (description
3272 "Nmap (\"Network Mapper\") is a network discovery and security auditing
3273tool. It is also useful for tasks such as network inventory, managing service
3274upgrade schedules, and monitoring host or service uptime. It also provides an
3275advanced netcat implementation (ncat), a utility for comparing scan
3276results (ndiff), and a packet generation and response analysis tool (nping).")
a91ad29d 3277 ;; See <https://github.com/nmap/nmap/issues/2199#issuecomment-894812634>.
d0457553
TUBK
3278 ;; This package uses nmap's bundled versions of libdnet and liblinear, which
3279 ;; both use a 3-clause BSD license.
2dba37e2 3280 (license (list license:nmap license:bsd-3))))
1a0346f0
P
3281
3282(define-public dstat
3283 (package
3284 (name "dstat")
ad20da2e 3285 (version "0.7.4")
fc204d24
TGR
3286 (source
3287 (origin
3288 (method git-fetch)
3289 (uri (git-reference
e620447f 3290 (url "https://github.com/dstat-real/dstat")
ad20da2e 3291 (commit (string-append "v" version))))
fc204d24
TGR
3292 (file-name (git-file-name "dstat" version))
3293 (sha256
10a32973
TGR
3294 (base32 "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v"))
3295 (patches (search-patches "dstat-fix-crash-when-specifying-delay.patch"
3296 "dstat-skip-devices-without-io.patch"))))
1a0346f0
P
3297 (build-system gnu-build-system)
3298 (arguments
fc204d24 3299 `(#:tests? #f ; no make check
5c8e8bc5
TGR
3300 #:make-flags
3301 (list (string-append "prefix=" (assoc-ref %outputs "out")))
5cc5364e
TGR
3302 #:phases
3303 (modify-phases %standard-phases
fa67073f
TGR
3304 (add-after 'unpack 'fix-python3-DeprecationWarning
3305 (lambda _
3306 (substitute* "dstat"
3307 (("collections") "collections.abc"))
3308 #t))
5cc5364e
TGR
3309 (delete 'configure) ; no configure script
3310 (add-after 'install 'wrap
3311 (lambda* (#:key outputs #:allow-other-keys)
3312 (let ((out (assoc-ref outputs "out")))
3313 (wrap-program (string-append out "/bin/dstat")
d42245d4 3314 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
5cc5364e
TGR
3315 #t))))))
3316 (inputs
5cc5364e
TGR
3317 `(("python" ,python-wrapper)
3318 ("python-six" ,python-six)))
1a0346f0
P
3319 (synopsis "Versatile resource statistics tool")
3320 (description "Dstat is a versatile replacement for @command{vmstat},
3321@command{iostat}, @command{netstat}, and @command{ifstat}. Dstat overcomes
3322some of their limitations and adds some extra features, more counters and
3323flexibility. Dstat is handy for monitoring systems during performance tuning
3324tests, benchmarks or troubleshooting.
3325
3326Dstat allows you to view all of your system resources in real-time, you can,
3327e.g., compare disk utilization in combination with interrupts from your IDE
3328controller, or compare the network bandwidth numbers directly with the disk
3329throughput (in the same interval).")
3330 (home-page "http://dag.wiee.rs/home-made/dstat/")
c59f62e9 3331 (license license:gpl2+)))
0405e5f4
EB
3332
3333(define-public thefuck
3334 (package
3335 (name "thefuck")
26787a70 3336 (version "3.31")
a0c693e1
TGR
3337 (source
3338 (origin
3339 (method git-fetch)
3340 (uri (git-reference
b0e7b699 3341 (url "https://github.com/nvbn/thefuck")
a0c693e1
TGR
3342 (commit version)))
3343 (file-name (git-file-name name version))
3344 (sha256
26787a70 3345 (base32 "05h60gxky57nalc2hdkpg8wqyg16432x9gcb9wnwblplk98998kq"))
a0c693e1 3346 (patches (search-patches "thefuck-test-environ.patch"))))
0405e5f4 3347 (build-system python-build-system)
1c1b67a3 3348 (arguments
bf5b6fb2
EB
3349 '(#:phases
3350 (modify-phases %standard-phases
3351 (delete 'check)
3352 (add-after 'install 'check
3353 (lambda* (#:key inputs outputs #:allow-other-keys)
3354 ;; Tests look for installed package
3355 (add-installed-pythonpath inputs outputs)
3356 ;; Some tests need write access to $HOME.
3357 (setenv "HOME" "/tmp")
26787a70
TGR
3358 ;; Even with that, this function tries to mkdir /.config.
3359 (substitute* "tests/test_utils.py"
3360 (("settings\\.init\\(\\)") ""))
3361 (invoke "py.test" "-v"))))))
1c1b67a3 3362 (propagated-inputs
8394619b
LC
3363 (list python-colorama python-decorator python-psutil python-pyte
3364 python-six))
2d1ac1d1 3365 (native-inputs
8394619b 3366 (list go python-mock python-pytest python-pytest-mock))
0405e5f4
EB
3367 (home-page "https://github.com/nvbn/thefuck")
3368 (synopsis "Correct mistyped console command")
3369 (description
3370 "The Fuck tries to match a rule for a previous, mistyped command, creates
3371a new command using the matched rule, and runs it.")
3372 (license license:x11)))
61402398
JF
3373
3374(define-public di
3375 (package
3376 (name "di")
3b7619b2 3377 (version "4.51")
61402398
JF
3378 (source
3379 (origin
3380 (method url-fetch)
e999ea12 3381 (uri (string-append "mirror://sourceforge/diskinfo-di/di-" version ".tar.gz"))
61402398 3382 (sha256
3b7619b2 3383 (base32 "1fv12j9b9sw6p38lcbzcw87zl5qp1aa7a4a4jn3449zz9af15ckr"))))
61402398
JF
3384 (build-system gnu-build-system)
3385 (arguments
ad9baf38 3386 `(#:tests? #f ; obscure test failures
61402398
JF
3387 #:phases
3388 (modify-phases %standard-phases
ad9baf38 3389 (delete 'configure) ; no configure script
61402398
JF
3390 (add-before 'build 'setup-environment
3391 (lambda* (#:key outputs #:allow-other-keys)
aba98be5 3392 (setenv "CC" ,(cc-for-target))
3b7619b2 3393 (setenv "prefix" (assoc-ref outputs "out")))))
61402398 3394 #:make-flags (list "--environment-overrides")))
f76c16d2 3395 (home-page "https://gentoo.com/di/")
61402398
JF
3396 (synopsis "Advanced df like disk information utility")
3397 (description
36a4366d 3398 "@code{di} is a disk information utility, displaying everything that your
26c6de8b
TGR
3399@code{df} command does and more. It features the ability to display your disk
3400usage in whatever format you prefer. It is designed to be highly portable and
3401produce uniform output across heterogeneous networks.")
61402398 3402 (license license:zlib)))
5ec8b02d 3403
3404(define-public cbatticon
3405 (package
3406 (name "cbatticon")
50db7df4 3407 (version "1.6.10")
d8d910e6
TGR
3408 (source
3409 (origin
3410 (method git-fetch)
3411 (uri (git-reference
b0e7b699 3412 (url "https://github.com/valr/cbatticon")
d8d910e6
TGR
3413 (commit version)))
3414 (sha256
50db7df4 3415 (base32 "0ivm2dzhsa9ir25ry418r2qg2llby9j7a6m3arbvq5c3kaj8m9jr"))
d8d910e6 3416 (file-name (git-file-name name version))))
5ec8b02d 3417 (build-system gnu-build-system)
3418 (arguments
d8d910e6 3419 `(#:tests? #f ; no tests
5ec8b02d 3420 #:make-flags
3421 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
9c44af6b 3422 ,(string-append "CC=" (cc-for-target)))
5ec8b02d 3423 #:phases
3424 (modify-phases %standard-phases
d8d910e6 3425 (delete 'configure)))) ; no configure script
5ec8b02d 3426 (inputs
3427 `(("gtk+" ,gtk+)
b94a6ca0 3428 ("gettext" ,gettext-minimal)
5ec8b02d 3429 ("libnotify" ,libnotify)))
3430 (native-inputs
8394619b 3431 (list pkg-config))
5ec8b02d 3432 (synopsis "Lightweight battery icon for the system tray")
3433 (description "cbatticon is a lightweight battery icon that displays
3434the status of your battery in the system tray.")
3435 (home-page "https://github.com/valr/cbatticon")
3436 (license license:gpl2+)))
c08533b2 3437
3438(define-public interrobang
3439 (let ((revision "1")
3440 (commit "896543735e1c99144765fdbd7b6e6b5afbd8b881"))
3441 (package
3442 (name "interrobang")
807a3099
TGR
3443 (version (git-version "0.0.0" revision commit))
3444 (source
3445 (origin
3446 (method git-fetch)
3447 (uri (git-reference
b0e7b699 3448 (url "https://github.com/TrilbyWhite/interrobang")
807a3099
TGR
3449 (commit commit)))
3450 (file-name (git-file-name name version))
3451 (sha256
3452 (base32 "1n13m70p1hfba5dy3i8hfclbr6k9q3d9dai3dg4jvhdhmxcpjzdf"))))
c08533b2 3453 (build-system gnu-build-system)
3454 (arguments
807a3099 3455 `(#:tests? #f ; no tests
c08533b2 3456 #:phases
3457 (modify-phases %standard-phases
807a3099 3458 (delete 'configure)) ; no configure script
c08533b2 3459 #:make-flags (list (string-append "PREFIX="
3460 (assoc-ref %outputs "out")))))
3461 (inputs
8394619b 3462 (list libx11))
c08533b2 3463 (native-inputs
8394619b 3464 (list pkg-config))
c08533b2 3465 (synopsis "Scriptable launcher menu")
3466 (description "Interrobang is a scriptable launcher menu with a customizable
3467shortcut syntax and completion options.")
3468 (home-page "https://github.com/TrilbyWhite/interrobang")
3469 (license license:gpl3+))))
94c5dc8c 3470
94c5dc8c
JD
3471(define-public pam-krb5
3472 (package
3473 (name "pam-krb5")
0e6c242b 3474 (version "4.8")
94c5dc8c
JD
3475 (source (origin
3476 (method url-fetch)
ed683219
EF
3477 (uri
3478 (list (string-append
3479 "https://archives.eyrie.org/software/kerberos/"
3480 "pam-krb5-" version ".tar.xz")
3481 (string-append
3482 "https://archives.eyrie.org/software/ARCHIVE/"
3483 "pam-krb5/pam-krb5-" version ".tar.xz")))
653a51cb 3484 (patches (search-patches "pam-krb5-CVE-2020-10595.patch"))
94c5dc8c
JD
3485 (sha256
3486 (base32
0e6c242b 3487 "1qjp8i1s9bz7g6kiqrkzzkxn5pfspa4sy53b6z40fqmdf9przdfb"))))
94c5dc8c
JD
3488 (build-system gnu-build-system)
3489 (arguments
3490 `(#:phases
3491 (modify-phases %standard-phases
3492 (add-before 'configure 'disable-tests
3493 (lambda _
3494 ;; The build container seems to interfere with some tests.
3495 (substitute* "tests/TESTS"
3496 (("module/basic\n") ""))
3497 (substitute* "tests/TESTS"
3498 (("pam-util/vector\n") ""))
3499 #t)))))
3500 (inputs
8394619b 3501 (list linux-pam mit-krb5))
94c5dc8c 3502 (native-inputs
8394619b 3503 (list perl perl-test-pod)) ; required for tests
94c5dc8c
JD
3504 (synopsis "Kerberos PAM module")
3505 (description
3506 "Pam-krb5 is a Kerberos PAM module for either MIT Kerberos or Heimdal.
3507It supports ticket refreshing by screen savers, configurable
3508authorization handling, authentication of non-local accounts for network
3509services, password changing, and password expiration, as well as all the
3510standard expected PAM features. It works correctly with OpenSSH, even
45298300
TGR
3511with @code{ChallengeResponseAuthentication} and @code{PrivilegeSeparation}
3512enabled, and supports extensive configuration either by PAM options or in
94c5dc8c
JD
3513krb5.conf or both. PKINIT is supported with recent versions of both MIT
3514Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
ed683219 3515 (home-page "https://www.eyrie.org/~eagle/software/pam-krb5/")
94c5dc8c
JD
3516 ;; Dual licenced under a homebrew non-copyleft OR GPL (any version)
3517 ;; However, the tarball does not contain a copy of the GPL, so unless
3518 ;; we put one in, we cannot distribute it under GPL without violating
3519 ;; clause requiring us to give all recipients a copy.
3520 (license license:gpl1+)))
3521
208e7434 3522(define (sunxi-tools-source version)
b04ca7a1 3523 (origin
43eb601f
TGR
3524 (method git-fetch)
3525 (uri (git-reference
b0e7b699 3526 (url "https://github.com/linux-sunxi/sunxi-tools")
43eb601f 3527 (commit (string-append "v" version))))
b04ca7a1 3528 (sha256
43eb601f 3529 (base32 "04f3jqg8ww4jxsf9c6ddcdgy2xbhkyp0b3l5f1hvvbv94p81rjxd"))
7e917283
DM
3530 (patches
3531 (search-patches "sunxi-tools-remove-sys-io.patch"))
b04ca7a1
DM
3532 (modules '((guix build utils)))
3533 (snippet
3534 ;; Remove binaries contained in the tarball which are only for the
3535 ;; target and can be regenerated anyway.
6cbee49d
MW
3536 '(begin
3537 (delete-file-recursively "bin")
3538 #t))
208e7434
DM
3539 (file-name (git-file-name "sunxi-tools" version))))
3540
3541(define sunxi-target-tools
3542 (package
3543 (name "sunxi-target-tools")
3544 (version "1.4.2")
3545 (build-system gnu-build-system)
3546 (source
3547 (sunxi-tools-source version))
3548 (arguments
3549 `(#:system "armhf-linux"
3550 #:tests? #f
3551 #:make-flags (list (string-append "PREFIX="
3552 (assoc-ref %outputs "out"))
3553 (string-append "CROSS_COMPILE=")
3554 "CC=gcc")
3555 #:phases
3556 (modify-phases %standard-phases
3557 (delete 'configure)
3558 (replace 'build
3559 (lambda* (#:key make-flags #:allow-other-keys)
3560 (apply invoke "make" "target-tools" make-flags)))
3561 (replace 'install
3562 (lambda* (#:key make-flags #:allow-other-keys)
3563 (apply invoke "make" "install-target-tools"
3564 make-flags))))))
3565 (home-page "https://github.com/linux-sunxi/sunxi-tools")
3566 (synopsis "Hardware management tools for Allwinner computers")
3567 (description "This package contains tools for Allwinner devices:
3568@enumerate
3569@item @command{sunxi-meminfo}: Prints memory bus settings.
3570@end enumerate")
3571 (license license:gpl2+)))
3572
3573(define-public sunxi-tools
3574 (package
3575 (name "sunxi-tools")
3576 (version "1.4.2")
3577 (source
3578 (sunxi-tools-source version))
b04ca7a1 3579 (native-inputs
8394619b 3580 (list sunxi-target-tools pkg-config))
b04ca7a1 3581 (inputs
8394619b 3582 (list libusb))
b04ca7a1
DM
3583 (build-system gnu-build-system)
3584 (arguments
faa6bdf8 3585 `(#:tests? #f ; no tests exist
b04ca7a1
DM
3586 #:make-flags (list (string-append "PREFIX="
3587 (assoc-ref %outputs "out"))
208e7434 3588 (string-append "CROSS_COMPILE=disabled")
faa6bdf8 3589 "CC=gcc")
b04ca7a1
DM
3590 #:phases
3591 (modify-phases %standard-phases
b054b26a 3592 (delete 'configure)
faa6bdf8
DM
3593 (replace 'build
3594 (lambda* (#:key make-flags #:allow-other-keys)
cb8ba848 3595 (apply invoke "make" "tools" "misc" make-flags)))
b054b26a 3596 (replace 'install
208e7434
DM
3597 (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
3598 ;; Those tools have been built for armhf but are part of the
3599 ;; installation in the upstream package. So do the same
3600 ;; here.
3601 (copy-recursively (assoc-ref inputs "sunxi-target-tools")
3602 (assoc-ref outputs "out"))
3603 (apply invoke "make" "install-tools" "install-misc"
cb8ba848 3604 make-flags))))))
b04ca7a1
DM
3605 (home-page "https://github.com/linux-sunxi/sunxi-tools")
3606 (synopsis "Hardware management tools for Allwinner computers")
3607 (description "This package contains tools for Allwinner devices:
3608@enumerate
3609@item @command{sunxi-fexc}, @command{bin2fex}, @command{fex2bin}: Compile
3610a textual description of a board (.fex) to a binary representation (.bin).
3611@item @command{sunxi-fel}: Puts an Allwinner device into FEL mode which
3612makes it register as a special USB device (rather than USB host).
3613You can then connect it to another computer and flash it from there.
3614@item @command{sunxi-nand-part}: Partitions NAND flash.
3615@item @command{sunxi-bootinfo}: Reads out boot0 and boot1 (Allwinner
3616bootloader) parameters.
3617@item @command{sunxi-pio}: Sets GPIO parameters and oscillates a GPIO
3618in order to be able to find it.
3619@item @command{sunxi-meminfo}: Prints memory bus settings.
b054b26a 3620@item @command{sunxi-nand-image-builder}: Prepares raw NAND images.
b04ca7a1
DM
3621@end enumerate")
3622 (license license:gpl2+)))
a054777e 3623
c78f916a
DM
3624(define-public xfel
3625 (package
3626 (name "xfel")
3627 (version "1.2.4")
3628 (source
3629 (origin
3630 (method git-fetch)
3631 (uri (git-reference
3632 (url "https://github.com/xboot/xfel.git")
3633 (commit (string-append "v" version))))
3634 (sha256
3635 (base32 "0r4j63vh6279fj1yh71h08d1av3nc0majlad5yh6admsxiig101m"))
3636 (file-name (git-file-name name version))))
3637 (native-inputs
3638 (list pkg-config))
3639 (inputs
3640 (list libusb))
3641 (build-system gnu-build-system)
3642 (arguments
3643 `(#:tests? #f ; No tests exist
3644 #:phases
3645 (modify-phases %standard-phases
3646 (add-after 'unpack 'patch-installation-target
3647 (lambda* (#:key outputs #:allow-other-keys)
3648 (let ((out (assoc-ref outputs "out")))
3649 (substitute* "Makefile"
3650 (("/usr/local") out)
3651 (("/usr") out)
3652 (("/etc/udev/rules.d")
3653 (string-append out "/lib/udev/rules.d"))))))
3654 (delete 'configure))))
3655 (home-page "https://github.com/xboot/xfel")
3656 (synopsis "Remote debugging tool for Allwinner D1 computers")
3657 (description "This package contains a debugging tool for Allwinner D1
3658devices (connects via USB OTG).")
3659 (license license:expat)))
3660
a054777e 3661(define-public sedsed
3662 (package
3663 (name "sedsed")
bde99125 3664 (version "1.1")
a054777e 3665 (source
3666 (origin
7d6e8fda
TGR
3667 (method git-fetch)
3668 (uri (git-reference
b0e7b699 3669 (url "https://github.com/aureliojargas/sedsed")
7d6e8fda
TGR
3670 (commit (string-append "v" version))))
3671 (file-name (git-file-name name version))
a054777e 3672 (sha256
bde99125 3673 (base32 "05cl35mwljdb9ynbbsfa8zx6ig8r0xncbg2cir9vwn5manndjj18"))))
a054777e 3674 (build-system python-build-system)
3675 (arguments
7d6e8fda 3676 `(#:tests? #f ; no tests
a054777e 3677 #:phases
3678 (modify-phases %standard-phases
3679 (add-after 'unpack 'patch-sed-in
3680 (lambda _
3681 (substitute* "sedsed.py"
3682 (("sedbin = 'sed'")
3683 (string-append "sedbin = '" (which "sed") "'")))
3684 #t))
3685 (delete 'build)
3686 (replace 'install
3687 (lambda* (#:key outputs #:allow-other-keys)
3688 (let* ((out (assoc-ref outputs "out"))
3689 (bin (string-append out "/bin")))
3690 ;; Just one file to copy around
3691 (install-file "sedsed.py" bin)
3692 #t)))
b7e26ec6 3693 (add-after 'wrap 'symlink
a054777e 3694 ;; Create 'sedsed' symlink to "sedsed.py".
3695 (lambda* (#:key outputs #:allow-other-keys)
3696 (let* ((out (assoc-ref outputs "out"))
3697 (bin (string-append out "/bin"))
3698 (sed (string-append bin "/sedsed"))
3699 (sedpy (string-append bin "/sedsed.py")))
b7e26ec6 3700 (symlink sedpy sed)
a054777e 3701 #t))))))
fbdabdad 3702 (home-page "https://aurelio.net/projects/sedsed")
a054777e 3703 (synopsis "Sed sed scripts")
3704 (description
975a0c15
TGR
3705 "@code{sedsed} can debug, indent, tokenize and HTMLize your @command{sed}
3706script.
a054777e 3707
975a0c15 3708In debug mode, it reads your script and adds extra commands to it. When
a054777e 3709executed you can see the data flow between the commands, revealing all the
975a0c15 3710magic sed performs on its internal buffers.
a054777e 3711
975a0c15 3712In indent mode, your script is reformatted with standard spacing.
a054777e 3713
975a0c15 3714In tokenize mode, you can see the elements of every command you use.
a054777e 3715
975a0c15 3716In HTMLize mode, your script is converted to a beautiful colored HTML file,
a054777e 3717with all the commands and parameters identified for your viewing pleasure.
3718
3719With sedsed you can master any sed script. No more secrets, no more hidden
3720buffers.")
3721 (license license:expat)))
d10fa5c7 3722
dca48d3c 3723(define-public igt-gpu-tools
d10fa5c7 3724 (package
dca48d3c 3725 (name "igt-gpu-tools")
cf879dc0 3726 ;; You should very likely remove the 'fix-meson.build phase when upgrading.
69f0534a 3727 (version "1.26")
e4d6746f
TGR
3728 (source
3729 (origin
3730 (method git-fetch)
3731 (uri (git-reference
3732 (url "https://gitlab.freedesktop.org/drm/igt-gpu-tools.git")
3733 (commit (string-append "igt-gpu-tools-" version))))
3734 (file-name (git-file-name name version))
3735 (sha256
69f0534a 3736 (base32 "0m124pqv7zna25jnvk566c4kk628jr0w8mgnp8mr5xqz9cprgczm"))))
ad7749a1 3737 (build-system meson-build-system)
d10fa5c7 3738 (arguments
cf879dc0
TGR
3739 `(#:tests? #f ; many of the tests try to load kernel modules
3740 #:phases
3741 (modify-phases %standard-phases
c4b786fb
TGR
3742 (add-after 'unpack 'find-rst2man.py
3743 (lambda _
3744 (substitute* "man/meson.build"
3745 (("'rst2man'") "'rst2man.py'"))))
cf879dc0
TGR
3746 (add-after 'unpack 'fix-meson.build
3747 ;; Fix ‘ERROR: Function does not take positional arguments.’
3748 (lambda _
3749 (substitute* "lib/meson.build"
3750 (("f\\.underscorify\\(f\\)")
3751 "f.underscorify()")))))))
d10fa5c7 3752 (inputs
8394619b
LC
3753 (list cairo
3754 elfutils ; libdw
3755 eudev
3756 kmod
3757 libdrm
3758 libpciaccess
3759 libunwind
3760 procps))
d10fa5c7 3761 (native-inputs
c4b786fb 3762 (list bison flex pkg-config python-docutils))
49d41690 3763 (home-page "https://gitlab.freedesktop.org/drm/igt-gpu-tools")
d10fa5c7 3764 (synopsis "Tools for development and testing of the Intel DRM driver")
dca48d3c 3765 (description "IGT GPU Tools is a collection of tools for development and
d10fa5c7
RW
3766testing of the Intel DRM driver. There are many macro-level test suites that
3767get used against the driver, including xtest, rendercheck, piglit, and
3768oglconform, but failures from those can be difficult to track down to kernel
3769changes, and many require complicated build procedures or specific testing
dca48d3c 3770environments to get useful results. Therefore, IGT GPU Tools includes
d10fa5c7
RW
3771low-level tools and tests specifically for development and testing of the
3772Intel DRM Driver.")
9f375a4c 3773 (supported-systems '("i686-linux" "x86_64-linux"))
d10fa5c7 3774 (license license:expat)))
c1aba1a7 3775
6e75ea48 3776(define-public neofetch
816bce68
MR
3777 (package
3778 (name "neofetch")
1a9acdef 3779 (version "7.1.0")
816bce68
MR
3780 (source (origin
3781 (method git-fetch)
3782 (uri (git-reference
3783 (url "https://github.com/dylanaraps/neofetch")
3784 (commit version)))
3785 (file-name (git-file-name name version))
3786 (sha256
3787 (base32
1a9acdef 3788 "0i7wpisipwzk0j62pzaigbiq42y1mn4sbraz4my2jlz6ahwf00kv"))))
816bce68
MR
3789 (build-system gnu-build-system)
3790 (arguments
3791 `(#:tests? #f ; there are no tests
3792 #:make-flags
3793 (list (string-append "PREFIX=" %output))
3794 #:phases
3795 (modify-phases %standard-phases
3796 (delete 'configure)))) ; no configure script
3797 (home-page "https://github.com/dylanaraps/neofetch")
3798 (synopsis "System information script")
3799 (description "Neofetch is a command-line system information tool written in
2cd8e6e0 3800Bash. Neofetch displays information about your system next to an image, your OS
6e75ea48
EJ
3801logo, or any ASCII file of your choice. The main purpose of Neofetch is to be
3802used in screenshots to show other users what operating system or distribution
3803you are running, what theme or icon set you are using, etc.")
816bce68 3804 (license license:expat)))
a76ca052 3805
ff12cf5e
W
3806(define-public hyfetch
3807 (package
3808 (name "hyfetch")
3809 (version "1.0.2")
3810 (source
3811 (origin
3812 (method url-fetch)
3813 (uri (pypi-uri "HyFetch" version))
3814 (sha256
3815 (base32 "1bfkycdhsyzkk6q24gdy1xwvyz0rvkr7xk2khbn74b3nk6kp83r2"))))
3816 (build-system python-build-system)
3817 (inputs (list python-hypy-utils python-typing-extensions))
3818 (arguments `(#:phases (modify-phases %standard-phases
3819 (add-before 'build 'set-HOME
3820 (lambda _ ;; Tries to set files in .config
3821 (setenv "HOME" "/tmp"))))))
3822 (home-page "https://github.com/hykilpikonna/HyFetch")
3823 (synopsis "@code{neofetch} with pride flags <3")
3824 (description "HyFetch is a command-line system information tool fork of
3825@code{neofetch}. HyFetch displays information about your system next to your
3826OS logo in ASCII representation. The ASCII representation is then colored in
3827the pattern of the pride flag of your choice. The main purpose of HyFetch is to
3828be used in screenshots to show other users what operating system or distribution
3829you are running, what theme or icon set you are using, etc.")
3830 (license license:expat)))
3831
67648704 3832(define-public screenfetch
9dbda847
TGR
3833 (package
3834 (name "screenfetch")
89f51a9d 3835 (version "3.9.1")
9dbda847
TGR
3836 (source (origin
3837 (method git-fetch)
3838 (uri (git-reference
3839 (url "https://github.com/KittyKatt/screenFetch")
3840 (commit (string-append "v" version))))
3841 (file-name (git-file-name name version))
3842 (sha256
3843 (base32
89f51a9d 3844 "04l8aqr474pb115nagn9f6y48jw92n1qfszgw7dbhgl4mpn95lcr"))))
9dbda847
TGR
3845 (build-system trivial-build-system)
3846 (arguments
3847 `(#:modules ((guix build utils))
3848 #:builder
3849 (begin
3850 (use-modules (guix build utils))
3851 (let ((source (assoc-ref %build-inputs "source"))
3852 (out (assoc-ref %outputs "out")))
3853 (mkdir-p (string-append out "/bin/"))
3854 (copy-file (string-append source "/screenfetch-dev")
3855 (string-append out "/bin/screenfetch"))
3856 (install-file (string-append source "/screenfetch.1")
3857 (string-append out "/man/man1/"))
3858 (install-file (string-append source "/COPYING")
3859 (string-append out "/share/doc/" ,name "-" ,version))
3860 (substitute* (string-append out "/bin/screenfetch")
3861 (("/usr/bin/env bash")
2dffe476 3862 (search-input-file %build-inputs "/bin/bash")))
9dbda847 3863 (wrap-program
67648704 3864 (string-append out "/bin/screenfetch")
9dbda847
TGR
3865 `("PATH" ":" prefix
3866 (,(string-append (assoc-ref %build-inputs "bc") "/bin:"
3867 (assoc-ref %build-inputs "scrot") "/bin:"
3868 (assoc-ref %build-inputs "xdpyinfo") "/bin"
3869 (assoc-ref %build-inputs "xprop") "/bin"))))
3870 (substitute* (string-append out "/bin/screenfetch")
3871 (("#!#f")
2dffe476
LC
3872 (string-append "#!"
3873 (search-input-file %build-inputs
3874 "/bin/bash"))))))))
9dbda847 3875 (inputs
8394619b 3876 (list bash bc scrot xdpyinfo xprop))
9dbda847
TGR
3877 (home-page "https://github.com/KittyKatt/screenFetch")
3878 (synopsis "System information script")
3879 (description "Bash screenshot information tool which can be used to
67648704
JK
3880generate those nifty terminal theme information and ASCII distribution logos in
3881everyone's screenshots nowadays.")
9dbda847 3882 (license license:gpl3)))
67648704 3883
ce9ea433
EB
3884(define-public ufetch
3885 (let ((commit "98b622023e03fe24dbc137e9a68104dfe1fbd04a")
3886 (revision "1"))
3887 (package
3888 (name "ufetch")
3889 (version (git-version "0.2" revision commit))
3890 (source (origin
3891 (method git-fetch)
3892 (uri (git-reference
3893 (url "https://gitlab.com/jschx/ufetch.git")
3894 (commit commit)))
3895 (file-name (git-file-name name version))
3896 (sha256
3897 (base32
3898 "09c4zmikza16xpydinnqbi3hmcibfrrn10wij7j0j1wv1pj2sl2l"))))
3899 (build-system trivial-build-system)
3900 (inputs
3901 `(("bash" ,bash)
3902 ("tput" ,ncurses)))
3903 (arguments
3904 `(#:modules ((guix build utils))
3905 #:builder
3906 (begin
3907 (use-modules (guix build utils))
3908 (let* ((source (assoc-ref %build-inputs "source"))
3909 (output (assoc-ref %outputs "out"))
3910 (bindir (string-append output "/bin"))
3911 (docdir (string-append output "/share/doc/ufetch-" ,version))
2dffe476 3912 (tput (search-input-file %build-inputs "/bin/tput")))
ce9ea433
EB
3913 (install-file (string-append source "/LICENSE") docdir)
3914 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
3915 (mkdir-p bindir)
3916 (for-each (lambda (src)
3917 (let ((dst (string-append bindir "/" (basename src))))
3918 (copy-file src dst)
3919 (patch-shebang dst)
3920 (substitute* dst (("tput") tput))))
3921 (find-files source "ufetch-[[:alpha:]]*$"))
3922 ;; Note: the `ufetch` we create below will only work if run under
3923 ;; the Guix System. I.e. a user trying to run `ufetch` on a
3924 ;; foreign distro will not get great results. The `screenfetch`
3925 ;; program does actual runtime detection of the operating system,
3926 ;; and would be a better choice in such a situation.
3927 (symlink "ufetch-guix" (string-append bindir "/ufetch"))))))
3928 (home-page "https://gitlab.com/jschx/ufetch")
3929 (synopsis "Tiny system info")
3930 (description "This package provides a tiny system info utility.")
3931 (license license:isc))))
3932
67d621c5
EB
3933(define-public pfetch
3934 (let ((commit "e18a0959ab98b963744755ec4687e59dc11db3c5")
3935 (revision "0"))
3936 (package
3937 (name "pfetch")
3938 (version (git-version "0.7.0" revision commit))
3939 (source (origin
3940 (method git-fetch)
3941 (uri (git-reference
3942 (url "https://github.com/dylanaraps/pfetch")
3943 (commit commit)))
3944 (file-name (git-file-name name version))
3945 (sha256
3946 (base32
3947 "1md40av6i3xvvwig5jzhy4kf3s5sgxxk35r0vcyrjd8qyndk927l"))))
3948 (build-system trivial-build-system)
8394619b 3949 (inputs (list bash))
67d621c5
EB
3950 (arguments
3951 `(#:modules ((guix build utils))
3952 #:builder
3953 (begin
3954 (use-modules (guix build utils))
3955 (let* ((source (lambda (f)
3956 (string-append (assoc-ref %build-inputs "source") "/" f)))
3957 (output (assoc-ref %outputs "out"))
3958 (docdir (string-append output "/share/doc/pfetch-" ,version)))
3959 (install-file (source "LICENSE.md") docdir)
3960 (install-file (source "README.md") docdir)
3961 (install-file (source "pfetch") (string-append output "/bin"))
3962 (patch-shebang
3963 (string-append output "/bin/pfetch")
3964 (list (string-append (assoc-ref %build-inputs "bash") "/bin")))
3965 #t))))
3966 (home-page "https://github.com/dylanaraps/pfetch")
3967 (synopsis "System information tool")
3968 (description "This package provides a simple, configurable system
3969information tool.")
3970 (license license:expat))))
3971
a76ca052
EJ
3972(define-public nnn
3973 (package
3974 (name "nnn")
0de6c317 3975 (version "4.6")
eb5a6643
TGR
3976 (source
3977 (origin
3978 (method url-fetch)
3979 (uri (string-append "https://github.com/jarun/nnn/releases/download/v"
16572d0e 3980 version "/nnn-v" version ".tar.gz"))
eb5a6643 3981 (sha256
0de6c317 3982 (base32 "0gvyvynw957yirvc1aj65flzni7niaj5bvyk82ka5dfgi2dazb0m"))))
a76ca052 3983 (build-system gnu-build-system)
eb5a6643 3984 (inputs
8394619b 3985 (list ncurses readline))
eb5a6643 3986 (native-inputs
8394619b 3987 (list pkg-config))
a76ca052 3988 (arguments
755e702d
TGR
3989 (list #:tests? #f ; no tests
3990 #:make-flags
3991 #~(list
3992 (string-append "PREFIX=" #$output)
3993 (string-append "CC=" #$(cc-for-target))
3994 (string-append "PKG_CONFIG=" #$(pkg-config-for-target)))
3995 #:phases
3996 #~(modify-phases %standard-phases
3997 (delete 'configure)))) ; no configure script
a76ca052
EJ
3998 (home-page "https://github.com/jarun/nnn")
3999 (synopsis "Terminal file browser")
605a40b3
TGR
4000 (description
4001 "@command{nnn} is a fork of @command{noice}, a fast and minimal text
4002terminal file browser with keyboard shortcuts for navigation, opening files and
4003running tasks. There is no configuration file and MIME associations are
4004hard-coded.")
a76ca052 4005 (license license:bsd-2)))
58989684
CAW
4006
4007(define-public thermald
4008 (package
4009 (name "thermald")
924352ab 4010 (version "2.4.7")
58989684
CAW
4011 (source
4012 (origin
d09e84c2
EF
4013 (method git-fetch)
4014 (uri (git-reference
66741676 4015 (url "https://github.com/intel/thermal_daemon")
d09e84c2
EF
4016 (commit (string-append "v" version))))
4017 (file-name (git-file-name name version))
4018 (sha256
924352ab 4019 (base32 "1n0ih86bkm09bzhjl7hllxkl4gzcxvzsznbwi8dx87ragsjlix6n"))))
58989684
CAW
4020 (build-system gnu-build-system)
4021 (arguments
12007839 4022 `(#:configure-flags
8fe36949 4023 (let ((out (assoc-ref %outputs "out")))
7a67a45f 4024 (list (string-append "--with-dbus-sys-dir="
58989684 4025 out "/etc/dbus-1/system.d")
73db69be
GLV
4026 "--localstatedir=/var"
4027 "--disable-werror"))
c9188cdb
TGR
4028 #:make-flags
4029 (list "V=1") ; log build commands
4030 #:phases
4031 (modify-phases %standard-phases
4032 (add-before 'bootstrap 'no-early-./configure
4033 (lambda _
ddd871c1 4034 (setenv "NO_CONFIGURE" "yet"))))))
58989684 4035 (native-inputs
8394619b
LC
4036 (list autoconf
4037 autoconf-archive
4038 automake
4039 `(,glib "bin") ; for glib-genmarshal, etc.
4040 gtk-doc
4041 pkg-config))
58989684 4042 (inputs
8394619b 4043 (list dbus-glib libevdev libxml2 upower xz))
58989684
CAW
4044 (home-page "https://01.org/linux-thermal-daemon/")
4045 (synopsis "CPU scaling for thermal management")
4046 (description "The Linux Thermal Daemon helps monitor and control temperature
4047on systems running the Linux kernel.")
b6315bc0 4048 ;; arm and aarch64 don't have cpuid.h.
86ee7625 4049 (supported-systems '("i686-linux" "x86_64-linux"))
7fb78380 4050 (license license:gpl2)))
d7c64ad5
LF
4051
4052(define-public masscan
4053 (package
4054 (name "masscan")
b4bf9516 4055 (version "1.0.5")
e956d76d
TGR
4056 (source
4057 (origin
4058 (method git-fetch)
4059 (uri (git-reference
b0e7b699 4060 (url "https://github.com/robertdavidgraham/masscan")
e956d76d
TGR
4061 (commit version)))
4062 (file-name (git-file-name name version))
4063 (sha256
4064 (base32 "0q0c7bsf0pbl8napry1qyg0gl4pd8wn872h4mz9b56dx4rx90vqg"))))
d7c64ad5
LF
4065 (build-system gnu-build-system)
4066 (inputs
8394619b 4067 (list libpcap))
d7c64ad5 4068 (arguments
164c4910 4069 `(#:test-target "regress"
b4bf9516 4070 #:make-flags
164c4910 4071 (list (string-append "CC=" ,(cc-for-target))
b4bf9516 4072 (string-append "PREFIX=" (assoc-ref %outputs "out")))
d7c64ad5
LF
4073 #:phases
4074 (modify-phases %standard-phases
b4bf9516 4075 (delete 'configure) ; no ./configure script
d7c64ad5
LF
4076 (add-after 'unpack 'patch-path
4077 (lambda* (#:key outputs inputs #:allow-other-keys)
4078 (let* ((out (assoc-ref outputs "out"))
4079 (pcap (assoc-ref inputs "libpcap")))
4080 (substitute* "src/rawsock-pcap.c"
4081 (("libpcap.so") (string-append pcap "/lib/libpcap.so")))
4082 #t))))))
4083 (synopsis "TCP port scanner")
4084 (description "MASSCAN is an asynchronous TCP port scanner. It can detect
4085open ports, and also complete the TCP connection and interact with the remote
4086application, collecting the information received.")
4087 (home-page "https://github.com/robertdavidgraham/masscan")
b4bf9516
TGR
4088 ;; 'src/siphash24.c' is the SipHash reference implementation, which
4089 ;; bears a CC0 Public Domain Dedication.
d7c64ad5 4090 (license license:agpl3+)))
82d57f12
TGR
4091
4092(define-public hungrycat
4093 (package
4094 (name "hungrycat")
4095 (version "0.4.1")
4096 (source (origin
4097 (method url-fetch)
4098 (uri (string-append "https://github.com/jwilk/hungrycat/"
4099 "releases/download/" version "/"
e20796dc 4100 "hungrycat-" version ".tar.gz"))
82d57f12
TGR
4101 (sha256
4102 (base32
4103 "03fc1zsrf99lvxa7b4ps6pbi43304wbxh1f6ci4q0vkal370yfwh"))))
4104 (build-system gnu-build-system)
4105 (native-inputs
4106 ;; For tests.
4107 `(("python" ,python-wrapper)
4108 ("python-nose" ,python-nose)))
4109 (arguments
4110 `(#:test-target "test"))
ae876b9c 4111 (synopsis "Single tool that combines @command{cat} & @command{rm}")
82d57f12
TGR
4112 (description
4113 "hungrycat prints the contents of a file to standard output, while
4114simultaneously freeing the disk space it occupied. It is useful if you need
4115to process a large file, don't have enough space to store both the input and
4116output files, and don't need the input file afterwards.
4117While similar in principle to running @command{cat} immediately followed by
4118@command{rm}, @command{hungrycat} actually frees blocks as soon as they are
4119printed instead of after the entire file has been read, which is often too
4120late.")
4121 (home-page "https://jwilk.net/software/hungrycat")
4122 (license license:expat)))
3ebf2c29
PAR
4123
4124(define-public launchmon
4125 (package
4126 (name "launchmon")
4127 (version "1.0.2")
4128 (source (origin
4129 (method url-fetch)
4130 (uri (string-append
4131 "https://github.com/LLNL/LaunchMON/releases/download/v"
f44eca94 4132 version "/launchmon-v" version ".tar.gz"))
3ebf2c29
PAR
4133 (sha256
4134 (base32
989d564f
MB
4135 "0fm3nd9mydm9v2bf7bh01dbgrfnpwkapxa3dsvy3x1z0rz61qc0x"))
4136 (modules '((guix build utils)))
4137 (snippet
4138 '(begin
4139 ;; Fix build failure with GCC 7 due to a conversion error.
4140 ;; Remove for versions > 1.0.2.
4141 (substitute* "launchmon/src/linux/lmon_api/lmon_coloc_spawner.cxx"
4142 ((" lmonpl = '\\\\0'")
4143 " *lmonpl = '\\0'"))
4144 #t))))
3ebf2c29
PAR
4145 (build-system gnu-build-system)
4146 (inputs
e3196755
LC
4147 (list openmpi
4148 munge
4149 boost
4150 libelf
4151 libgcrypt
4152 libgpg-error))
3ebf2c29
PAR
4153 (synopsis "Infrastructue for large scale tool daemon launching")
4154 (description
4155 "LaunchMON is a software infrastructure that enables HPC run-time
4156tools to co-locate tool daemons with a parallel job. Its API allows a
4157tool to identify all the remote processes of a job and to scalably
4158launch daemons into the relevant nodes.")
4159 (home-page "https://github.com/LLNL/LaunchMON")
4160 (supported-systems '("i686-linux" "x86_64-linux"))
4161 (license license:lgpl2.1)))
541dac8a
PAR
4162
4163(define-public spindle
4164 (package
4165 (name "spindle")
4166 (version "0.10")
4167 (source (origin
4168 ;; We use git checkout to avoid github auto-generated tarballs
4169 (method git-fetch)
4170 (uri (git-reference
b0e7b699 4171 (url "https://github.com/hpc/Spindle")
541dac8a
PAR
4172 (commit (string-append "v" version))))
4173 (file-name (git-file-name name version))
4174 (sha256
4175 (base32
4176 "15n3ay0qq81r5v7fif61q1vdjcq44pp2nynkh3fvbzc9fj3c39wd"))))
4177 (build-system gnu-build-system)
4178 (arguments '(#:configure-flags '("--enable-sec-launchmon"
4179 "--enable-sec-munge"
4180 "--enable-sec-none")))
4181 (inputs
4182 `(("mpi" ,openmpi)
4183 ("munge" ,munge)
4184 ("launchmon" ,launchmon)
4185 ("libgcrypt" ,libgcrypt)))
4186 (synopsis "Scalable library loading in HPC environments")
4187 (description
4188 "Spindle is a tool for improving the performance of dynamic library and
4189Python loading in HPC environments.")
4190 (home-page "https://github.com/hpc/Spindle")
785f40df
EF
4191 ;; This package supports x86_64 and PowerPC64
4192 (supported-systems '("x86_64-linux"))
541dac8a 4193 (license license:lgpl2.1)))
bbc94ed0
PN
4194
4195(define-public inxi-minimal
4196 (let ((real-name "inxi"))
4197 (package
4198 (name "inxi-minimal")
db0bab5b 4199 (version "3.3.19-1")
bbc94ed0
PN
4200 (source
4201 (origin
b740a305
TGR
4202 (method git-fetch)
4203 (uri (git-reference
4204 (url "https://github.com/smxi/inxi")
4205 (commit version)))
7458ceac 4206 (file-name (git-file-name real-name version))
bbc94ed0 4207 (sha256
db0bab5b 4208 (base32 "0g5m43cj4534gb181zy1hwjz5il88xibf8psxw8a4s6jnaq1zdlk"))))
bbc94ed0
PN
4209 (build-system trivial-build-system)
4210 (inputs
a49bbaa6
EF
4211 `(("bash" ,bash-minimal)
4212 ("perl" ,perl)
4213 ("procps" ,procps)))
bbc94ed0 4214 (native-inputs
8394619b 4215 (list gzip))
bbc94ed0 4216 (arguments
c5dd10b2 4217 `(#:modules ((guix build utils))
bbc94ed0
PN
4218 #:builder
4219 (begin
4220 (use-modules (guix build utils)
4221 (ice-9 match)
4222 (srfi srfi-26))
4223 (setenv "PATH" (string-append
4224 (assoc-ref %build-inputs "bash") "/bin" ":"
4225 (assoc-ref %build-inputs "gzip") "/bin" ":"
b740a305
TGR
4226 (assoc-ref %build-inputs "perl") "/bin" ":"))
4227 (copy-recursively (assoc-ref %build-inputs "source")
4228 ,(string-append real-name "-" version))
bbc94ed0
PN
4229 (with-directory-excursion ,(string-append real-name "-" version)
4230 (with-fluids ((%default-port-encoding #f))
4231 (substitute* "inxi" (("/usr/bin/env perl") (which "perl"))))
4232 (let ((bin (string-append %output "/bin")))
4233 (install-file "inxi" bin)
4234 (wrap-program (string-append bin "/inxi")
4235 `("PATH" ":" =
4236 ("$PATH"
4237 ,@(map (lambda (input)
4238 (match input
4239 ((name . store)
4240 (let ((store-append
4241 (cut string-append store <>)))
4242 (cond
4243 ((member name '("util-linux"))
4244 (string-append (store-append "/bin") ":"
4245 (store-append "/sbin")))
4246 ((member name '("dmidecode" "iproute2"))
4247 (store-append "/sbin"))
4248 (else (store-append "/bin")))))))
4249 %build-inputs)))
4250 `("PERL5LIB" ":" =
4251 ,(delete
4252 ""
4253 (map (match-lambda
4254 (((? (cut string-prefix? "perl-" <>) name) . dir)
4255 (string-append dir "/lib/perl5/site_perl"))
4256 (_ ""))
4257 %build-inputs)))))
aaed8bab 4258 (invoke "gzip" "-n" "inxi.1")
bbc94ed0 4259 (install-file "inxi.1.gz"
3887c1f3 4260 (string-append %output "/share/man/man1"))))))
bbc94ed0 4261 (home-page "https://smxi.org/docs/inxi.htm")
4ee41a6a 4262 (synopsis "Full-featured system information script")
bbc94ed0
PN
4263 (description "Inxi is a system information script that can display
4264various things about your hardware and software to users in an IRC chatroom or
4ee41a6a 4265support forum. It runs with the @code{/exec} command in most IRC clients.")
bbc94ed0
PN
4266 (license license:gpl3+))))
4267
4268(define-public inxi
4269 (package
4270 (inherit inxi-minimal)
4271 (name "inxi")
4272 (inputs
4273 `(("dmidecode" ,dmidecode)
4274 ("file" ,file)
4275 ("bind:utils" ,isc-bind "utils") ; dig
4276 ("gzip" ,gzip)
4277 ("iproute2" ,iproute) ; ip
4278 ("kmod" ,kmod) ; modinfo
4279 ("lm-sensors" ,lm-sensors)
4280 ("mesa-utils" ,mesa-utils)
4281 ("pciutils" ,pciutils)
bbc94ed0
PN
4282 ("tar" ,tar)
4283 ("tree" ,tree)
4284 ("util-linux" ,util-linux) ; lsblk
4285 ("usbutils" ,usbutils) ; lsusb
4286 ("wmctrl" ,wmctrl)
4287 ("xdpyinfo" ,xdpyinfo)
4288 ("xprop" ,xprop)
4289 ("xrandr" ,xrandr)
4290 ("coreutils" ,coreutils) ; uptime
4291 ("inetutils" ,inetutils) ; ifconfig
4292 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
4293 ("perl-http-tiny" ,perl-http-tiny)
4294 ("perl-io-socket-ssl" ,perl-io-socket-ssl)
4295 ("perl-json-xs" ,perl-json-xs)
4296 ("perl-time-hires" ,perl-time-hires)
04b0636e
TGR
4297 ("lvm2" ,lvm2) ; lvs
4298 ("mdadm" ,mdadm)
bbc94ed0
PN
4299 ;; TODO: Add more inputs:
4300 ;; ipmi-sensors
4301 ;; hddtemp
4302 ;; perl-xml-dumper
4303 ;; ipmitool
4304 ,@(package-inputs inxi-minimal)))))
b19f3337
OP
4305
4306(define-public pscircle
4307 (package
4308 (name "pscircle")
0b4ced58 4309 (version "1.3.1")
b19f3337
OP
4310 (source
4311 (origin
494b702a
TGR
4312 (method git-fetch)
4313 (uri (git-reference
4314 (url "https://gitlab.com/mildlyparallel/pscircle.git")
4315 (commit (string-append "v" version))))
4316 (file-name (git-file-name name version))
b19f3337 4317 (sha256
0b4ced58 4318 (base32 "1sm99423hh90kr4wdjqi9sdrrpk65j2vz2hzj65zcxfxyr6khjci"))))
b19f3337
OP
4319 (build-system meson-build-system)
4320 (native-inputs
8394619b 4321 (list pkg-config))
b19f3337 4322 (inputs
8394619b 4323 (list cairo libpng libx11))
b19f3337
OP
4324 (home-page "https://gitlab.com/mildlyparallel/pscircle")
4325 (synopsis "Visualize Linux processes in a form of radial tree")
4326 (description
4327 "@code{pscircle} visualizes Linux processes in the form of a radial tree.")
4328 (license license:gpl2+)))
ac94ccb9
DM
4329
4330(define-public python-pyudev
4331 (package
4332 (name "python-pyudev")
78fca231 4333 (version "0.22.0")
ac94ccb9
DM
4334 (source
4335 (origin
4336 (method url-fetch)
4337 (uri (pypi-uri "pyudev" version))
4338 (sha256
4339 (base32
78fca231 4340 "0xmj6l08iih2js9skjqpv4w7y0dhxyg91zmrs6v5aa65gbmipfv9"))))
ac94ccb9
DM
4341 (build-system python-build-system)
4342 (arguments
4343 `(#:tests? #f ; Tests require /sys
4344 #:phases
4345 (modify-phases %standard-phases
4346 (add-after 'unpack 'patch-ctypes-udev
4347 (lambda* (#:key inputs outputs #:allow-other-keys)
4348 (let ((eudev (assoc-ref inputs "eudev")))
4349 (substitute* "src/pyudev/core.py"
4350 (("'udev'")
4351 (string-append "'" eudev "/lib/libudev.so'")))
4352 (substitute* "src/pyudev/_ctypeslib/utils.py"
4353 ;; Use absolute paths instead of keys.
4354 (("= find_library") "= "))
4355 #t))))))
4356 (inputs
8394619b 4357 (list eudev))
cbb1b168 4358 (propagated-inputs
8394619b 4359 (list python-six))
ac94ccb9 4360 (native-inputs
8394619b
LC
4361 (list python-docutils python-hypothesis python-mock python-pytest
4362 python-sphinx))
a20ede32 4363 (home-page "https://pyudev.readthedocs.io/")
ac94ccb9
DM
4364 (synopsis "Python udev binding")
4365 (description "This package provides @code{udev} bindings for Python.")
4366 (license license:lgpl2.1)))
15c56e82 4367
c7be46b7 4368(define-public vmtouch
4369 (package
4370 (name "vmtouch")
4371 (version "1.3.1")
4372 (source
4373 (origin
4374 (method git-fetch)
4375 (uri (git-reference
4376 (url "https://github.com/hoytech/vmtouch/")
4377 (commit (string-append "v" version))))
4378 (file-name (git-file-name name version))
4379 (sha256
4380 (base32 "08da6apzfkfjwasn4dxrlfxqfx7arl28apdzac5nvm0fhvws0dxk"))))
4381 (build-system gnu-build-system)
4382 (native-inputs
8394619b 4383 (list perl))
c7be46b7 4384 (arguments
4385 `(#:tests? #f ; no tests
4386 #:make-flags
4387 (list
4388 (string-append "CC=" ,(cc-for-target))
4389 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4390 #:phases
4391 (modify-phases %standard-phases
4392 (delete 'configure))))
4393 (home-page "https://github.com/hoytech/vmtouch/")
4394 (synopsis "Portable file system cache diagnostics and control")
4395 (description
4396 "vmtouch is a tool for learning about and controlling the file system
4397cache of unix and unix-like systems.")
4398 (license license:bsd-3)))
4399
15c56e82
DM
4400(define-public solaar
4401 (package
4402 (name "solaar")
b7beb039 4403 (version "1.0.7")
15c56e82
DM
4404 (source (origin
4405 (method git-fetch)
4406 (uri (git-reference
aed5b1ff 4407 (url "https://github.com/pwr-Solaar/Solaar")
15c56e82
DM
4408 (commit version)))
4409 (file-name (git-file-name name version))
4410 (sha256
4411 (base32
b7beb039 4412 "0k7mjdfvf28fay50b2hs2z4qk6s23h71wvl8777idlrz5i5f43j5"))))
15c56e82
DM
4413 (build-system python-build-system)
4414 (arguments
4415 `(#:phases
4416 (modify-phases %standard-phases
210f5420 4417 (add-before 'build 'setenv-PATH
15c56e82 4418 (lambda _
0a3226e8 4419 (setenv "PYTHONPATH" "lib"))))))
15c56e82 4420 (propagated-inputs
8394619b
LC
4421 (list python-pygobject
4422 python-pyudev
4423 ;; For GUI.
4424 python-pyyaml
4425 python-psutil
4426 python-xlib
4427 gtk+
4428 python-pygobject))
17db882d 4429 (home-page "https://pwr-solaar.github.io/Solaar/")
15c56e82
DM
4430 (synopsis "Linux devices manager for the Logitech Unifying Receiver")
4431 (description "This package provides tools to manage clients of the
4432Logitech Unifying Receiver.")
4433 (license license:gpl2)))
4d26987d
AI
4434
4435(define-public lynis
4436 (package
4437 (name "lynis")
112dc8eb 4438 ;; Also update the ‘lynis-sdk’ input to the commit matching this release.
e490aacd 4439 (version "3.0.8")
4d26987d
AI
4440 (source
4441 (origin
4442 (method git-fetch)
4443 (uri (git-reference
4444 (url "https://github.com/CISOfy/lynis")
4445 (commit version)))
4446 (file-name (git-file-name name version))
4447 (sha256
e490aacd 4448 (base32 "19kz1ffbbd431cdfw7fjcl5hjkks3gfkwk3w2zkwsxgyiky1gx3w"))
4d26987d
AI
4449 (modules '((guix build utils)))
4450 (snippet
4451 '(begin
4452 ;; Remove proprietary plugins. As of now, all plugins supplied with
4453 ;; lynis are proprietary. In the future, if free plugins are
4454 ;; provided, whitelist them from deletion.
d84420d4 4455 (for-each delete-file (find-files "plugins"))))))
4d26987d
AI
4456 (build-system gnu-build-system)
4457 (native-inputs
4458 `(;; For tests
4459 ("lynis-sdk"
4460 ,(origin
4461 (method git-fetch)
4462 (uri (git-reference
4463 (url "https://github.com/CISOfy/lynis-sdk")
e490aacd 4464 (commit "dffe5d352e4d6029ea95a84d50604ccd97cb8999")))
4d26987d
AI
4465 (file-name (git-file-name "lynis-sdk" version))
4466 (sha256
e490aacd 4467 (base32 "05qq4395x8f0kyl1ppm74npsf8sb3hhgz0ck4fya91sy6a26b4ja"))))))
4d26987d
AI
4468 (arguments
4469 `(#:phases
4470 (modify-phases %standard-phases
52431e42
TGR
4471 (replace 'unpack
4472 ;; XXX Remove after fixing <https://issues.guix.gnu.org/55287>.
4473 (lambda* (#:key source #:allow-other-keys)
4474 (mkdir "source")
4475 (chdir "source")
4476 (copy-recursively source "."
4477 #:keep-mtime? #t)))
4d26987d
AI
4478 (replace 'configure
4479 (lambda* (#:key inputs outputs #:allow-other-keys)
4480 (substitute* "lynis"
4481 (("/usr/share/lynis")
4482 (string-append (assoc-ref outputs "out") "/share/lynis")))
4483 (substitute* "include/functions"
4484 (("/usr/local/etc/lynis")
d84420d4 4485 (string-append (assoc-ref outputs "out") "/etc/lynis")))))
4d26987d
AI
4486 (delete 'build)
4487 (replace 'install
4488 (lambda* (#:key outputs #:allow-other-keys)
4489 (let ((out (assoc-ref outputs "out")))
4490 (install-file "lynis" (string-append out "/bin/"))
4491 (install-file "default.prf" (string-append out "/etc/lynis"))
4492 (for-each
4493 (lambda (dir)
4494 (copy-recursively dir (string-append out "/share/lynis/" dir)))
4495 (list "db" "include" "plugins"))
d84420d4 4496 (install-file "lynis.8" (string-append out "/share/man/man8")))))
4d26987d
AI
4497 (replace 'check
4498 (lambda* (#:key inputs #:allow-other-keys)
4499 (copy-recursively (assoc-ref inputs "lynis-sdk") "../lynis-sdk")
4500 (setenv "LANG" "en_US.UTF-8")
4501 (let ((lynis-dir (getcwd)))
4502 (with-directory-excursion "../lynis-sdk"
4503 (substitute* "config"
4504 (("\\.\\./lynis") lynis-dir))
4505 (substitute* "unit-tests/tests-language-translations.sh"
4506 (("\\.\\./lynis") lynis-dir))
4507 (invoke "sh" "lynis-devkit" "run" "unit-tests"))))))))
4508 (home-page "https://cisofy.com/lynis/")
4509 (synopsis "Security auditing tool")
4510 (description "Lynis is a security auditing tool. It performs an in-depth
4511security scan and runs on the system itself. The primary goal is to test
4512security defenses and provide tips for further system hardening. It will also
4513scan for general system information, vulnerable software packages, and
4514possible configuration issues.")
4515 (license license:gpl3+)))
2eddeeba
PN
4516
4517(define-public ngrep
4518 (package
4519 (name "ngrep")
4520 (version "1.47")
4521 (source
4522 (origin
4523 (method git-fetch)
4524 (uri (git-reference
4525 (url "https://github.com/jpr5/ngrep/")
4526 (commit (string-append "V" (string-replace-substring version "." "_")))))
4527 (file-name (git-file-name name version))
4528 (sha256
4529 (base32
4530 "1x2fyd7wdqlj1r76ilal06cl2wmbz0ws6i3ys204sbjh1cj6dcl7"))))
4531 (build-system gnu-build-system)
4532 (inputs
8394619b 4533 (list libpcap))
2eddeeba
PN
4534 (arguments
4535 `(#:tests? #f ;; No tests.
4536 #:configure-flags (list (string-append "--with-pcap-includes="
4537 (assoc-ref %build-inputs "libpcap")
4538 "/include/pcap"))))
4539 (home-page "https://github.com/jpr5/ngrep/")
4540 (synopsis "Grep-like utility to search for network packets on an interface")
4541 (description "@command{ngrep} is like GNU grep applied to the network
4542layer. It's a PCAP-based tool that allows you to specify an extended regular
4543or hexadecimal expression to match against data payloads of packets. It
4544understands many kinds of protocols, including IPv4/6, TCP, UDP, ICMPv4/6,
4545IGMP and Raw, across a wide variety of interface types, and understands BPF
4546filter logic in the same fashion as more common packet sniffing tools, such as
4547tcpdump and snoop.")
4548 (license license:bsd-3)))
cd2ce8ab
GLV
4549
4550(define-public pam-mount
4551 (package
4552 (name "pam-mount")
f7aa0734 4553 (version "2.18")
cd2ce8ab
GLV
4554 (source
4555 (origin
4556 (method url-fetch)
4557 (uri (string-append "mirror://sourceforge/pam-mount/pam_mount/"
6a84fddc 4558 "pam_mount-" version ".tar.xz"))
cd2ce8ab 4559 (sha256
f7aa0734 4560 (base32 "0832nh2qf9pisgwnbgx6hkylx5d7i416l19y3ly4ifv7k1p7mxqa"))))
cd2ce8ab
GLV
4561 (build-system gnu-build-system)
4562 (native-inputs
8394619b 4563 (list perl pkg-config))
cd2ce8ab
GLV
4564 (inputs
4565 `(("cryptsetup" ,cryptsetup)
4566 ("libhx" ,libhx)
4567 ("libxml2" ,libxml2)
4568 ("linux-pam" ,linux-pam)
4569 ("lvm2" ,lvm2)
4570 ("openssl" ,openssl)
f7aa0734 4571 ("pcre2" ,pcre2)
bb93042c 4572 ("libmount" ,util-linux "lib")
cd2ce8ab
GLV
4573 ("util-linux" ,util-linux)))
4574 (arguments
4575 `(#:configure-flags
4576 (list (string-append "--with-slibdir=" %output "/lib")
4577 (string-append "--with-ssbindir=" %output "/sbin"))
4578 #:phases
4579 (modify-phases %standard-phases
4580 (add-after 'unpack 'fix-program-paths
4581 (lambda* (#:key inputs outputs #:allow-other-keys)
4582 (let ((util-linux (assoc-ref inputs "util-linux"))
4583 (out (assoc-ref outputs "out")))
4584 (substitute* "src/mtcrypt.c"
4585 (("\"mount\";")
4586 (string-append "\"" util-linux "/bin/mount\";"))
4587 (("\"umount\";")
4588 (string-append "\"" util-linux "/bin/umount\";"))
4589 (("\"fsck\",")
4590 (string-append "\"" util-linux "/sbin/fsck\",")))
4591 (substitute* "src/rdconf1.c"
4592 (("\"mount\", \"")
4593 (string-append "\"" util-linux "/bin/mount\", \""))
4594 (("\"umount\", \"")
4595 (string-append "\"" util-linux "/bin/umount\", \""))
4596 (("\"fsck\", \"")
4597 (string-append "\"" util-linux "/sbin/fsck\", \""))
4598 (("\"pmvarrun\", \"")
4599 (string-append "\"" out "/sbin/pmvarrun\", \""))))
4600 #t)))))
4601 (home-page "http://pam-mount.sourceforge.net")
4602 (synopsis "PAM module to mount volumes for a user session")
4603 (description
4604 "Pam-mount is a PAM module that can mount volumes when a user logs in.
4605It supports mounting local filesystems of any kind the normal mount utility
4606supports. It can also mount encrypted LUKS volumes using the password
4607supplied by the user when logging in.")
4608 (license (list license:gpl2+ license:lgpl2.1+))))
ace3e549 4609
d8a046d5
OP
4610(define-public jc
4611 (package
4612 (name "jc")
1a6be557 4613 (version "1.19.0")
b94cb3be
TGR
4614 (source
4615 (origin
4616 ;; The PyPI tarball lacks the test suite.
4617 (method git-fetch)
4618 (uri (git-reference
4619 (url "https://github.com/kellyjonbrazil/jc")
4620 (commit (string-append "v" version))))
4621 (file-name (git-file-name name version))
4622 (sha256
1a6be557 4623 (base32 "021zk0y8kb6v3qf3hwfg8qjzzmrca039nz3fjywiy2njmbhr8hyi"))))
d8a046d5 4624 (build-system python-build-system)
1a6be557
TGR
4625 (arguments
4626 (list #:phases
4627 #~(modify-phases %standard-phases
4628 ;; XXX Guix's America/Los_Angeles time zone is somehow broken.
4629 (add-before 'check 'hack-time-zone
4630 (lambda _
4631 (substitute* (find-files "tests" "^test.*\\.py$")
4632 (("America/Los_Angeles") "PST8PDT")))))))
d8a046d5 4633 (propagated-inputs
8394619b 4634 (list python-pygments python-ruamel.yaml python-xmltodict))
d8a046d5
OP
4635 (home-page "https://github.com/kellyjonbrazil/jc")
4636 (synopsis "Convert the output of command-line tools to JSON")
4637 (description "@code{jc} JSONifies the output of many CLI tools and
4638file-types for easier parsing in scripts.")
4639 (license license:expat)))
4640
ace3e549
OP
4641(define-public jtbl
4642 (package
4643 (name "jtbl")
517bd086 4644 (version "1.1.7")
ace3e549
OP
4645 (source (origin
4646 (method git-fetch)
4647 (uri (git-reference
b0e7b699 4648 (url "https://github.com/kellyjonbrazil/jtbl")
ace3e549
OP
4649 (commit (string-append "v" version))))
4650 (file-name (git-file-name name version))
4651 (sha256
4652 (base32
517bd086 4653 "19i21fqz2m40cds9pb17brjxkczqagmx2f7mfb0xdvbygaply5wz"))))
ace3e549
OP
4654 (build-system python-build-system)
4655 (inputs
8394619b 4656 (list python-tabulate))
ace3e549
OP
4657 (home-page "https://github.com/kellyjonbrazil/jtbl")
4658 (synopsis "Command-line tool to print JSON data as a table in the terminal")
4659 (description "@code{jtbl} accepts piped JSON data from stdin and outputs a
4660text table representation to stdout.")
4661 (license license:expat)))
ceb233bb
OP
4662
4663(define-public hosts
4664 (package
4665 (name "hosts")
4666 (version "3.6.3")
4667 (source (origin
4668 (method git-fetch)
4669 (uri (git-reference
b0e7b699 4670 (url "https://github.com/xwmx/hosts")
ceb233bb
OP
4671 (commit version)))
4672 (file-name (git-file-name name version))
4673 (sha256
4674 (base32
4675 "1ni4z89kxzgwm26hhx908g04f2h0fypy7lgfa0rvsz8d0wslgcsn"))))
4676 (build-system trivial-build-system)
4677 (inputs
4678 `(("bats" ,bats) ;for test
4679 ("awk" ,gawk)
4680 ("bash" ,bash)
4681 ("coreutils" ,coreutils)
4682 ("diffutils" ,diffutils)
4683 ("grep" ,grep)
4684 ("ncurses" ,ncurses) ;tput
4685 ("sed" ,sed)))
4686 (arguments
4687 `(#:modules ((guix build utils))
4688 #:builder
4689 (begin
4690 (use-modules (guix build utils))
4691 ;; copy source
4692 (copy-recursively (assoc-ref %build-inputs "source") ".")
4693 ;; patch-shebang phase
4694 (setenv "PATH"
4695 (string-append (assoc-ref %build-inputs "bash") "/bin"
4696 ":" (assoc-ref %build-inputs "awk") "/bin"
4697 ":" (assoc-ref %build-inputs "coreutils") "/bin"
4698 ":" (assoc-ref %build-inputs "diffutils") "/bin"
4699 ":" (assoc-ref %build-inputs "grep") "/bin"
4700 ":" (assoc-ref %build-inputs "ncurses") "/bin"
4701 ":" (assoc-ref %build-inputs "sed") "/bin"
4702 ":" "/run/setuid-programs"
4703 ":" (getenv "PATH")))
4704 (substitute* "hosts"
4705 (("#!/usr/bin/env bash")
4706 (string-append "#!" (which "bash")
4707 "\nPATH=" (getenv "PATH"))))
4708 ;; check phase
4709 (setenv "TERM" "linux") ;set to tty for test
2dffe476 4710 (invoke (search-input-file %build-inputs "/bin/bats")
ceb233bb
OP
4711 "test")
4712 ;; install phase
4713 (install-file "hosts" (string-append %output "/bin"))
4714 (let ((bash-completion
4715 (string-append %output "/etc/bash_completion.d")))
4716 (mkdir-p bash-completion)
4717 (copy-file "etc/hosts-completion.bash"
4718 (string-append bash-completion "/hosts")))
4719 (let ((zsh-completion
4720 (string-append %output "/share/zsh/site-functions")))
4721 (mkdir-p zsh-completion)
4722 (copy-file "etc/hosts-completion.zsh"
4723 (string-append zsh-completion "/_hosts")))
4724 (let ((doc (string-append %output "/share/doc/" ,name "-" ,version)))
4725 (mkdir-p doc)
4726 (install-file "LICENSE" doc)
4727 (install-file "README.md" doc))
4728 #t)))
4729 (home-page "https://github.com/xwmx/hosts/")
4a986753 4730 (synopsis "Script for editing a foreign distro's @file{/etc/hosts} file")
ceb233bb 4731 (description "Hosts is a command line program for managing
4a986753
JN
4732@file{/etc/hosts} entries. On Guix System, @file{/etc/hosts} is managed from
4733the system configuration; hosts only works when using the Guix package manager
4734on a foreign distro. @command{hosts} works with existing hosts files and
4735entries, providing commands to add, remove, comment, and search.")
ceb233bb 4736 (license license:expat)))
93d3cfec
DM
4737
4738(define-public nmrpflash
4739 (package
4740 (name "nmrpflash")
56b29a61 4741 (version "0.9.16")
93d3cfec
DM
4742 (source
4743 (origin
4744 (method git-fetch)
4745 (uri
4746 (git-reference
8ed4c468 4747 (url "https://github.com/jclehner/nmrpflash")
93d3cfec
DM
4748 (commit (string-append "v" version))))
4749 (sha256
56b29a61 4750 (base32 "0gp66l3a2wznjnlc2ljs8g38mfrf1b9a0qcfxqg2bczmfxnrsynj"))
93d3cfec
DM
4751 (file-name (git-file-name name version))))
4752 (build-system gnu-build-system)
4753 (native-inputs
8394619b 4754 (list pkg-config))
93d3cfec 4755 (inputs
8394619b 4756 (list libnl libpcap))
93d3cfec
DM
4757 (arguments
4758 `(#:tests? #f ; None exist
4759 #:make-flags
4760 (list (string-append "CC=" ,(cc-for-target))
4761 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4762 #:phases
4763 (modify-phases %standard-phases
4764 (delete 'configure)
4765 (add-before 'install 'prepare-install
4766 (lambda* (#:key outputs #:allow-other-keys)
56b29a61 4767 (mkdir-p (string-append (assoc-ref outputs "out") "/bin")))))))
93d3cfec
DM
4768 (home-page "https://github.com/jclehner/nmrpflash")
4769 (synopsis "Netgear unbrick utility")
4770 (description "This package provides a utility to flash a new firmware
4771image to a Netgear device. It has been tested on Netgear EX2700, EX6120,
4772EX6150v2, DNG3700v2, R6100, R6220, R7000, D7000, WNR3500, R6400, R6800,
4773R8000, R8500, WNDR3800, but is likely to be compatible with many other
4774Netgear devices.")
4775 (license license:gpl3+)))
3728ed7c
LF
4776
4777(define-public atop
4778 (package
4779 (name "atop")
eab070a8 4780 (version "2.7.1")
3728ed7c
LF
4781 (source (origin
4782 (method url-fetch)
4783 (uri (string-append "https://www.atoptool.nl/download/atop-"
4784 version ".tar.gz"))
4785 (sha256
4786 (base32
eab070a8 4787 "0kjwgf94skbrndv1krlmsrq34smzi3iwk73fbsnyw787gvqx4j6a"))))
3728ed7c
LF
4788 (build-system gnu-build-system)
4789 (arguments
ef55192e
EF
4790 (list
4791 #:tests? #f ; no test suite
3728ed7c 4792 #:make-flags
ef55192e
EF
4793 #~(list (string-append "CC=" #$(cc-for-target))
4794 (string-append "DESTDIR=" #$output)
4795 (string-append "SYSDPATH=/etc/systemd/system")
4796 (string-append "PMPATHD=/etc/systemd/system-sleep")
4797 ;; Or else it tries to create /var/log/atop...
4798 (string-append "LOGPATH="))
3728ed7c 4799 #:phases
ef55192e
EF
4800 #~(modify-phases %standard-phases
4801 (delete 'configure) ; No ./configure script
4802 (add-before 'build 'patch-build
4803 (lambda _
4804 (substitute* "Makefile"
4805 ;; Don't use /usr as a prefix.
4806 (("/usr") "")
4807 ;; Otherwise, it creates a blank configuration file as a "default".
4808 (("touch.*DEFPATH)/atop") "")
4809 (("chmod.*DEFPATH)/atop") "")))))))
3728ed7c 4810 (inputs
ef55192e
EF
4811 (list ncurses
4812 python-wrapper ; for `atopgpud`
4813 zlib))
3728ed7c
LF
4814 (home-page "https://www.atoptool.nl/")
4815 (synopsis "Linux performance monitoring console")
4816 (description "Atop is an ASCII full-screen performance monitor for Linux
4817that is capable of reporting the activity of all processes (even processes have
4818finished during the monitoring interval), daily logging of system and process
4819activity for long-term analysis, highlighting overloaded system resources by
4820using colors, etc. At regular intervals, it shows system-level activity related
4821to the CPU, memory, swap, disks (including LVM) and network layers, and for
4822every process (and thread) it shows e.g. the CPU utilization, memory growth,
4823disk utilization, priority, username, state, and exit code.")
e81f26d2
EF
4824 (properties
4825 `((release-monitoring-url . "https://www.atoptool.nl/downloadatop.php")))
3728ed7c 4826 (license license:gpl2+)))
a94214f6
DM
4827
4828;; TODO: Unvendor u-root (pkg: forth, golang, testutil).
4829(define fiano
4830 (package
4831 (name "fiano")
4832 (version "5.0.0")
4833 (source (origin
4834 (method git-fetch)
4835 (uri (git-reference
4836 (url "https://github.com/linuxboot/fiano.git")
4837 (commit (string-append "v" version))))
4838 (file-name (string-append name "-" version "-checkout"))
4839 (sha256
4840 (base32
4841 "03ihdwwhb7g6bihx141cn0924sjs5ps6q3ps58pk1cg0g0srrr9h"))
4842 (modules '((guix build utils)))
4843 (snippet
4844 '(begin
4845 (delete-file-recursively "vendor/golang.org")
4846 (delete-file-recursively "vendor/github.com")
4847 #t))))
4848 (build-system go-build-system)
4849 (arguments
4850 `(#:import-path "github.com/linuxboot/fiano"
4851 #:unpack-path "github.com/linuxboot/fiano"))
4852 (native-inputs
4853 `())
4854 (inputs
4855 `(("go-golang-org-x-text" ,go-golang-org-x-text)
4856 ("go-github.com-ulikunitz-xz" ,go-github.com-ulikunitz-xz)))
4857 (synopsis "UEFI image editor")
4858 (description "This package provides a command-line UEFI image editor.")
4859 (home-page "https://github.com/linuxboot/fiano")
4860 (license license:bsd-3)))
4f318f74
DM
4861
4862(define-public fiano-utk
4863 (package
4864 (inherit fiano)
4865 (name "fiano-utk")
4866 (arguments
4867 `(#:import-path "github.com/linuxboot/fiano/cmds/utk"
4868 #:unpack-path "github.com/linuxboot/fiano"))))
ad012138
DM
4869
4870(define-public fiano-fmap
4871 (package
4872 (inherit fiano)
4873 (name "fiano-fmap")
4874 (arguments
4875 `(#:import-path "github.com/linuxboot/fiano/cmds/fmap"
4876 #:unpack-path "github.com/linuxboot/fiano"))))
00fb3976
DM
4877
4878(define-public novena-eeprom
4879 (package
4880 (name "novena-eeprom")
4881 (version "2.3")
4882 (source (origin
4883 (method git-fetch)
4884 (uri (git-reference
4885 (url "https://github.com/xobs/novena-eeprom.git")
4886 (commit (string-append "v" version))))
4887 (file-name (string-append name "-" version "-checkout"))
4888 (sha256
4889 (base32
4890 "00pd71mg0g20v0820ggp3ghf9nyj5s4wavaz9mkmrmsr91hcnf7i"))))
4891 (build-system gnu-build-system)
4892 (arguments
4893 `(#:tests? #f ; No tests exist
4894 #:make-flags
4895 (list (string-append "CC=" ,(cc-for-target)))
4896 #:phases
4897 (modify-phases %standard-phases
4898 (delete 'configure)
4899 (replace 'install
4900 (lambda* (#:key outputs #:allow-other-keys)
4901 (let* ((out (assoc-ref outputs "out"))
4902 (out-bin (string-append out "/bin"))
4903 (out-share-man (string-append out "/share/man/man8")))
4904 (install-file "novena-eeprom" out-bin)
4905 (install-file "novena-eeprom.8" out-share-man)))))))
4906 (inputs
063b43b9 4907 (list i2c-tools-3))
00fb3976
DM
4908 (synopsis "Novena EEPROM editor")
4909 (description "This package provides an editor for the Novena EEPROM.
4910Novena boards contain a device-dependent descriptive EEPROM that defines
4911various parameters such as serial number, MAC address, and featureset.
4912This program allows you to view and manipulate this EEPROM list.")
4913 (home-page "https://github.com/xobs/novena-eeprom/")
4914 (supported-systems '("armhf-linux"))
4915 (license license:bsd-3)))
74a83afd
DM
4916
4917(define-public lrzsz
4918 (package
4919 (name "lrzsz")
4920 (version "0.12.20")
4921 (source (origin
4922 (method url-fetch)
4923 (uri (string-append "https://www.ohse.de/uwe/releases/lrzsz-"
4924 version ".tar.gz"))
4925 (sha256
4926 (base32
4927 "1wcgfa9fsigf1gri74gq0pa7pyajk12m4z69x7ci9c6x9fqkd2y2"))))
4928 (build-system gnu-build-system)
4929 (arguments
4930 `(#:phases
4931 (modify-phases %standard-phases
4932 (replace 'configure
4933 (lambda* (#:key outputs #:allow-other-keys)
4934 (setenv "CONFIG_SHELL" (which "bash"))
4935 (invoke "./configure"
4936 (string-append "--prefix="
4937 (assoc-ref outputs "out"))))))))
4938 (synopsis "Implementation of XMODEM/YMODEM/ZMODEM transfer protocols")
4939 (description "This package provides programs that transfer files using
4940the XMODEM/YMODEM/ZMODEM file transfer protocols.")
4941 (home-page "https://ohse.de/uwe/software/lrzsz.html")
4942 (license license:gpl2+)))
e41f8923
GLV
4943
4944(define-public nq
4945 (package
4946 (name "nq")
4051231d 4947 (version "0.5")
e41f8923
GLV
4948 (source
4949 (origin
4950 (method git-fetch)
4951 (uri (git-reference
4952 (url "https://github.com/leahneukirchen/nq")
4953 (commit (string-append "v" version))))
4954 (file-name (git-file-name name version))
4955 (sha256
4051231d 4956 (base32 "0szbndvwl6ghwjzb165s09977s0r1yq8h0ziknm0h6xndkcjspl3"))))
e41f8923
GLV
4957 (build-system gnu-build-system)
4958 (native-inputs
8394619b 4959 (list perl))
e41f8923 4960 (arguments
d24ad394
TGR
4961 (list #:make-flags
4962 #~(list (string-append "CC=" #$(cc-for-target))
4963 (string-append "PREFIX=" #$output))
4964 #:phases
4965 #~(modify-phases %standard-phases
4966 (delete 'configure))))
e41f8923
GLV
4967 (synopsis "Unix command line queue utility")
4968 (description
4969 "@code{nq} can create very lightweight job queue systems which require no
4970setup, maintenance, supervision, or any long-running processes.")
4971 (home-page "https://github.com/leahneukirchen/nq")
4972 (license license:public-domain)))
63fec9fd
OP
4973
4974(define-public lsofgraph
4975 (let ((commit "1d414bdc727c00a8c6cbfffc3c43128c60d6f0de")
4976 (revision "1"))
4977 (package
4978 (name "lsofgraph")
4979 (version (git-version "0.0.1" revision commit)) ;no upstream release
4980 (source (origin
4981 (method git-fetch)
4982 (uri (git-reference
4983 (url "https://github.com/zevv/lsofgraph")
4984 (commit commit)))
4985 (file-name (git-file-name name version))
4986 (sha256
4987 (base32
4988 "058x04yp6bc77hbl3qchqm7pa8f9vqfl9jryr88m8pzl7kvpif54"))))
4989 (build-system trivial-build-system)
4990 (inputs
8394619b 4991 (list lua))
63fec9fd
OP
4992 (arguments
4993 `(#:modules ((guix build utils))
4994 #:builder
4995 (begin
4996 (use-modules (guix build utils))
4997 ;; copy source
4998 (copy-recursively (assoc-ref %build-inputs "source") ".")
4999 ;; patch-shebang phase
5000 (setenv "PATH"
5001 (string-append (assoc-ref %build-inputs "lua") "/bin"
5002 ":" (getenv "PATH")))
5003 (substitute* "lsofgraph"
5004 (("#!/usr/bin/env lua")
5005 (string-append "#!" (which "lua"))))
5006 ;; install phase
5007 (install-file "lsofgraph" (string-append %output "/bin"))
5008 (let ((doc (string-append
5009 %output "/share/doc/" ,name "-" ,version)))
5010 (mkdir-p doc)
5011 (install-file "LICENSE" doc)
5012 (install-file "README.md" doc))
5013 #t)))
5014 (home-page "https://github.com/zevv/lsofgraph")
5015 (synopsis "Convert @code{lsof} output to @code{graphviz}")
5016 (description "Utility to convert @code{lsof} output to a graph showing
5017FIFO and UNIX interprocess communication.")
5018 (license license:bsd-2))))
987b50f4
SPW
5019
5020(define-public runitor
5021 (package
5022 (name "runitor")
5023 (version "0.8.0")
5024 (source
5025 (origin
5026 (method git-fetch)
5027 (uri (git-reference
5028 (url "https://github.com/bdd/runitor")
5029 (commit (string-append "v" version))))
5030 (file-name (git-file-name name version))
5031 (sha256
5032 (base32 "0vjfbyrbp5ywgzdz9j3x0qgjvnq7nw7193x8v9yy6k2cih1zsacn"))))
5033 (build-system go-build-system)
5034 (arguments
5035 `(#:unpack-path "bdd.fi/x/runitor"
987b50f4
SPW
5036 #:build-flags '(,(string-append "-ldflags=-X main.Version=" version))
5037 #:import-path "bdd.fi/x/runitor/cmd/runitor"
5038 #:install-source? #f))
5039 (home-page "https://github.com/bdd/runitor")
5040 (synopsis "Command runner with healthchecks.io integration")
5041 (description
5042 "Runitor runs the supplied command, captures its output, and based on its
5043exit code reports successful or failed execution to
5044@url{https://healthchecks.io,https://healthchecks.io} or your private instance.")
5045 (license license:bsd-0)))
85e3ed2b
AP
5046
5047(define-public udpcast
5048 (package
5049 (name "udpcast")
84873830 5050 (version "20211207")
85e3ed2b
AP
5051 (source
5052 (origin
5053 (method url-fetch)
5054 ;; XXX: Original server is at https://www.udpcast.linux.lu is not
5055 ;; reliable.
5056 (uri (list (string-append
85e3ed2b
AP
5057 "https://fossies.org/linux/privat/udpcast-"
5058 version ".tar.gz")
5059 (string-append
5060 "https://www.udpcast.linux.lu/download/udpcast-"
5061 version ".tar.gz")))
5062 (sha256
84873830 5063 (base32 "0l6hck694szrrvz85nm48rwb7mzvg2z2bwa50v51pkvym3kvxkm3"))))
85e3ed2b
AP
5064 (build-system gnu-build-system)
5065 (native-inputs
5066 (list autoconf automake m4 perl))
5067 (arguments `(#:tests? #f)) ;no test suite
5068 (synopsis "Multicast file transfer tool")
5069 (description
5070 "UDPcast is a file transfer tool that can send data simultaneously to
5071many destinations on a LAN. This can for instance be used to install entire
5072classrooms of PC's at once. The advantage of UDPcast over using other
5073methods (nfs, ftp, whatever) is that UDPcast uses UDP's multicast abilities:
5074it won't take longer to install 15 machines than it would to install just 2.")
5075 (home-page "https://www.udpcast.linux.lu")
5076 (license license:gpl2+)))
5077
c08d56a1 5078(define-public greetd
5079 (package
5080 (name "greetd")
5081 (version "0.8.0")
5082 (home-page "https://git.sr.ht/~kennylevinsen/greetd")
5083 (source (origin
5084 (method git-fetch)
5085 (uri (git-reference
5086 (url home-page)
5087 (commit version)))
5088 (file-name (git-file-name name version))
5089 (sha256
5090 (base32 "0x5c3jkw09kvj2grcxm899y2n6ws8p990cyp9cs0fy6lm4fzlh6v"))))
5091 (build-system cargo-build-system)
5092 (arguments
5093 `(#:cargo-inputs
5094 (("rust-nix" ,rust-nix-0.19)
5095 ("rust-pam-sys" ,rust-pam-sys-0.5)
5096 ("rust-rpassword" ,rust-rpassword-5)
5097 ("rust-users" ,rust-users-0.11)
5098 ("rust-serde" ,rust-serde-1)
5099 ("rust-serde-json" ,rust-serde-json-1)
5100 ("rust-libc" ,rust-libc-0.2)
5101 ("rust-tokio" ,rust-tokio-1)
5102 ("rust-getopts" ,rust-getopts-0.2)
5103 ("rust-thiserror" ,rust-thiserror-1)
5104 ("rust-async-trait" ,rust-async-trait-0.1)
5105 ("rust-enquote" ,rust-enquote-1))
5106 #:phases
5107 (modify-phases %standard-phases
5108 (delete 'package)
5109 (add-after 'build 'build-man-pages
5110 (lambda* (#:key inputs #:allow-other-keys)
5111 (define (scdoc-cmd doc lvl)
5112 (system (string-append "scdoc < "
5113 doc "-" lvl ".scd > "
5114 doc "." lvl)))
5115 (with-directory-excursion "man"
5116 (scdoc-cmd "greetd" "1")
5117 (scdoc-cmd "greetd" "5")
5118 (scdoc-cmd "greetd-ipc" "7")
5119 (scdoc-cmd "agreety" "1"))))
5120 (replace 'install
5121 (lambda* (#:key inputs outputs #:allow-other-keys)
5122 (let* ((out (assoc-ref outputs "out"))
5123 (bin (string-append out "/bin"))
5124 (sbin (string-append out "/sbin"))
5125 (share (string-append out "/share"))
5126 (man (string-append share "/man"))
5127 (man1 (string-append man "/man1"))
5128 (man5 (string-append man "/man5"))
5129 (man7 (string-append man "/man7"))
5130 (release "target/release")
5131 (greetd-bin (string-append release "/greetd"))
5132 (agreety-bin (string-append release "/agreety")))
5133 (install-file greetd-bin sbin)
5134 (install-file agreety-bin bin)
5135 (with-directory-excursion "man"
5136 (install-file "greetd.1" man1)
5137 (install-file "greetd.5" man5)
5138 (install-file "greetd-ipc.7" man7)
5139 (install-file "agreety.1" man1))))))))
5140 (native-inputs
5141 `(("linux-pam" ,linux-pam)
5142 ("scdoc" ,scdoc)))
5143 (synopsis "minimal and flexible login manager daemon")
5144 (description
5145 "greetd is a minimal and flexible login manager daemon
5146that makes no assumptions about what you want to launch.
85e3ed2b 5147
c08d56a1 5148If you can run it from your shell in a TTY, greetd can start it.
5149
5150If it can be taught to speak a simple JSON-based IPC protocol,
5151then it can be a greeter.")
5152 (license license:gpl3+)))
32ca068c 5153
5154(define-public greetd-pam-mount
5155 (package
5156 (inherit pam-mount)
5157 (name "greetd-pam-mount")
5158 (arguments
5159 (substitute-keyword-arguments (package-arguments pam-mount)
5160 ((#:configure-flags flags ''())
5161 #~(cons* "--with-rundir=/run/greetd" #$flags))
5162 ((#:phases phases)
5163 #~(modify-phases #$phases
5164 (add-after 'unpack 'patch-config-file-name
5165 (lambda* (#:key inputs #:allow-other-keys)
5166 (substitute* "src/pam_mount.c"
5167 ((".*define CONFIGFILE .*$")
5168 "#define CONFIGFILE \"/etc/security/greetd_pam_mount.conf.xml\"\n")
5169 (("pam_mount_config") "greetd_pam_mount_config")
5170 (("pam_mount_system_authtok") "greetd_pam_mount_system_authtok"))))))))
5171 (synopsis "pam-mount specifically compiled for use with greetd")
5172 (description
5173 "Pam-mount is a PAM module that can mount volumes when a user logs in.
5174It supports mounting local filesystems of any kind the normal mount utility
5175supports. It can also mount encrypted LUKS volumes using the password
5176supplied by the user when logging in.
5177
5178This package inherits pam-mount in the way that it is compiled specifically
5179for use with greetd daemon. It uses different configuration location and
5180name space for storing data in PAM.
5181
5182greetd-pam-mount is used in configuration of greetd to provide
5183auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that it will not
5184interfere with default pam-mount configuration.")))
167b8f29 5185
5186(define-public libseat
5187 (package
5188 (name "libseat")
5189 (version "0.7.0")
5190 (source (origin
5191 (method git-fetch)
5192 (uri (git-reference
5193 (url "https://git.sr.ht/~kennylevinsen/seatd")
5194 (commit version)))
5195 (file-name (git-file-name name version))
5196 (sha256
5197 (base32
5198 "10f8387yy5as547xjjhl0cna6iywdgjmw0iq2nvcs8q6vlpnik4v"))))
5199 (build-system meson-build-system)
5200 (arguments
5201 `(#:configure-flags '("-Dlibseat-logind=elogind"
5202 "-Dserver=disabled")))
5203 (native-inputs
5204 `(("pkg-config" ,pkg-config)))
5205 (propagated-inputs
5206 `(("elogind" ,elogind)))
5207 (home-page "https://sr.ht/~kennylevinsen/seatd")
5208 (synopsis "Seat management library")
5209 (description
5210 "This package provides a universal seat management library that
5211allows applications to use whatever seat management is available.")
5212 (license license:expat)))
5213
5214(define-public seatd
5215 (package
5216 (inherit libseat)
5217 (name "seatd")
5218 (arguments
5219 `(#:configure-flags '("-Dlibseat-logind=elogind")
5220 #:phases
5221 (modify-phases %standard-phases
5222 (add-after 'install 'remove-libs
5223 (lambda* (#:key outputs #:allow-other-keys)
5224 (with-directory-excursion (assoc-ref outputs "out")
5225 (for-each delete-file-recursively '("lib" "include"))))))))
5226 (native-inputs
5227 `(("pkg-config" ,pkg-config)
5228 ("scdoc" ,scdoc)))
5229 (inputs '())
5230 (synopsis "Seat management daemon")
5231 (description
5232 "This package provides a minimal seat management daemon whose task is to
5233mediate access to shared devices, such as graphics and input, for applications
5234that require it.")
5235 (license license:expat)))
d7e7494b 5236
5237(define-public fail2ban
5238 (package
5239 (name "fail2ban")
5240 (version "0.11.2")
5241 (source (origin
5242 (method git-fetch)
5243 (uri (git-reference
5244 (url "https://github.com/fail2ban/fail2ban")
5245 (commit version)))
5246 (file-name (git-file-name name version))
5247 (sha256
5248 (base32
5249 "00d9q8m284q2wy6q462nipzszplfbvrs9fhgn0y3imwsc24kv1db"))
5250 (modules '((guix build utils)))
5251 (snippet
5252 '(begin
5253 ;; Get rid of absolute file names.
5254 (substitute* "setup.py"
5255 (("/etc/fail2ban")
5256 "etc/fail2ban")
5257 (("/var/lib/fail2ban")
5258 "var/lib/fail2ban")
5259 (("\"/usr/bin/\"")
5260 "\"usr/bin/\"")
5261 (("\"/usr/lib/fail2ban/\"")
5262 "\"usr/lib/fail2ban/\"")
5263 (("'/usr/share/doc/fail2ban'")
5264 "'usr/share/doc/fail2ban'"))
5265 ;; disable tests performing unacceptable side-effects
5266 (let ((make-suite (lambda (t)
5267 (string-append
5268 "tests.addTest.unittest.makeSuite."
5269 t ".."))))
5270 (substitute* "fail2ban/tests/utils.py"
5271 (((make-suite "actiontestcase.CommandActionTest"))
5272 "")
5273 (((make-suite "misctestcase.SetupTest"))
5274 "")
5275 (((make-suite
5276 "filtertestcase.DNSUtilsNetworkTests"))
5277 "")
5278 (((make-suite "filtertestcase.IgnoreIPDNS"))
5279 "")
5280 (((make-suite "filtertestcase.GetFailures"))
5281 "")
5282 (((make-suite
5283 "fail2banclienttestcase.Fail2banServerTest"))
5284 "")
5285 (((make-suite
5286 "servertestcase.ServerConfigReaderTests"))
5287 "")))))
5288 (patches (search-patches
5289 "fail2ban-0.11.2_fix-setuptools-drop-2to3.patch"
5290 "fail2ban-python310-server-action.patch"
5291 "fail2ban-python310-server-actions.patch"
5292 "fail2ban-python310-server-jails.patch"
5293 "fail2ban-0.11.2_fix-test-suite.patch"
5294 "fail2ban-0.11.2_CVE-2021-32749.patch"
5295 "fail2ban-paths-guix-conf.patch"))))
5296 (build-system python-build-system)
5297 (arguments
5298 '(#:phases (modify-phases %standard-phases
5299 (add-before 'build 'invoke-2to3
5300 (lambda _
5301 (invoke "./fail2ban-2to3")))
5302 (add-before 'install 'fix-default-config
5303 (lambda* (#:key outputs #:allow-other-keys)
5304 (substitute* '("config/paths-common.conf"
5305 "fail2ban/tests/utils.py"
5306 "fail2ban/client/configreader.py"
5307 "fail2ban/client/fail2bancmdline.py"
5308 "fail2ban/client/fail2banregex.py")
5309 (("/etc/fail2ban")
5310 (string-append (assoc-ref outputs "out")
5311 "/etc/fail2ban")))))
5312 (add-after 'fix-default-config 'set-action-dependencies
5313 (lambda* (#:key inputs #:allow-other-keys)
5314 ;; deleting things that are not feasible to fix
5315 ;; or won't be used any way
5316 (with-directory-excursion "config"
5317 (for-each delete-file
5318 '("paths-arch.conf"
5319 "paths-debian.conf"
5320 "paths-fedora.conf"
5321 "paths-freebsd.conf"
5322 "paths-opensuse.conf"
5323 "paths-osx.conf")))
5324 (with-directory-excursion "config/action.d"
5325 (for-each delete-file
5326 '("apf.conf"
5327 "bsd-ipfw.conf"
5328 "dshield.conf"
5329 "ipfilter.conf"
5330 "ipfw.conf"
5331 "firewallcmd-allports.conf"
5332 "firewallcmd-common.conf"
5333 "firewallcmd-ipset.conf"
5334 "firewallcmd-multiport.conf"
5335 "firewallcmd-new.conf"
5336 "firewallcmd-rich-logging.conf"
5337 "firewallcmd-rich-rules.conf"
5338 "osx-afctl.conf"
5339 "osx-ipfw.conf"
5340 "pf.conf"
5341 "nginx-block-map.conf"
5342 "npf.conf"
5343 "shorewall.conf"
5344 "shorewall-ipset-proto6.conf"
5345 "ufw.conf")))
5346 (let* ((lookup-cmd (lambda (i)
5347 (search-input-file inputs i)))
5348 (bin (lambda (i)
5349 (lookup-cmd (string-append "/bin/" i))))
5350 (sbin (lambda (i)
5351 (lookup-cmd (string-append "/sbin/" i))))
5352 (ip (sbin "ip"))
5353 (sendmail (sbin "sendmail")))
5354 (substitute* (find-files "config/action.d" "\\.conf$")
5355 ;; TODO: deal with geoiplookup ..
5356 (("(awk|curl|dig|jq)" all cmd)
5357 (bin cmd))
5358 (("(cat|echo|grep|head|printf|wc) " all
5359 cmd)
5360 (string-append (bin cmd) " "))
5361 ((" (date|rm|sed|tail|touch|tr) " all
5362 cmd)
5363 (string-append " "
5364 (bin cmd) " "))
5365 (("cut -d")
5366 (string-append (bin "cut") " -d"))
5367 (("`date`")
5368 (string-append "`"
5369 (bin "date") "`"))
5370 (("id -")
5371 (string-append (bin "id") " -"))
5372 (("ip -([46]) addr" all ver)
5373 (string-append ip " -" ver " addr"))
5374 (("ip route")
5375 (string-append ip " route"))
5376 (("ipset ")
5377 (string-append (sbin "ipset") " "))
5378 (("(iptables|ip6tables) <" all cmd)
5379 (string-append (sbin cmd) " <"))
5380 (("/usr/bin/nsupdate")
5381 (bin "nsupdate"))
5382 (("mail -E")
5383 (string-append sendmail " -E"))
5384 (("nftables = nft")
5385 (string-append "nftables = " (sbin "nft")))
5386 (("perl -e")
5387 (string-append (bin "perl") " -e"))
5388 (("/usr/sbin/sendmail")
5389 sendmail)
5390 (("test -e")
5391 (string-append (bin "test") " -e"))
5392 (("_whois = whois")
5393 (string-append "_whois = " (bin "whois")))))
5394 (substitute* "config/jail.conf"
5395 (("before = paths-debian.conf")
5396 "before = paths-guix.conf"))))
5397 (add-after 'install 'copy-man-pages
5398 (lambda* (#:key outputs #:allow-other-keys)
5399 (let* ((man (string-append (assoc-ref outputs "out")
5400 "/man"))
5401 (install-man (lambda (m)
5402 (lambda (f)
5403 (install-file (string-append f
5404 "." m)
5405 (string-append man
5406 "/man" m)))))
5407 (install-man1 (install-man "1"))
5408 (install-man5 (install-man "5")))
5409 (with-directory-excursion "man"
5410 (for-each install-man1
5411 '("fail2ban"
5412 "fail2ban-client"
5413 "fail2ban-python"
5414 "fail2ban-regex"
5415 "fail2ban-server"
5416 "fail2ban-testcases"))
5417 (for-each install-man5
5418 '("jail.conf")))))))))
5419 (inputs (list gawk
5420 coreutils-minimal
5421 curl
5422 grep
5423 jq
5424 iproute
5425 ipset
5426 iptables
5427 `(,isc-bind "utils")
5428 nftables
5429 perl
5430 python-pyinotify
5431 sed
5432 sendmail
5433 sqlite
5434 whois))
5435 (home-page "http://www.fail2ban.org")
5436 (synopsis "Daemon to ban hosts that cause multiple authentication errors")
5437 (description
5438 "Fail2Ban scans log files like @file{/var/log/auth.log} and bans IP
5439addresses conducting too many failed login attempts. It does this by updating
5440system firewall rules to reject new connections from those IP addresses, for a
5441configurable amount of time. Fail2Ban comes out-of-the-box ready to read many
5442standard log files, such as those for sshd and Apache, and is easily
5443configured to read any log file of your choosing, for any error you wish.
5444
5445Though Fail2Ban is able to reduce the rate of incorrect authentication
5446attempts, it cannot eliminate the risk presented by weak authentication. Set
5447up services to use only two factor, or public/private authentication
5448mechanisms if you really want to protect services.")
5449 (license license:gpl2+)))