Browse Source

gnu: Add fakeroot.

* gnu/packages/linux.scm (fakeroot): New variable.
Danny Milosavljevic 3 years ago
No known key found for this signature in database GPG Key ID: E71A35542C30BAA5
  1. 63


@ -5060,3 +5060,66 @@ filesystem as a normal (non-root) user. It does not require you to mount
the image file to copy files on it, nor does it require that you become
the superuser to make device nodes.")
(license license:gpl2)))
(define-public fakeroot
(name "fakeroot")
(version "1.23")
(source (origin
(method url-fetch)
(uri (string-append ""
"fakeroot/fakeroot_" version ".orig.tar.xz"))
(file-name (string-append name "-" version ".tar.gz"))
(build-system gnu-build-system)
(modify-phases %standard-phases
(add-after 'configure 'patch-Makefile
(lambda _
;; Note: The root of the problem is already in "".
(substitute* "Makefile"
(("/bin/sh") (which "sh")))
(add-after 'unpack 'patch-getopt
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "scripts/"
(string-append (assoc-ref inputs "util-linux")
(add-before 'check 'prepare-check
(lambda _
(setenv "SHELL" (which "bash"))
(setenv "VERBOSE" "1")
(substitute* "test/t.touchinstall"
;; We don't have the name of the root user, so use ID=0.
(("grep root") "grep \"\\<0\\>\""))
(substitute* "test/tartest"
;; We don't have the name of the root group, so use ID=0.
;; We don't have the name of the daemon user, so use IDs.
(("daemon:sys") "1:3")
(("daemon:") "1:"))
;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
(substitute* "test/compare-tar"
(("tar -tvf") "tar --numeric-owner -tvf"))
`(("sharutils" ,sharutils) ; for the tests
("xz" ,xz))) ; for the tests
`(("libcap" ,libcap)
("util-linux" ,util-linux)))
(synopsis "Provides a fake root environment")
(description "@command{fakeroot} runs a command in an environment where
it appears to have root privileges for file manipulation. This is useful
for allowing users to create archives (tar, ar, .deb etc.) with files in
them with root permissions/ownership. Without fakeroot one would have to
have root privileges to create the constituent files of the archives with
the correct permissions and ownership, and then pack them up, or one would
have to construct the archives directly, without using the archiver.")
(home-page "")
(license license:gpl3+)))