gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / debian.scm
CommitLineData
1779aaa0 1;;; GNU Guix --- Functional package management for GNU
002b6112 2;;; Copyright © 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
6729488f 3;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
dd3bd0be 4;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
8e1cd1a2 5;;;
1779aaa0
TGR
6;;; This file is part of GNU Guix.
7;;;
8e1cd1a2
EF
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages debian)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
5743ba49 24 #:use-module (guix git-download)
8e1cd1a2
EF
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
b3230c28 27 #:use-module (guix build-system trivial)
dd3bd0be 28 #:use-module (gnu packages autotools)
13978f02 29 #:use-module (gnu packages backup)
b3230c28
EF
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages compression)
d82766e6 32 #:use-module (gnu packages crypto)
13978f02 33 #:use-module (gnu packages dbm)
dd3bd0be 34 #:use-module (gnu packages gettext)
298a2c1e 35 #:use-module (gnu packages gnupg)
d82766e6
EF
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages wget))
8e1cd1a2
EF
40
41(define-public debian-archive-keyring
42 (package
43 (name "debian-archive-keyring")
002b6112 44 (version "2021.1.1")
8e1cd1a2
EF
45 (source
46 (origin
f909e217
EF
47 (method git-fetch)
48 (uri (git-reference
49 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
50 (commit version)))
51 (file-name (git-file-name name version))
8e1cd1a2
EF
52 (sha256
53 (base32
002b6112 54 "0dcmv7y1k6j3a646kr0rkd2a0c4j2wrz868bh8j9zjx1npzns73q"))))
8e1cd1a2
EF
55 (build-system gnu-build-system)
56 (arguments
57 '(#:test-target "verify-results"
58 #:parallel-build? #f ; has race conditions
59 #:phases
60 (modify-phases %standard-phases
61 (delete 'configure) ; no configure script
62 (replace 'install
63 (lambda* (#:key outputs #:allow-other-keys)
64 (let* ((out (assoc-ref outputs "out"))
65 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
66 (key (string-append out "/share/keyrings/")))
67 (install-file "keyrings/debian-archive-keyring.gpg" key)
68 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
69 (for-each (lambda (file)
70 (install-file file apt))
71 (find-files "trusted.gpg" "\\.gpg$")))
72 #t)))))
73 (native-inputs
74 `(("gnupg" ,gnupg)
75 ("jetring" ,jetring)))
76 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
77 (synopsis "GnuPG archive keys of the Debian archive")
78 (description
79 "The Debian project digitally signs its Release files. This package
80contains the archive keys used for that.")
81 (license (list license:public-domain ; the keys
82 license:gpl2+)))) ; see debian/copyright
b3230c28
EF
83
84(define-public ubuntu-keyring
85 (package
86 (name "ubuntu-keyring")
482ff111 87 (version "2021.03.26")
b3230c28
EF
88 (source
89 (origin
90 (method url-fetch)
91 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
92 "+files/" name "_" version ".tar.gz"))
93 (sha256
94 (base32
482ff111 95 "1ccvwh4s51viyhcg8gh189jmvbrhc5wv1bbp4minz3200rffsbj9"))))
b3230c28
EF
96 (build-system trivial-build-system)
97 (arguments
98 `(#:modules ((guix build utils))
99 #:builder (begin
100 (use-modules (guix build utils))
101 (let* ((out (assoc-ref %outputs "out"))
102 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
103 (key (string-append out "/share/keyrings/")))
104 (setenv "PATH" (string-append
105 (assoc-ref %build-inputs "gzip") "/bin:"
106 (assoc-ref %build-inputs "tar") "/bin"))
107 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
108 (for-each (lambda (file)
109 (install-file file apt))
110 (find-files "." "ubuntu-[^am].*\\.gpg$"))
111 (for-each (lambda (file)
112 (install-file file key))
113 (find-files "." "ubuntu-[am].*\\.gpg$")))
114 #t)))
115 (native-inputs
116 `(("tar" ,tar)
117 ("gzip" ,gzip)))
118 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
119 (synopsis "GnuPG keys of the Ubuntu archive")
120 (description
121 "The Ubuntu project digitally signs its Release files. This package
122contains the archive keys used for that.")
123 (license (list license:public-domain ; the keys
124 license:gpl2+)))) ; see debian/copyright
298a2c1e
EF
125
126(define-public debootstrap
127 (package
128 (name "debootstrap")
6729488f 129 (version "1.0.123")
298a2c1e
EF
130 (source
131 (origin
5743ba49
EF
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://salsa.debian.org/installer-team/debootstrap.git")
135 (commit version)))
136 (file-name (git-file-name name version))
298a2c1e 137 (sha256
6729488f 138 (base32 "0fr5ir8arzisx71jybbk4xz85waz50lf2y052nfimzh6vv9dx54c"))))
298a2c1e
EF
139 (build-system gnu-build-system)
140 (arguments
141 `(#:phases
142 (modify-phases %standard-phases
143 (delete 'configure)
144 (add-after 'unpack 'patch-source
145 (lambda* (#:key inputs outputs #:allow-other-keys)
146 (let ((out (assoc-ref outputs "out"))
7111ea0d 147 (tzdata (assoc-ref inputs "tzdata"))
298a2c1e
EF
148 (debian (assoc-ref inputs "debian-keyring"))
149 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
150 (substitute* "Makefile"
151 (("/usr") "")
152 (("-o root -g root") "")
153 (("chown root.*") "\n"))
7111ea0d
EF
154 (substitute* '("scripts/etch"
155 "scripts/potato"
156 "scripts/sarge"
157 "scripts/sid"
158 "scripts/woody"
159 "scripts/woody.buildd")
298a2c1e
EF
160 (("/usr") debian))
161 (substitute* "scripts/gutsy"
162 (("/usr") ubuntu))
163 (substitute* "debootstrap"
164 (("=/usr") (string-append "=" out)))
90041e9c
VC
165 ;; Ensure PATH works both in guix and within the debian chroot
166 ;; workaround for: https://bugs.debian.org/929889
167 (substitute* "functions"
168 (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
169 "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
7111ea0d
EF
170 (substitute* (find-files "scripts" ".")
171 (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
298a2c1e
EF
172 #t)))
173 (add-after 'install 'install-man-file
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let ((out (assoc-ref outputs "out")))
176 (install-file "debootstrap.8"
177 (string-append out "/share/man/man8"))
7111ea0d
EF
178 #t)))
179 (add-after 'install 'wrap-executable
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let ((debootstrap (string-append (assoc-ref outputs "out")
182 "/sbin/debootstrap"))
183 (path (getenv "PATH")))
184 (wrap-program debootstrap
185 `("PATH" ":" prefix (,path)))
298a2c1e
EF
186 #t))))
187 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
188 #:tests? #f)) ; no tests
189 (inputs
7111ea0d 190 `(("debian-keyring" ,debian-archive-keyring)
298a2c1e 191 ("ubuntu-keyring" ,ubuntu-keyring)
6941004f
MB
192 ("tzdata" ,tzdata)
193
194 ;; Called at run-time from various places, needs to be in PATH.
195 ("gnupg" ,gnupg)
196 ("wget" ,wget)))
7111ea0d
EF
197 (native-inputs
198 `(("perl" ,perl)))
5743ba49 199 (home-page "https://tracker.debian.org/pkg/debootstrap")
298a2c1e
EF
200 (synopsis "Bootstrap a basic Debian system")
201 (description "Debootstrap is used to create a Debian base system from
202scratch, without requiring the availability of @code{dpkg} or @code{apt}.
203It does this by downloading .deb files from a mirror site, and carefully
90041e9c 204unpacking them into a directory which can eventually be chrooted into.")
298a2c1e 205 (license license:gpl2)))
524e5fe5 206
dd3bd0be
MB
207(define-public debianutils
208 (package
209 (name "debianutils")
34017e3f 210 (version "4.11.1")
dd3bd0be
MB
211 (source (origin
212 (method git-fetch)
213 (uri (git-reference
214 (url "https://salsa.debian.org/debian/debianutils.git")
215 (commit (string-append "debian/" version))))
216 (file-name (git-file-name "debianutils" version))
217 (sha256
218 (base32
34017e3f 219 "18ypb7fivch53wwrdf73yhf1fhkwn9kvw1kfdc1m450241d6191w"))))
dd3bd0be
MB
220 (build-system gnu-build-system)
221 (arguments
222 '(#:phases (modify-phases %standard-phases
223 (add-after 'bootstrap 'create-translations
224 (lambda _
225 (with-directory-excursion "po4a"
226 (invoke "po4a" "--no-backups" "po4a.conf"))
227 #t)))))
228 (native-inputs
229 `(("autoconf" ,autoconf)
230 ("automake" ,automake)
231 ("gettext" ,gettext-minimal)
232 ("po4a" ,po4a)))
233 (home-page "https://packages.debian.org/unstable/debianutils")
234 (synopsis "Miscellaneous shell utilities")
235 (description
236 "This package provides a number of utilities which are mostly for use
237in installation scripts of Debian packages. The programs included are
238@command{add-shell}, @command{installkernel}, @command{ischroot},
239@command{remove-shell}, @command{run-parts}, @command{savelog},
240@command{tempfile}, and @command{which}.")
241 (license (list license:gpl2+
242 ;; The 'savelog' program is distributed under a
243 ;; GPL-compatible copyleft license.
244 (license:fsf-free "file://debian/copyright"
245 "The SMAIL General Public License, see
246debian/copyright for more information.")))))
524e5fe5
JBN
247
248(define-public apt-mirror
249 (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
250 (revision "1"))
251 (package
252 (name "apt-mirror")
253 (version (git-version "0.5.4" revision commit))
254 (source (origin
255 (method git-fetch)
256 (uri (git-reference
257 (url "https://github.com/apt-mirror/apt-mirror/")
258 (commit commit)))
259 (file-name (git-file-name name version))
260 (sha256
261 (base32
262 "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
263 (build-system gnu-build-system)
264 (outputs '("out"))
265 (arguments
266 `(#:tests? #f
267 ;; sysconfdir is not PREFIXed in the makefile but DESTDIR is
268 ;; honored correctly; we therefore use DESTDIR for our
269 ;; needs. A more correct fix would involve patching.
270 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
271 "PREFIX=/")
272 #:phases (modify-phases %standard-phases (delete 'configure))))
273 (inputs
274 `(("wget" ,wget)
275 ("perl" ,perl)))
276 (home-page "http://apt-mirror.github.io/")
277 (synopsis "Script for mirroring a Debian repository")
278 (description
279 "apt-mirror is a small tool that provides the ability to
280selectively mirror Debian and Ubuntu GNU/Linux distributions or any
281other apt sources typically provided by open source developers.")
282 (license license:gpl2))))
d82766e6
EF
283
284(define-public dpkg
285 (package
286 (name "dpkg")
6c7251f2 287 (version "1.20.9")
d82766e6
EF
288 (source
289 (origin
290 (method git-fetch)
291 (uri (git-reference
292 (url "https://git.dpkg.org/git/dpkg/dpkg")
293 (commit version)))
294 (file-name (git-file-name name version))
295 (sha256
296 (base32
6c7251f2 297 "16wlb8hwbdvxar187bjd4pzdzj95g3l2ryi2khqqmwbyca4sjm1n"))))
d82766e6
EF
298 (build-system gnu-build-system)
299 (arguments
300 `(#:phases
301 (modify-phases %standard-phases
302 (add-before 'bootstrap 'patch-version
303 (lambda _
304 (patch-shebang "get-version")
305 (with-output-to-file ".dist-version"
306 (lambda () (display ,version)))
307 #t))
308 (add-after 'unpack 'set-perl-libdir
309 (lambda* (#:key inputs outputs #:allow-other-keys)
310 (let ((out (assoc-ref outputs "out"))
311 (perl (assoc-ref inputs "perl")))
312 (setenv "PERL_LIBDIR"
313 (string-append out
314 "/lib/perl5/site_perl/"
315 ,(package-version perl)))
316 #t))))))
317 (native-inputs
318 `(("autoconf" ,autoconf)
319 ("automake" ,automake)
320 ("gettext" ,gettext-minimal)
321 ("libtool" ,libtool)
322 ("pkg-config" ,pkg-config)
323 ("perl-io-string" ,perl-io-string)))
324 (inputs
325 `(("bzip2" ,bzip2)
326 ("libmd" ,libmd)
327 ("ncurses" ,ncurses)
328 ("perl" ,perl)
329 ("xz" ,xz)
330 ("zlib" ,zlib)))
331 (home-page "https://wiki.debian.org/Teams/Dpkg")
332 (synopsis "Debian package management system")
333 (description "This package provides the low-level infrastructure for
334handling the installation and removal of Debian software packages.")
335 (license license:gpl2+)))
13978f02
EF
336
337(define-public reprepro
338 (package
339 (name "reprepro")
340 (version "5.3.0")
341 (source
342 (origin
343 (method git-fetch)
344 (uri (git-reference
345 (url "https://salsa.debian.org/brlink/reprepro.git/")
346 (commit (string-append name "-" version))))
347 (file-name (git-file-name name version))
348 (sha256
349 (base32
350 "1kn7m5rxay6q2c4vgjgm4407xx2r46skkkb6rn33m6dqk1xfkqnh"))))
351 (build-system gnu-build-system)
352 (arguments
353 `(#:tests? #f ; testtool not found
354 #:phases
355 (modify-phases %standard-phases
356 (replace 'check
357 (lambda* (#:key tests? #:allow-other-keys)
358 (if tests?
359 (with-directory-excursion "tests"
360 (invoke (which "sh") "test.sh"))
361 #t)))
362 (add-after 'install 'install-completions
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let* ((out (assoc-ref outputs "out"))
365 (bash (string-append out "/etc/bash_completion.d/"))
366 (zsh (string-append out "/share/zsh/site-fucnctions/")))
367 (mkdir-p bash)
368 (mkdir-p zsh)
369 (copy-file "docs/reprepro.bash_completion"
370 (string-append bash "reprepro"))
371 (copy-file "docs/reprepro.zsh_completion"
372 (string-append zsh "_reprepro"))
373 #t))))))
374 (inputs
375 `(("bdb" ,bdb)
376 ("bzip2" ,bzip2)
377 ("gpgme" ,gpgme)
378 ("libarchive" ,libarchive)
379 ("xz" ,xz)
380 ("zlib" ,zlib)))
381 (native-inputs
382 `(("autoconf" ,autoconf)
383 ("automake" ,automake)))
384 (home-page "https://salsa.debian.org/brlink/reprepro")
385 (synopsis "Debian package repository producer")
386 (description "Reprepro is a tool to manage a repository of Debian packages
387(@code{.deb}, @code{.udeb}, @code{.dsc}, ...). It stores files either being
388injected manually or downloaded from some other repository (partially) mirrored
389into one pool/ hierarchy. Managed packages and files are stored in a Berkeley
390DB, so no database server is needed. Checking signatures of mirrored
391repositories and creating signatures of the generated Package indices is
392supported.")
393 (license license:gpl2)))