gnu: r-fields: Update to 11.4.
[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, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages debian)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system trivial)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages gnupg)
33 #:use-module (gnu packages wget)
34 #:use-module (gnu packages perl))
35
36 (define-public debian-archive-keyring
37 (package
38 (name "debian-archive-keyring")
39 (version "2019.1")
40 (source
41 (origin
42 (method git-fetch)
43 (uri (git-reference
44 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
45 (commit version)))
46 (file-name (git-file-name name version))
47 (sha256
48 (base32
49 "0bphwji3ywk1zi5bq8bhqk7l51fwjy1idwsw7zfqnxca8m5wvw1g"))))
50 (build-system gnu-build-system)
51 (arguments
52 '(#:test-target "verify-results"
53 #:parallel-build? #f ; has race conditions
54 #:phases
55 (modify-phases %standard-phases
56 (delete 'configure) ; no configure script
57 (replace 'install
58 (lambda* (#:key outputs #:allow-other-keys)
59 (let* ((out (assoc-ref outputs "out"))
60 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
61 (key (string-append out "/share/keyrings/")))
62 (install-file "keyrings/debian-archive-keyring.gpg" key)
63 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
64 (for-each (lambda (file)
65 (install-file file apt))
66 (find-files "trusted.gpg" "\\.gpg$")))
67 #t)))))
68 (native-inputs
69 `(("gnupg" ,gnupg)
70 ("jetring" ,jetring)))
71 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
72 (synopsis "GnuPG archive keys of the Debian archive")
73 (description
74 "The Debian project digitally signs its Release files. This package
75 contains the archive keys used for that.")
76 (license (list license:public-domain ; the keys
77 license:gpl2+)))) ; see debian/copyright
78
79 (define-public ubuntu-keyring
80 (package
81 (name "ubuntu-keyring")
82 (version "2018.09.18.1")
83 (source
84 (origin
85 (method url-fetch)
86 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
87 "+files/" name "_" version ".tar.gz"))
88 (sha256
89 (base32
90 "0csx2n62rj9rxjv4y8qhby7l9rbybfwrb0406pc2cjr7f2yk91af"))))
91 (build-system trivial-build-system)
92 (arguments
93 `(#:modules ((guix build utils))
94 #:builder (begin
95 (use-modules (guix build utils))
96 (let* ((out (assoc-ref %outputs "out"))
97 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
98 (key (string-append out "/share/keyrings/")))
99 (setenv "PATH" (string-append
100 (assoc-ref %build-inputs "gzip") "/bin:"
101 (assoc-ref %build-inputs "tar") "/bin"))
102 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
103 (for-each (lambda (file)
104 (install-file file apt))
105 (find-files "." "ubuntu-[^am].*\\.gpg$"))
106 (for-each (lambda (file)
107 (install-file file key))
108 (find-files "." "ubuntu-[am].*\\.gpg$")))
109 #t)))
110 (native-inputs
111 `(("tar" ,tar)
112 ("gzip" ,gzip)))
113 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
114 (synopsis "GnuPG keys of the Ubuntu archive")
115 (description
116 "The Ubuntu project digitally signs its Release files. This package
117 contains the archive keys used for that.")
118 (license (list license:public-domain ; the keys
119 license:gpl2+)))) ; see debian/copyright
120
121 (define-public debootstrap
122 (package
123 (name "debootstrap")
124 (version "1.0.123")
125 (source
126 (origin
127 (method git-fetch)
128 (uri (git-reference
129 (url "https://salsa.debian.org/installer-team/debootstrap.git")
130 (commit version)))
131 (file-name (git-file-name name version))
132 (sha256
133 (base32 "0fr5ir8arzisx71jybbk4xz85waz50lf2y052nfimzh6vv9dx54c"))))
134 (build-system gnu-build-system)
135 (arguments
136 `(#:phases
137 (modify-phases %standard-phases
138 (delete 'configure)
139 (add-after 'unpack 'patch-source
140 (lambda* (#:key inputs outputs #:allow-other-keys)
141 (let ((out (assoc-ref outputs "out"))
142 (tzdata (assoc-ref inputs "tzdata"))
143 (debian (assoc-ref inputs "debian-keyring"))
144 (ubuntu (assoc-ref inputs "ubuntu-keyring")))
145 (substitute* "Makefile"
146 (("/usr") "")
147 (("-o root -g root") "")
148 (("chown root.*") "\n"))
149 (substitute* '("scripts/etch"
150 "scripts/potato"
151 "scripts/sarge"
152 "scripts/sid"
153 "scripts/woody"
154 "scripts/woody.buildd")
155 (("/usr") debian))
156 (substitute* "scripts/gutsy"
157 (("/usr") ubuntu))
158 (substitute* "debootstrap"
159 (("=/usr") (string-append "=" out)))
160 ;; Ensure PATH works both in guix and within the debian chroot
161 ;; workaround for: https://bugs.debian.org/929889
162 (substitute* "functions"
163 (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
164 "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
165 (substitute* (find-files "scripts" ".")
166 (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo")))
167 #t)))
168 (add-after 'install 'install-man-file
169 (lambda* (#:key outputs #:allow-other-keys)
170 (let ((out (assoc-ref outputs "out")))
171 (install-file "debootstrap.8"
172 (string-append out "/share/man/man8"))
173 #t)))
174 (add-after 'install 'wrap-executable
175 (lambda* (#:key outputs #:allow-other-keys)
176 (let ((debootstrap (string-append (assoc-ref outputs "out")
177 "/sbin/debootstrap"))
178 (path (getenv "PATH")))
179 (wrap-program debootstrap
180 `("PATH" ":" prefix (,path)))
181 #t))))
182 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
183 #:tests? #f)) ; no tests
184 (inputs
185 `(("debian-keyring" ,debian-archive-keyring)
186 ("ubuntu-keyring" ,ubuntu-keyring)
187 ("tzdata" ,tzdata)
188
189 ;; Called at run-time from various places, needs to be in PATH.
190 ("gnupg" ,gnupg)
191 ("wget" ,wget)))
192 (native-inputs
193 `(("perl" ,perl)))
194 (home-page "https://tracker.debian.org/pkg/debootstrap")
195 (synopsis "Bootstrap a basic Debian system")
196 (description "Debootstrap is used to create a Debian base system from
197 scratch, without requiring the availability of @code{dpkg} or @code{apt}.
198 It does this by downloading .deb files from a mirror site, and carefully
199 unpacking them into a directory which can eventually be chrooted into.")
200 (license license:gpl2)))
201
202 (define-public debianutils
203 (package
204 (name "debianutils")
205 (version "4.11.1")
206 (source (origin
207 (method git-fetch)
208 (uri (git-reference
209 (url "https://salsa.debian.org/debian/debianutils.git")
210 (commit (string-append "debian/" version))))
211 (file-name (git-file-name "debianutils" version))
212 (sha256
213 (base32
214 "18ypb7fivch53wwrdf73yhf1fhkwn9kvw1kfdc1m450241d6191w"))))
215 (build-system gnu-build-system)
216 (arguments
217 '(#:phases (modify-phases %standard-phases
218 (add-after 'bootstrap 'create-translations
219 (lambda _
220 (with-directory-excursion "po4a"
221 (invoke "po4a" "--no-backups" "po4a.conf"))
222 #t)))))
223 (native-inputs
224 `(("autoconf" ,autoconf)
225 ("automake" ,automake)
226 ("gettext" ,gettext-minimal)
227 ("po4a" ,po4a)))
228 (home-page "https://packages.debian.org/unstable/debianutils")
229 (synopsis "Miscellaneous shell utilities")
230 (description
231 "This package provides a number of utilities which are mostly for use
232 in installation scripts of Debian packages. The programs included are
233 @command{add-shell}, @command{installkernel}, @command{ischroot},
234 @command{remove-shell}, @command{run-parts}, @command{savelog},
235 @command{tempfile}, and @command{which}.")
236 (license (list license:gpl2+
237 ;; The 'savelog' program is distributed under a
238 ;; GPL-compatible copyleft license.
239 (license:fsf-free "file://debian/copyright"
240 "The SMAIL General Public License, see
241 debian/copyright for more information.")))))
242
243 (define-public apt-mirror
244 (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
245 (revision "1"))
246 (package
247 (name "apt-mirror")
248 (version (git-version "0.5.4" revision commit))
249 (source (origin
250 (method git-fetch)
251 (uri (git-reference
252 (url "https://github.com/apt-mirror/apt-mirror/")
253 (commit commit)))
254 (file-name (git-file-name name version))
255 (sha256
256 (base32
257 "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
258 (build-system gnu-build-system)
259 (outputs '("out"))
260 (arguments
261 `(#:tests? #f
262 ;; sysconfdir is not PREFIXed in the makefile but DESTDIR is
263 ;; honored correctly; we therefore use DESTDIR for our
264 ;; needs. A more correct fix would involve patching.
265 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
266 "PREFIX=/")
267 #:phases (modify-phases %standard-phases (delete 'configure))))
268 (inputs
269 `(("wget" ,wget)
270 ("perl" ,perl)))
271 (home-page "http://apt-mirror.github.io/")
272 (synopsis "Script for mirroring a Debian repository")
273 (description
274 "apt-mirror is a small tool that provides the ability to
275 selectively mirror Debian and Ubuntu GNU/Linux distributions or any
276 other apt sources typically provided by open source developers.")
277 (license license:gpl2))))