[cmor] 150/190: WIP: more python3
Alastair McKinstry
mckinstry at moszumanska.debian.org
Tue Jul 21 12:54:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository cmor.
commit bca12ea0841da311ae8d738cbefd9f64772f6325
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Thu Jun 13 15:25:42 2013 +0100
WIP: more python3
---
debian/changelog | 5 +++
debian/patches/cmor_ver.patch | 15 ++++++++-
debian/patches/python3.patch | 60 +++++++++++++++++++++++-------------
debian/patches/series | 1 +
debian/patches/shlib-link.patch | 4 +--
debian/patches/silence-warning.patch | 15 +++++++++
debian/rules | 17 +++++-----
7 files changed, 85 insertions(+), 32 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2cc3990..d620320 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,13 @@
cmor (2.8.3-1) unstable; urgency=low
* New upstream release.
+ * Add python3 support.
* Depend on debhelper >=9 now. Remove lintian override.
* Enable hardening.
+ * Enable buiid-twice.
+ * Enable all the python tests, for all versions of python.
+ (long; but desirable given beta nature of python3 port)
+ * Standards-Version: 3.9.4
-- Alastair McKinstry <mckinstry at debian.org> Mon, 31 Dec 2012 11:57:20 +0000
diff --git a/debian/patches/cmor_ver.patch b/debian/patches/cmor_ver.patch
index a49716a..3521019 100644
--- a/debian/patches/cmor_ver.patch
+++ b/debian/patches/cmor_ver.patch
@@ -6,7 +6,7 @@ Forwarded: no
Index: cmor-2.8.3/cmor.ver
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ cmor-2.8.3/cmor.ver 2013-06-10 20:09:36.000000000 +0100
++++ cmor-2.8.3/cmor.ver 2013-06-13 04:50:16.000000000 +0100
@@ -0,0 +1,7 @@
+CMOR_2.0.0 {
+ global:
@@ -15,3 +15,16 @@ Index: cmor-2.8.3/cmor.ver
+ Cd*;
+ local: *;
+};
+Index: cmor-2.8.3/configure.ac
+===================================================================
+--- cmor-2.8.3.orig/configure.ac 2013-06-12 18:03:51.000000000 +0100
++++ cmor-2.8.3/configure.ac 2013-06-13 04:50:39.000000000 +0100
+@@ -21,7 +21,7 @@
+ CMOR_VERSION=${PACKAGE_VERSION}" (commit: ${GIT_TAG})"
+
+ AC_PREFIX_DEFAULT([/usr/local/cmor])
+-AC_CONFIG_FILES([Makefile setup.py compile_line.txt include/cmor_locale.h])
++AC_CONFIG_FILES([Makefile setup.py compile_line.txt include/cmor_locale.h cmor.pc])
+
+
+ INCFILES="include/cmor.h include/cmor_func_def.h include/cmor_md5.h "`ls -x --width=10000 include/cdTime/*.h include/cdTime/cdunifpp/*.h`
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 7790468..b1c142f 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -5,8 +5,8 @@ Forwarded: no
Index: cmor-2.8.3/Lib/git2svn.py
===================================================================
---- cmor-2.8.3.orig/Lib/git2svn.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Lib/git2svn.py 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/Lib/git2svn.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Lib/git2svn.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,3 +1,4 @@
+from __future__ import print_function
import os,sys
@@ -33,8 +33,8 @@ Index: cmor-2.8.3/Lib/git2svn.py
os.popen(cmd).readlines()
Index: cmor-2.8.3/Lib/pywrapper.py
===================================================================
---- cmor-2.8.3.orig/Lib/pywrapper.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Lib/pywrapper.py 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/Lib/pywrapper.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Lib/pywrapper.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,4 +1,3 @@
-
import cmor_const,numpy,os,_cmor
@@ -708,8 +708,8 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if (file_name is False):
Index: cmor-2.8.3/Lib/__init__.py
===================================================================
---- cmor-2.8.3.orig/Lib/__init__.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Lib/__init__.py 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/Lib/__init__.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Lib/__init__.py 2013-06-13 15:21:03.000000000 +0100
@@ -1,9 +1,9 @@
-from cmor_const import *
-
@@ -728,8 +728,8 @@ Index: cmor-2.8.3/Lib/__init__.py
pass
Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
===================================================================
---- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Lib/check_CMOR_compliant.py 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Lib/check_CMOR_compliant.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cdms2
@@ -1152,8 +1152,8 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
Index: cmor-2.8.3/Test/check_results.py
===================================================================
---- cmor-2.8.3.orig/Test/check_results.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/check_results.py 2013-06-12 16:18:36.000000000 +0100
+--- cmor-2.8.3.orig/Test/check_results.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/check_results.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,3 +1,4 @@
+from __future__ import print_function
from out_files import out
@@ -1203,8 +1203,8 @@ Index: cmor-2.8.3/Test/check_results.py
+ raise CMORResultCheckError(["Error checking output files for test: Test/%s.f90 we could only find %i files when %i were expected.\n\n Expected files: \n\t%s\n\nPresent files: \n\t%s\n\nMissing files: \n\t%s\n" % (test,nfiles,len(outfiles),repr(outfiles),repr(gotfiles),repr(missing)),])
Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,11 +1,13 @@
+from __future__ import print_function
import cmor,numpy,sys,os
@@ -1282,8 +1282,8 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
f.close()
Index: cmor-2.8.3/setup.py.in
===================================================================
---- cmor-2.8.3.orig/setup.py.in 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/setup.py.in 2013-06-12 15:52:40.000000000 +0100
+--- cmor-2.8.3.orig/setup.py.in 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/setup.py.in 2013-06-13 15:09:42.000000000 +0100
@@ -1,8 +1,10 @@
+from __future__ import print_function # to be python2/python3 agnostic
import numpy
@@ -1316,8 +1316,8 @@ Index: cmor-2.8.3/setup.py.in
version='2.0',
Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_02.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_02.py 2013-06-12 16:20:59.000000000 +0100
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression_02.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression_02.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,8 +1,9 @@
+from __future__ import print_function
import cmor,numpy,sys,os
@@ -1390,8 +1390,8 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
f.close()
Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression.py 2013-06-12 16:22:41.000000000 +0100
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy,sys,os
@@ -1453,8 +1453,8 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
f.close()
Index: cmor-2.8.3/Test/jamie_hybrid_height.py
===================================================================
---- cmor-2.8.3.orig/Test/jamie_hybrid_height.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/jamie_hybrid_height.py 2013-06-12 16:24:00.000000000 +0100
+--- cmor-2.8.3.orig/Test/jamie_hybrid_height.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/jamie_hybrid_height.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -1491,8 +1491,8 @@ Index: cmor-2.8.3/Test/jamie_hybrid_height.py
Index: cmor-2.8.3/Test/nc2asc.py
===================================================================
---- cmor-2.8.3.orig/Test/nc2asc.py 2013-06-12 15:52:32.000000000 +0100
-+++ cmor-2.8.3/Test/nc2asc.py 2013-06-12 16:30:45.000000000 +0100
+--- cmor-2.8.3.orig/Test/nc2asc.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Test/nc2asc.py 2013-06-13 15:09:42.000000000 +0100
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -1582,3 +1582,19 @@ Index: cmor-2.8.3/Test/nc2asc.py
+print(j,s[-1])
f.close()
+Index: cmor-2.8.3/Src/_cmormodule.c
+===================================================================
+--- cmor-2.8.3.orig/Src/_cmormodule.c 2013-06-12 18:03:44.000000000 +0100
++++ cmor-2.8.3/Src/_cmormodule.c 2013-06-13 15:24:02.000000000 +0100
+@@ -2,6 +2,11 @@
+ #include "numpy/arrayobject.h"
+ #include "cmor.h"
+
++#if PY_MAJOR_VERSION >= 3
++#define PyInt_AsLong PyLong_AsLong
++#define PyString_AsString PyBytesAsString
++#endif
++
+ static PyObject *
+ PyCMOR_get_original_shape(PyObject *self,PyObject *args)
+ {
diff --git a/debian/patches/series b/debian/patches/series
index a90e748..95fade7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ ld-no-add-needed.patch
destdir.patch
cmor_ver.patch
python3.patch
+silence_warning.patch
diff --git a/debian/patches/shlib-link.patch b/debian/patches/shlib-link.patch
index bb01d1a..d6ed3fc 100644
--- a/debian/patches/shlib-link.patch
+++ b/debian/patches/shlib-link.patch
@@ -1,6 +1,6 @@
Author: Alastair McKinstry <mckinstry at debian.org>
Description: Bugfix to link libcmor.so.2 against -lossp-uuid
-Last-Updated: 2010-10-14
+Last-Updated: 2013-06-13
Forwarded: no
Index: cmor-2.8.3/Makefile.in
@@ -35,7 +35,7 @@ Index: cmor-2.8.3/Makefile.in
+ @FC@ -c -o $@ -fPIC @FCFLAGS@ @DEBUG@ @MACROS@ $<
+
+shlib $(SONAME): $(PIC_OBJS)
-+ $(CC) -shared -o $(SONAME) $(SHLIBFLAGS) $(PIC_OBJS) @NCCFLAGS@ @UDUNITS2FLAGS@ @UUIDLDFLAGS@ @ZFLAGS@
++ $(CC) -shared -o $(SONAME) $(LDFLAGS) $(SHLIBFLAGS) $(PIC_OBJS) @NCCFLAGS@ @UDUNITS2FLAGS@ @UUIDLDFLAGS@ @ZFLAGS@
+
depend: $(LIBSOURCES)
${DEPEND} $(LIBSOURCES)
diff --git a/debian/patches/silence-warning.patch b/debian/patches/silence-warning.patch
new file mode 100644
index 0000000..583eb77
--- /dev/null
+++ b/debian/patches/silence-warning.patch
@@ -0,0 +1,15 @@
+Index: cmor-2.8.3/Lib/__init__.py
+===================================================================
+--- cmor-2.8.3.orig/Lib/__init__.py 2013-06-13 15:09:42.000000000 +0100
++++ cmor-2.8.3/Lib/__init__.py 2013-06-13 15:13:27.000000000 +0100
+@@ -4,6 +4,10 @@
+
+ try:
+ from .check_CMOR_compliant import checkCMOR
++except ImportError as e:
++ if e == 'No module named cdms2':
++ print("Warning: cdms2 module not found")
++ pass
+ except Exception as err:
+ print(err)
+ pass
diff --git a/debian/rules b/debian/rules
index 15c98a1..ffabb74 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,13 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
+# export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
# DEB_BUILD_MAINT_OPTIONS:= hardening=+all
-DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic
+DEB_CFLAGS_MAINT_APPEND:= -Wall
export DEB_BUILD_MAINT_OPTIONS
export DEB_CFLAGS_MAINT_APPEND
@@ -25,11 +25,12 @@ override_dh_auto_configure:
autoreconf -fiv
ln -sf /usr/share/misc/config.sub
dh_auto_configure -- --disable-color --enable-verbose-test --with-uuid --without-python \
- UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" SZLIBFLAGS=nosz
+ UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" SZLIBFLAGS=nosz \
+ CFLAGS="$(CFLAGS)" LDFLAGS=$(LDFLAGS)"
override_dh_auto_clean:
rm -rf config.sub config.log config.status libcmor.a libcmor.so.2 build test_grid configure CMIP5
- rm -f ipcc_test_code Makefile setup.py *.mod compile_line.txt include/cmor_locale.h
+ rm -f ipcc_test_code Makefile setup.py *.mod compile_line.txt include/cmor_locale.h cmor.pc
find . -name '*.nc' -delete
find . -name '*.o' -delete
find . -name '*.pic_o' -delete
@@ -39,13 +40,15 @@ override_dh_auto_build:
$(MAKE) FC=gfortran
override_dh_auto_test:
- # for p in $(PYVERS) ; do \
- $(MAKE) test_python PYTHONEXEC=$$p DESTDIR=$(DESTDIR) ; done
ifeq ( $(BUILD_ARCH_OS)-$(BUILD_ARCH_CPU), kfreebsd-i386)
@echo "Tests disabled; see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598745"
else
dh_auto_test
endif
+
+
+# # for p in $(PYVERS) ; do \
+ $(MAKE) test_python PYTHONEXEC=$$p DESTDIR=$(DESTDIR) ; done
override_dh_auto_install:
$(MAKE) install DESTDIR=$(DESTDIR)
@@ -55,7 +58,7 @@ override_dh_auto_install:
done
dh_install -p libcmor2 libcmor.so.2 $(LIBDIR)
dh_install -p libcmor-dev debian/tmp/usr/lib/libcmor.a $(LIBDIR)
- dh_install -p libcmor-dev debian/tmp/usr/lib/pkgconfig/cmor.pc $(LIBDIR)/pkgconfig
+ dh_install -p libcmor-dev cmor.pc $(LIBDIR)/pkgconfig
dh_link -p libcmor-dev $(LIBDIR)/libcmor.so.2 $(LIBDIR)/libcmor.so
dh_numpy
dh_numpy3
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cmor.git
More information about the debian-science-commits
mailing list