Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / debian.scm
1 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
2 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;;
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.
8 ;;;
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.
13 ;;;
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/>.
16
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))
29
30 (define-public debian-archive-keyring
31 (package
32 (name "debian-archive-keyring")
33 (version "2017.7")
34 (source
35 (origin
36 (method url-fetch)
37 (uri (string-append "mirror://debian/pool/main/d/" name "/"
38 name "_" version ".tar.xz"))
39 (sha256
40 (base32
41 "1pdwgipfi0y4svhxlw8arhq792f1g3vlmw4raphizy7sa65vd4ca"))))
42 (build-system gnu-build-system)
43 (arguments
44 '(#:test-target "verify-results"
45 #:parallel-build? #f ; has race conditions
46 #:phases
47 (modify-phases %standard-phases
48 (delete 'configure) ; no configure script
49 (replace 'install
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$")))
59 #t)))))
60 (native-inputs
61 `(("gnupg" ,gnupg)
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")
65 (description
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
70
71 (define-public ubuntu-keyring
72 (package
73 (name "ubuntu-keyring")
74 (version "2018.02.28")
75 (source
76 (origin
77 (method url-fetch)
78 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
79 "+files/" name "_" version ".tar.gz"))
80 (sha256
81 (base32
82 "1zj3012cz7rlx9pm39wnwa0lmi1h38n6bkgbz81vnmcsvqsc9a3a"))))
83 (build-system trivial-build-system)
84 (arguments
85 `(#:modules ((guix build utils))
86 #:builder (begin
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$")))
101 #t)))
102 (native-inputs
103 `(("tar" ,tar)
104 ("gzip" ,gzip)))
105 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
106 (synopsis "GnuPG keys of the Ubuntu archive")
107 (description
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
112
113 (define-public debootstrap
114 (package
115 (name "debootstrap")
116 (version "1.0.106")
117 (source
118 (origin
119 (method git-fetch)
120 (uri (git-reference
121 (url "https://salsa.debian.org/installer-team/debootstrap.git")
122 (commit version)))
123 (file-name (git-file-name name version))
124 (sha256
125 (base32
126 "1fm5bgllcwgwizrqi4sn8p4fpbzhbzgwprrfppfq9hqdzbmlfmnv"))))
127 (build-system gnu-build-system)
128 (arguments
129 `(#:phases
130 (modify-phases %standard-phases
131 (delete 'configure)
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"
140 (("/usr") "")
141 (("-o root -g root") "")
142 (("chown root.*") "\n"))
143 (substitute* "scripts/sid"
144 (("/usr") debian))
145 (substitute* "scripts/gutsy"
146 (("/usr") ubuntu))
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 ")))
152 #t)))
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"))
158 #t))))
159 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
160 #:tests? #f)) ; no tests
161 (inputs
162 `(("coreutils" ,coreutils)
163 ("debian-keyring" ,debian-archive-keyring)
164 ("ubuntu-keyring" ,ubuntu-keyring)
165 ("wget" ,wget)))
166 ;; The following are required for debootstrap to work correctly
167 (propagated-inputs
168 `(("binutils" ,binutils)
169 ("gnupg" ,gnupg)
170 ("perl" ,perl)))
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)))