gnu: Add ubuntu-keyring.
[jackhill/guix/guix.git] / gnu / packages / debian.scm
1 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
2 ;;;
3 ;;; GNU Guix is free software; you can redistribute it and/or modify it
4 ;;; under the terms of the GNU General Public License as published by
5 ;;; the Free Software Foundation; either version 3 of the License, or (at
6 ;;; your option) any later version.
7 ;;;
8 ;;; GNU Guix is distributed in the hope that it will be useful, but
9 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ;;; GNU General Public License for more details.
12 ;;;
13 ;;; You should have received a copy of the GNU General Public License
14 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
15
16 (define-module (gnu packages debian)
17 #:use-module ((guix licenses) #:prefix license:)
18 #:use-module (guix download)
19 #:use-module (guix packages)
20 #:use-module (guix build-system gnu)
21 #:use-module (guix build-system trivial)
22 #:use-module (gnu packages base)
23 #:use-module (gnu packages compression)
24 #:use-module (gnu packages gnupg))
25
26 (define-public debian-archive-keyring
27 (package
28 (name "debian-archive-keyring")
29 (version "2017.7")
30 (source
31 (origin
32 (method url-fetch)
33 (uri (string-append "mirror://debian/pool/main/d/" name "/"
34 name "_" version ".tar.xz"))
35 (sha256
36 (base32
37 "1pdwgipfi0y4svhxlw8arhq792f1g3vlmw4raphizy7sa65vd4ca"))))
38 (build-system gnu-build-system)
39 (arguments
40 '(#:test-target "verify-results"
41 #:parallel-build? #f ; has race conditions
42 #:phases
43 (modify-phases %standard-phases
44 (delete 'configure) ; no configure script
45 (replace 'install
46 (lambda* (#:key outputs #:allow-other-keys)
47 (let* ((out (assoc-ref outputs "out"))
48 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
49 (key (string-append out "/share/keyrings/")))
50 (install-file "keyrings/debian-archive-keyring.gpg" key)
51 (install-file "keyrings/debian-archive-removed-keys.gpg" key)
52 (for-each (lambda (file)
53 (install-file file apt))
54 (find-files "trusted.gpg" "\\.gpg$")))
55 #t)))))
56 (native-inputs
57 `(("gnupg" ,gnupg)
58 ("jetring" ,jetring)))
59 (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
60 (synopsis "GnuPG archive keys of the Debian archive")
61 (description
62 "The Debian project digitally signs its Release files. This package
63 contains the archive keys used for that.")
64 (license (list license:public-domain ; the keys
65 license:gpl2+)))) ; see debian/copyright
66
67 (define-public ubuntu-keyring
68 (package
69 (name "ubuntu-keyring")
70 (version "2018.02.28")
71 (source
72 (origin
73 (method url-fetch)
74 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
75 "+files/" name "_" version ".tar.gz"))
76 (sha256
77 (base32
78 "1zj3012cz7rlx9pm39wnwa0lmi1h38n6bkgbz81vnmcsvqsc9a3a"))))
79 (build-system trivial-build-system)
80 (arguments
81 `(#:modules ((guix build utils))
82 #:builder (begin
83 (use-modules (guix build utils))
84 (let* ((out (assoc-ref %outputs "out"))
85 (apt (string-append out "/etc/apt/trusted.gpg.d/"))
86 (key (string-append out "/share/keyrings/")))
87 (setenv "PATH" (string-append
88 (assoc-ref %build-inputs "gzip") "/bin:"
89 (assoc-ref %build-inputs "tar") "/bin"))
90 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
91 (for-each (lambda (file)
92 (install-file file apt))
93 (find-files "." "ubuntu-[^am].*\\.gpg$"))
94 (for-each (lambda (file)
95 (install-file file key))
96 (find-files "." "ubuntu-[am].*\\.gpg$")))
97 #t)))
98 (native-inputs
99 `(("tar" ,tar)
100 ("gzip" ,gzip)))
101 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
102 (synopsis "GnuPG keys of the Ubuntu archive")
103 (description
104 "The Ubuntu project digitally signs its Release files. This package
105 contains the archive keys used for that.")
106 (license (list license:public-domain ; the keys
107 license:gpl2+)))) ; see debian/copyright