From: Brice Waegeneire <brice@waegenei.re>
To: 41192@debbugs.gnu.org
Cc: leo@famulari.name
Subject: [bug#41192] [PATCH v2 1/2] gnu: Add openresolv.
Date: Tue, 12 May 2020 23:01:51 +0200 [thread overview]
Message-ID: <20200512210152.11991-2-brice@waegenei.re> (raw)
In-Reply-To: <20200512210152.11991-1-brice@waegenei.re>
* gnu/packages/dns.scm (openresolv): New variable.
---
gnu/local.mk | 2 ++
gnu/packages/dns.scm | 32 +++++++++++++++++
.../patches/openresolv-restartcmd-guix.patch | 34 +++++++++++++++++++
3 files changed, 68 insertions(+)
create mode 100644 gnu/packages/patches/openresolv-restartcmd-guix.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 90c1c64888..48169fcdb6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -34,6 +34,7 @@
# Copyright © 2020 Felix Gruber <felgru@posteo.net>
# Copyright © 2020 Ryan Prior <rprior@protonmail.com>
# Copyright © 2020 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
+# Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
#
# This file is part of GNU Guix.
#
@@ -1323,6 +1324,7 @@ dist_patch_DATA = \
%D%/packages/patches/openmpi-mtl-priorities.patch \
%D%/packages/patches/openocd-nrf52.patch \
%D%/packages/patches/openssh-hurd.patch \
+ %D%/packages/patches/openresolv-restartcmd-guix.patch \
%D%/packages/patches/openssl-runpath.patch \
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
%D%/packages/patches/openssl-c-rehash-in.patch \
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 7ac1611cbf..2ab512f8ac 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1001,3 +1002,34 @@ known public suffixes.")
consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
and TCP-capable recursive DNS server for finding domains on the internet.")
(license license:bsd-2)))
+
+(define-public openresolv
+ (package
+ (name "openresolv")
+ (version "3.10.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://roy.marples.name/downloads/openresolv/"
+ "openresolv-" version ".tar.xz"))
+ (sha256
+ (base32
+ "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
+ (patches
+ (search-patches "openresolv-restartcmd-guix.patch"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; No test suite
+ #:configure-flags
+ (list (string-append "--sysconfdir=/etc"))
+ #:make-flags
+ (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
+ (home-page "https://roy.marples.name/projects/openresolv/")
+ (synopsis "A POSIX resolvconf implementation, a middleman for resolv.conf")
+ (description "openresolv is an implementation of @command{resolvconf}, the
+the middleman between the network configuration services and
+@file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
+stores, removes and lists a full @file{resolv.conf} generated for the
+interface. It then calls all the helper scripts it knows about so it can
+configure the real @file{/etc/resolv.conf} and optionally any local
+nameservers other than libc.")
+ (license license:bsd-2)))
diff --git a/gnu/packages/patches/openresolv-restartcmd-guix.patch b/gnu/packages/patches/openresolv-restartcmd-guix.patch
new file mode 100644
index 0000000000..ad70ebd6f2
--- /dev/null
+++ b/gnu/packages/patches/openresolv-restartcmd-guix.patch
@@ -0,0 +1,34 @@
+From 7f0ce36828ec1e130bee857b8236ca091e4d8a2c Mon Sep 17 00:00:00 2001
+From: Brice Waegeneire <brice@waegenei.re>
+Date: Sat, 9 May 2020 15:52:06 +0200
+Subject: [PATCH] Add RESTARTCMD for Guix System.
+
+---
+
+openresolv need to know how to restart the nscd service, this patch teach it
+to do it on Guix System by using shepherd.
+
+ resolvconf.in | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/resolvconf.in b/resolvconf.in
+index 3cad04d..5ef5294 100644
+--- a/resolvconf.in
++++ b/resolvconf.in
+@@ -369,6 +369,13 @@ detect_init()
+ then
+ /etc/rc.d/$1 restart
+ fi'
++ elif [ -e /gnu/store ] && [ -e /run/current-system/profile ]; then
++ # Guix System
++ RESTARTCMD='
++ if /run/current-system/profile/bin/herd status $1 2>&1
++ then
++ /run/current-system/profile/bin/herd restart $1
++ fi'
+ else
+ for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
+ [ -d $x ] || continue
+--
+2.26.0
+
--
2.26.2
next prev parent reply other threads:[~2020-05-12 21:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 18:43 [bug#41192] [PATCH 0/2] wireguard-tools: Fix wg-quick Brice Waegeneire
2020-05-11 18:53 ` [bug#41192] [PATCH 1/2] gnu: Add openresolv Brice Waegeneire
2020-05-11 19:52 ` Leo Famulari
2020-05-12 20:34 ` Brice Waegeneire
2020-05-11 18:53 ` [bug#41192] [PATCH 2/2] gnu: wireguard-tools: Fix wg-quick Brice Waegeneire
2020-05-11 19:58 ` Leo Famulari
2020-05-12 20:57 ` Brice Waegeneire
2020-05-12 21:01 ` [bug#41192] [PATCH v2 0/2] " Brice Waegeneire
2020-05-12 21:01 ` Brice Waegeneire [this message]
2020-05-12 21:01 ` [bug#41192] [PATCH v2 2/2] " Brice Waegeneire
2020-05-12 21:28 ` [bug#41192] [PATCH v2 0/2] " Leo Famulari
2020-05-13 9:28 ` bug#41192: " Brice Waegeneire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200512210152.11991-2-brice@waegenei.re \
--to=brice@waegenei.re \
--cc=41192@debbugs.gnu.org \
--cc=leo@famulari.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.