* Jakub Wilk <jw...@debian.org>, 2012-01-15, 22:19:
I think we are set with the requirements for the "new" dh_numpy?
Jakub, do you still have time to implement it?
I plan to work on it on the next weekend.
Here's the patch, to be applied to the sid version. Beware, it has been
only lightly tested.
The remaining things to be done:
- Do more testing.
- Update dh_numpy manpage.
- Update README.DebianMaints.
- Write a nice changelog entry.
- File a bug against pytables, asking to start using --strict. (This can
be implement even before dh_numpy starts supporting the option, because
in compat<8 debhelper commands ignore unknown options.)
--
Jakub Wilk
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@
Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
Suggests: python-numpy-doc, python-numpy-dbg, python-nose (>= 0.10.1), python-dev, gfortran
XB-Python-Version: ${python:Versions}
-Provides: ${python:Provides}, python-numpy-dev, python-f2py
+Provides: ${python:Provides}, ${numpy:Provides}, python-numpy-dev, python-f2py
Description: Numerical Python adds a fast array facility to the Python language
Numpy contains a powerful N-dimensional array object, sophisticated
(broadcasting) functions, tools for integrating C/C++ and Fortran
--- a/debian/dh_numpy
+++ b/debian/dh_numpy
@@ -1,6 +1,7 @@
#!/usr/bin/perl -w
# Copyright © 2010 Piotr Ożarowski <pi...@debian.org>
+# Copyright © 2012 Jakub Wilk <jw...@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -23,24 +24,34 @@
use strict;
use Debian::Debhelper::Dh_Lib;
-init();
+init(options => {
+ "strict" => \$dh{STRICT},
+});
-my $numpy_dep;
+my %data;
-open(PYDIST, '/usr/share/python/dist/python-numpy') || error("cannot read python-numpy pydist file: $!\n");
-while (<PYDIST>) {
- my($line) = $_;
- chomp($line);
- if ($line =~ /[^\s]*\s([^;]*).*/ ) {
- $numpy_dep = $1;
- }
+open(FILE, '<', '/usr/share/numpy/versions') or error("cannot read version data: $!\n");
+while (<FILE>) {
+ chomp;
+ next unless /^[^#]/;
+ my ($key, $value) = split;
+ $data{$key} = $value;
}
+close FILE;
-if($numpy_dep eq "") {
- error ("cannot parse pydist file")
+unless ($data{'abi'} and $data{'api'} and $data{'api-min-version'}) {
+ error("cannot parse version data file");
}
foreach my $package (@{$dh{DOPACKAGES}}) {
+ my $numpy_dep;
+ if (package_arch($package) eq 'all') {
+ $numpy_dep = 'python-numpy';
+ } elsif ($dh{STRICT}) {
+ $numpy_dep = "python-numpy-api$data{'api'}";
+ } else {
+ $numpy_dep = "python-numpy (>= $data{'api-min-version'}), python-numpy-abi$data{'abi'}";
+ }
addsubstvar($package, "python:Depends", $numpy_dep);
}
--- a/debian/versions.helper
+++ b/debian/versions.helper
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+'''
+Check if debian/versions is sane and generate substvars for numpy:Provides.
+'''
+
+import os
+
+def main():
+ os.chdir(os.path.join(os.path.dirname(__file__), '..'))
+ data = {}
+ file = open('numpy/core/setup_common.py', 'r')
+ try:
+ exec(file.read(), data)
+ finally:
+ file.close()
+ file = open('debian/versions', 'r')
+ try:
+ for line in file:
+ line = line.strip()
+ if not line or line.startswith('#'):
+ continue
+ key, value = line.split(None, 1)
+ data[key] = value
+ finally:
+ file.close()
+ assert data['abi'] == str(data['C_ABI_VERSION'] - 0x1000000), 'Is debian/versions up-to-date?'
+ assert data['api'] == str(data['C_API_VERSION']), 'Is debian/versions up-to-date?'
+ print 'numpy:Provides=python-numpy-abi%s, python-numpy-api%s' % (data['abi'], data['api'])
+
+if __name__ == '__main__':
+ main()
--- a/debian/rules
+++ b/debian/rules
@@ -71,9 +71,9 @@
rm -f debian/python-numpy-doc/usr/share/doc/python-numpy-doc/html/_static/jquery.js
dh_link -ppython-numpy-doc /usr/share/javascript/jquery/jquery.js /usr/share/doc/python-numpy-doc/html/_static/jquery.js
- # create the pydist file
- mkdir -p debian/python-numpy/usr/share/python/dist/
- echo "numpy python-numpy (>= 1:1.5.1), python-numpy (<< 1:1.6)" > debian/python-numpy/usr/share/python/dist/python-numpy
+override_dh_gencontrol:
+ python debian/versions.helper >> debian/python-numpy.substvars
+ dh_gencontrol
override_dh_compress:
dh_compress -X.js -Xobjects.inv
--- a/debian/python-numpy.install
+++ b/debian/python-numpy.install
@@ -1,4 +1,5 @@
debian/dh_numpy usr/bin
+debian/versions usr/share/numpy/
usr/lib/python*/*-packages/*/*/*[!_][!_].so
usr/lib/python*/*-packages/*/*/*/libnpymath.a
usr/lib/python*/*-packages/*/*.py
--- a/debian/versions (revision 0)
+++ b/debian/versions (revision 0)
@@ -0,0 +1,13 @@
+# ABI version.
+# This number must be changed every time C_ABI_VERSION changes.
+# It's should be normally equal to C_ABI_VERSION - 0x1000000.
+abi 9
+
+# Minor API version.
+# This number must be changed every time C_API_VERSION changes.
+# It's should be normally equal to C_API_VERISON.
+api 4
+
+# Minimum version of Numpy that shares this minor API version.
+# This version must be updated every time C_API_VERSION changes.
+api-min-version 1:1.4.1
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team