On Tue, 11 Jun 2024 11:43:23 +0300 =?utf-8?q?Martin-=C3=89ric_Racine?=
<[email protected]> wrote:
> Package: rdate
> Version: 1:1.11-3
> Severity: normal
>
> The Hurd port still depends on the deprecated reference 'ntpdate' to sync 
> clocks at bootup. That reference NTP implementation was replaced by ntpsec in 
> Debian a long time ago.
>
> The only NTP client that still builds for Hurd is rdate. What is missing is 
> an ifup script to issue the following command whenever the network is up:
>
> rdate -n debian.pool.ntp.org
>
> You may want to use an /etc/default/rdate to source the command options and 
> the server.
>
> You may check 
> <https://ftp.debian.org/debian-ports/pool-hurd-i386/main/n/ntp/ntp_4.2.8p15+dfsg-2~1.2.2+dfsg1-2+hurd.1.dsc>
>  for ideas on how to implement this.
>
> Once rdate has implemented such an ifup script, the Hurd port will finally be 
> able to retire its obsolete fork of ntpdate.
>
> Thanks!
> Martin-Éric

I tried branching Salsa Git and pushing an MR, but that apparently
fails because this mere DM is not in group debian. Here are patches
instead.

Martin-Éric
From b549c6c93a16ffc4b0b859978e85da0a794f71fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin-=C3=89ric=20Racine?= <[email protected]>
Date: Thu, 5 Feb 2026 13:22:13 +0200
Subject: Add rdate-ntpdate package for DHCP exit script (Closes: #1072978).

---
 debian/control               | 15 ++++++++++++---
 debian/copyright             |  1 +
 debian/rdate-ntpdate.default |  7 +++++++
 debian/rdate-ntpdate.dhcp    |  7 +++++++
 debian/rules                 |  5 +++++
 5 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 debian/rdate-ntpdate.default
 create mode 100644 debian/rdate-ntpdate.dhcp

diff --git a/debian/control b/debian/control
index cdfcf3a..8f160cc 100644
--- a/debian/control
+++ b/debian/control
@@ -11,9 +11,9 @@ Vcs-Git: https://salsa.debian.org/debian/rdate.git
 
 Package: rdate
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Replaces: netstd
-Description: sets the system's date from a remote host with network time protocol
+Description: sets the system's date from a remote host with Network Time Protocol
  OpenRdate or openrdate or rdate displays and sets the local date and time from
  the host name or address given as the argument. The time source may be an RFC
  868 TCP protocol server, which is usually implemented as a built-in service of
@@ -25,6 +25,15 @@ Description: sets the system's date from a remote host with network time protoco
 Package: rdate-udeb
 Section: debian-installer
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Package-Type: udeb
 Description: sets the system's date from a remote host
+
+Package: rdate-ntpdate
+Architecture: all
+Depends: rdate, ${misc:Depends}, ${shlibs:Depends}
+Breaks: ntpdate (<< 1:4.2.8p15+dfsg-2~)
+Replaces: ntpdate (<< 1:4.2.8p15+dfsg-2~)
+Description: DHCP exit script for rdate
+ This script calls rdate with the -n option to synchronize the local clock
+ with a remote NTP server upon successful DHCP configuration.
diff --git a/debian/copyright b/debian/copyright
index bfbd04c..bca0000 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -45,6 +45,7 @@ Copyright: 1999-2003 Herbert Xu <[email protected]>
            2009      Cyril Brulebois
            2019      Joao Eriberto Mota Filho <[email protected]>
            2019-2023 Thiago Andrade Marques <[email protected]>
+           2026      Martin-Éric Racine <[email protected]>
 License: BSD-3-Clause
 
 License: BSD-4-Clause
diff --git a/debian/rdate-ntpdate.default b/debian/rdate-ntpdate.default
new file mode 100644
index 0000000..314dfa2
--- /dev/null
+++ b/debian/rdate-ntpdate.default
@@ -0,0 +1,7 @@
+# These settings are used by the package rdate-ntpdate.
+
+# List the NTP server to use (rdate only accepts one).
+NTPSERVER=0.debian.pool.ntp.org
+
+# Options to pass to rdate. See rdate(8) for details.
+RDATEOPTIONS="-a"
diff --git a/debian/rdate-ntpdate.dhcp b/debian/rdate-ntpdate.dhcp
new file mode 100644
index 0000000..b205b25
--- /dev/null
+++ b/debian/rdate-ntpdate.dhcp
@@ -0,0 +1,7 @@
+. /etc/default/rdate-ntpdate
+case $reason in
+BOUND | RENEW | REBIND | REBOOT)
+	rdate -n $RDATEOPTIONS $NTPSERVER
+	;;
+EXPIRE | FAIL | RELEASE | STOP) ;;
+esac
diff --git a/debian/rules b/debian/rules
index c8e9403..1fa6a8f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,3 +15,8 @@ export DEB_LDFLAGS_MAINT_APPEND +=$(shell getconf LFS_LDFLAGS) $(HARDENING_LDFLA
 
 override_dh_auto_configure:
 	dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
+
+override_dh_install:
+	install -D -m 0644 debian/rdate-ntpdate.dhcp \
+		debian/rdate-ntpdate/etc/dhcp/dhclient-exit-hooks.d/rdate-ntpdate
+	dh_install
-- 
2.51.0

From 79152ea774454de16d3fc04d8f7b2fe49ad4944c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin-=C3=89ric=20Racine?= <[email protected]>
Date: Thu, 5 Feb 2026 13:12:29 +0200
Subject: [Lintian] Add support for LFS flags in debian/rules.

---
 debian/rules | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/debian/rules b/debian/rules
index c16b56f..c8e9403 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,10 @@ DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+# Append flags for Long File Support (LFS)
+# LFS_CPPFLAGS does not exist
+export DEB_CFLAGS_MAINT_APPEND  +=$(shell getconf LFS_CFLAGS) $(HARDENING_CFLAGS)
+export DEB_LDFLAGS_MAINT_APPEND +=$(shell getconf LFS_LDFLAGS) $(HARDENING_LDFLAGS)
 
 %:
 	dh $@
-- 
2.51.0

Reply via email to