Commit | Line | Data |
---|---|---|
1779aaa0 | 1 | ;;; GNU Guix --- Functional package management for GNU |
8e1cd1a2 | 2 | ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> |
07922c50 | 3 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
8e1cd1a2 | 4 | ;;; |
1779aaa0 TGR |
5 | ;;; This file is part of GNU Guix. |
6 | ;;; | |
8e1cd1a2 EF |
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. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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/>. | |
19 | ||
20 | (define-module (gnu packages debian) | |
21 | #:use-module ((guix licenses) #:prefix license:) | |
22 | #:use-module (guix download) | |
5743ba49 | 23 | #:use-module (guix git-download) |
8e1cd1a2 EF |
24 | #:use-module (guix packages) |
25 | #:use-module (guix build-system gnu) | |
b3230c28 EF |
26 | #:use-module (guix build-system trivial) |
27 | #:use-module (gnu packages base) | |
28 | #:use-module (gnu packages compression) | |
298a2c1e | 29 | #:use-module (gnu packages gnupg) |
7111ea0d | 30 | #:use-module (gnu packages perl)) |
8e1cd1a2 EF |
31 | |
32 | (define-public debian-archive-keyring | |
33 | (package | |
34 | (name "debian-archive-keyring") | |
76513c94 | 35 | (version "2019.1") |
8e1cd1a2 EF |
36 | (source |
37 | (origin | |
f909e217 EF |
38 | (method git-fetch) |
39 | (uri (git-reference | |
40 | (url "https://salsa.debian.org/release-team/debian-archive-keyring.git") | |
41 | (commit version))) | |
42 | (file-name (git-file-name name version)) | |
8e1cd1a2 EF |
43 | (sha256 |
44 | (base32 | |
76513c94 | 45 | "0bphwji3ywk1zi5bq8bhqk7l51fwjy1idwsw7zfqnxca8m5wvw1g")))) |
8e1cd1a2 EF |
46 | (build-system gnu-build-system) |
47 | (arguments | |
48 | '(#:test-target "verify-results" | |
49 | #:parallel-build? #f ; has race conditions | |
50 | #:phases | |
51 | (modify-phases %standard-phases | |
52 | (delete 'configure) ; no configure script | |
53 | (replace 'install | |
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$"))) | |
63 | #t))))) | |
64 | (native-inputs | |
65 | `(("gnupg" ,gnupg) | |
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") | |
69 | (description | |
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 | |
b3230c28 EF |
74 | |
75 | (define-public ubuntu-keyring | |
76 | (package | |
77 | (name "ubuntu-keyring") | |
4aa64e3a | 78 | (version "2018.09.18.1") |
b3230c28 EF |
79 | (source |
80 | (origin | |
81 | (method url-fetch) | |
82 | (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/" | |
83 | "+files/" name "_" version ".tar.gz")) | |
84 | (sha256 | |
85 | (base32 | |
4aa64e3a | 86 | "0csx2n62rj9rxjv4y8qhby7l9rbybfwrb0406pc2cjr7f2yk91af")))) |
b3230c28 EF |
87 | (build-system trivial-build-system) |
88 | (arguments | |
89 | `(#:modules ((guix build utils)) | |
90 | #:builder (begin | |
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$"))) | |
105 | #t))) | |
106 | (native-inputs | |
107 | `(("tar" ,tar) | |
108 | ("gzip" ,gzip))) | |
109 | (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring") | |
110 | (synopsis "GnuPG keys of the Ubuntu archive") | |
111 | (description | |
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 | |
298a2c1e EF |
116 | |
117 | (define-public debootstrap | |
118 | (package | |
119 | (name "debootstrap") | |
54d14302 | 120 | (version "1.0.114") |
298a2c1e EF |
121 | (source |
122 | (origin | |
5743ba49 EF |
123 | (method git-fetch) |
124 | (uri (git-reference | |
125 | (url "https://salsa.debian.org/installer-team/debootstrap.git") | |
126 | (commit version))) | |
127 | (file-name (git-file-name name version)) | |
298a2c1e EF |
128 | (sha256 |
129 | (base32 | |
54d14302 | 130 | "147308flz9y8g6f972izi3szmsywf5f8xm64z2smy1cayd340i63")))) |
298a2c1e EF |
131 | (build-system gnu-build-system) |
132 | (arguments | |
133 | `(#:phases | |
134 | (modify-phases %standard-phases | |
135 | (delete 'configure) | |
136 | (add-after 'unpack 'patch-source | |
137 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
138 | (let ((out (assoc-ref outputs "out")) | |
7111ea0d | 139 | (tzdata (assoc-ref inputs "tzdata")) |
298a2c1e EF |
140 | (debian (assoc-ref inputs "debian-keyring")) |
141 | (ubuntu (assoc-ref inputs "ubuntu-keyring"))) | |
142 | (substitute* "Makefile" | |
143 | (("/usr") "") | |
144 | (("-o root -g root") "") | |
145 | (("chown root.*") "\n")) | |
7111ea0d EF |
146 | (substitute* '("scripts/etch" |
147 | "scripts/potato" | |
148 | "scripts/sarge" | |
149 | "scripts/sid" | |
150 | "scripts/woody" | |
151 | "scripts/woody.buildd") | |
298a2c1e EF |
152 | (("/usr") debian)) |
153 | (substitute* "scripts/gutsy" | |
154 | (("/usr") ubuntu)) | |
155 | (substitute* "debootstrap" | |
156 | (("=/usr") (string-append "=" out))) | |
90041e9c VC |
157 | ;; Ensure PATH works both in guix and within the debian chroot |
158 | ;; workaround for: https://bugs.debian.org/929889 | |
159 | (substitute* "functions" | |
160 | (("PATH=/sbin:/usr/sbin:/bin:/usr/bin") | |
161 | "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin")) | |
7111ea0d EF |
162 | (substitute* (find-files "scripts" ".") |
163 | (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo"))) | |
298a2c1e EF |
164 | #t))) |
165 | (add-after 'install 'install-man-file | |
166 | (lambda* (#:key outputs #:allow-other-keys) | |
167 | (let ((out (assoc-ref outputs "out"))) | |
168 | (install-file "debootstrap.8" | |
169 | (string-append out "/share/man/man8")) | |
7111ea0d EF |
170 | #t))) |
171 | (add-after 'install 'wrap-executable | |
172 | (lambda* (#:key outputs #:allow-other-keys) | |
173 | (let ((debootstrap (string-append (assoc-ref outputs "out") | |
174 | "/sbin/debootstrap")) | |
175 | (path (getenv "PATH"))) | |
176 | (wrap-program debootstrap | |
177 | `("PATH" ":" prefix (,path))) | |
298a2c1e EF |
178 | #t)))) |
179 | #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) | |
180 | #:tests? #f)) ; no tests | |
181 | (inputs | |
7111ea0d | 182 | `(("debian-keyring" ,debian-archive-keyring) |
298a2c1e | 183 | ("ubuntu-keyring" ,ubuntu-keyring) |
7111ea0d EF |
184 | ("tzdata" ,tzdata))) |
185 | (native-inputs | |
186 | `(("perl" ,perl))) | |
5743ba49 | 187 | (home-page "https://tracker.debian.org/pkg/debootstrap") |
298a2c1e EF |
188 | (synopsis "Bootstrap a basic Debian system") |
189 | (description "Debootstrap is used to create a Debian base system from | |
190 | scratch, without requiring the availability of @code{dpkg} or @code{apt}. | |
191 | It does this by downloading .deb files from a mirror site, and carefully | |
90041e9c | 192 | unpacking them into a directory which can eventually be chrooted into.") |
298a2c1e | 193 | (license license:gpl2))) |