From patchwork Mon Feb 6 17:21:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 46697 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 A0E2A27BBED; Mon, 6 Feb 2023 17:31:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E983227BBE9 for ; Mon, 6 Feb 2023 17:31:19 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP5Kb-00011N-TD; Mon, 06 Feb 2023 12:31:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP5KY-0000uk-W5 for guix-patches@gnu.org; Mon, 06 Feb 2023 12:31:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP5KY-0005jr-O4 for guix-patches@gnu.org; Mon, 06 Feb 2023 12:31:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pP5KY-000712-Ci for guix-patches@gnu.org; Mon, 06 Feb 2023 12:31:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61327] [PATCH] gnu: ddclient: Update to 3.10.0. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Feb 2023 17:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61327@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167570460726801 (code B ref -1); Mon, 06 Feb 2023 17:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Feb 2023 17:30:07 +0000 Received: from localhost ([127.0.0.1]:49782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP5Jd-0006y5-PP for submit@debbugs.gnu.org; Mon, 06 Feb 2023 12:30:07 -0500 Received: from lists.gnu.org ([209.51.188.17]:34814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP5JY-0006x3-RE for submit@debbugs.gnu.org; Mon, 06 Feb 2023 12:30:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP5JY-00089r-Id for guix-patches@gnu.org; Mon, 06 Feb 2023 12:30:00 -0500 Received: from smtpmciv6.myservices.hosting ([185.26.106.201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP5JV-0005AG-AA for guix-patches@gnu.org; Mon, 06 Feb 2023 12:30:00 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv6.myservices.hosting (Postfix) with ESMTP id 6A8C520521 for ; Mon, 6 Feb 2023 18:29:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id EFE7E80098; Mon, 6 Feb 2023 18:22:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vpGEPpiVda0y; Mon, 6 Feb 2023 18:22:23 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1ED4280097; Mon, 6 Feb 2023 18:22:23 +0100 (CET) From: Bruno Victal Date: Mon, 6 Feb 2023 17:21:52 +0000 Message-Id: <54fe756ab7e4f7b64bc7f3df85a0d7308f85c502.1675704037.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=185.26.106.201; envelope-from=mirai@makinata.eu; helo=smtpmciv6.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 3.10.0 switched to autotools based build system. * gnu/packages/dns.scm (ddclient): Update to 3.10.0. [source]: Patch test-suite to skip tests that require networking. [build-system]: Switch to gnu-build-system. [native-inputs]: Remove bash. Move perl to inputs. [inputs]: Add perl, perl-io-socket-inet6, perl-json. Remove perl-data-validate-ip. [native-search-paths]: Add $SSL_CERT_DIR, $SSL_CERT_FILE. Required for SSL support. * gnu/packages/patches/ddclient-skip-test.patch: New file. --- Tested IPv4 with SSL and Cloudflare. gnu/packages/dns.scm | 88 ++++++++----------- gnu/packages/patches/ddclient-skip-test.patch | 43 +++++++++ 2 files changed, 80 insertions(+), 51 deletions(-) create mode 100644 gnu/packages/patches/ddclient-skip-test.patch diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 6eac4fa542..0221c04e53 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2020 Simon South ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -64,6 +65,7 @@ (define-module (gnu packages dns) #:use-module (gnu packages nettle) #:use-module (gnu packages networking) #:use-module (gnu packages perl) + #:use-module (gnu packages perl-check) #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) @@ -81,6 +83,7 @@ (define-module (gnu packages dns) #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE)) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) @@ -1098,7 +1101,7 @@ (define-public knot-resolver (define-public ddclient (package (name "ddclient") - (version "3.9.1") + (version "3.10.0") (source (origin (method git-fetch) @@ -1107,62 +1110,45 @@ (define-public ddclient (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w")))) - (build-system trivial-build-system) ; no Makefile.PL + (base32 "0l87d72apwrg6ipc9gix5gv64d4hr1ykxmss8x4r8d8mgj6j8rf1")) + (modules '((guix build utils))) + (snippet + ;; XXX: erroneous version value, this is fixed in master + #~(begin + (substitute* "configure.ac" + (("3.10.0_2") #$version)))) + (patches (search-patches "ddclient-skip-test.patch")))) + (build-system gnu-build-system) (native-inputs - (list bash perl)) + (list autoconf automake libtool + perl-test-warnings perl-test-mockmodule)) (inputs (list inetutils ; logger net-tools - perl-data-validate-ip + perl perl-digest-sha1 - perl-io-socket-ssl)) + perl-io-socket-ssl + perl-io-socket-inet6 ;; XXX: this is likely to be removed in a future ddclient release + ;; https://github.com/ddclient/ddclient/issues/461 + perl-json)) (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils) - (ice-9 match) - (srfi srfi-26)) - (setenv "PATH" (string-append - (assoc-ref %build-inputs "bash") "/bin" ":" - (assoc-ref %build-inputs "perl") "/bin")) - - ;; Copy the (read-only) source into the (writable) build directory. - (copy-recursively (assoc-ref %build-inputs "source") ".") - - ;; Install. - (let* ((out (assoc-ref %outputs "out")) - (bin (string-append out "/bin"))) - (let ((file "ddclient")) - (substitute* file - (("/usr/bin/perl") (which "perl")) - ;; Strictly use ‘/etc/ddclient/ddclient.conf’. - (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf") - (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf") - ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’ - (("\\$cachedir\\$program\\.cache") - "/var/cache/ddclient/ddclient.cache")) - (install-file file bin) - (wrap-program (string-append bin "/" file) - `("PATH" ":" = - ("$PATH" - ,@(map (lambda (input) - (match input - ((name . store) - (string-append store "/bin")))) - %build-inputs))) - `("PERL5LIB" ":" = - ,(delete - "" - (map (match-lambda - (((? (cut string-prefix? "perl-" <>) name) . dir) - (string-append dir "/lib/perl5/site_perl")) - (_ "")) - %build-inputs))))) - (for-each (cut install-file <> (string-append out - "/share/ddclient")) - (find-files "." "sample.*$")))))) + (list + #:configure-flags #~(list "--localstatedir=/var") + #:phases + #~(modify-phases %standard-phases + (replace 'install + (lambda _ + ;; XXX: Do not create /var + (invoke "make" "localstatedir=/tmp/discard" "install"))) + (add-after 'wrap 'wrap-ddclient + (lambda* (#:key inputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/ddclient") + `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)) + `("PATH" prefix ,(map (lambda (x) + (string-append (assoc-ref inputs x) "/bin")) + '("inetutils" "net-tools"))))))))) + (native-search-paths + (list $SSL_CERT_DIR $SSL_CERT_FILE)) (home-page "https://ddclient.net/") (synopsis "Address updating utility for dynamic DNS services") (description "This package provides a client to update dynamic IP diff --git a/gnu/packages/patches/ddclient-skip-test.patch b/gnu/packages/patches/ddclient-skip-test.patch new file mode 100644 index 0000000000..28d748997b --- /dev/null +++ b/gnu/packages/patches/ddclient-skip-test.patch @@ -0,0 +1,43 @@ +From e5657802025f238b39581534f3b4d408565c8943 Mon Sep 17 00:00:00 2001 +From: Bruno Victal +Date: Sun, 5 Feb 2023 21:05:00 +0000 +Subject: [PATCH] Disable sandbox incompatible tests. + +See: https://github.com/ddclient/ddclient/issues/465 +--- + t/get_ip_from_if.pl | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/t/get_ip_from_if.pl b/t/get_ip_from_if.pl +index 6f08e5d..d78c3d0 100644 +--- a/t/get_ip_from_if.pl ++++ b/t/get_ip_from_if.pl +@@ -39,25 +39,4 @@ subtest "get_ip_from_interface tests" => sub { + } + }; + +-subtest "Get default interface and IP for test system" => sub { +- my $interface = ddclient::get_default_interface(4); +- if ($interface) { +- isnt($interface, "lo", "Check for loopback 'lo'"); +- isnt($interface, "lo0", "Check for loopback 'lo0'"); +- my $ip1 = ddclient::get_ip_from_interface("default", 4); +- my $ip2 = ddclient::get_ip_from_interface($interface, 4); +- is($ip1, $ip2, "Check IPv4 from default interface"); +- ok(ddclient::is_ipv4($ip1), "Valid IPv4 from get_ip_from_interface($interface)"); +- } +- $interface = ddclient::get_default_interface(6); +- if ($interface) { +- isnt($interface, "lo", "Check for loopback 'lo'"); +- isnt($interface, "lo0", "Check for loopback 'lo0'"); +- my $ip1 = ddclient::get_ip_from_interface("default", 6); +- my $ip2 = ddclient::get_ip_from_interface($interface, 6); +- is($ip1, $ip2, "Check IPv6 from default interface"); +- ok(ddclient::is_ipv6($ip1), "Valid IPv6 from get_ip_from_interface($interface)"); +- } +-}; +- + done_testing(); +-- +2.38.1 +