gnu: debian-archive-keyring: Update to 2018.1.
[jackhill/guix/guix.git] / gnu / packages / debian.scm
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>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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)
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)
31 #:use-module (gnu packages wget))
32
33 (define-public debian-archive-keyring
34 (package
35 (name "debian-archive-keyring")
36 (version "2018.1")
37 (source
38 (origin
39 (method git-fetch)
40 (uri (git-reference
41 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
42 (commit version)))
43 (file-name (git-file-name name version))
44 (sha256
45 (base32
46 "136vr5dj7w0dz563qdghsndcfcqm2m8d4j1dyiq9dzx5vd0rcpcw"))))
47 (build-system gnu-build-system)
48 (arguments
49 '(#:test-target "verify-results"
50 #:parallel-build? #f ; has race conditions
51 #:phases
52 (modify-phases %standard-phases
53 (delete 'configure) ; no configure script
54 (replace 'install
55 (lambda* (#:key outputs #:allow-other-keys)
56 (let* ((out (assoc-ref outputs "out"))
57 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
58 (key (string-append out "/share/keyrings/")))
59 (install-file "keyrings/debian-archive-keyring.gpg" key)
60 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
61 (for-each (lambda (file)
62 (install-file file apt))
63 (find-files "trusted.gpg" "\\.gpg$")))
64 #t)))))
65 (native-inputs
66 `(("gnupg" ,gnupg)
67 ("jetring" ,jetring)))
68 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
69 (synopsis "GnuPG archive keys of the Debian archive")
70 (description
71 "The Debian project digitally signs its Release files. This package
72 contains the archive keys used for that.")
73 (license (list license:public-domain ; the keys
74 license:gpl2+)))) ; see debian/copyright
75
76 (define-public ubuntu-keyring
77 (package
78 (name "ubuntu-keyring")
79 (version "2018.09.18.1")
80 (source
81 (origin
82 (method url-fetch)
83 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
84 "+files/" name "_" version ".tar.gz"))
85 (sha256
86 (base32
87 "0csx2n62rj9rxjv4y8qhby7l9rbybfwrb0406pc2cjr7f2yk91af"))))
88 (build-system trivial-build-system)
89 (arguments
90 `(#:modules ((guix build utils))
91 #:builder (begin
92 (use-modules (guix build utils))
93 (let* ((out (assoc-ref %outputs "out"))
94 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
95 (key (string-append out "/share/keyrings/")))
96 (setenv "PATH" (string-append
97 (assoc-ref %build-inputs "gzip") "/bin:"
98 (assoc-ref %build-inputs "tar") "/bin"))
99 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
100 (for-each (lambda (file)
101 (install-file file apt))
102 (find-files "." "ubuntu-[^am].*\\.gpg$"))
103 (for-each (lambda (file)
104 (install-file file key))
105 (find-files "." "ubuntu-[am].*\\.gpg$")))
106 #t)))
107 (native-inputs
108 `(("tar" ,tar)
109 ("gzip" ,gzip)))
110 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
111 (synopsis "GnuPG keys of the Ubuntu archive")
112 (description
113 "The Ubuntu project digitally signs its Release files. This package
114 contains the archive keys used for that.")
115 (license (list license:public-domain ; the keys
116 license:gpl2+)))) ; see debian/copyright
117
118 (define-public debootstrap
119 (package
120 (name "debootstrap")
121 (version "1.0.109")
122 (source
123 (origin
124 (method git-fetch)
125 (uri (git-reference
126 (url "https://salsa.debian.org/installer-team/debootstrap.git")
127 (commit version)))
128 (file-name (git-file-name name version))
129 (sha256
130 (base32
131 "0bjqlyg605lnsjcn3wjplc6jl75nx7c6miyac2qsahi484rylg5g"))))
132 (build-system gnu-build-system)
133 (arguments
134 `(#:phases
135 (modify-phases %standard-phases
136 (delete 'configure)
137 (add-after 'unpack 'patch-source
138 (lambda* (#:key inputs outputs #:allow-other-keys)
139 (let ((out (assoc-ref outputs "out"))
140 (coreutils (assoc-ref inputs "coreutils"))
141 (wget (assoc-ref inputs "wget"))
142 (debian (assoc-ref inputs "debian-keyring"))
143 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
144 (substitute* "Makefile"
145 (("/usr") "")
146 (("-o root -g root") "")
147 (("chown root.*") "\n"))
148 (substitute* "scripts/sid"
149 (("/usr") debian))
150 (substitute* "scripts/gutsy"
151 (("/usr") ubuntu))
152 (substitute* "debootstrap"
153 (("chroot ") (string-append coreutils "/bin/chroot "))
154 (("=/usr") (string-append "=" out)))
155 (substitute* "functions"
156 (("wget ") (string-append wget "/bin/wget ")))
157 #t)))
158 (add-after 'install 'install-man-file
159 (lambda* (#:key outputs #:allow-other-keys)
160 (let ((out (assoc-ref outputs "out")))
161 (install-file "debootstrap.8"
162 (string-append out "/share/man/man8"))
163 #t))))
164 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
165 #:tests? #f)) ; no tests
166 (inputs
167 `(("coreutils" ,coreutils)
168 ("debian-keyring" ,debian-archive-keyring)
169 ("ubuntu-keyring" ,ubuntu-keyring)
170 ("wget" ,wget)))
171 ;; The following are required for debootstrap to work correctly
172 (propagated-inputs
173 `(("binutils" ,binutils)
174 ("gnupg" ,gnupg)
175 ("perl" ,perl)))
176 (home-page "https://tracker.debian.org/pkg/debootstrap")
177 (synopsis "Bootstrap a basic Debian system")
178 (description "Debootstrap is used to create a Debian base system from
179 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
180 It does this by downloading .deb files from a mirror site, and carefully
181 unpacking them into a directory which can eventually be chrooted into.")
182 (license license:gpl2)))