1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
21 (define-module (gnu packages debian)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system trivial)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages backup)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages crypto)
33 #:use-module (gnu packages dbm)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages gnupg)
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))
41 (define-public debian-archive-keyring
43 (name "debian-archive-keyring")
49 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
51 (file-name (git-file-name name version))
54 "0dcmv7y1k6j3a646kr0rkd2a0c4j2wrz868bh8j9zjx1npzns73q"))))
55 (build-system gnu-build-system)
57 '(#:test-target "verify-results"
58 #:parallel-build? #f ; has race conditions
60 (modify-phases %standard-phases
61 (delete 'configure) ; no configure script
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$")))
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")
79 "The Debian project digitally signs its Release files. This package
80 contains the archive keys used for that.")
81 (license (list license:public-domain ; the keys
82 license:gpl2+)))) ; see debian/copyright
84 (define-public ubuntu-keyring
86 (name "ubuntu-keyring")
87 (version "2021.03.26")
91 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
92 "+files/" name "_" version ".tar.gz"))
95 "1ccvwh4s51viyhcg8gh189jmvbrhc5wv1bbp4minz3200rffsbj9"))))
96 (build-system trivial-build-system)
98 `(#:modules ((guix build utils))
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$")))
118 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
119 (synopsis "GnuPG keys of the Ubuntu archive")
121 "The Ubuntu project digitally signs its Release files. This package
122 contains the archive keys used for that.")
123 (license (list license:public-domain ; the keys
124 license:gpl2+)))) ; see debian/copyright
126 (define-public debootstrap
134 (url "https://salsa.debian.org/installer-team/debootstrap.git")
136 (file-name (git-file-name name version))
138 (base32 "0fr5ir8arzisx71jybbk4xz85waz50lf2y052nfimzh6vv9dx54c"))))
139 (build-system gnu-build-system)
142 (modify-phases %standard-phases
144 (add-after 'unpack 'patch-source
145 (lambda* (#:key inputs outputs #:allow-other-keys)
146 (let ((out (assoc-ref outputs "out"))
147 (tzdata (assoc-ref inputs "tzdata"))
148 (debian (assoc-ref inputs "debian-keyring"))
149 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
150 (substitute* "Makefile"
152 (("-o root -g root") "")
153 (("chown root.*") "\n"))
154 (substitute* '("scripts/etch"
159 "scripts/woody.buildd")
161 (substitute* "scripts/gutsy"
163 (substitute* "debootstrap"
164 (("=/usr") (string-append "=" out)))
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"))
170 (substitute* (find-files "scripts" ".")
171 (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
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"))
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)))
187 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
188 #:tests? #f)) ; no tests
190 `(("debian-keyring" ,debian-archive-keyring)
191 ("ubuntu-keyring" ,ubuntu-keyring)
194 ;; Called at run-time from various places, needs to be in PATH.
199 (home-page "https://tracker.debian.org/pkg/debootstrap")
200 (synopsis "Bootstrap a basic Debian system")
201 (description "Debootstrap is used to create a Debian base system from
202 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
203 It does this by downloading .deb files from a mirror site, and carefully
204 unpacking them into a directory which can eventually be chrooted into.")
205 (license license:gpl2)))
207 (define-public debianutils
214 (url "https://salsa.debian.org/debian/debianutils.git")
215 (commit (string-append "debian/" version))))
216 (file-name (git-file-name "debianutils" version))
219 "18ypb7fivch53wwrdf73yhf1fhkwn9kvw1kfdc1m450241d6191w"))))
220 (build-system gnu-build-system)
222 '(#:phases (modify-phases %standard-phases
223 (add-after 'bootstrap 'create-translations
225 (with-directory-excursion "po4a"
226 (invoke "po4a" "--no-backups" "po4a.conf"))
229 `(("autoconf" ,autoconf)
230 ("automake" ,automake)
231 ("gettext" ,gettext-minimal)
233 (home-page "https://packages.debian.org/unstable/debianutils")
234 (synopsis "Miscellaneous shell utilities")
236 "This package provides a number of utilities which are mostly for use
237 in 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
246 debian/copyright for more information.")))))
248 (define-public apt-mirror
249 (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
253 (version (git-version "0.5.4" revision commit))
257 (url "https://github.com/apt-mirror/apt-mirror/")
259 (file-name (git-file-name name version))
262 "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
263 (build-system gnu-build-system)
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"))
272 #:phases (modify-phases %standard-phases (delete 'configure))))
276 (home-page "http://apt-mirror.github.io/")
277 (synopsis "Script for mirroring a Debian repository")
279 "apt-mirror is a small tool that provides the ability to
280 selectively mirror Debian and Ubuntu GNU/Linux distributions or any
281 other apt sources typically provided by open source developers.")
282 (license license:gpl2))))
292 (url "https://git.dpkg.org/git/dpkg/dpkg")
294 (file-name (git-file-name name version))
297 "16wlb8hwbdvxar187bjd4pzdzj95g3l2ryi2khqqmwbyca4sjm1n"))))
298 (build-system gnu-build-system)
301 (modify-phases %standard-phases
302 (add-before 'bootstrap 'patch-version
304 (patch-shebang "get-version")
305 (with-output-to-file ".dist-version"
306 (lambda () (display ,version)))
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"
314 "/lib/perl5/site_perl/"
315 ,(package-version perl)))
318 `(("autoconf" ,autoconf)
319 ("automake" ,automake)
320 ("gettext" ,gettext-minimal)
322 ("pkg-config" ,pkg-config)
323 ("perl-io-string" ,perl-io-string)))
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
334 handling the installation and removal of Debian software packages.")
335 (license license:gpl2+)))
337 (define-public reprepro
345 (url "https://salsa.debian.org/brlink/reprepro.git/")
346 (commit (string-append name "-" version))))
347 (file-name (git-file-name name version))
350 "1kn7m5rxay6q2c4vgjgm4407xx2r46skkkb6rn33m6dqk1xfkqnh"))))
351 (build-system gnu-build-system)
353 `(#:tests? #f ; testtool not found
355 (modify-phases %standard-phases
357 (lambda* (#:key tests? #:allow-other-keys)
359 (with-directory-excursion "tests"
360 (invoke (which "sh") "test.sh"))
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/")))
369 (copy-file "docs/reprepro.bash_completion"
370 (string-append bash "reprepro"))
371 (copy-file "docs/reprepro.zsh_completion"
372 (string-append zsh "_reprepro"))
378 ("libarchive" ,libarchive)
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
388 injected manually or downloaded from some other repository (partially) mirrored
389 into one pool/ hierarchy. Managed packages and files are stored in a Berkeley
390 DB, so no database server is needed. Checking signatures of mirrored
391 repositories and creating signatures of the generated Package indices is
393 (license license:gpl2)))