debian.scm 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018, 2020-2023 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. (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 gexp)
  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 backup)
  30. #:use-module (gnu packages base)
  31. #:use-module (gnu packages bash)
  32. #:use-module (gnu packages compression)
  33. #:use-module (gnu packages crypto)
  34. #:use-module (gnu packages dbm)
  35. #:use-module (gnu packages gettext)
  36. #:use-module (gnu packages gnupg)
  37. #:use-module (gnu packages guile)
  38. #:use-module (gnu packages linux)
  39. #:use-module (gnu packages man)
  40. #:use-module (gnu packages ncurses)
  41. #:use-module (gnu packages perl)
  42. #:use-module (gnu packages pkg-config)
  43. #:use-module (gnu packages wget)
  44. #:use-module (srfi srfi-26))
  45. (define-public debian-archive-keyring
  46. (package
  47. (name "debian-archive-keyring")
  48. (version "2023.3")
  49. (source
  50. (origin
  51. (method git-fetch)
  52. (uri (git-reference
  53. (url "https://salsa.debian.org/release-team/debian-archive-keyring.git")
  54. (commit version)))
  55. (file-name (git-file-name name version))
  56. (sha256
  57. (base32
  58. "1x0hsgfq08c53ws5llkhr1jqwr6yr0sccy5w9pz3p1dzbgfv2wd5"))))
  59. (build-system gnu-build-system)
  60. (arguments
  61. '(#:test-target "verify-results"
  62. #:parallel-build? #f ; has race conditions
  63. #:phases
  64. (modify-phases %standard-phases
  65. (delete 'configure) ; no configure script
  66. (replace 'install
  67. (lambda* (#:key outputs #:allow-other-keys)
  68. (let* ((out (assoc-ref outputs "out"))
  69. (apt (string-append out "/etc/apt/trusted.gpg.d/"))
  70. (key (string-append out "/share/keyrings/")))
  71. (install-file "keyrings/debian-archive-keyring.gpg" key)
  72. (install-file "keyrings/debian-archive-removed-keys.gpg" key)
  73. (for-each (lambda (file)
  74. (install-file file apt))
  75. (find-files "trusted.gpg" "\\.gpg$")))
  76. #t)))))
  77. (native-inputs
  78. (list gnupg jetring))
  79. (home-page "https://packages.qa.debian.org/d/debian-archive-keyring.html")
  80. (synopsis "GnuPG archive keys of the Debian archive")
  81. (description
  82. "The Debian project digitally signs its Release files. This package
  83. contains the archive keys used for that.")
  84. (license (list license:public-domain ; the keys
  85. license:gpl2+)))) ; see debian/copyright
  86. (define-public debian-ports-archive-keyring
  87. (package
  88. (name "debian-ports-archive-keyring")
  89. (version "2023.02.01")
  90. (source
  91. (origin
  92. (method url-fetch)
  93. (uri (string-append "mirror://debian/pool/main/d"
  94. "/debian-ports-archive-keyring"
  95. "/debian-ports-archive-keyring_" version ".tar.xz"))
  96. (sha256
  97. (base32
  98. "1xq7i6plgfbf4drqdmmk1yija48x11jmhnk2av3cajn2cdhkw73s"))))
  99. (build-system gnu-build-system)
  100. (arguments
  101. '(#:tests? #f ; No test suite.
  102. #:phases
  103. (modify-phases %standard-phases
  104. (delete 'configure) ; No configure script.
  105. (replace 'build
  106. (lambda _
  107. ;; gpg options derived from the debian/rules file.
  108. (let ((gpg-options (list "--no-options" "--no-default-keyring"
  109. "--no-auto-check-trustdb" "--no-keyring"
  110. "--import-options" "import-export"
  111. "--import")))
  112. (with-output-to-file "debian-ports-archive-keyring.gpg"
  113. (lambda _
  114. (apply invoke "gpg"
  115. (append gpg-options (find-files "active-keys")))))
  116. (with-output-to-file "debian-ports-archive-keyring-removed.gpg"
  117. (lambda _
  118. (apply invoke "gpg"
  119. (append gpg-options (find-files "removed-keys")))))
  120. (mkdir "trusted.gpg")
  121. (for-each
  122. (lambda (key)
  123. (with-output-to-file
  124. (string-append "trusted.gpg/" (basename key ".key") ".gpg")
  125. (lambda _
  126. (apply invoke "gpg" (append gpg-options (list key))))))
  127. (find-files "active-keys")))))
  128. (replace 'install
  129. (lambda* (#:key outputs #:allow-other-keys)
  130. (let* ((out (assoc-ref outputs "out"))
  131. (apt (string-append out "/etc/apt/trusted.gpg.d/"))
  132. (key (string-append out "/share/keyrings/")))
  133. (install-file "debian-ports-archive-keyring.gpg" key)
  134. (install-file "debian-ports-archive-keyring-removed.gpg" key)
  135. (for-each (lambda (file)
  136. (install-file file apt))
  137. (find-files "trusted.gpg" "\\.gpg$"))))))))
  138. (native-inputs
  139. (list gnupg))
  140. (home-page "https://tracker.debian.org/pkg/debian-ports-archive-keyring")
  141. (synopsis "GnuPG archive keys of the Debian ports archive")
  142. (description
  143. "The Debian ports-archive digitally signs its Release files. This package
  144. contains the archive keys used for that.")
  145. ;; "The keys in the keyrings don't fall under any copyright."
  146. (license license:public-domain)))
  147. (define-public ubuntu-keyring
  148. (package
  149. (name "ubuntu-keyring")
  150. (version "2021.03.26")
  151. (source
  152. (origin
  153. (method url-fetch)
  154. (uri (string-append "https://launchpad.net/ubuntu/+archive/primary/"
  155. "+files/" name "_" version ".tar.gz"))
  156. (sha256
  157. (base32
  158. "1ccvwh4s51viyhcg8gh189jmvbrhc5wv1bbp4minz3200rffsbj9"))))
  159. (build-system trivial-build-system)
  160. (arguments
  161. `(#:modules ((guix build utils))
  162. #:builder (begin
  163. (use-modules (guix build utils))
  164. (let* ((out (assoc-ref %outputs "out"))
  165. (apt (string-append out "/etc/apt/trusted.gpg.d/"))
  166. (key (string-append out "/share/keyrings/")))
  167. (setenv "PATH" (string-append
  168. (assoc-ref %build-inputs "gzip") "/bin:"
  169. (assoc-ref %build-inputs "tar") "/bin"))
  170. (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
  171. (for-each (lambda (file)
  172. (install-file file apt))
  173. (find-files "." "ubuntu-[^am].*\\.gpg$"))
  174. (for-each (lambda (file)
  175. (install-file file key))
  176. (find-files "." "ubuntu-[am].*\\.gpg$")))
  177. #t)))
  178. (native-inputs
  179. (list tar gzip))
  180. (home-page "https://launchpad.net/ubuntu/+source/ubuntu-keyring")
  181. (synopsis "GnuPG keys of the Ubuntu archive")
  182. (description
  183. "The Ubuntu project digitally signs its Release files. This package
  184. contains the archive keys used for that.")
  185. (license (list license:public-domain ; the keys
  186. license:gpl2+)))) ; see debian/copyright
  187. (define-public debootstrap
  188. (package
  189. (name "debootstrap")
  190. (version "1.0.128")
  191. (source
  192. (origin
  193. (method git-fetch)
  194. (uri (git-reference
  195. (url "https://salsa.debian.org/installer-team/debootstrap.git")
  196. (commit version)))
  197. (file-name (git-file-name name version))
  198. (sha256
  199. (base32 "0hc7xc6qvnmjlpf3j6bm25kf0j1ifvv5j7a0iljfmbag4idxc9jv"))))
  200. (build-system gnu-build-system)
  201. (arguments
  202. (list
  203. #:phases
  204. #~(modify-phases %standard-phases
  205. (delete 'configure)
  206. (add-after 'unpack 'patch-source
  207. (lambda* (#:key inputs outputs #:allow-other-keys)
  208. (let ((debian #$(this-package-input "debian-archive-keyring"))
  209. (ubuntu #$(this-package-input "ubuntu-keyring")))
  210. (substitute* "Makefile"
  211. (("/usr") "")
  212. (("-o root -g root") "")
  213. (("chown root.*") "\n"))
  214. (substitute* '("scripts/etch"
  215. "scripts/potato"
  216. "scripts/sarge"
  217. "scripts/sid"
  218. "scripts/woody"
  219. "scripts/woody.buildd")
  220. (("/usr") debian))
  221. (substitute* "scripts/gutsy"
  222. (("/usr") ubuntu))
  223. (substitute* "debootstrap"
  224. (("=/usr") (string-append "=" #$output))
  225. (("/usr/bin/dpkg") (search-input-file inputs "/bin/dpkg")))
  226. ;; Ensure PATH works both in guix and within the debian chroot
  227. ;; workaround for: https://bugs.debian.org/929889
  228. (substitute* "functions"
  229. (("PATH=/sbin:/usr/sbin:/bin:/usr/bin")
  230. "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin"))
  231. (substitute* (find-files "scripts")
  232. (("/usr/share/zoneinfo")
  233. (search-input-directory inputs "/share/zoneinfo"))))))
  234. (add-after 'install 'install-man-file
  235. (lambda* (#:key outputs #:allow-other-keys)
  236. (install-file "debootstrap.8"
  237. (string-append #$output "/share/man/man8"))))
  238. (add-after 'install 'wrap-executable
  239. (lambda* (#:key outputs #:allow-other-keys)
  240. (let ((debootstrap (string-append #$output "/sbin/debootstrap"))
  241. (path (getenv "PATH")))
  242. (wrap-program debootstrap
  243. `("PATH" ":" prefix (,path)))))))
  244. #:make-flags #~(list (string-append "DESTDIR=" #$output))
  245. #:tests? #f)) ; no tests
  246. (inputs
  247. (list debian-archive-keyring
  248. ubuntu-keyring
  249. bash-minimal
  250. dpkg
  251. tzdata
  252. ;; Called at run-time from various places, needs to be in PATH.
  253. gnupg
  254. wget))
  255. (native-inputs
  256. (list perl))
  257. (home-page "https://tracker.debian.org/pkg/debootstrap")
  258. (synopsis "Bootstrap a basic Debian system")
  259. (description "Debootstrap is used to create a Debian base system from
  260. scratch, without requiring the availability of @code{dpkg} or @code{apt}.
  261. It does this by downloading .deb files from a mirror site, and carefully
  262. unpacking them into a directory which can eventually be chrooted into.")
  263. (license license:gpl2)))
  264. (define-public debianutils
  265. (package
  266. (name "debianutils")
  267. (version "5.7-0.4")
  268. (source (origin
  269. (method git-fetch)
  270. (uri (git-reference
  271. (url "https://salsa.debian.org/debian/debianutils.git")
  272. (commit (string-append "debian/" version))))
  273. (file-name (git-file-name "debianutils" version))
  274. (sha256
  275. (base32
  276. "0hw407fm5ylsf28b0vrwz7rm2r2rsgfwzajbkbn6n2b6kqhdjyy9"))))
  277. (build-system gnu-build-system)
  278. (native-inputs
  279. (list autoconf automake gettext-minimal po4a))
  280. (home-page "https://packages.debian.org/unstable/debianutils")
  281. (synopsis "Miscellaneous shell utilities")
  282. (description
  283. "This package provides a number of utilities which are mostly for use
  284. in installation scripts of Debian packages. The programs included are
  285. @command{add-shell}, @command{installkernel}, @command{ischroot},
  286. @command{remove-shell}, @command{run-parts}, @command{savelog},
  287. @command{tempfile}, and @command{which}.")
  288. (license (list license:gpl2+
  289. ;; The 'savelog' program is distributed under a
  290. ;; GPL-compatible copyleft license.
  291. (license:fsf-free "file://debian/copyright"
  292. "The SMAIL General Public License, see
  293. debian/copyright for more information.")))))
  294. (define-public apt-mirror
  295. (let ((commit "e664486a5d8947c2579e16dd793d762ea3de4202")
  296. (revision "1"))
  297. (package
  298. (name "apt-mirror")
  299. (version (git-version "0.5.4" revision commit))
  300. (source (origin
  301. (method git-fetch)
  302. (uri (git-reference
  303. (url "https://github.com/apt-mirror/apt-mirror/")
  304. (commit commit)))
  305. (file-name (git-file-name name version))
  306. (sha256
  307. (base32
  308. "0qj6b7gldwcqyfs2kp6amya3ja7s4vrljs08y4zadryfzxf35nqq"))))
  309. (build-system gnu-build-system)
  310. (outputs '("out"))
  311. (arguments
  312. `(#:tests? #f
  313. ;; sysconfdir is not PREFIXed in the makefile but DESTDIR is
  314. ;; honored correctly; we therefore use DESTDIR for our
  315. ;; needs. A more correct fix would involve patching.
  316. #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
  317. "PREFIX=/")
  318. #:phases (modify-phases %standard-phases (delete 'configure))))
  319. (inputs
  320. (list wget perl))
  321. (home-page "https://apt-mirror.github.io/")
  322. (synopsis "Script for mirroring a Debian repository")
  323. (description
  324. "apt-mirror is a small tool that provides the ability to selectively
  325. mirror @acronym{APT, advanced package tool} sources, including GNU/Linux
  326. distributions such as Debian and Trisquel.")
  327. (license license:gpl2))))
  328. (define-public dpkg
  329. (package
  330. (name "dpkg")
  331. (version "1.21.21")
  332. (source
  333. (origin
  334. (method git-fetch)
  335. (uri (git-reference
  336. (url "https://git.dpkg.org/git/dpkg/dpkg")
  337. (commit version)))
  338. (file-name (git-file-name name version))
  339. (sha256
  340. (base32 "0vgc5irrjyyb5y5hza2hbq3dgfylrxvfdzysw8zzlhgf4bhm69zq"))))
  341. (build-system gnu-build-system)
  342. (arguments
  343. `(#:phases
  344. (modify-phases %standard-phases
  345. (add-before 'bootstrap 'patch-version
  346. (lambda _
  347. (patch-shebang "build-aux/get-version")
  348. (with-output-to-file ".dist-version"
  349. (lambda () (display ,version)))))
  350. (add-after 'unpack 'set-perl-libdir
  351. (lambda* (#:key inputs outputs #:allow-other-keys)
  352. (let ((out (assoc-ref outputs "out"))
  353. (perl (assoc-ref inputs "perl")))
  354. (setenv "PERL_LIBDIR"
  355. (string-append out
  356. "/lib/perl5/site_perl/"
  357. ,(package-version perl))))))
  358. (add-after 'install 'wrap-scripts
  359. (lambda* (#:key outputs #:allow-other-keys)
  360. (let ((out (assoc-ref outputs "out")))
  361. (with-directory-excursion (string-append out "/bin")
  362. (for-each
  363. (lambda (file)
  364. (wrap-script file
  365. ;; Make sure all perl scripts in "bin" find the
  366. ;; required Perl modules at runtime.
  367. `("PERL5LIB" ":" prefix
  368. (,(string-append out
  369. "/lib/perl5/site_perl")
  370. ,(getenv "PERL5LIB")))
  371. ;; DPKG perl modules always expect dpkg to be installed.
  372. ;; Work around this by adding dpkg to the path of the scripts.
  373. `("PATH" ":" prefix (,(string-append out "/bin")))))
  374. (list "dpkg-architecture"
  375. "dpkg-buildflags"
  376. "dpkg-buildpackage"
  377. "dpkg-checkbuilddeps"
  378. "dpkg-distaddfile"
  379. "dpkg-genbuildinfo"
  380. "dpkg-genchanges"
  381. "dpkg-gencontrol"
  382. "dpkg-gensymbols"
  383. "dpkg-mergechangelogs"
  384. "dpkg-name"
  385. "dpkg-parsechangelog"
  386. "dpkg-scanpackages"
  387. "dpkg-scansources"
  388. "dpkg-shlibdeps"
  389. "dpkg-source"
  390. "dpkg-vendor")))))))))
  391. (native-inputs
  392. (list autoconf
  393. automake
  394. gettext-minimal
  395. gnupg ; to run t/Dpkg_OpenPGP.t
  396. libtool
  397. pkg-config
  398. perl-io-string))
  399. (inputs
  400. (list bzip2
  401. guile-3.0 ; for wrap-script
  402. libmd
  403. ncurses
  404. perl
  405. xz
  406. zlib))
  407. (home-page "https://wiki.debian.org/Teams/Dpkg")
  408. (synopsis "Debian package management system")
  409. (description "This package provides the low-level infrastructure for
  410. handling the installation and removal of Debian software packages.")
  411. (license license:gpl2+)))
  412. (define-public pbuilder
  413. (package
  414. (name "pbuilder")
  415. (version "0.231")
  416. (source
  417. (origin
  418. (method git-fetch)
  419. (uri (git-reference
  420. (url "https://salsa.debian.org/pbuilder-team/pbuilder.git/")
  421. (commit version)))
  422. (file-name (git-file-name name version))
  423. (sha256
  424. (base32 "0z6f1fgcrkfql9ayc3d0nxra2y6cn91xd5lvr0hd8gdlp9xdvxbc"))))
  425. (build-system gnu-build-system)
  426. (arguments
  427. (list
  428. #:modules `((guix build gnu-build-system)
  429. (guix build utils)
  430. (srfi srfi-26))
  431. #:phases
  432. #~(modify-phases %standard-phases
  433. (delete 'configure) ; no configure script
  434. (add-after 'unpack 'patch-source
  435. (lambda* (#:key inputs outputs #:allow-other-keys)
  436. ;; Documentation requires tldp-one-page.xsl
  437. (substitute* "Makefile"
  438. ((".*-C Documentation.*") ""))
  439. ;; Don't create #$output/var/cache/pbuilder/...
  440. (substitute* '("Makefile"
  441. "pbuildd/Makefile")
  442. ((".*/var/cache/pbuilder.*") ""))
  443. ;; Find the correct fallback location.
  444. (substitute* '("pbuilder-checkparams"
  445. "pbuilder-loadconfig"
  446. "pbuilder-satisfydepends-apt"
  447. "pbuilder-satisfydepends-aptitude"
  448. "pbuilder-satisfydepends-classic"
  449. "t/test_pbuilder-satisfydepends-classic")
  450. (("\\$PBUILDER_ROOT(/usr)?") #$output))
  451. ;; Some hardcoded paths
  452. (substitute* '("debuild-pbuilder"
  453. "pbuilder"
  454. "pbuilder-buildpackage"
  455. "pbuilderrc"
  456. "pdebuild"
  457. "pdebuild-checkparams"
  458. "pdebuild-internal")
  459. (("/usr/lib/pbuilder")
  460. (string-append #$output "/lib/pbuilder")))
  461. (substitute* "pbuildd/buildd-config.sh"
  462. (("/usr/share/doc/pbuilder")
  463. (string-append #$output "/share/doc/pbuilder")))
  464. (substitute* "pbuilder-unshare-wrapper"
  465. (("/(s)?bin/ifconfig") "ifconfig")
  466. (("/(s)?bin/ip") (search-input-file inputs "/sbin/ip")))
  467. (substitute* "Documentation/Makefile"
  468. (("/usr") ""))
  469. ;; Ensure PATH works both in Guix and within the Debian chroot.
  470. (substitute* "pbuilderrc"
  471. (("PATH=\"/usr/sbin:/usr/bin:/sbin:/bin")
  472. "PATH=\"$PATH:/usr/sbin:/usr/bin:/sbin:/bin"))))
  473. (add-after 'install 'create-etc-pbuilderrc
  474. (lambda* (#:key outputs #:allow-other-keys)
  475. (with-output-to-file (string-append #$output "/etc/pbuilderrc")
  476. (lambda ()
  477. (format #t "# A couple of presets to make this work more smoothly.~@
  478. MIRRORSITE=\"http://deb.debian.org/debian\"~@
  479. if [ -r /run/setuid-programs/sudo ]; then~@
  480. PBUILDERROOTCMD=\"/run/setuid-programs/sudo -E\"~@
  481. fi~@
  482. PBUILDERSATISFYDEPENDSCMD=\"~a/lib/pbuilder/pbuilder-satisfydepends-apt\"~%"
  483. #$output)))))
  484. (add-after 'install 'install-manpages
  485. (lambda* (#:key outputs #:allow-other-keys)
  486. (let ((man (string-append #$output "/share/man/")))
  487. (install-file "debuild-pbuilder.1" (string-append man "man1"))
  488. (install-file "pdebuild.1" (string-append man "man1"))
  489. (install-file "pbuilder.8" (string-append man "man8"))
  490. (install-file "pbuilderrc.5" (string-append man "man5")))))
  491. (add-after 'install 'wrap-programs
  492. (lambda* (#:key inputs outputs #:allow-other-keys)
  493. (for-each
  494. (lambda (file)
  495. (wrap-script file
  496. `("PATH" ":" prefix
  497. ,(map (compose dirname (cut search-input-file inputs <>))
  498. (list "/bin/cut"
  499. "/bin/dpkg"
  500. "/bin/grep"
  501. "/bin/perl"
  502. "/bin/sed"
  503. "/bin/which"
  504. "/sbin/debootstrap")))))
  505. (cons*
  506. (string-append #$output "/bin/pdebuild")
  507. (string-append #$output "/sbin/pbuilder")
  508. (find-files (string-append #$output "/lib/pbuilder"))))))
  509. ;; Move the 'check phase to after 'install.
  510. (delete 'check)
  511. (add-after 'validate-runpath 'check
  512. (assoc-ref %standard-phases 'check)))
  513. #:make-flags
  514. ;; No PREFIX, use DESTDIR instead.
  515. #~(list (string-append "DESTDIR=" #$output)
  516. (string-append "SYSCONFDIR=" #$output "/etc")
  517. (string-append "BINDIR=" #$output "/bin")
  518. (string-append "PKGLIBDIR=" #$output "/lib/pbuilder")
  519. (string-append "SBINDIR=" #$output "/sbin")
  520. (string-append "PKGDATADIR=" #$output "/share/pbuilder")
  521. (string-append "EXAMPLEDIR=" #$output "/share/doc/pbuilder/examples")
  522. "PBUILDDDIR=/share/doc/pbuilder/examples/pbuildd/")))
  523. (inputs
  524. (list dpkg
  525. debootstrap
  526. grep
  527. guile-3.0 ; for wrap-script
  528. iproute
  529. perl
  530. which))
  531. (native-inputs
  532. (list man-db
  533. util-linux))
  534. (home-page "https://pbuilder-team.pages.debian.net/pbuilder/")
  535. (synopsis "Personal package builder for Debian packages")
  536. (description
  537. "@code{pbuilder} is a personal package builder for Debian packages.
  538. @itemize
  539. @item@code{pbuilder} constructs a chroot system, and builds a package inside the
  540. chroot. It is an ideal system to use to check that a package has correct
  541. build-dependencies. It uses @code{apt} extensively, and a local mirror, or a
  542. fast connection to a Debian mirror is ideal, but not necessary.
  543. @item@code{pbuilder create} uses debootstrap to create a chroot image.
  544. @item@code{pbuilder update} updates the image to the current state of
  545. testing/unstable/whatever.
  546. @item@code{pbuilder build} takes a @code{*.dsc} file and builds a binary in the
  547. chroot image.
  548. @item@code{pdebuild} is a wrapper for Debian Developers, to allow running
  549. @code{pbuilder} just like @code{debuild}, as a normal user.
  550. @end itemize")
  551. (license license:gpl2+)))
  552. (define-public reprepro
  553. (package
  554. (name "reprepro")
  555. (version "5.3.0")
  556. (source
  557. (origin
  558. (method git-fetch)
  559. (uri (git-reference
  560. (url "https://salsa.debian.org/brlink/reprepro.git/")
  561. (commit (string-append name "-" version))))
  562. (file-name (git-file-name name version))
  563. (sha256
  564. (base32
  565. "1kn7m5rxay6q2c4vgjgm4407xx2r46skkkb6rn33m6dqk1xfkqnh"))))
  566. (build-system gnu-build-system)
  567. (arguments
  568. `(#:tests? #f ; testtool not found
  569. #:phases
  570. (modify-phases %standard-phases
  571. (replace 'check
  572. (lambda* (#:key tests? #:allow-other-keys)
  573. (if tests?
  574. (with-directory-excursion "tests"
  575. (invoke (which "sh") "test.sh"))
  576. #t)))
  577. (add-after 'install 'install-completions
  578. (lambda* (#:key outputs #:allow-other-keys)
  579. (let* ((out (assoc-ref outputs "out"))
  580. (bash (string-append out "/etc/bash_completion.d/"))
  581. (zsh (string-append out "/share/zsh/site-fucnctions/")))
  582. (mkdir-p bash)
  583. (mkdir-p zsh)
  584. (copy-file "docs/reprepro.bash_completion"
  585. (string-append bash "reprepro"))
  586. (copy-file "docs/reprepro.zsh_completion"
  587. (string-append zsh "_reprepro"))
  588. #t))))))
  589. (inputs
  590. (list bdb
  591. bzip2
  592. gpgme
  593. libarchive
  594. xz
  595. zlib))
  596. (native-inputs
  597. (list autoconf automake))
  598. (home-page "https://salsa.debian.org/brlink/reprepro")
  599. (synopsis "Debian package repository producer")
  600. (description "Reprepro is a tool to manage a repository of Debian packages
  601. (@code{.deb}, @code{.udeb}, @code{.dsc}, ...). It stores files either being
  602. injected manually or downloaded from some other repository (partially) mirrored
  603. into one pool/ hierarchy. Managed packages and files are stored in a Berkeley
  604. DB, so no database server is needed. Checking signatures of mirrored
  605. repositories and creating signatures of the generated Package indices is
  606. supported.")
  607. (license license:gpl2)))