projects/guix·blob kernel-updates · refs

1001 lines · 41.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018, 2020-2026 Efraim Flashner <[email protected]>
3;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2020 Marius Bakke <[email protected]>
5;;; Copyright © 2023, 2024 Denis 'GNUtoo' Carikli <[email protected]>
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages debian)
23 #:use-module (gnu packages autotools)
24 #:use-module (gnu packages backup)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages bash)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages crypto)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages dbm)
31 #:use-module (gnu packages dns)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages libevent)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages man)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages tls)
43 #:use-module (gnu packages web)
44 #:use-module (gnu packages wget)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system copy)
47 #:use-module (guix build-system gnu)
48 #:use-module (guix build-system perl)
49 #:use-module (guix build-system trivial)
50 #:use-module (guix download)
51 #:use-module (guix gexp)
52 #:use-module (guix git-download)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix utils)
56 #:use-module (srfi srfi-1)
57 #:use-module (srfi srfi-26))
58
59(define-public debian-archive-keyring
60 (package
61 (name "debian-archive-keyring")
62 (version "2025.1")
63 (source
64 (origin
65 (method git-fetch)
66 (uri (git-reference
67 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
68 (commit version)))
69 (file-name (git-file-name name version))
70 (sha256
71 (base32 "11i6gpff0sa7a6cngj3n3ysdphw745zp39zlhpw4iiv6mmqmp99m"))))
72 (build-system gnu-build-system)
73 (arguments
74 '(#:tests? #f ; no tests
75 #:parallel-build? #f ; has race conditions
76 #:phases
77 (modify-phases %standard-phases
78 (delete 'configure) ; no configure script
79 (replace 'install
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let* ((out (assoc-ref outputs "out"))
82 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
83 (key (string-append out "/share/keyrings/")))
84 (install-file "keyrings/debian-archive-keyring.gpg" key)
85 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
86 (for-each (lambda (file)
87 (install-file file apt))
88 (find-files "trusted.gpg" "\\.gpg$"))))))))
89 (native-inputs
90 (list gnupg jetring))
91 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
92 (synopsis "GnuPG archive keys of the Debian archive")
93 (description
94 "The Debian project digitally signs its Release files. This package
95contains the archive keys used for that.")
96 (license (list license:public-domain ; the keys
97 license:gpl2+)))) ; see debian/copyright
98
99(define-public debian-ports-archive-keyring
100 (package
101 (name "debian-ports-archive-keyring")
102 (version "2025.04.05")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append "mirror://debian/pool/main/d"
107 "/debian-ports-archive-keyring"
108 "/debian-ports-archive-keyring_" version ".tar.xz"))
109 (sha256
110 (base32
111 "0chh1jvz3qb1zv7k5j2p5adc8yip25vbhdmk1q6djzlpgd02420h"))))
112 (build-system gnu-build-system)
113 (arguments
114 '(#:tests? #f ; No test suite.
115 #:phases
116 (modify-phases %standard-phases
117 (delete 'configure) ; No configure script.
118 (replace 'build
119 (lambda _
120 ;; gpg options derived from the debian/rules file.
121 (let ((gpg-options (list "--no-options" "--no-default-keyring"
122 "--no-auto-check-trustdb" "--no-keyring"
123 "--import-options" "import-export"
124 "--import")))
125 (with-output-to-file "debian-ports-archive-keyring.gpg"
126 (lambda _
127 (apply invoke "gpg"
128 (append gpg-options (find-files "active-keys")))))
129 (with-output-to-file "debian-ports-archive-keyring-removed.gpg"
130 (lambda _
131 (apply invoke "gpg"
132 (append gpg-options (find-files "removed-keys")))))
133 (mkdir "trusted.gpg")
134 (for-each
135 (lambda (key)
136 (with-output-to-file
137 (string-append "trusted.gpg/" (basename key ".key") ".gpg")
138 (lambda _
139 (apply invoke "gpg" (append gpg-options (list key))))))
140 (find-files "active-keys")))))
141 (replace 'install
142 (lambda* (#:key outputs #:allow-other-keys)
143 (let* ((out (assoc-ref outputs "out"))
144 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
145 (key (string-append out "/share/keyrings/")))
146 (install-file "debian-ports-archive-keyring.gpg" key)
147 (install-file "debian-ports-archive-keyring-removed.gpg" key)
148 (for-each (lambda (file)
149 (install-file file apt))
150 (find-files "trusted.gpg" "\\.gpg$"))))))))
151 (native-inputs
152 (list gnupg))
153 (home-page "https://tracker.debian.org/pkg/debian-ports-archive-keyring")
154 (synopsis "GnuPG archive keys of the Debian ports archive")
155 (description
156 "The Debian ports-archive digitally signs its Release files. This package
157contains the archive keys used for that.")
158 ;; "The keys in the keyrings don't fall under any copyright."
159 (license license:public-domain)))
160
161(define-public elxr-archive-keyring
162 (package
163 (name "elxr-archive-keyring")
164 (version "2024.1")
165 (source
166 (origin
167 (method git-fetch)
168 (uri
169 (git-reference
170 (url "https://gitlab.com/elxr/packages/elxr-archive-keyring")
171 (commit (string-append "upstream/" version))))
172 (file-name (git-file-name name version))
173 (sha256
174 (base32 "1cw7sn22g82g01g7xb4fp8pb6nvb4lck269w1i91rfcmhqxb4iz7"))))
175 (build-system gnu-build-system)
176 (arguments
177 (list
178 #:tests? #f
179 #:phases
180 #~(modify-phases %standard-phases
181 (delete 'configure)
182 (replace 'install
183 (lambda _
184 (install-file "elxr-archive-keyring.gpg"
185 (string-append #$output "/share/keyrings/")))))))
186 (native-inputs (list gnupg))
187 (home-page "https://pkg.elxr.org/pkg/elxr-archive-keyring")
188 (synopsis "GnuPG archive keys of the Elxr archive")
189 (description "The Elxr distribution signs its packages. This package
190contains the archive keys used for that.")
191 (license (list license:public-domain ;; the keys
192 license:gpl2+))))
193
194(define-public kali-archive-keyring
195 (package
196 (name "kali-archive-keyring")
197 (version "2025.1")
198 (source
199 (origin
200 (method git-fetch)
201 (uri
202 (git-reference
203 (url "https://gitlab.com/kalilinux/packages/kali-archive-keyring")
204 (commit (string-append "kali/" version))))
205 (file-name (git-file-name name version))
206 (sha256
207 (base32 "07iwh24myf3s2ziqd2wwzclm48vyv0qvddz0rb6771laaal4wd7w"))
208 (modules '((guix build utils)))
209 (snippet #~(delete-file-recursively "debian"))))
210 (build-system gnu-build-system)
211 (arguments
212 (list
213 #:tests? #f
214 #:phases
215 #~(modify-phases %standard-phases
216 (delete 'configure)
217 (replace 'install
218 (lambda _
219 (install-file "kali-archive-keyring.gpg"
220 (string-append #$output "/share/keyrings/")))))))
221 (native-inputs (list gnupg))
222 (home-page "https://pkg.kali.org/pkg/kali-archive-keyring")
223 (synopsis "GnuPG archive keys of the Kali archive")
224 (description "The Kali distribution signs its packages. This package
225contains the archive keys used for that.")
226 (license (list license:public-domain ;; the keys
227 license:gpl2+))))
228
229(define-public pardus-archive-keyring
230 (package
231 (name "pardus-archive-keyring")
232 (version "2021.1")
233 (source
234 (origin
235 (method url-fetch)
236 (uri (string-append "https://depo.pardus.org.tr/pardus/pool/main/p/"
237 "pardus-archive-keyring/pardus-archive-keyring_"
238 version ".tar.xz"))
239 (sha256
240 (base32 "0h4y9clpcfprx7fq2yy2bb22ykax5a0wlw8zlcq9kbiya83q02yr"))))
241 (build-system gnu-build-system)
242 (arguments
243 (list
244 #:tests? #f
245 #:phases
246 #~(modify-phases %standard-phases
247 (delete 'configure)
248 (replace 'install
249 (lambda _
250 (install-file "keyrings/pardus-archive-keyring.gpg"
251 (string-append #$output "/share/keyrings/")))))))
252 (native-inputs (list jetring))
253 (home-page "https://tracker.pardus.org.tr/yirmiuc/pardus-archive-keyring")
254 (synopsis "GnuPG archive keys of the Pardus archive")
255 (description "The Pardus distribution signs its packages. This package
256contains the archive keys used for that.")
257 (license (list license:public-domain ;; the keys
258 license:gpl2+))))
259
260(define-public pureos-archive-keyring
261 (package
262 (name "pureos-archive-keyring")
263 (version "2021.11.0")
264 (source (origin
265 (method url-fetch)
266 (uri (string-append
267 "https://repo.puri.sm/pureos/pool/main/p/pureos-archive-keyring/"
268 "pureos-archive-keyring_" version ".tar.xz"))
269 (sha256
270 (base32
271 "1a0d084a98bycyhbw531646rbivvlfkdk6ldshl5dy6fvzmbci0d"))))
272 (build-system copy-build-system)
273 (arguments
274 '(#:install-plan '(("keyrings/pureos-archive-keyring.gpg"
275 "share/keyrings/")
276 ("keyrings/pureos-archive-removed-keys.gpg"
277 "share/keyrings/"))))
278 (home-page "https://source.puri.sm/pureos/core/pureos-archive-keyring")
279 (synopsis "GnuPG archive keys of the Pureos archive")
280 (description "The Pureos distribution signs its packages. This package
281contains the archive keys used for that.")
282 (license (list license:public-domain ;; the keys
283 license:gpl2+)))) ;; see debian/copyright
284
285(define-public trisquel-keyring
286 (package
287 (name "trisquel-keyring")
288 (version "2022.10.19")
289 (source (origin
290 (method url-fetch)
291 (uri (string-append
292 "http://archive.trisquel.info/trisquel/"
293 "pool/main/t/trisquel-keyring/trisquel-keyring_"
294 version ".tar.gz"))
295 (sha256
296 (base32
297 "1qkqm3wb945i2izm47xni21hi3ad807bvl106r2mnwdxnjs4ij08"))))
298 (build-system copy-build-system)
299 (arguments
300 '(#:install-plan '(("keyrings/trisquel-archive-keyring.gpg"
301 "share/keyrings/"))))
302 (home-page "http://archive.trisquel.info/trisquel/pool/main/t/trisquel-keyring")
303 (synopsis "GnuPG archive keys of the Trisquel archive")
304 (description "The Trisquel distribution signs its packages. This package
305contains the archive keys used for that.")
306 (license license:gpl2+))) ;; see debian/copyright
307
308(define-public ubuntu-keyring
309 (package
310 (name "ubuntu-keyring")
311 (version "2023.11.28.1")
312 (source
313 (origin
314 (method url-fetch)
315 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
316 "+files/" name "_" version ".tar.xz"))
317 (sha256
318 (base32
319 "0bmafky67hrb79baaydmw7al21lz0wgi4ks5dqfkfqamw5d4bkdf"))))
320 (build-system trivial-build-system)
321 (arguments
322 `(#:modules ((guix build utils))
323 #:builder (begin
324 (use-modules (guix build utils))
325 (let* ((out (assoc-ref %outputs "out"))
326 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
327 (key (string-append out "/share/keyrings/")))
328 (setenv "PATH" (string-append
329 (assoc-ref %build-inputs "xz") "/bin:"
330 (assoc-ref %build-inputs "tar") "/bin"))
331 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
332 (for-each (lambda (file)
333 (install-file file apt))
334 (find-files "." "ubuntu-[^am].*\\.gpg$"))
335 (for-each (lambda (file)
336 (install-file file key))
337 (find-files "." "ubuntu-[am].*\\.gpg$"))))))
338 (native-inputs
339 (list tar xz))
340 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
341 (synopsis "GnuPG keys of the Ubuntu archive")
342 (description
343 "The Ubuntu project digitally signs its Release files. This package
344contains the archive keys used for that.")
345 (license (list license:public-domain ; the keys
346 license:gpl2+)))) ; see debian/copyright
347
348(define-public debian-devscripts-bts
349 (package
350 (name "debian-devscripts-bts")
351 (version "2.23.7")
352 (source
353 (origin
354 (method git-fetch)
355 (uri (git-reference
356 (url "https://salsa.debian.org/debian/devscripts.git")
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
359 (sha256
360 (base32
361 "031467rclglk1hdx8z2vzx5z88vpy0sk73qi8ni0sai3jx62ji75"))))
362 (build-system perl-build-system)
363 (arguments
364 (list
365 #:tests? #f ; tests assume various Debian specific capabilities
366 #:phases
367 ;; only includes the bts command as that's useful for Guix packagers
368 #~(modify-phases %standard-phases
369 (add-after 'unpack 'patch-programs
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (with-directory-excursion "scripts"
372 (substitute* "bts.pl" (("/bin/bash") (which "bash")))
373 (substitute* "bts.pl" (("/bin/rm") (which "rm")))
374 (substitute* "bts.pl" (("/bin/cat") (which "cat")))
375 ;; Avoid having to provide Debian's sensible-browser package
376 (substitute* "bts.pl"
377 (("my \\$browser;") "my $browser = $ENV{'BROWSER'};"))
378 (substitute* "bts.pl"
379 (("'sensible-browser',") "$browser,"))
380 ;; Use Guix's debbugs - patching the source as putting a config
381 ;; file into #$output/etc doesn't work
382 (substitute* "bts.pl"
383 (("= 'https://bugs.debian.org'")
384 "= 'https://debbugs.gnu.org'"))
385 (rename-file "bts.pl" "bts"))))
386 (delete 'configure)
387 (delete 'build)
388 (replace 'install
389 (lambda* (#:key inputs outputs #:allow-other-keys)
390 (let* ((bindir (string-append #$output "/bin"))
391 (bashcomp (string-append #$output
392 "/etc/bash_completion.d"))
393 (perl-lib (string-append #$output
394 "/lib/perl5/site_perl/Devscripts"))
395 (wrap.pl
396 (lambda (scripts keys)
397 (for-each
398 (lambda (script)
399 (wrap-program script
400 `("PERL5LIB" ":" prefix
401 ,(cons*
402 (getenv "PERL5LIB")
403 (string-append #$output
404 "/lib/perl5/site_perl")
405 (map
406 (lambda (key)
407 (string-append
408 (assoc-ref inputs key)
409 "/lib/perl5/site_perl"))
410 keys)))))
411 scripts)))
412 (doc (string-append #$output
413 "/share/doc/" #$name "-" #$version)))
414 (with-directory-excursion "scripts"
415 (for-each (lambda (f) (install-file f bindir))
416 '("bts"))
417 (mkdir-p bashcomp)
418 (copy-file "bts.bash_completion" (string-append bashcomp "/bts")))
419 (wrap.pl (find-files bindir)
420 (list "dpkg"
421 "perl-authen-sasl"
422 "perl-db-file"
423 "perl-encode"
424 "perl-encode-locale"
425 "perl-file-homedir"
426 "perl-file-listing"
427 "perl-file-which"
428 "perl-http-cookies"
429 "perl-http-daemon"
430 "perl-http-date"
431 "perl-http-message"
432 "perl-http-negotiate"
433 "perl-http-parser"
434 "perl-io-socket-ssl"
435 "perl-ipc-run"
436 "perl-json"
437 "perl-libwww"
438 "perl-list-compare"
439 "perl-lwp-protocol-https"
440 "perl-moo"
441 "perl-mozilla-ca"
442 "perl-net-http"
443 "perl-try-tiny"
444 "perl-uri"
445 "perl-www-robotrules"))
446 (with-directory-excursion "lib/Devscripts/"
447 (for-each (lambda (f) (install-file f perl-lib))
448 (find-files "./")))
449 (for-each (lambda (f) (install-file f doc))
450 '("README")))))
451 (add-after 'install 'manpage
452 (lambda* (#:key outputs #:allow-other-keys)
453 (let ( (man1 (string-append #$output "/share/man/man1"))
454 (man5 (string-append #$output "/share/man/man5")))
455 (with-directory-excursion "scripts"
456 (invoke "pod2man" "--utf8" "--center=' '" "bts" "bts.1")
457 (install-file "bts.1" man1))
458 (with-directory-excursion "doc"
459 (invoke "make" "devscripts.1")
460 (install-file "devscripts.1" man1)
461 (install-file "devscripts.conf.5" man5))))))))
462 (inputs
463 (list
464 bash-minimal
465 dpkg
466 perl-authen-sasl
467 perl-db-file
468 perl-encode
469 perl-encode-locale
470 perl-file-homedir
471 perl-file-listing
472 perl-file-which
473 perl-http-cookies
474 perl-http-daemon
475 perl-http-date
476 perl-http-message
477 perl-http-negotiate
478 perl-http-parser
479 perl-io-socket-ssl
480 perl-ipc-run
481 perl-json
482 perl-libwww
483 perl-list-compare
484 perl-lwp-protocol-https
485 perl-moo
486 perl-mozilla-ca
487 perl-net-http
488 perl-try-tiny
489 perl-uri
490 perl-www-robotrules))
491 (native-inputs
492 (list perl perl-libwww perl-uri pkg-config python))
493 (propagated-inputs
494 (list perl-lwp-protocol-https))
495 (home-page "https://tracker.debian.org/pkg/devscripts")
496 (synopsis "BTS script from Debian's devscripts")
497 (description "This package only provides the bts script from the Debian
498devscripts archive. It's useful for Guix Developers that interact with GNU's
499debbugs server.")
500 (license license:gpl2+)))
501
502(define-public debootstrap
503 (package
504 (name "debootstrap")
505 (version "1.0.141")
506 (source
507 (origin
508 (method git-fetch)
509 (uri (git-reference
510 (url "https://salsa.debian.org/installer-team/debootstrap.git")
511 (commit version)))
512 (file-name (git-file-name name version))
513 (sha256
514 (base32 "1xdw29cygp0ii65kz8ns8hf0lfrwdjhaxf3sm6q304cm0ic2m7aj"))))
515 (build-system gnu-build-system)
516 (arguments
517 (list
518 #:tests? #f ; no tests
519 #:modules '((guix build gnu-build-system)
520 (guix build utils)
521 (ice-9 textual-ports)
522 (srfi srfi-1)
523 (srfi srfi-26))
524 #:make-flags #~(list (string-append "DESTDIR=" #$output))
525 #:phases
526 #~(modify-phases %standard-phases
527 (delete 'configure)
528 (add-after 'unpack 'patch-source
529 (lambda* (#:key inputs #:allow-other-keys)
530 (substitute* "Makefile"
531 (("/usr") ""))
532 (substitute* "debootstrap"
533 (("=/usr") (string-append "=" #$output))
534 (("/usr/bin/dpkg") (search-input-file inputs "/bin/dpkg")))
535 ;; XXX: For unsupported distros (here, tangly is abandonned), we
536 ;; simply remove the scripts, otherwise the following substitute*
537 ;; will error.
538 (for-each
539 delete-file
540 (find-files
541 "scripts"
542 (lambda (file stat)
543 (let ((content (call-with-input-file file get-string-all)))
544 (any (compose (cut string-contains content <>)
545 (cut string-append "/usr/share/keyrings/" <>
546 "-archive-keyring.gpg"))
547 (list "tanglu"))))))
548 (substitute* (find-files "scripts")
549 ;; Include the keyring locations by default.
550 (("/usr(/share/keyrings/.*.gpg)"_ keyring)
551 (search-input-file inputs keyring))
552 ;; Patch zoneinfo.
553 (("/usr/share/zoneinfo")
554 (search-input-directory inputs "/share/zoneinfo")))
555 ;; Ensure PATH works both in guix and within the debian chroot
556 ;; workaround for: https://bugs.debian.org/929889
557 (substitute* "functions"
558 (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
559 "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))))
560 (add-after 'install 'install-man-file
561 (lambda _
562 (install-file "debootstrap.8"
563 (string-append #$output "/share/man/man8"))))
564 (add-after 'install 'wrap-executable
565 (lambda _
566 (wrap-program (string-append #$output "/sbin/debootstrap")
567 `("PATH" ":" prefix (,(getenv "PATH")))))))))
568 (inputs
569 (list debian-archive-keyring
570 elxr-archive-keyring
571 kali-archive-keyring
572 pardus-archive-keyring
573 pureos-archive-keyring
574 trisquel-keyring
575 ubuntu-keyring
576 bash-minimal
577 dpkg
578 tzdata
579 ;; Needed by dpkg-deb in extract_dpkg_deb_data for at least
580 ;; Trisquel 11 (aramo).
581 zstd
582 ;; Called at run-time from various places, needs to be in PATH.
583 gnupg
584 wget))
585 (native-inputs
586 (list perl))
587 (home-page "https://tracker.debian.org/pkg/debootstrap")
588 (synopsis "Bootstrap a basic Debian system")
589 (description "Debootstrap is used to create a Debian base system from
590scratch, without requiring the availability of @code{dpkg} or @code{apt}.
591It does this by downloading .deb files from a mirror site, and carefully
592unpacking them into a directory which can eventually be chrooted into.")
593 (license license:gpl2)))
594
595(define-public debianutils
596 (package
597 (name "debianutils")
598 (version "5.7-0.4")
599 (source (origin
600 (method git-fetch)
601 (uri (git-reference
602 (url "https://salsa.debian.org/debian/debianutils.git")
603 (commit (string-append "debian/" version))))
604 (file-name (git-file-name "debianutils" version))
605 (sha256
606 (base32
607 "0hw407fm5ylsf28b0vrwz7rm2r2rsgfwzajbkbn6n2b6kqhdjyy9"))))
608 (build-system gnu-build-system)
609 (inputs (if (%current-target-system) (list bash-minimal)
610 '()))
611 (native-inputs
612 (list autoconf automake gettext-minimal po4a-minimal))
613 (home-page "https://packages.debian.org/unstable/debianutils")
614 (synopsis "Miscellaneous shell utilities")
615 (description
616 "This package provides a number of utilities which are mostly for use
617in installation scripts of Debian packages. The programs included are
618@command{add-shell}, @command{installkernel}, @command{ischroot},
619@command{remove-shell}, @command{run-parts}, @command{savelog},
620@command{tempfile}, and @command{which}.")
621 (license (list license:gpl2+
622 ;; The 'savelog' program is distributed under a
623 ;; GPL-compatible copyleft license.
624 (license:fsf-free "file://debian/copyright"
625 "The SMAIL General Public License, see
626debian/copyright for more information.")))))
627
628(define-public apt-cacher-ng
629 (package
630 (name "apt-cacher-ng")
631 (version "3.7.5")
632 (source
633 (origin
634 (method git-fetch)
635 (uri (git-reference
636 (url "https://salsa.debian.org/blade/apt-cacher-ng.git")
637 (commit "upstream/3.7.5")))
638 (file-name (git-file-name name version))
639 (sha256
640 (base32 "0wxqdmmm2gm27zng7v7lwai4zf6ppj26890r7z2ns237xx33jdp6"))))
641 (build-system cmake-build-system)
642 (inputs (list bzip2 ;optional
643 c-ares
644 libevent
645 openssl ;optional
646 xz ;optional
647 zlib))
648 (native-inputs (list pkg-config))
649 (arguments
650 (list
651 #:tests? #f ;Tests are "for development only".
652 #:phases #~(modify-phases %standard-phases
653 ;; We want to provide good defaults. Here apt-cacher-ng is built
654 ;; without libwrap support so we disable that by default.
655 (add-before 'configure 'patch-config
656 (lambda _
657 (substitute* "conf/acng.conf.in"
658 (("# UseWrap: 0")
659 "UseWrap: 0")))))))
660 (home-page "https://www.unix-ag.uni-kl.de/~bloch/acng/")
661 (synopsis "Caching proxy for packages of various software distributions or
662repositories")
663 (description
664 "This package mainly meant for caching packages of Debian or Debian
665based distributions (like Trisquel) through HTTP. It also has partial support
666for HTTPS and other distributions / repositories (OpenSUSE, Arch Linux,
667Sourceforge mirror network, Cygwin mirrors) as this requires more
668configuration and comes with some limitations. Packages can be imported
669manually either by copying files from another apt-cacher-ng instance or by
670importing them from CD, DVD, jigdo, etc. While apt-cacher-ng can work offline,
671it requires some online access before that to build valid index files. It also
672supports partial mirroring. It can be configured through configuration files
673and/or a web interface and/or a command line tool.")
674 (license license:gpl3+)))
675
676(define-public apt-mirror
677 (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
678 (revision "1"))
679 (package
680 (name "apt-mirror")
681 (version (git-version "0.5.4" revision commit))
682 (source (origin
683 (method git-fetch)
684 (uri (git-reference
685 (url "https://github.com/apt-mirror/apt-mirror/")
686 (commit commit)))
687 (file-name (git-file-name name version))
688 (sha256
689 (base32
690 "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
691 (build-system gnu-build-system)
692 (outputs '("out"))
693 (arguments
694 `(#:tests? #f
695 ;; sysconfdir is not PREFIXed in the makefile but DESTDIR is
696 ;; honored correctly; we therefore use DESTDIR for our
697 ;; needs. A more correct fix would involve patching.
698 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
699 "PREFIX=/")
700 #:phases (modify-phases %standard-phases (delete 'configure))))
701 (inputs
702 (list wget perl))
703 (home-page "https://apt-mirror.github.io/")
704 (synopsis "Script for mirroring a Debian repository")
705 (description
706 "apt-mirror is a small tool that provides the ability to selectively
707mirror @acronym{APT, advanced package tool} sources, including GNU/Linux
708distributions such as Debian and Trisquel.")
709 (license license:gpl2))))
710
711(define-public dpkg
712 (package
713 (name "dpkg")
714 (version "1.22.21")
715 (source
716 (origin
717 (method git-fetch)
718 (uri (git-reference
719 (url "https://git.dpkg.org/git/dpkg/dpkg")
720 (commit version)))
721 (file-name (git-file-name name version))
722 (sha256
723 (base32 "00hqb3x5yvf9r35sxn0xg8si7n3ymgvg23y6wzsqq1vdnkwcc06w"))))
724 (build-system gnu-build-system)
725 (arguments
726 (list #:modules
727 `((srfi srfi-71)
728 ,@%default-gnu-modules)
729 #:phases
730 #~(modify-phases %standard-phases
731 (add-before 'bootstrap 'patch-version
732 (lambda _
733 (patch-shebang "build-aux/get-version")
734 (with-output-to-file ".dist-version"
735 (lambda () (display #$version)))))
736 (add-after 'unpack 'set-perl-libdir
737 (lambda _
738 (let* ((perl #$(this-package-input "perl"))
739 (_ perl-version (package-name->name+version perl)))
740 (setenv "PERL_LIBDIR"
741 (string-append #$output
742 "/lib/perl5/site_perl/"
743 perl-version)))))
744 (add-after 'install 'wrap-scripts
745 (lambda _
746 (with-directory-excursion (string-append #$output "/bin")
747 (for-each
748 (lambda (file)
749 (wrap-script file
750 ;; Make sure all perl scripts in "bin" find the
751 ;; required Perl modules at runtime.
752 `("PERL5LIB" ":" prefix
753 (,(string-append #$output
754 "/lib/perl5/site_perl")
755 ,(getenv "PERL5LIB")))
756 ;; DPKG perl modules expect dpkg to be installed.
757 ;; Work around it by adding dpkg to the script's path.
758 `("PATH" ":" prefix (,(string-append #$output
759 "/bin")))))
760 (list "dpkg-architecture"
761 "dpkg-buildapi"
762 "dpkg-buildflags"
763 "dpkg-buildpackage"
764 "dpkg-checkbuilddeps"
765 "dpkg-distaddfile"
766 "dpkg-genbuildinfo"
767 "dpkg-genchanges"
768 "dpkg-gencontrol"
769 "dpkg-gensymbols"
770 "dpkg-mergechangelogs"
771 "dpkg-name"
772 "dpkg-parsechangelog"
773 "dpkg-scanpackages"
774 "dpkg-scansources"
775 "dpkg-shlibdeps"
776 "dpkg-source"
777 "dpkg-vendor"))))))))
778 (native-inputs
779 (list autoconf
780 automake
781 gettext-minimal
782 gnupg ; to run t/Dpkg_OpenPGP.t
783 libtool
784 pkg-config
785 perl-io-string))
786 (inputs
787 (list bzip2
788 guile-3.0 ; for wrap-script
789 libmd
790 ncurses
791 perl
792 xz
793 zlib))
794 (home-page "https://wiki.debian.org/Teams/Dpkg")
795 (synopsis "Debian package management system")
796 (description "This package provides the low-level infrastructure for
797handling the installation and removal of Debian software packages.")
798 (license license:gpl2+)))
799
800(define-public pbuilder
801 (package
802 (name "pbuilder")
803 (version "0.231")
804 (source
805 (origin
806 (method git-fetch)
807 (uri (git-reference
808 (url "https://salsa.debian.org/pbuilder-team/pbuilder.git/")
809 (commit version)))
810 (file-name (git-file-name name version))
811 (sha256
812 (base32 "0z6f1fgcrkfql9ayc3d0nxra2y6cn91xd5lvr0hd8gdlp9xdvxbc"))))
813 (build-system gnu-build-system)
814 (arguments
815 (list
816 #:modules `((guix build gnu-build-system)
817 (guix build utils)
818 (srfi srfi-26))
819 #:phases
820 #~(modify-phases %standard-phases
821 (delete 'configure) ; no configure script
822 (add-after 'unpack 'patch-source
823 (lambda* (#:key inputs outputs #:allow-other-keys)
824
825 ;; Documentation requires tldp-one-page.xsl
826 (substitute* "Makefile"
827 ((".*-C Documentation.*") ""))
828
829 ;; Don't create #$output/var/cache/pbuilder/...
830 (substitute* '("Makefile"
831 "pbuildd/Makefile")
832 ((".*/var/cache/pbuilder.*") ""))
833
834 ;; Find the correct fallback location.
835 (substitute* '("pbuilder-checkparams"
836 "pbuilder-loadconfig"
837 "pbuilder-satisfydepends-apt"
838 "pbuilder-satisfydepends-aptitude"
839 "pbuilder-satisfydepends-classic"
840 "t/test_pbuilder-satisfydepends-classic")
841 (("\\$PBUILDER_ROOT(/usr)?") #$output))
842
843 ;; Some hardcoded paths
844 (substitute* '("debuild-pbuilder"
845 "pbuilder"
846 "pbuilder-buildpackage"
847 "pbuilderrc"
848 "pdebuild"
849 "pdebuild-checkparams"
850 "pdebuild-internal")
851 (("/usr/lib/pbuilder")
852 (string-append #$output "/lib/pbuilder")))
853 (substitute* "pbuildd/buildd-config.sh"
854 (("/usr/share/doc/pbuilder")
855 (string-append #$output "/share/doc/pbuilder")))
856 (substitute* "pbuilder-unshare-wrapper"
857 (("/(s)?bin/ifconfig") "ifconfig")
858 (("/(s)?bin/ip") (search-input-file inputs "/sbin/ip")))
859 (substitute* "Documentation/Makefile"
860 (("/usr") ""))
861
862 ;; Ensure PATH works both in Guix and within the Debian chroot.
863 (substitute* "pbuilderrc"
864 (("PATH=\"/usr/sbin:/usr/bin:/sbin:/bin")
865 "PATH=\"$PATH:/usr/sbin:/usr/bin:/sbin:/bin"))))
866 (add-after 'install 'create-etc-pbuilderrc
867 (lambda* (#:key outputs #:allow-other-keys)
868 (with-output-to-file (string-append #$output "/etc/pbuilderrc")
869 (lambda ()
870 (format #t "# A couple of presets to make this work more smoothly.~@
871 MIRRORSITE=\"http://deb.debian.org/debian\"~@
872 if [ -r /run/privileged/bin/sudo ]; then~@
873 PBUILDERROOTCMD=\"/run/privileged/bin/sudo -E\"~@
874 fi~@
875 PBUILDERSATISFYDEPENDSCMD=\"~a/lib/pbuilder/pbuilder-satisfydepends-apt\"~%"
876 #$output)))))
877 (add-after 'install 'install-manpages
878 (lambda* (#:key outputs #:allow-other-keys)
879 (let ((man (string-append #$output "/share/man/")))
880 (install-file "debuild-pbuilder.1" (string-append man "man1"))
881 (install-file "pdebuild.1" (string-append man "man1"))
882 (install-file "pbuilder.8" (string-append man "man8"))
883 (install-file "pbuilderrc.5" (string-append man "man5")))))
884 (add-after 'install 'wrap-programs
885 (lambda* (#:key inputs outputs #:allow-other-keys)
886 (for-each
887 (lambda (file)
888 (wrap-script file
889 `("PATH" ":" prefix
890 ,(map (compose dirname (cut search-input-file inputs <>))
891 (list "/bin/cut"
892 "/bin/dpkg"
893 "/bin/grep"
894 "/bin/perl"
895 "/bin/sed"
896 "/bin/which"
897 "/sbin/debootstrap")))))
898 (cons*
899 (string-append #$output "/bin/pdebuild")
900 (string-append #$output "/sbin/pbuilder")
901 (find-files (string-append #$output "/lib/pbuilder"))))))
902 ;; Move the 'check phase to after 'install.
903 (delete 'check)
904 (add-after 'validate-runpath 'check
905 (assoc-ref %standard-phases 'check)))
906 #:make-flags
907 ;; No PREFIX, use DESTDIR instead.
908 #~(list (string-append "DESTDIR=" #$output)
909 (string-append "SYSCONFDIR=" #$output "/etc")
910 (string-append "BINDIR=" #$output "/bin")
911 (string-append "PKGLIBDIR=" #$output "/lib/pbuilder")
912 (string-append "SBINDIR=" #$output "/sbin")
913 (string-append "PKGDATADIR=" #$output "/share/pbuilder")
914 (string-append "EXAMPLEDIR=" #$output "/share/doc/pbuilder/examples")
915 "PBUILDDDIR=/share/doc/pbuilder/examples/pbuildd/")))
916 (inputs
917 (list dpkg
918 debootstrap
919 grep
920 guile-3.0 ; for wrap-script
921 iproute
922 perl
923 which))
924 (native-inputs
925 (list man-db
926 util-linux))
927 (home-page "https://pbuilder-team.pages.debian.net/pbuilder/")
928 (synopsis "Personal package builder for Debian packages")
929 (description
930 "@code{pbuilder} is a personal package builder for Debian packages.
931@itemize
932@item@code{pbuilder} constructs a chroot system, and builds a package inside the
933chroot. It is an ideal system to use to check that a package has correct
934build-dependencies. It uses @code{apt} extensively, and a local mirror, or a
935fast connection to a Debian mirror is ideal, but not necessary.
936@item@code{pbuilder create} uses debootstrap to create a chroot image.
937@item@code{pbuilder update} updates the image to the current state of
938testing/unstable/whatever.
939@item@code{pbuilder build} takes a @code{*.dsc} file and builds a binary in the
940chroot image.
941@item@code{pdebuild} is a wrapper for Debian Developers, to allow running
942@code{pbuilder} just like @code{debuild}, as a normal user.
943@end itemize")
944 (license license:gpl2+)))
945
946(define-public reprepro
947 (package
948 (name "reprepro")
949 (version "5.3.0")
950 (source
951 (origin
952 (method git-fetch)
953 (uri (git-reference
954 (url "https://salsa.debian.org/brlink/reprepro.git/")
955 (commit (string-append name "-" version))))
956 (file-name (git-file-name name version))
957 (sha256
958 (base32
959 "1kn7m5rxay6q2c4vgjgm4407xx2r46skkkb6rn33m6dqk1xfkqnh"))))
960 (build-system gnu-build-system)
961 (arguments
962 `(#:tests? #f ; testtool not found
963 #:phases
964 (modify-phases %standard-phases
965 (replace 'check
966 (lambda* (#:key tests? #:allow-other-keys)
967 (if tests?
968 (with-directory-excursion "tests"
969 (invoke (which "sh") "test.sh"))
970 #t)))
971 (add-after 'install 'install-completions
972 (lambda* (#:key outputs #:allow-other-keys)
973 (let* ((out (assoc-ref outputs "out"))
974 (bash (string-append out "/etc/bash_completion.d/"))
975 (zsh (string-append out "/share/zsh/site-fucnctions/")))
976 (mkdir-p bash)
977 (mkdir-p zsh)
978 (copy-file "docs/reprepro.bash_completion"
979 (string-append bash "reprepro"))
980 (copy-file "docs/reprepro.zsh_completion"
981 (string-append zsh "_reprepro"))
982 #t))))))
983 (inputs
984 (list bdb
985 bzip2
986 gpgme
987 libarchive
988 xz
989 zlib))
990 (native-inputs
991 (list autoconf automake))
992 (home-page "https://salsa.debian.org/brlink/reprepro")
993 (synopsis "Debian package repository producer")
994 (description "Reprepro is a tool to manage a repository of Debian packages
995(@code{.deb}, @code{.udeb}, @code{.dsc}, ...). It stores files either being
996injected manually or downloaded from some other repository (partially) mirrored
997into one pool/ hierarchy. Managed packages and files are stored in a Berkeley
998DB, so no database server is needed. Checking signatures of mirrored
999repositories and creating signatures of the generated Package indices is
1000supported.")
1001 (license license:gpl2)))