gnu: libvirt: Use /etc as the sysconfdir.

* gnu/packages/qemu.scm (libvirt)[arguments]: Add '--sysconfdir=/etc' to
configure flags.  Replace the 'do-not-mkdir-in-/var' phase with a modified
'install' phase.
This commit is contained in:
宋文武 2017-06-25 20:56:42 +08:00
parent 1a80e4d7fc
commit a4b9392151
No known key found for this signature in database
GPG key ID: 26525665AE727D37

View file

@ -289,6 +289,7 @@ (define-public libvirt
#:tests? #f
#:configure-flags
(list "--with-polkit"
"--sysconfdir=/etc"
"--localstatedir=/var")
#:phases
(modify-phases %standard-phases
@ -299,16 +300,14 @@ (define-public libvirt
"gnulib/tests/test-posix_spawn2.c")
(("/bin/sh") (which "sh")))
#t))
(add-after 'unpack 'do-not-mkdir-in-/var
;; Since the localstatedir should be /var at runtime, we must
;; prevent writing to /var at installation time.
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(localstatedir (string-append out "/var")))
(substitute* '("src/Makefile.in"
"daemon/Makefile.in")
(("\\$\\(DESTDIR\\)\\$\\(localstatedir)") localstatedir)))
#t)))))
(replace 'install
;; Since the sysconfdir and localstatedir should be /etc and /var
;; at runtime, we must prevent writing to them at installation
;; time.
(lambda _
(zero? (system* "make" "install"
"sysconfdir=/tmp/etc"
"localstatedir=/tmp/var")))))))
(inputs
`(("libxml2" ,libxml2)
("gnutls" ,gnutls)