Source: dhcp-helper
Version: 1.2-3.2
Tags: patch

Hi,

please find (dgit) patches attached to use debhelper v13 instead of
building without debhelper. This simplifies the packaging setup and
should improve the cross-build situation (#1086388) and also enables
rootless builds (#1089312).

I intend to NMU this in a few days if I don't hear back.

Chris

>From f42f11a622c23251436828bc2dbc6af32a9e0a2d Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Wed, 1 Jan 2025 03:25:24 +0100
Subject: [PATCH 1/5] Use debhelper (v13) to build

Closes: #1086388
---
 debian/conffiles                              |  2 -
 debian/control                                |  6 +-
 debian/{default => dhcp-helper.default}       |  0
 debian/{init => dhcp-helper.init}             |  0
 .../{systemd.service => dhcp-helper.service}  |  0
 debian/postinst                               | 14 ---
 debian/postrm                                 |  6 --
 debian/prerm                                  | 12 ---
 debian/rules                                  | 94 +------------------
 9 files changed, 8 insertions(+), 126 deletions(-)
 delete mode 100644 debian/conffiles
 rename debian/{default => dhcp-helper.default} (100%)
 rename debian/{init => dhcp-helper.init} (100%)
 rename debian/{systemd.service => dhcp-helper.service} (100%)
 delete mode 100644 debian/postinst
 delete mode 100644 debian/postrm
 delete mode 100644 debian/prerm

diff --git a/debian/conffiles b/debian/conffiles
deleted file mode 100644
index 52bf8fb..0000000
--- a/debian/conffiles
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/init.d/dhcp-helper
-/etc/default/dhcp-helper
diff --git a/debian/control b/debian/control
index e4ee72e..0e5c049 100644
--- a/debian/control
+++ b/debian/control
@@ -2,11 +2,13 @@ Source: dhcp-helper
 Section: net
 Priority: optional
 Maintainer: Simon Kelley <si...@thekelleys.org.uk>
-Standards-Version:  3.9.3
+Standards-Version: 3.9.3
+Build-Depends: debhelper-compat (= 13)
 
 Package: dhcp-helper
 Architecture: any
-Depends: netbase, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Depends: netbase, ${shlibs:Depends}, ${misc:Depends}
 Conflicts: isc-dhcp-relay, dhcp3-relay, isc-dhcp-server, dhcp3-server, udhcpd
 Description: A DHCP relay agent
  dhcp-helper is a DHCP and BOOTP relay agent. It listens for DHCP 
diff --git a/debian/default b/debian/dhcp-helper.default
similarity index 100%
rename from debian/default
rename to debian/dhcp-helper.default
diff --git a/debian/init b/debian/dhcp-helper.init
similarity index 100%
rename from debian/init
rename to debian/dhcp-helper.init
diff --git a/debian/systemd.service b/debian/dhcp-helper.service
similarity index 100%
rename from debian/systemd.service
rename to debian/dhcp-helper.service
diff --git a/debian/postinst b/debian/postinst
deleted file mode 100644
index 84268a8..0000000
--- a/debian/postinst
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-set -e
-
-update-rc.d dhcp-helper defaults >/dev/null
-
-if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
-
-        if [ -x /usr/sbin/invoke-rc.d ] ; then
-           invoke-rc.d dhcp-helper  start || true
-        else
-            /etc/init.d/dhcp-helper start || true
-        fi
-
-fi
diff --git a/debian/postrm b/debian/postrm
deleted file mode 100644
index 9b6a8a7..0000000
--- a/debian/postrm
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ purge = "$1" ]; then
-   update-rc.d dhcp-helper remove >/dev/null
-fi
diff --git a/debian/prerm b/debian/prerm
deleted file mode 100644
index ae89d82..0000000
--- a/debian/prerm
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ -x /usr/sbin/invoke-rc.d ] ; then
-    invoke-rc.d dhcp-helper  stop || true
-else
-    /etc/init.d/dhcp-helper stop || true
-fi
-
-exit 0
-
-
diff --git a/debian/rules b/debian/rules
index 9614932..dace220 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,94 +1,8 @@
 #!/usr/bin/make -f
-# debian/rules file - for dhcp-helper.
-# Copyright 2004 by Simon Kelley
-# Based on the sample in the debian hello package which carries the following:
-# Copyright 1994,1995 by Ian Jackson.
-# I hereby give you perpetual unlimited permission to copy,
-# modify and relicense this file, provided that you do not remove
-# my name from the file itself.  (I assert my moral right of
-# paternity under the Copyright, Designs and Patents Act 1988.)
-# This file may have to be extensively modified
 
-package=dhcp-helper
-
-CFLAGS = $(shell export DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS); 
dpkg-buildflags --get CFLAGS)
-CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
-CFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
-CFLAGS += -Wall -W
-BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
-
-build:
-       $(checkdir)
-       make CC=gcc CFLAGS="$(CFLAGS)"
-       touch build
-
-clean:
-       $(checkdir)
-       rm -f build
-       rm -rf debian/tmp debian/*~ debian/files* debian/substvars
-       make clean
-
-binary-indep:  checkroot build
-       $(checkdir)
-# There are no architecture-independent files to be uploaded
-# generated by this package.  If there were any they would be
-# made here.
-
-binary-arch:   checkroot build
-       $(checkdir)
-       rm -rf debian/tmp
-       install -d debian/tmp/DEBIAN\
-               -d debian/tmp/usr/sbin\
-               -d debian/tmp/usr/share/doc/$(package)\
-               -d debian/tmp/usr/share/man/man8\
-                -d debian/tmp/etc/init.d\
-                -d debian/tmp/etc/default\
-               -d debian/tmp/usr/lib/systemd/system\
-               -d debian/tmp/var/run
-       install -m 644 debian/conffiles debian/tmp/DEBIAN
-       install -m 755 debian/postinst debian/postrm debian/prerm 
debian/tmp/DEBIAN
-       install -m 755 dhcp-helper debian/tmp/usr/sbin
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-       strip -R .note -R .comment debian/tmp/usr/sbin/dhcp-helper      
-endif
-       install -m 755 debian/init debian/tmp/etc/init.d/dhcp-helper
-       install -m 644 debian/default debian/tmp/etc/default/dhcp-helper
-       install -m 644 debian/systemd.service 
debian/tmp/usr/lib/systemd/system/dhcp-helper.service
-ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
-       cp CHANGELOG debian/tmp/usr/share/doc/$(package)/changelog
-       gzip -9n debian/tmp/usr/share/doc/$(package)/changelog
-       cp README debian/tmp/usr/share/doc/$(package)/README
-       gzip -9n debian/tmp/usr/share/doc/$(package)/README
-endif
-       cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
-       gzip -9n debian/tmp/usr/share/doc/$(package)/changelog.Debian
-       cp debian/copyright debian/tmp/usr/share/doc/$(package)/copyright
-       cp dhcp-helper.8 debian/tmp/usr/share/man/man8
-       gzip -9n debian/tmp/usr/share/man/man8/dhcp-helper.8
-       cd debian/tmp && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | 
LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
-       dpkg-shlibdeps debian/tmp/usr/sbin/dhcp-helper
-       dpkg-gencontrol
-       find debian/tmp -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r 
touch --no-dereference --date='$(BUILD_DATE)'
-       chown -R root.root debian/tmp
-       chmod -R g-ws debian/tmp
-       dpkg --build debian/tmp ..
-
-define checkdir
-       test -f dhcp-helper.c -a -f debian/rules
-endef
-
-# Below here is fairly generic really
-
-binary:                binary-indep binary-arch
-
-build:          
-build-arch:
-build-indep:
-
-checkroot:
-       $(checkdir)
-       test root = "`whoami`"
-
-.PHONY: binary binary-arch binary-indep clean checkroot
+%:
+       dh $@
 
+override_dh_auto_install:
+       dh_auto_install -- PREFIX=/usr
 
-- 
2.45.2

>From f11eeb78e004163842ece549ffb0cae3102d05f6 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Wed, 1 Jan 2025 03:36:33 +0100
Subject: [PATCH 2/5] Fix MANDIR in upstream Makefile

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4c3897b..701fc02 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 PREFIX?=/usr/local
 BINDIR = ${PREFIX}/sbin
-MANDIR = ${PREFIX}/man
+MANDIR = ${PREFIX}/share/man
  
 CFLAGS?= -O2
 version= $(shell ./get-version)
-- 
2.45.2

>From c1983d5a220531af3624f0fe7b59ec90f0b817a3 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Wed, 1 Jan 2025 03:26:09 +0100
Subject: [PATCH 3/5] Declare Rules-Requires-Root: no

Closes: #1089312
---
 debian/control | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/control b/debian/control
index 0e5c049..3d2183c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,6 +4,7 @@ Priority: optional
 Maintainer: Simon Kelley <si...@thekelleys.org.uk>
 Standards-Version: 3.9.3
 Build-Depends: debhelper-compat (= 13)
+Rules-Requires-Root: no
 
 Package: dhcp-helper
 Architecture: any
-- 
2.45.2

>From e52f109af090cddaacdbe2fd8a5c682ff089c064 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Wed, 1 Jan 2025 03:34:46 +0100
Subject: [PATCH 4/5] Release version 1.2-3.3

---
 debian/changelog | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2640fb3..40aef2c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+dhcp-helper (1.2-3.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Use debhelper (v13) to build (Closes: #1086388)
+  * Declare Rules-Requires-Root: no (Closes: #1089312)
+
+ -- Chris Hofstaedtler <z...@debian.org>  Wed, 01 Jan 2025 03:34:21 +0100
+
 dhcp-helper (1.2-3.2) unstable; urgency=medium
 
   * Non-maintainer upload.
-- 
2.45.2

>From d9c39d058deae2b518fb0534ffa83457ec6b0a3e Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Wed, 1 Jan 2025 03:37:30 +0100
Subject: [PATCH 5/5] Commit Debian 3.0 (quilt) metadata

[dgit (12.3) quilt-fixup]
---
 .../fix-mandir-in-upstream-makefile.patch     | 20 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 21 insertions(+)
 create mode 100644 debian/patches/fix-mandir-in-upstream-makefile.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/fix-mandir-in-upstream-makefile.patch 
b/debian/patches/fix-mandir-in-upstream-makefile.patch
new file mode 100644
index 0000000..58d20f2
--- /dev/null
+++ b/debian/patches/fix-mandir-in-upstream-makefile.patch
@@ -0,0 +1,20 @@
+From: Chris Hofstaedtler <z...@debian.org>
+Date: Wed, 1 Jan 2025 03:36:33 +0100
+X-Dgit-Generated: 1.2-3.3 f11eeb78e004163842ece549ffb0cae3102d05f6
+Subject: Fix MANDIR in upstream Makefile
+
+
+---
+
+diff --git a/Makefile b/Makefile
+index 4c3897b..701fc02 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ PREFIX?=/usr/local
+ BINDIR = ${PREFIX}/sbin
+-MANDIR = ${PREFIX}/man
++MANDIR = ${PREFIX}/share/man
+  
+ CFLAGS?= -O2
+ version= $(shell ./get-version)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2aaabd7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-mandir-in-upstream-makefile.patch
-- 
2.45.2

Reply via email to