From patchwork Tue May 12 21:01:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 22038 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F07C427BBE3; Tue, 12 May 2020 22:03:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2732527BBE1 for ; Tue, 12 May 2020 22:03:37 +0100 (BST) Received: from localhost ([::1]:38060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYc3s-0005Z9-NZ for patchwork@mira.cbaines.net; Tue, 12 May 2020 17:03:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYc3N-0005EM-7D for guix-patches@gnu.org; Tue, 12 May 2020 17:03:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYc3K-0000w3-Gz for guix-patches@gnu.org; Tue, 12 May 2020 17:03:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYc3K-0007gp-D7 for guix-patches@gnu.org; Tue, 12 May 2020 17:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41192] [PATCH v2 1/2] gnu: Add openresolv. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 May 2020 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41192 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41192@debbugs.gnu.org Cc: leo@famulari.name Received: via spool by 41192-submit@debbugs.gnu.org id=B41192.158931734029488 (code B ref 41192); Tue, 12 May 2020 21:03:02 +0000 Received: (at 41192) by debbugs.gnu.org; 12 May 2020 21:02:20 +0000 Received: from localhost ([127.0.0.1]:56636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYc2V-0007fO-TL for submit@debbugs.gnu.org; Tue, 12 May 2020 17:02:20 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:57715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYc2Q-0007eW-Ku for 41192@debbugs.gnu.org; Tue, 12 May 2020 17:02:09 -0400 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 9178A1BF203; Tue, 12 May 2020 21:01:59 +0000 (UTC) From: Brice Waegeneire Date: Tue, 12 May 2020 23:01:51 +0200 Message-Id: <20200512210152.11991-2-brice@waegenei.re> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512210152.11991-1-brice@waegenei.re> References: <20200512210152.11991-1-brice@waegenei.re> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 # Copyright © 2020 Ryan Prior # Copyright © 2020 Jan Wielkiewicz +# Copyright © 2020 Brice Waegeneire # # 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 ;;; Copyright © 2020 Arun Isaac ;;; Copyright © 2020 Leo Famulari +;;; Copyright © 2020 Brice Waegeneire ;;; ;;; 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 +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 + From patchwork Tue May 12 21:01:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 22037 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 46FBF27BBE3; Tue, 12 May 2020 22:03:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 3FB3F27BBE1 for ; Tue, 12 May 2020 22:03:12 +0100 (BST) Received: from localhost ([::1]:37484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYc3T-0005Gd-P5 for patchwork@mira.cbaines.net; Tue, 12 May 2020 17:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYc3N-0005EP-7q for guix-patches@gnu.org; Tue, 12 May 2020 17:03:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYc3K-0000w4-S8 for guix-patches@gnu.org; Tue, 12 May 2020 17:03:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYc3K-0007gw-Pk for guix-patches@gnu.org; Tue, 12 May 2020 17:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41192] [PATCH v2 2/2] gnu: wireguard-tools: Fix wg-quick. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 May 2020 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41192 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41192@debbugs.gnu.org Cc: leo@famulari.name Received: via spool by 41192-submit@debbugs.gnu.org id=B41192.158931734129494 (code B ref 41192); Tue, 12 May 2020 21:03:02 +0000 Received: (at 41192) by debbugs.gnu.org; 12 May 2020 21:02:21 +0000 Received: from localhost ([127.0.0.1]:56638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYc2e-0007fZ-O1 for submit@debbugs.gnu.org; Tue, 12 May 2020 17:02:20 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:62375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYc2S-0007eq-QY for 41192@debbugs.gnu.org; Tue, 12 May 2020 17:02:09 -0400 X-Originating-IP: 78.237.113.178 Received: from localhost (luy13-1-78-237-113-178.fbx.proxad.net [78.237.113.178]) (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 72F4A240003; Tue, 12 May 2020 21:02:01 +0000 (UTC) From: Brice Waegeneire Date: Tue, 12 May 2020 23:01:52 +0200 Message-Id: <20200512210152.11991-3-brice@waegenei.re> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512210152.11991-1-brice@waegenei.re> References: <20200512210152.11991-1-brice@waegenei.re> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vpn.scm (wireguard-tools)[arguments]: Add phase 'wrap-wg-quick'. [inputs]: Add 'openresolv', 'iproute' and 'iptables'. --- gnu/packages/vpn.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index ebae1c43f7..369d3200c1 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm @@ -40,7 +40,9 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) + #:use-module (gnu packages dns) #:use-module (gnu packages autotools) #:use-module (gnu packages compression) #:use-module (gnu packages gettext) @@ -541,7 +543,33 @@ WireGuard was added to Linux 5.6.") #:phases (modify-phases %standard-phases ;; No configure script - (delete 'configure)))) + (delete 'configure) + (add-after 'install 'install-contrib-docs + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (copy-recursively "contrib/" + (string-append out "/share/doc/wireguard-tools")) + #t))) + (add-after 'install 'wrap-wg-quick + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (inputs-sbin (map (lambda (input) + (string-append (assoc-ref inputs input) "/sbin")) + (list "resolvconf" "iproute" "procps" + "iptables"))) + (coreutils (string-append (assoc-ref inputs "coreutils") + "/bin"))) + (wrap-program (string-append out "/bin/wg-quick") + `("PATH" ":" prefix ,(append inputs-sbin + (list coreutils)))) + #t)))))) + (inputs + `(("resolvconf" ,openresolv) + ("coreutils" ,coreutils) + ("bash" ,bash) ; for scripts using /dev/tcp + ("procps" ,procps) + ("iproute" ,iproute) + ("iptables" ,iptables))) (home-page "https://www.wireguard.com/") (synopsis "Tools for configuring WireGuard tunnels") (description