From d28fea39ea64d260ae991d3d43b9911e71a17d4e Mon Sep 17 00:00:00 2001 From: Jos de Kloe Date: Aug 29 2013 09:31:39 +0000 Subject: update to version 1.9.6 --- diff --git a/.gitignore b/.gitignore index e383a5b..27bc47e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pygrib-1.9.5.tar.gz +/pygrib-1.9.6.tar.gz diff --git a/pygrib-1.9.5-2-build.patch b/pygrib-1.9.5-2-build.patch deleted file mode 100644 index f1c1216..0000000 --- a/pygrib-1.9.5-2-build.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- setup.py.orig 2012-11-22 14:52:16.394328492 +0100 -+++ setup.py 2012-11-22 15:52:26.566006076 +0100 -@@ -24,7 +24,7 @@ - setup_cfg = os.environ.get('PYGRIBSETUPCFG', 'setup.cfg') - # contents of setup.cfg will override env vars. - if os.path.exists(setup_cfg): -- print 'reading from setup.cfg...' -+ print('reading from setup.cfg...') - config = configparser.SafeConfigParser() - config.read(setup_cfg) - try: grib_api_dir = config.get("directories", "grib_api_dir") -@@ -101,23 +101,33 @@ - if zlib_incdir is None and zlib_dir is not None: - incdirs.append(os.path.join(zlib_dir,'include')) - --g2clib_deps = glob.glob('g2clib_src/*.c') --g2clib_deps.append('g2clib.c') --incdirs.append("g2clib_src") -+#g2clib_deps = glob.glob('g2clib_src/*.c') -+#g2clib_deps.append('g2clib.c') -+g2clib_deps = ['g2clib.c',] -+g2clib_dir = '/usr/lib64' -+g2clib_incdir = '/usr/include' -+libdirs.append(g2clib_dir) -+incdirs.append(g2clib_incdir) -+libraries.append('grib2c') -+#incdirs.append("g2clib_src") - macros=[] - --# if jasper or openjpeg lib not available... --if 'jasper' not in libraries and 'openjpeg' not in libraries: -- g2clib_deps.remove('g2clib_src/jpcpack.c') -- g2clib_deps.remove('g2clib_src/jpcunpack.c') --else: -- macros.append(('USE_JPEG2000',1)) --# if png lib not available... --if 'png' not in libraries: -- g2clib_deps.remove('g2clib_src/pngpack.c') -- g2clib_deps.remove('g2clib_src/pngunpack.c') --else: -- macros.append(('USE_PNG',1)) -+# the USE_JPEG2000 and USE_PNG defines are only used inside -+# g2clib_src, which is removed before doing the fedora rpm build -+# anyway, so these lines can be safely discarded: -+ -+## if jasper or openjpeg lib not available... -+#if 'jasper' not in libraries and 'openjpeg' not in libraries: -+# g2clib_deps.remove('g2clib_src/jpcpack.c') -+# g2clib_deps.remove('g2clib_src/jpcunpack.c') -+#else: -+# macros.append(('USE_JPEG2000',1)) -+## if png lib not available... -+#if 'png' not in libraries: -+# g2clib_deps.remove('g2clib_src/pngpack.c') -+# g2clib_deps.remove('g2clib_src/pngunpack.c') -+#else: -+# macros.append(('USE_PNG',1)) - - if hasattr(sys,'maxsize'): - if sys.maxsize > 2**31-1: macros.append(('__64BIT__',1)) -@@ -130,6 +140,11 @@ - pygribext =\ - Extension("pygrib",["pygrib.c"],include_dirs=incdirs,library_dirs=libdirs,libraries=libraries) - -+# don't provide the scripts for the python3 version, to prevent collisions -+# in case a user installs both a python2 and a python3 version of the module -+scripts_list = [] -+if sys.version_info[0] < 3: -+ scripts_list = ['utils/grib_list','utils/grib_repack','utils/cnvgrib1to2','utils/cnvgrib2to1'] - - setup(name = "pygrib", - version = "1.9.5", -@@ -138,7 +153,6 @@ - author_email = "jeffrey.s.whitaker@noaa.gov", - url = "http://code.google.com/p/pygrib", - download_url = "http://code.google.com/p/pygrib/downloads/list", -- scripts = -- ['utils/grib_list','utils/grib_repack','utils/cnvgrib1to2','utils/cnvgrib2to1'], -+ scripts = scripts_list, - ext_modules = [pygribext,g2clibext,redtoregext], - py_modules = ["ncepgrib2"]) diff --git a/pygrib-1.9.5-g2clib.pyx.patch b/pygrib-1.9.5-g2clib.pyx.patch deleted file mode 100644 index f53f873..0000000 --- a/pygrib-1.9.5-g2clib.pyx.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- g2clib.pyx.orig 2012-11-22 14:17:33.519722304 +0100 -+++ g2clib.pyx 2012-11-22 14:17:33.519722304 +0100 -@@ -450,7 +450,7 @@ - format = "%."+repr(digitsofprecision+1)+"g" - minmaxstring = 'min/max='+format+'/'+format - minmaxstring = minmaxstring % (fldmin,fldmax) -- print minmaxstring -+ print(minmaxstring) - - data = _toarray(fld, zeros(ngpts, 'f4', order=storageorder)) - return data diff --git a/pygrib-1.9.6-build.patch b/pygrib-1.9.6-build.patch new file mode 100644 index 0000000..d378248 --- /dev/null +++ b/pygrib-1.9.6-build.patch @@ -0,0 +1,72 @@ +--- setup.py.orig 2013-01-11 16:46:43.000000000 +0100 ++++ setup.py 2013-08-19 14:50:23.110124644 +0200 +@@ -101,23 +101,33 @@ + if zlib_incdir is None and zlib_dir is not None: + incdirs.append(os.path.join(zlib_dir,'include')) + +-g2clib_deps = glob.glob('g2clib_src/*.c') +-g2clib_deps.append('g2clib.c') +-incdirs.append("g2clib_src") ++#g2clib_deps = glob.glob('g2clib_src/*.c') ++#g2clib_deps.append('g2clib.c') ++g2clib_deps = ['g2clib.c',] ++g2clib_dir = '/usr/lib64' ++g2clib_incdir = '/usr/include' ++libdirs.append(g2clib_dir) ++incdirs.append(g2clib_incdir) ++libraries.append('grib2c') ++#incdirs.append("g2clib_src") + macros=[] + +-# if jasper or openjpeg lib not available... +-if 'jasper' not in libraries and 'openjpeg' not in libraries: +- g2clib_deps.remove('g2clib_src/jpcpack.c') +- g2clib_deps.remove('g2clib_src/jpcunpack.c') +-else: +- macros.append(('USE_JPEG2000',1)) +-# if png lib not available... +-if 'png' not in libraries: +- g2clib_deps.remove('g2clib_src/pngpack.c') +- g2clib_deps.remove('g2clib_src/pngunpack.c') +-else: +- macros.append(('USE_PNG',1)) ++# the USE_JPEG2000 and USE_PNG defines are only used inside ++# g2clib_src, which is removed before doing the fedora rpm build ++# anyway, so these lines can be safely discarded: ++ ++## if jasper or openjpeg lib not available... ++#if 'jasper' not in libraries and 'openjpeg' not in libraries: ++# g2clib_deps.remove('g2clib_src/jpcpack.c') ++# g2clib_deps.remove('g2clib_src/jpcunpack.c') ++#else: ++# macros.append(('USE_JPEG2000',1)) ++## if png lib not available... ++#if 'png' not in libraries: ++# g2clib_deps.remove('g2clib_src/pngpack.c') ++# g2clib_deps.remove('g2clib_src/pngunpack.c') ++#else: ++# macros.append(('USE_PNG',1)) + + if hasattr(sys,'maxsize'): + if sys.maxsize > 2**31-1: macros.append(('__64BIT__',1)) +@@ -130,6 +140,11 @@ + pygribext =\ + Extension("pygrib",["pygrib.c"],include_dirs=incdirs,library_dirs=libdirs,libraries=libraries) + ++# don't provide the scripts for the python3 version, to prevent collisions ++# in case a user installs both a python2 and a python3 version of the module ++scripts_list = [] ++if sys.version_info[0] < 3: ++ scripts_list = ['utils/grib_list','utils/grib_repack','utils/cnvgrib1to2','utils/cnvgrib2to1'] + + setup(name = "pygrib", + version = "1.9.6", +@@ -138,7 +153,6 @@ + author_email = "jeffrey.s.whitaker@noaa.gov", + url = "http://code.google.com/p/pygrib", + download_url = "http://code.google.com/p/pygrib/downloads/list", +- scripts = +- ['utils/grib_list','utils/grib_repack','utils/cnvgrib1to2','utils/cnvgrib2to1'], ++ scripts = scripts_list, + ext_modules = [pygribext,g2clibext,redtoregext], + py_modules = ["ncepgrib2"]) diff --git a/pygrib-1.9.6-g2clib.pyx.patch b/pygrib-1.9.6-g2clib.pyx.patch new file mode 100644 index 0000000..f53f873 --- /dev/null +++ b/pygrib-1.9.6-g2clib.pyx.patch @@ -0,0 +1,11 @@ +--- g2clib.pyx.orig 2012-11-22 14:17:33.519722304 +0100 ++++ g2clib.pyx 2012-11-22 14:17:33.519722304 +0100 +@@ -450,7 +450,7 @@ + format = "%."+repr(digitsofprecision+1)+"g" + minmaxstring = 'min/max='+format+'/'+format + minmaxstring = minmaxstring % (fldmin,fldmax) +- print minmaxstring ++ print(minmaxstring) + + data = _toarray(fld, zeros(ngpts, 'f4', order=storageorder)) + return data diff --git a/pygrib.spec b/pygrib.spec index 5ae23ee..49a35c3 100644 --- a/pygrib.spec +++ b/pygrib.spec @@ -4,8 +4,8 @@ %endif Name: pygrib -Version: 1.9.5 -Release: 4%{?dist} +Version: 1.9.6 +Release: 1%{?dist} Summary: Python module for reading and writing GRIB (editions 1 and 2) files License: MIT @@ -15,14 +15,14 @@ Source0: http://pygrib.googlecode.com/files/%{name}-%{version}.tar.gz # Adapt setup.py to not use packaged g2clib source code # and fix a small python3 problem -Patch0: %{name}-%{version}-2-build.patch +Patch0: %{name}-%{version}-build.patch # Adapt g2clib.pyx to the python3 coding standard Patch1: %{name}-%{version}-g2clib.pyx.patch # both issues have been reported upstream here: # http://code.google.com/p/pygrib/issues/detail?id=64 BuildRequires: python2-devel -BuildRequires: grib_api-static >= 1.9.0 +BuildRequires: grib_api-devel BuildRequires: g2clib-static BuildRequires: numpy BuildRequires: Cython @@ -62,7 +62,7 @@ Requires: python3-pyproj %endif # if with_python3 # specifying this is not needed. rpmbuild figures it out without help -# Requires: grib_api pyproj jasper-libs openjpeg-libs libpng zlib +# Requires: pyproj jasper-libs openjpeg-libs libpng zlib # avoid providing the private libs: %{?filter_setup: @@ -198,6 +198,11 @@ export PYTHONPATH=%{buildroot}/%{python3_sitearch} %endif # with_python3 %changelog +* Fri Aug 23 2013 Jos de Kloe 1.9.6-1 +- update to upstream version 1.9.6 + and move to use grib_api-devel as BR as suggested by Orion Poplawski + on devel mailinglist op 23-Aug-2013 + * Wed Aug 14 2013 Jos de Kloe 1.9.5-4 - add an explicit requirement on grib_api diff --git a/sources b/sources index 1d32ece..dddccc3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e14a9c7fa6bc0c8036b6f45cac6eb187 pygrib-1.9.5.tar.gz +745346ed88d276297651a4bb40da017d pygrib-1.9.6.tar.gz