GNU bug report logs - #61327
[PATCH] gnu: ddclient: Update to 3.10.0.

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Mon, 6 Feb 2023 17:31:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61327 in the body.
You can then email your comments to 61327 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61327; Package guix-patches. (Mon, 06 Feb 2023 17:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Victal <mirai <at> makinata.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 06 Feb 2023 17:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: guix-patches <at> gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH] gnu: ddclient: Update to 3.10.0.
Date: Mon,  6 Feb 2023 17:21:52 +0000
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 <brice <at> waegenei.re>
 ;;; Copyright © 2020 Simon South <simon <at> simonsouth.net>
 ;;; Copyright © 2021 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 ;;;
 ;;; 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 <mirai <at> makinata.eu>
+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
+
-- 
2.38.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 10 Feb 2023 22:37:01 GMT) Full text and rfc822 format available.

Notification sent to Bruno Victal <mirai <at> makinata.eu>:
bug acknowledged by developer. (Fri, 10 Feb 2023 22:37:02 GMT) Full text and rfc822 format available.

Message #10 received at 61327-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: 61327-done <at> debbugs.gnu.org
Subject: Re: bug#61327: [PATCH] gnu: ddclient: Update to 3.10.0.
Date: Fri, 10 Feb 2023 23:36:04 +0100
[Message part 1 (text/plain, inline)]
Hi Bruno,

Bruno Victal <mirai <at> makinata.eu> skribis:

> 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.

Applied with the changes below.

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/local.mk b/gnu/local.mk
index c88c5e8da2..7379ad5bcc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1032,6 +1032,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/dbus-c++-gcc-compat.patch		\
   %D%/packages/patches/dbus-c++-threading-mutex.patch		\
   %D%/packages/patches/dbxfs-remove-sentry-sdk.patch		\
+  %D%/packages/patches/ddclient-skip-test.patch			\
   %D%/packages/patches/debops-constants-for-external-program-names.patch \
   %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \
   %D%/packages/patches/dee-vapi.patch			\
diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index 0221c04e53..aa44de2d65 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -1125,6 +1125,7 @@ (define-public ddclient
     (inputs
      (list inetutils ; logger
            net-tools
+           bash-minimal                           ;for 'wrap-program'
            perl
            perl-digest-sha1
            perl-io-socket-ssl

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 11 Mar 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.