1 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
2 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; GNU Guix is free software; you can redistribute it and/or modify it
5 ;;; under the terms of the GNU General Public License as published by
6 ;;; the Free Software Foundation; either version 3 of the License, or (at
7 ;;; your option) any later version.
9 ;;; GNU Guix is distributed in the hope that it will be useful, but
10 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ;;; GNU General Public License for more details.
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
17 (define-module (gnu packages debian)
18 #:use-module ((guix licenses) #:prefix license:)
19 #:use-module (guix download)
20 #:use-module (guix git-download)
21 #:use-module (guix packages)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix build-system trivial)
24 #:use-module (gnu packages base)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages gnupg)
27 #:use-module (gnu packages perl)
28 #:use-module (gnu packages wget))
30 (define-public debian-archive-keyring
32 (name "debian-archive-keyring")
37 (uri (string-append "mirror://debian/pool/main/d/" name "/"
38 name "_" version ".tar.xz"))
41 "1pdwgipfi0y4svhxlw8arhq792f1g3vlmw4raphizy7sa65vd4ca"))))
42 (build-system gnu-build-system)
44 '(#:test-target "verify-results"
45 #:parallel-build? #f ; has race conditions
47 (modify-phases %standard-phases
48 (delete 'configure) ; no configure script
50 (lambda* (#:key outputs #:allow-other-keys)
51 (let* ((out (assoc-ref outputs "out"))
52 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
53 (key (string-append out "/share/keyrings/")))
54 (install-file "keyrings/debian-archive-keyring.gpg" key)
55 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
56 (for-each (lambda (file)
57 (install-file file apt))
58 (find-files "trusted.gpg" "\\.gpg$")))
62 ("jetring" ,jetring)))
63 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
64 (synopsis "GnuPG archive keys of the Debian archive")
66 "The Debian project digitally signs its Release files. This package
67 contains the archive keys used for that.")
68 (license (list license:public-domain ; the keys
69 license:gpl2+)))) ; see debian/copyright
71 (define-public ubuntu-keyring
73 (name "ubuntu-keyring")
74 (version "2018.02.28")
78 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
79 "+files/" name "_" version ".tar.gz"))
82 "1zj3012cz7rlx9pm39wnwa0lmi1h38n6bkgbz81vnmcsvqsc9a3a"))))
83 (build-system trivial-build-system)
85 `(#:modules ((guix build utils))
87 (use-modules (guix build utils))
88 (let* ((out (assoc-ref %outputs "out"))
89 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
90 (key (string-append out "/share/keyrings/")))
91 (setenv "PATH" (string-append
92 (assoc-ref %build-inputs "gzip") "/bin:"
93 (assoc-ref %build-inputs "tar") "/bin"))
94 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
95 (for-each (lambda (file)
96 (install-file file apt))
97 (find-files "." "ubuntu-[^am].*\\.gpg$"))
98 (for-each (lambda (file)
99 (install-file file key))
100 (find-files "." "ubuntu-[am].*\\.gpg$")))
105 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
106 (synopsis "GnuPG keys of the Ubuntu archive")
108 "The Ubuntu project digitally signs its Release files. This package
109 contains the archive keys used for that.")
110 (license (list license:public-domain ; the keys
111 license:gpl2+)))) ; see debian/copyright
113 (define-public debootstrap
121 (url "https://salsa.debian.org/installer-team/debootstrap.git")
123 (file-name (git-file-name name version))
126 "1fm5bgllcwgwizrqi4sn8p4fpbzhbzgwprrfppfq9hqdzbmlfmnv"))))
127 (build-system gnu-build-system)
130 (modify-phases %standard-phases
132 (add-after 'unpack 'patch-source
133 (lambda* (#:key inputs outputs #:allow-other-keys)
134 (let ((out (assoc-ref outputs "out"))
135 (coreutils (assoc-ref inputs "coreutils"))
136 (wget (assoc-ref inputs "wget"))
137 (debian (assoc-ref inputs "debian-keyring"))
138 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
139 (substitute* "Makefile"
141 (("-o root -g root") "")
142 (("chown root.*") "\n"))
143 (substitute* "scripts/sid"
145 (substitute* "scripts/gutsy"
147 (substitute* "debootstrap"
148 (("chroot ") (string-append coreutils "/bin/chroot "))
149 (("=/usr") (string-append "=" out)))
150 (substitute* "functions"
151 (("wget ") (string-append wget "/bin/wget ")))
153 (add-after 'install 'install-man-file
154 (lambda* (#:key outputs #:allow-other-keys)
155 (let ((out (assoc-ref outputs "out")))
156 (install-file "debootstrap.8"
157 (string-append out "/share/man/man8"))
159 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
160 #:tests? #f)) ; no tests
162 `(("coreutils" ,coreutils)
163 ("debian-keyring" ,debian-archive-keyring)
164 ("ubuntu-keyring" ,ubuntu-keyring)
166 ;; The following are required for debootstrap to work correctly
168 `(("binutils" ,binutils)
171 (home-page "https://tracker.debian.org/pkg/debootstrap")
172 (synopsis "Bootstrap a basic Debian system")
173 (description "Debootstrap is used to create a Debian base system from
174 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
175 It does this by downloading .deb files from a mirror site, and carefully
176 unpacking them into a directory which can eventually be chrooted into.")
177 (license license:gpl2)))