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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
36 (define-public debian-archive-keyring
38 (name "debian-archive-keyring")
44 (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
46 (file-name (git-file-name name version))
49 "0bphwji3ywk1zi5bq8bhqk7l51fwjy1idwsw7zfqnxca8m5wvw1g"))))
50 (build-system gnu-build-system)
52 '(#:test-target "verify-results"
53 #:parallel-build? #f ; has race conditions
55 (modify-phases %standard-phases
56 (delete 'configure) ; no configure script
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$")))
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")
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
79 (define-public ubuntu-keyring
81 (name "ubuntu-keyring")
82 (version "2018.09.18.1")
86 (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
87 "+files/" name "_" version ".tar.gz"))
90 "0csx2n62rj9rxjv4y8qhby7l9rbybfwrb0406pc2cjr7f2yk91af"))))
91 (build-system trivial-build-system)
93 `(#:modules ((guix build utils))
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$")))
113 (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
114 (synopsis "GnuPG keys of the Ubuntu archive")
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
121 (define-public debootstrap
129 (url "https://salsa.debian.org/installer-team/debootstrap.git")
131 (file-name (git-file-name name version))
133 (base32 "0fr5ir8arzisx71jybbk4xz85waz50lf2y052nfimzh6vv9dx54c"))))
134 (build-system gnu-build-system)
137 (modify-phases %standard-phases
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"
147 (("-o root -g root") "")
148 (("chown root.*") "\n"))
149 (substitute* '("scripts/etch"
154 "scripts/woody.buildd")
156 (substitute* "scripts/gutsy"
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")))
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"))
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)))
182 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
183 #:tests? #f)) ; no tests
185 `(("debian-keyring" ,debian-archive-keyring)
186 ("ubuntu-keyring" ,ubuntu-keyring)
189 ;; Called at run-time from various places, needs to be in PATH.
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)))
202 (define-public debianutils
209 (url "https://salsa.debian.org/debian/debianutils.git")
210 (commit (string-append "debian/" version))))
211 (file-name (git-file-name "debianutils" version))
214 "18ypb7fivch53wwrdf73yhf1fhkwn9kvw1kfdc1m450241d6191w"))))
215 (build-system gnu-build-system)
217 '(#:phases (modify-phases %standard-phases
218 (add-after 'bootstrap 'create-translations
220 (with-directory-excursion "po4a"
221 (invoke "po4a" "--no-backups" "po4a.conf"))
224 `(("autoconf" ,autoconf)
225 ("automake" ,automake)
226 ("gettext" ,gettext-minimal)
228 (home-page "https://packages.debian.org/unstable/debianutils")
229 (synopsis "Miscellaneous shell utilities")
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.")))))
243 (define-public apt-mirror
244 (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
248 (version (git-version "0.5.4" revision commit))
252 (url "https://github.com/apt-mirror/apt-mirror/")
254 (file-name (git-file-name name version))
257 "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
258 (build-system gnu-build-system)
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"))
267 #:phases (modify-phases %standard-phases (delete 'configure))))
271 (home-page "http://apt-mirror.github.io/")
272 (synopsis "Script for mirroring a Debian repository")
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))))