[SCM] Debian package checker branch, master, updated. 2.5.4-175-g2684897
The following commit has been merged in the master branch:
commit 26848974a9f7d10f612b6f2e8425b63bab59e166
Author: Jakub Wilk <jwilk@debian.org>
Date: Sun Feb 19 23:37:18 2012 +0100
Added check for python-numpy ABI dependency
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/binaries b/checks/binaries
index 47bec4b..10fdb71 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -139,6 +139,7 @@ my $needs_libc_count = 0;
my $needs_depends_line = 0;
my $has_perl_lib = 0;
my $has_php_ext = 0;
+my $uses_numpy_c_abi = 0;
my %SONAME;
@@ -370,6 +371,13 @@ foreach my $file (@{$info->sorted_file_info}) {
$has_php_ext = 1;
}
+ # Python extension using Numpy C ABI?
+ if ($file =~ m,usr/lib/(?:pyshared/)?python2\.\d+/.*(?<!_d)\.so$,) {
+ if ($strings =~ m,module compiled against ABI version %x but this version of numpy is %x,) {
+ $uses_numpy_c_abi = 1;
+ }
+ }
+
# Something other than detached debugging symbols in /usr/lib/debug paths.
if ($file =~ m,^usr/lib/debug/(?:lib\d*|s?bin|usr|opt|dev|emul)/,) {
if (exists($objdump->{NEEDED})) {
@@ -474,6 +482,17 @@ if ($has_php_ext) {
}
}
+# Check for dependency on python-numpy-abiN dependency (or strict versioned
+# dependency on python-numpy)
+if ($uses_numpy_c_abi and $pkg ) {
+ tag 'missing-dependency-on-numpy-abi'
+ unless
+ $depends =~ m/(?:^|,)\s*python-numpy-abi\d+\s*(?:,|\z)/ or (
+ $depends =~ m/(?:^|,)\s*python-numpy\s+\(>[>=]/ and
+ $depends =~ m/(?:^|,)\s*python-numpy\s+\(<[<=]/) or
+ $pkg eq 'python-numpy';
+}
+
}
1;
diff --git a/checks/binaries.desc b/checks/binaries.desc
index 0fc77bf..4e0ad1e 100644
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -213,6 +213,16 @@ Info: This package includes a *.so file in <tt>/usr/lib/phpN</tt>
.
echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars
+Tag: missing-dependency-on-numpy-abi
+Severity: serious
+Certainty: possible
+Info: This package includes a Python extension module, which uses Numpy via its
+ binary interface. Such packages must depend on python-numpy-abi<i>N</i>.
+ .
+ If the package is using debhelper, this problem is usually due to a
+ missing dh_numpy call in <tt>debian/rules</tt>.
+Ref: /usr/share/doc/python-numpy/README.DebianMaints
+
Tag: debug-file-should-use-detached-symbols
Severity: normal
Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index ebbb794..51e4ea1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
- dh-exec-script-without-dh-exec-features
- dh-exec-subst-unknown-variable
- executable-debhelper-file-without-being-executable
+ - missing-dependency-on-numpy-abi
- package-file-is-executable
- package-uses-dh-exec-but-lacks-build-depends
- preinst-uses-dpkg-maintscript-helper-without-predepends
@@ -34,6 +35,7 @@ lintian (2.5.5) UNRELEASED; urgency=low
+ [NT] Allow libnss_* plugins in usr/lib.
+ [JW] Check for ELF binaries installed in unsafe paths in
Multi-Arch: same packages. (Closes: #650445)
+ + [JW] Added check numpy ABI dependency. (Closes: #658311)
* checks/control-file{,.desc}:
+ [NT] Allow "pkg (= ${source:Version})" versioned dependency if
pkg is architecture all. This fixes a false-positive
@@ -189,6 +191,8 @@ lintian (2.5.5) UNRELEASED; urgency=low
+ [NT] Prefer libc-bin (>= 2.13) to locales. Thanks to Josh
Triplett for the suggestion, investigative work and the
proposed patch to make this possible. (Closes: #636086)
+ + [JW] Add Build-Dependency on python-numpy and python-all-dev
+ for the test suite.
* debian/{postinst,prerm}:
+ [JW,NT] Remove the internal Lintian locale if a C.UTF-8 locale
is found in /usr/lib/locale.
diff --git a/debian/control b/debian/control
index 2e79673..5705471 100644
--- a/debian/control
+++ b/debian/control
@@ -45,6 +45,8 @@ Build-Depends: binutils,
perl,
perl (>= 5.12) | libtest-simple-perl (>= 0.93),
python,
+ python-all-dev,
+ python-numpy,
quilt,
rsync,
unzip,
diff --git a/t/tests/binaries-missing-depends-on-numpy-abi/debian/basic.c b/t/tests/binaries-missing-depends-on-numpy-abi/debian/basic.c
new file mode 100644
index 0000000..deea058
--- /dev/null
+++ b/t/tests/binaries-missing-depends-on-numpy-abi/debian/basic.c
@@ -0,0 +1,7 @@
+#include <Python.h>
+#include <numpy/arrayobject.h>
+
+void do_import_array(void)
+{
+ import_array();
+}
diff --git a/t/tests/files-python-modules/debian/debian/rules b/t/tests/binaries-missing-depends-on-numpy-abi/debian/debian/rules
similarity index 98%
copy from t/tests/files-python-modules/debian/debian/rules
copy to t/tests/binaries-missing-depends-on-numpy-abi/debian/debian/rules
index d769a32..708e2e8 100644
--- a/t/tests/files-python-modules/debian/debian/rules
+++ b/t/tests/binaries-missing-depends-on-numpy-abi/debian/debian/rules
@@ -4,4 +4,3 @@
dh $@
override_dh_pysupport:
-
diff --git a/t/tests/binaries-missing-depends-on-numpy-abi/debian/setup.py b/t/tests/binaries-missing-depends-on-numpy-abi/debian/setup.py
new file mode 100644
index 0000000..4790ea8
--- /dev/null
+++ b/t/tests/binaries-missing-depends-on-numpy-abi/debian/setup.py
@@ -0,0 +1,5 @@
+import distutils.core
+
+distutils.core.setup(
+ ext_modules=[distutils.core.Extension('basic', ['basic.c'])]
+)
diff --git a/t/tests/binaries-missing-depends-on-numpy-abi/desc b/t/tests/binaries-missing-depends-on-numpy-abi/desc
new file mode 100644
index 0000000..1ff6c06
--- /dev/null
+++ b/t/tests/binaries-missing-depends-on-numpy-abi/desc
@@ -0,0 +1,7 @@
+Testname: binaries-missing-depends-on-numpy-abi
+Sequence: 6000
+Version: 1.0
+Description: Test for missing dependency on python-numpy-abiN
+Architecture: any
+Test-For:
+ missing-dependency-on-numpy-abi
diff --git a/t/tests/binaries-missing-depends-on-numpy-abi/tags b/t/tests/binaries-missing-depends-on-numpy-abi/tags
new file mode 100644
index 0000000..12e1d3e
--- /dev/null
+++ b/t/tests/binaries-missing-depends-on-numpy-abi/tags
@@ -0,0 +1 @@
+E: binaries-missing-depends-on-numpy-abi: missing-dependency-on-numpy-abi
--
Debian package checker
Reply to: