1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages debian)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix packages)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system trivial)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages gnupg)
30 #:use-module (gnu packages perl))
32 (define-public debian-archive-keyring
34 (name "debian-archive-keyring")
40 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
42 (file-name (git-file-name name version))
45 "136vr5dj7w0dz563qdghsndcfcqm2m8d4j1dyiq9dzx5vd0rcpcw"))))
46 (build-system gnu-build-system)
48 '(#:test-target "verify-results"
49 #:parallel-build? #f ; has race conditions
51 (modify-phases %standard-phases
52 (delete 'configure) ; no configure script
54 (lambda* (#:key outputs #:allow-other-keys)
55 (let* ((out (assoc-ref outputs "out"))
56 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
57 (key (string-append out "/share/keyrings/")))
58 (install-file "keyrings/debian-archive-keyring.gpg" key)
59 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
60 (for-each (lambda (file)
61 (install-file file apt))
62 (find-files "trusted.gpg" "\\.gpg$")))
66 ("jetring" ,jetring)))
67 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
68 (synopsis "GnuPG archive keys of the Debian archive")
70 "The Debian project digitally signs its Release files. This package
71 contains the archive keys used for that.")
72 (license (list license:public-domain ; the keys
73 license:gpl2+)))) ; see debian/copyright
75 (define-public ubuntu-keyring
77 (name "ubuntu-keyring")
78 (version "2018.09.18.1")
82 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
83 "+files/" name "_" version ".tar.gz"))
86 "0csx2n62rj9rxjv4y8qhby7l9rbybfwrb0406pc2cjr7f2yk91af"))))
87 (build-system trivial-build-system)
89 `(#:modules ((guix build utils))
91 (use-modules (guix build utils))
92 (let* ((out (assoc-ref %outputs "out"))
93 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
94 (key (string-append out "/share/keyrings/")))
95 (setenv "PATH" (string-append
96 (assoc-ref %build-inputs "gzip") "/bin:"
97 (assoc-ref %build-inputs "tar") "/bin"))
98 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
99 (for-each (lambda (file)
100 (install-file file apt))
101 (find-files "." "ubuntu-[^am].*\\.gpg$"))
102 (for-each (lambda (file)
103 (install-file file key))
104 (find-files "." "ubuntu-[am].*\\.gpg$")))
109 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
110 (synopsis "GnuPG keys of the Ubuntu archive")
112 "The Ubuntu project digitally signs its Release files. This package
113 contains the archive keys used for that.")
114 (license (list license:public-domain ; the keys
115 license:gpl2+)))) ; see debian/copyright
117 (define-public debootstrap
125 (url "https://salsa.debian.org/installer-team/debootstrap.git")
127 (file-name (git-file-name name version))
130 "1b8s00a2kvaajqhjlms3q2dk3gqv6g4yq9h843jal1pm66zsx19n"))))
131 (build-system gnu-build-system)
134 (modify-phases %standard-phases
136 (add-after 'unpack 'patch-source
137 (lambda* (#:key inputs outputs #:allow-other-keys)
138 (let ((out (assoc-ref outputs "out"))
139 (tzdata (assoc-ref inputs "tzdata"))
140 (debian (assoc-ref inputs "debian-keyring"))
141 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
142 (substitute* "Makefile"
144 (("-o root -g root") "")
145 (("chown root.*") "\n"))
146 (substitute* '("scripts/etch"
151 "scripts/woody.buildd")
153 (substitute* "scripts/gutsy"
155 (substitute* "debootstrap"
156 (("=/usr") (string-append "=" out)))
157 (substitute* (find-files "scripts" ".")
158 (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
160 (add-after 'install 'install-man-file
161 (lambda* (#:key outputs #:allow-other-keys)
162 (let ((out (assoc-ref outputs "out")))
163 (install-file "debootstrap.8"
164 (string-append out "/share/man/man8"))
166 (add-after 'install 'wrap-executable
167 (lambda* (#:key outputs #:allow-other-keys)
168 (let ((debootstrap (string-append (assoc-ref outputs "out")
169 "/sbin/debootstrap"))
170 (path (getenv "PATH")))
171 (wrap-program debootstrap
172 `("PATH" ":" prefix (,path)))
174 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
175 #:tests? #f)) ; no tests
177 `(("debian-keyring" ,debian-archive-keyring)
178 ("ubuntu-keyring" ,ubuntu-keyring)
182 (home-page "https://tracker.debian.org/pkg/debootstrap")
183 (synopsis "Bootstrap a basic Debian system")
184 (description "Debootstrap is used to create a Debian base system from
185 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
186 It does this by downloading .deb files from a mirror site, and carefully
187 unpacking them into a directory which can eventually be chrooted into.
189 It is recommended to run @code{debootstrap --foreign --arch=...} and then
190 @code{chroot} into the directory, set the PATH and run @code{debootstrap
191 --second-stage} after.")
192 (license license:gpl2)))