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 packages)
21 #:use-module (guix build-system gnu)
22 #:use-module (guix build-system trivial)
23 #:use-module (gnu packages base)
24 #:use-module (gnu packages compression)
25 #:use-module (gnu packages gnupg)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages wget))
29 (define-public debian-archive-keyring
31 (name "debian-archive-keyring")
36 (uri (string-append "mirror://debian/pool/main/d/" name "/"
37 name "_" version ".tar.xz"))
40 "1pdwgipfi0y4svhxlw8arhq792f1g3vlmw4raphizy7sa65vd4ca"))))
41 (build-system gnu-build-system)
43 '(#:test-target "verify-results"
44 #:parallel-build? #f ; has race conditions
46 (modify-phases %standard-phases
47 (delete 'configure) ; no configure script
49 (lambda* (#:key outputs #:allow-other-keys)
50 (let* ((out (assoc-ref outputs "out"))
51 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
52 (key (string-append out "/share/keyrings/")))
53 (install-file "keyrings/debian-archive-keyring.gpg" key)
54 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
55 (for-each (lambda (file)
56 (install-file file apt))
57 (find-files "trusted.gpg" "\\.gpg$")))
61 ("jetring" ,jetring)))
62 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
63 (synopsis "GnuPG archive keys of the Debian archive")
65 "The Debian project digitally signs its Release files. This package
66 contains the archive keys used for that.")
67 (license (list license:public-domain ; the keys
68 license:gpl2+)))) ; see debian/copyright
70 (define-public ubuntu-keyring
72 (name "ubuntu-keyring")
73 (version "2018.02.28")
77 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
78 "+files/" name "_" version ".tar.gz"))
81 "1zj3012cz7rlx9pm39wnwa0lmi1h38n6bkgbz81vnmcsvqsc9a3a"))))
82 (build-system trivial-build-system)
84 `(#:modules ((guix build utils))
86 (use-modules (guix build utils))
87 (let* ((out (assoc-ref %outputs "out"))
88 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
89 (key (string-append out "/share/keyrings/")))
90 (setenv "PATH" (string-append
91 (assoc-ref %build-inputs "gzip") "/bin:"
92 (assoc-ref %build-inputs "tar") "/bin"))
93 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
94 (for-each (lambda (file)
95 (install-file file apt))
96 (find-files "." "ubuntu-[^am].*\\.gpg$"))
97 (for-each (lambda (file)
98 (install-file file key))
99 (find-files "." "ubuntu-[am].*\\.gpg$")))
104 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
105 (synopsis "GnuPG keys of the Ubuntu archive")
107 "The Ubuntu project digitally signs its Release files. This package
108 contains the archive keys used for that.")
109 (license (list license:public-domain ; the keys
110 license:gpl2+)))) ; see debian/copyright
112 (define-public debootstrap
119 (uri (string-append "mirror://debian/pool/main/d/" name "/"
120 name "_" version ".tar.gz"))
123 "1xpd1yblcgwhri64hzgxhalpf5j8gqbmkrsm1fs0pbwiy0wdz0ry"))))
124 (build-system gnu-build-system)
127 (modify-phases %standard-phases
129 (add-after 'unpack 'patch-source
130 (lambda* (#:key inputs outputs #:allow-other-keys)
131 (let ((out (assoc-ref outputs "out"))
132 (wget (assoc-ref inputs "wget"))
133 (debian (assoc-ref inputs "debian-keyring"))
134 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
135 (substitute* "Makefile"
137 (("-o root -g root") "")
138 (("chown root.*") "\n"))
139 (substitute* "scripts/sid"
141 (substitute* "scripts/gutsy"
143 (substitute* "debootstrap"
144 (("=/usr") (string-append "=" out)))
145 (substitute* "functions"
146 (("wget ") (string-append wget "/bin/wget ")))
148 (add-after 'install 'install-man-file
149 (lambda* (#:key outputs #:allow-other-keys)
150 (let ((out (assoc-ref outputs "out")))
151 (install-file "debootstrap.8"
152 (string-append out "/share/man/man8"))
154 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
155 #:tests? #f)) ; no tests
157 `(("debian-keyring" ,debian-archive-keyring)
158 ("ubuntu-keyring" ,ubuntu-keyring)
160 ;; The following are required for debootstrap to work correctly
162 `(("binutils" ,binutils)
165 (home-page "https://anonscm.debian.org/cgit/d-i/debootstrap.git")
166 (synopsis "Bootstrap a basic Debian system")
167 (description "Debootstrap is used to create a Debian base system from
168 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
169 It does this by downloading .deb files from a mirror site, and carefully
170 unpacking them into a directory which can eventually be chrooted into.")
171 (license license:gpl2)))