[PATCH] gnu: ddclient: Update to 3.10.0.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Bruno Victal
Owner
unassigned
Submitted by
Bruno Victal
Severity
normal
B
B
Bruno Victal wrote on 6 Feb 2023 18:21
(address . guix-patches@gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
54fe756ab7e4f7b64bc7f3df85a0d7308f85c502.1675704037.git.mirai@makinata.eu
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

Toggle diff (184 lines)
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@waegenei.re>
;;; Copyright © 2020 Simon South <simon@simonsouth.net>
;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Bruno Victal <mirai@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@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
L
L
Ludovic Courtès wrote on 10 Feb 2023 23:36
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61327-done@debbugs.gnu.org)
87bkm1p2qz.fsf@gnu.org
Hi Bruno,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (10 lines)
> 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’.
Toggle diff (24 lines)
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
Closed
?