Source: python-numpy
Version: 1:1.13.3-2
Severity: wishlist

Dear Maintainer,

Looking at the debian/rules of lots of packages, running dh_numpy is mostly
achieved by overriding a target, often needlessly just so that dh_numpy
can be inserted into the sequence. The following is reasonably common:

override_dh_gencontrol:
        dh_numpy
        dh_numpy3
        dh_gencontrol

By providing a dh sequence addon, this could instead be achieved by
extending the original call to dh, such as:

%:
        dh $@ --with python2,python3,numpy,numpy3

The attached patch enables this by shipping these pretty trivial addons
in the python-numpy and python3-numpy pacakges:

/usr/share/perl5/Debian/Debhelper/Sequence/numpy.pm
/usr/share/perl5/Debian/Debhelper/Sequence/numpy3.pm

(I have no strong opinion on whether the Python 2 addon should be called
"numpy" in parallel with the dh_numpy utility or "numpy2" in parallel with
the dh_python2 tool. Adjust to taste!)

It would be great to include this feature to help maintainers simplify
their debian/rules files.

thanks!
Stuart
From dd0e8e348caceb0fca53b7590265bee2413b0e28 Mon Sep 17 00:00:00 2001
From: Stuart Prescott <[email protected]>
Date: Thu, 3 May 2018 23:04:14 +1000
Subject: [PATCH 1/2] Add dh sequencer for numpy and numpy3

Provides a sequencer for dh so that --with numpy and --with numpy3 will
cause dh_numpy or dh_numpy3 to be run late in the debhelper sequence.
---
 debian/changelog             | 4 ++++
 debian/numpy.pm              | 8 ++++++++
 debian/numpy3.pm             | 8 ++++++++
 debian/python-numpy.install  | 1 +
 debian/python3-numpy.install | 1 +
 5 files changed, 22 insertions(+)
 create mode 100644 debian/numpy.pm
 create mode 100644 debian/numpy3.pm

diff --git a/debian/changelog b/debian/changelog
index 4bd6a0b..891b035 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,14 @@
 python-numpy (1:1.13.3-3) UNRELEASED; urgency=medium
 
+  [ Ondřej Nový ]
   * d/control: Set Vcs-* to salsa.debian.org
   * d/changelog: Remove trailing whitespaces
   * d/tests: Use AUTOPKGTEST_TMP instead of ADTTMP
   * d/rules: Remove trailing whitespaces
 
+  [ Stuart Prescott ]
+  * add debhelper sequence to support --with numpy,numpy3
+
  -- Ondřej Nový <[email protected]>  Tue, 13 Feb 2018 10:05:23 +0100
 
 python-numpy (1:1.13.3-2) unstable; urgency=medium
diff --git a/debian/numpy.pm b/debian/numpy.pm
new file mode 100644
index 0000000..2b3e465
--- /dev/null
+++ b/debian/numpy.pm
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+insert_before("dh_gencontrol", "dh_numpy");
+
+1
diff --git a/debian/numpy3.pm b/debian/numpy3.pm
new file mode 100644
index 0000000..e3c2f9e
--- /dev/null
+++ b/debian/numpy3.pm
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+insert_before("dh_gencontrol", "dh_numpy3");
+
+1
diff --git a/debian/python-numpy.install b/debian/python-numpy.install
index 9f773aa..e3576f8 100644
--- a/debian/python-numpy.install
+++ b/debian/python-numpy.install
@@ -1,4 +1,5 @@
 debian/dh_numpy usr/bin
+debian/numpy.pm usr/share/perl5/Debian/Debhelper/Sequence/
 debian/versions usr/share/numpy/
 usr/bin/f2py
 usr/bin/f2py2.?
diff --git a/debian/python3-numpy.install b/debian/python3-numpy.install
index 950c7bf..cc86b0f 100644
--- a/debian/python3-numpy.install
+++ b/debian/python3-numpy.install
@@ -1,4 +1,5 @@
 debian/dh_numpy3 usr/bin
+debian/numpy3.pm usr/share/perl5/Debian/Debhelper/Sequence/
 debian/versions usr/share/numpy3/
 usr/bin/f2py3
 usr/bin/f2py3.?
-- 
2.11.0

Reply via email to