Package: netbase
Version: 5.4
Severity: minor
Tags: patch

Dear Marco,

I've supplied a series of patches at
https://salsa.debian.org/md/netbase/merge_requests/1 that make netbase
lintian clean and simplify the packaging.  they also stop shipping the
directory /etc/network in netbase, since that's not necessary any
longer, with netbase's simpler setup.

due to the simplification, the overall diff is negative:

 debian/changelog               |  2 +-
 debian/compat                  |  2 +-
 debian/control                 | 11 +++++----
 debian/copyright               | 18 +++++++-------
 debian/netbase.install         |  1 +
 debian/netbase.postinst        |  4 +++-
 debian/netbase.postrm          |  4 +++-
 debian/rules                   | 54 ++++--------------------------------------
 debian/tests/control           |  2 ++
 debian/tests/no-dups           | 13 ++++++++++
 etc-protocols => etc/protocols |  0
 etc-rpc => etc/rpc             |  0
 etc-services => etc/services   |  0
 13 files changed, 44 insertions(+), 67 deletions(-)

I'm also attaching the patches here.  I hope they're helpful!

thanks for your consideration,

        --dkg

-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'oldstable'), 
(200, 'unstable-debug'), (200, 'unstable'), (1, 'experimental-debug'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.17.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- no debconf information
>From 149b98f3d47d3a5bdda1d0703ecc08bb17a95043 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 13:25:08 -0400
Subject: [PATCH 01/11] correct Vcs-* tags

---
 debian/control | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 682af18..f187685 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,8 @@ Priority: important
 Maintainer: Marco d'Itri <[email protected]>
 Standards-Version: 3.9.8
 Build-Depends: debhelper (>= 9)
-Vcs-Git: https://anonscm.debian.org/git/users/md/netbase.git
-Vcs-Browser: https://anonscm.debian.org/cgit/users/md/netbase.git
+Vcs-Git: https://salsa.debian.org/md/netbase.git
+Vcs-Browser: https://salsa.debian.org/md/netbase
 
 Package: netbase
 Architecture: all
-- 
2.18.0

>From bf1a06bec4363454c4d79b25a13249c6f128bc72 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 13:25:47 -0400
Subject: [PATCH 02/11] bump Standards-Version to 4.2.0 (no changes needed)

---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index f187685..b4b01e9 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: netbase
 Section: admin
 Priority: important
 Maintainer: Marco d'Itri <[email protected]>
-Standards-Version: 3.9.8
+Standards-Version: 4.2.0
 Build-Depends: debhelper (>= 9)
 Vcs-Git: https://salsa.debian.org/md/netbase.git
 Vcs-Browser: https://salsa.debian.org/md/netbase
-- 
2.18.0

>From d0eaa0f30b370617166ef860e6f5a4c194992e19 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 13:38:00 -0400
Subject: [PATCH 03/11] d/rules: simplify with modern debhelper

This modification should introduce no change in the generated package.
---
 debian/netbase.dirs            |  1 +
 debian/netbase.install         |  1 +
 debian/rules                   | 44 ++++------------------------------
 etc-protocols => etc/protocols |  0
 etc-rpc => etc/rpc             |  0
 etc-services => etc/services   |  0
 6 files changed, 6 insertions(+), 40 deletions(-)
 create mode 100644 debian/netbase.dirs
 create mode 100644 debian/netbase.install
 rename etc-protocols => etc/protocols (100%)
 rename etc-rpc => etc/rpc (100%)
 rename etc-services => etc/services (100%)

diff --git a/debian/netbase.dirs b/debian/netbase.dirs
new file mode 100644
index 0000000..1e6f791
--- /dev/null
+++ b/debian/netbase.dirs
@@ -0,0 +1 @@
+etc/network
diff --git a/debian/netbase.install b/debian/netbase.install
new file mode 100644
index 0000000..2354c8b
--- /dev/null
+++ b/debian/netbase.install
@@ -0,0 +1 @@
+etc/* etc
diff --git a/debian/rules b/debian/rules
index 2a782f6..6fd83a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,19 +1,11 @@
 #!/usr/bin/make -f
+%:
+       dh $@
 
-D := $(CURDIR)/debian/netbase
-
-clean:
-       dh_testdir
-       dh_clean
-
-build: build-arch build-indep
-build-arch:
-build-indep:
-       dh_testdir
-
+dh_override_auto_test:
 #      check for duplicate etc-services entries and abort if any found
        @echo Checking for duplicate services:
-       @if (sed 's/#.*$$//;s/[[:space:]][[:space:]]*/ /g' etc-services | \
+       @if (sed 's/#.*$$//;s/[[:space:]][[:space:]]*/ /g' etc/services | \
              while read name serv other; do \
                for a in $$name $$other; do echo $$a $$serv; done; \
               done | sort | uniq -d | sed 's/^/  /' | grep ^); \
@@ -22,31 +14,3 @@ build-indep:
        else \
          echo "  None found"; \
        fi
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_prep
-       dh_installdirs etc/ etc/network/
-
-       install -o root -g root -m 0644 etc-protocols $D/etc/protocols
-       install -o root -g root -m 0644 etc-rpc $D/etc/rpc
-       install -o root -g root -m 0644 etc-services $D/etc/services
-
-binary-indep: install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs
-       dh_installdocs
-       dh_compress
-       dh_fixperms
-       dh_installdeb
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary-arch:
-
-binary: binary-arch binary-indep
-
-.PHONY: clean build build-arch build-indep binary binary-arch binary-indep 
install
diff --git a/etc-protocols b/etc/protocols
similarity index 100%
rename from etc-protocols
rename to etc/protocols
diff --git a/etc-rpc b/etc/rpc
similarity index 100%
rename from etc-rpc
rename to etc/rpc
diff --git a/etc-services b/etc/services
similarity index 100%
rename from etc-services
rename to etc/services
-- 
2.18.0

>From 9ca7356ebda6edb0dbe415caf594805174512dec Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 13:52:00 -0400
Subject: [PATCH 04/11] stop shipping /etc/network directory

This directory isn't needed for netbase any more.  other packages
which need it will already install it.
---
 debian/netbase.dirs | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 debian/netbase.dirs

diff --git a/debian/netbase.dirs b/debian/netbase.dirs
deleted file mode 100644
index 1e6f791..0000000
--- a/debian/netbase.dirs
+++ /dev/null
@@ -1 +0,0 @@
-etc/network
-- 
2.18.0

>From a321ee2d0076f54264a4c14a9dcb7e63e8e96d03 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:00:35 -0400
Subject: [PATCH 05/11] d/changelog: avoid trailing whitespace

---
 debian/changelog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index af0620b..f1b825b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -158,7 +158,7 @@ netbase (4.38) unstable; urgency=low
   * Made the init script check for swap over the network. (Closes: #540697)
   * Temporarily depend on initscripts to work around a bug in multistrap.
     (Closes: #556399)
-  * etc-services: added sieve (4190/tcp). 
+  * etc-services: added sieve (4190/tcp).
   * etc-services: removed sieve (2000/tcp). (Closes: #555664)
   * Made the init script warn that using the force-reload and restart
     parameters is not a good idea. (Closes: #550240)
-- 
2.18.0

>From 8836510c6e77139d6629c819de4e967bf53527a7 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:03:59 -0400
Subject: [PATCH 06/11] maintscripts: use set -e instead of passing -e on the
 shebang (see lintian's maintainer-script-without-set-e)

---
 debian/netbase.postinst | 4 +++-
 debian/netbase.postrm   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/netbase.postinst b/debian/netbase.postinst
index 4876e47..5c4eeda 100644
--- a/debian/netbase.postinst
+++ b/debian/netbase.postinst
@@ -1,4 +1,6 @@
-#!/bin/sh -e
+#!/bin/sh
+
+set -e
 
 create_hosts_file() {
   if [ -e /etc/hosts ]; then return 0; fi
diff --git a/debian/netbase.postrm b/debian/netbase.postrm
index cfed6c6..faa49a8 100644
--- a/debian/netbase.postrm
+++ b/debian/netbase.postrm
@@ -1,4 +1,6 @@
-#!/bin/sh -e
+#!/bin/sh
+
+set -e
 
 delete_if_md5_matches() {
   local md5
-- 
2.18.0

>From 35c27606a621949fa467baa8fc2f105e4718cd76 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:08:52 -0400
Subject: [PATCH 07/11] d/copyright: use DEP-5

---
 debian/copyright | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index 2a8e0d1..7c30b50 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,11 +1,11 @@
-This package was created by Peter Tobias [email protected] on
-Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
-<[email protected]> until 2001.
-It is currently maintained by Marco d'Itri <[email protected]>.
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
-Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
+Files: *
+Copyright: 1994-2016 Peter Tobias, Anthony Towns and Marco d'Itri
+License: GPL-2
 
-The programs in this package are distributed under the terms of the GNU
-General Public License, version 2 as distributed by the Free Software
-Foundation. On Debian systems, a copy of this license may be found in
-/usr/share/common-licenses/GPL-2.
+License: GPL-2
+ The programs in this package are distributed under the terms of the GNU
+ General Public License, version 2 as distributed by the Free Software
+ Foundation. On Debian systems, a copy of this license may be found in
+ /usr/share/common-licenses/GPL-2.
-- 
2.18.0

>From 0e5d49376d09a790e1306e4c96626fdca23bc59c Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:12:33 -0400
Subject: [PATCH 08/11] move to debhelper 11

---
 debian/compat  | 2 +-
 debian/control | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/compat b/debian/compat
index ec63514..b4de394 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+11
diff --git a/debian/control b/debian/control
index b4b01e9..1f5e2e6 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
 Priority: important
 Maintainer: Marco d'Itri <[email protected]>
 Standards-Version: 4.2.0
-Build-Depends: debhelper (>= 9)
+Build-Depends: debhelper (>= 11)
 Vcs-Git: https://salsa.debian.org/md/netbase.git
 Vcs-Browser: https://salsa.debian.org/md/netbase
 
-- 
2.18.0

>From 71ccc3992d12c56acb3ed4c24c137e9326bb75b0 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:15:22 -0400
Subject: [PATCH 09/11] flesh out package extended description to better fit
 the current package

---
 debian/control | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/control b/debian/control
index 1f5e2e6..b025ad5 100644
--- a/debian/control
+++ b/debian/control
@@ -14,3 +14,6 @@ Depends: ${misc:Depends}
 Description: Basic TCP/IP networking system
  This package provides the necessary infrastructure for basic TCP/IP based
  networking.
+ .
+ In particular, it supplies tables of common name-to-number mappings in
+ /etc/services, /etc/rpc, and /etc/protocols.
-- 
2.18.0

>From 069c86c16dc195665e4a4954516e97ce7c38039f Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:26:42 -0400
Subject: [PATCH 10/11] move test for duplicate services into separate file

---
 debian/rules         | 12 +-----------
 debian/tests/no-dups | 13 +++++++++++++
 2 files changed, 14 insertions(+), 11 deletions(-)
 create mode 100755 debian/tests/no-dups

diff --git a/debian/rules b/debian/rules
index 6fd83a5..58960cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,14 +3,4 @@
        dh $@
 
 dh_override_auto_test:
-#      check for duplicate etc-services entries and abort if any found
-       @echo Checking for duplicate services:
-       @if (sed 's/#.*$$//;s/[[:space:]][[:space:]]*/ /g' etc/services | \
-             while read name serv other; do \
-               for a in $$name $$other; do echo $$a $$serv; done; \
-              done | sort | uniq -d | sed 's/^/  /' | grep ^); \
-        then \
-         false; \
-       else \
-         echo "  None found"; \
-       fi
+       debian/tests/no-dups etc/services
diff --git a/debian/tests/no-dups b/debian/tests/no-dups
new file mode 100755
index 0000000..8e5be5d
--- /dev/null
+++ b/debian/tests/no-dups
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+printf "Checking for duplicate services in %s:\n" "$1"
+
+if (sed 's/#.*$//;s/[[:space:]][[:space:]]*/ /g' "$1" |
+        while read name serv other; do
+           for a in $name $other; do echo $a $serv; done
+        done | sort | uniq -d | sed 's/^/  /' | grep ^ )
+then
+    exit 1
+else
+    echo "  None found"
+fi
-- 
2.18.0

>From b3a87c1d685bdc10f51cf46fc703df8fdf5d1b38 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Wed, 22 Aug 2018 14:27:20 -0400
Subject: [PATCH 11/11] run the test for duplicate services via autopkgtest as
 well

---
 debian/tests/control | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 debian/tests/control

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..2839e3a
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Test-Command: debian/tests/no-dups /etc/services
+Depends: @
-- 
2.18.0

Reply via email to