From 8b26dda4284de0c3db8aa40c5d9ddd6130ded590 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sat, 20 Nov 2021 23:48:17 +0100
Subject: [PATCH] gnu: openresolv: Wrap resolvconf.
* gnu/packages/dns.scm (openresolv) [phases]: Wrap resolvconf to set PATH, for
coreutils programs mkdir and rm.
* gnu/packages/dns.scm (openresolv) [inputs]: Add coreutils, and bash-minimal
to run the wrapper and the wrapped script.
---
gnu/packages/dns.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
@@ -1417,7 +1417,22 @@ (define-public openresolv
#:configure-flags
(list (string-append "--sysconfdir=/etc"))
#:make-flags
- (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
+ (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (coreutils (assoc-ref inputs "coreutils-minimal")))
+ (substitute* (string-append out "/sbin/resolvconf")
+ (("RESOLVCONF=\"\\$0\"")
+ (format #f "\
+RESOLVCONF=\"$0\"
+PATH=~a/bin:$PATH"
+ coreutils)))))))))
+ (inputs
+ `(("bash-minimal" ,bash-minimal)
+ ("coreutils-minimal" ,coreutils-minimal)))
(home-page "https://roy.marples.name/projects/openresolv/")
(synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
(description "openresolv is an implementation of @command{resolvconf}, the
--
2.34.0