From patchwork Mon May 11 18:53:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 22011 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 F124E27BBE3; Mon, 11 May 2020 19:54: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 415A027BBE1 for ; Mon, 11 May 2020 19:54:13 +0100 (BST) Received: from localhost ([::1]:56426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYDZ6-0004BZ-Q8 for patchwork@mira.cbaines.net; Mon, 11 May 2020 14:54:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYw-00042T-Jc for guix-patches@gnu.org; Mon, 11 May 2020 14:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYDYw-0003My-Aj for guix-patches@gnu.org; Mon, 11 May 2020 14:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYDYw-00048b-9w for guix-patches@gnu.org; Mon, 11 May 2020 14:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41192] [PATCH 1/2] gnu: Add openresolv. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 May 2020 18:54: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 X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158922321615859 (code B ref -1); Mon, 11 May 2020 18:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2020 18:53:36 +0000 Received: from localhost ([127.0.0.1]:53274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDYQ-00047e-Iq for submit@debbugs.gnu.org; Mon, 11 May 2020 14:53:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:33238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDYF-00047D-V0 for submit@debbugs.gnu.org; Mon, 11 May 2020 14:53:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYF-0003Zd-NN for guix-patches@gnu.org; Mon, 11 May 2020 14:53:19 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYC-0003FU-Li for guix-patches@gnu.org; Mon, 11 May 2020 14:53:19 -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 relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 1B9F960005 for ; Mon, 11 May 2020 18:53:13 +0000 (UTC) From: Brice Waegeneire Date: Mon, 11 May 2020 20:53:09 +0200 Message-Id: <20200511185310.24537-1-brice@waegenei.re> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511184312.21587-1-brice@waegenei.re> References: <20200511184312.21587-1-brice@waegenei.re> MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.183.195; envelope-from=brice@waegenei.re; helo=relay3-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 14:53:14 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 | 34 +++++++++++++++++++ .../patches/openresolv-restartcmd-guix.patch | 30 ++++++++++++++++ 3 files changed, 66 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..c33f690b15 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,36 @@ 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 git-fetch) + (uri (git-reference + (url "git://roy.marples.name/openresolv.git") + (commit (string-append name "-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1gh7d0lczpxcap4fsxlvy2jxk9km4dg0chidlmgfvxbq61xpagbl")) + (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..2fd0e87590 --- /dev/null +++ b/gnu/packages/patches/openresolv-restartcmd-guix.patch @@ -0,0 +1,30 @@ +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. + +--- + 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 Mon May 11 18:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 22010 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 7815B27BBE1; Mon, 11 May 2020 19:54:08 +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 15ACA27BBE3 for ; Mon, 11 May 2020 19:54:08 +0100 (BST) Received: from localhost ([::1]:56230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYDZ1-00043D-Kc for patchwork@mira.cbaines.net; Mon, 11 May 2020 14:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYw-00042N-81 for guix-patches@gnu.org; Mon, 11 May 2020 14:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYDYv-0003Mc-Uk for guix-patches@gnu.org; Mon, 11 May 2020 14:54:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYDYv-00048U-Tb for guix-patches@gnu.org; Mon, 11 May 2020 14:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41192] [PATCH 2/2] gnu: wireguard-tools: Fix wg-quick. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 May 2020 18:54:01 +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 X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158922320015829 (code B ref -1); Mon, 11 May 2020 18:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2020 18:53:20 +0000 Received: from localhost ([127.0.0.1]:53272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDYG-00047E-BK for submit@debbugs.gnu.org; Mon, 11 May 2020 14:53:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:33236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDYE-000476-WA for submit@debbugs.gnu.org; Mon, 11 May 2020 14:53:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYE-0003ZZ-Nk for guix-patches@gnu.org; Mon, 11 May 2020 14:53:18 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYDYD-0003Fb-Mv for guix-patches@gnu.org; Mon, 11 May 2020 14:53:18 -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 relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 46BA8E0003 for ; Mon, 11 May 2020 18:53:14 +0000 (UTC) From: Brice Waegeneire Date: Mon, 11 May 2020 20:53:10 +0200 Message-Id: <20200511185310.24537-2-brice@waegenei.re> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511184312.21587-1-brice@waegenei.re> References: <20200511184312.21587-1-brice@waegenei.re> MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.183.196; envelope-from=brice@waegenei.re; helo=relay4-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 14:53:15 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index ebae1c43f7..1e31f05c98 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,36 @@ WireGuard was added to Linux 5.6.") #:phases (modify-phases %standard-phases ;; No configure script - (delete 'configure)))) + (delete 'configure) + (add-after 'install 'install-contrib + (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" ":" = ,(append inputs-sbin + (list coreutils + "/run/setuid-programs")))) + #t)))))) + (native-inputs + `(("bash" ,bash))) ; for contrib scripts using /dev/tcp + (inputs + `(("resolvconf" ,openresolv) + ("coreutils" ,coreutils) + ("bash" ,bash) ; for contrib scripts using /dev/tcp + ("procps" ,procps) + ("iproute" ,iproute) + ("iptables" ,iptables))) (home-page "https://www.wireguard.com/") (synopsis "Tools for configuring WireGuard tunnels") (description