debian/0000755000000000000000000000000012254700512007164 5ustar debian/watch0000644000000000000000000000011011743631670010217 0ustar version=3 http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/g2clib-(.+)\.tar debian/libgrib2c-dev.install0000644000000000000000000000007612151142120013161 0ustar grib2.h usr/include usr/lib/*/libgrib2c.a usr/lib/*/pkgconfig debian/patches/0000755000000000000000000000000012254700422010613 5ustar debian/patches/makefile.patch0000644000000000000000000000503212151143465013415 0ustar Description: Patch to build on Debian, and create a shared library Author: Alastair McKinstry Forwarded: not-needed Last-Updated: 2013-05-28 Index: g2clib-1.4.0/makefile =================================================================== --- g2clib-1.4.0.orig/makefile 2013-05-28 16:03:01.000000000 +0100 +++ g2clib-1.4.0/makefile 2013-05-28 16:03:13.000000000 +0100 @@ -17,23 +17,26 @@ # can be found (jasper/*.h and png.h pngconf.h zconf.h zlib.h) # -INC=-I/export/lnx102/wd42bv/jasper-1.900.1/src/libjasper/include - # # This "C" source code contains many uses of the C++ # comment style "//". Please make sure you include the # appropriate compiler flag to allow the use of "//" comment indicators. # -CFLAGS= $(INC) $(DEFS) +CFLAGS:= $(INC) $(DEFS) $(CFLAGS) $(CPPFLAGS) + +PIC:= -fPIC + +prefix=/usr +LIBDIR=/usr/lib +SHLIB=libgrib2c.so.0d +SONAME=libgrib2c.so.0d CC=cc LIB=libgrib2c.a ARFLAGS= -all: $(LIB) - $(LIB)(gridtemplates.o): gridtemplates.h $(LIB)(pdstemplates.o): pdstemplates.h @@ -86,7 +89,77 @@ $(LIB)(seekgb.o) .c.a: - $(CC) -c $(CFLAGS) $< + $(CC) -c $(CFLAGS) $(PIC) $< ar $(ARFLAGS) -ruv $@ $*.o rm -f $*.o +.c.o: + $(CC) -c $(CFLAGS) $(PIC) $< + +clean: + rm -f *.o *.a *.so grib2c.pc lib* + +LIBS= `pkg-config --libs libpng` -ljasper -lm +OBJS:= gridtemplates.o \ + drstemplates.o \ + pdstemplates.o \ + gbits.o \ + g2_unpack1.o \ + g2_unpack2.o \ + g2_unpack3.o \ + g2_unpack4.o \ + g2_unpack5.o \ + g2_unpack6.o \ + g2_unpack7.o \ + g2_free.o \ + g2_info.o \ + g2_getfld.o \ + simunpack.o \ + comunpack.o \ + pack_gp.o \ + reduce.o \ + specpack.o \ + specunpack.o \ + rdieee.o \ + mkieee.o \ + int_power.o \ + simpack.o \ + compack.o \ + cmplxpack.o \ + misspack.o \ + jpcpack.o \ + jpcunpack.o \ + pngpack.o \ + pngunpack.o \ + dec_jpeg2000.o \ + enc_jpeg2000.o \ + dec_png.o \ + enc_png.o \ + g2_create.o \ + g2_addlocal.o \ + g2_addgrid.o \ + g2_addfield.o \ + g2_gribend.o \ + getdim.o \ + g2_miss.o \ + getpoly.o \ + seekgb.o + + +all: $(LIB) $(SHLIB) + +$(SHLIB): $(OBJS) + gcc $(LDFLAGS) -Wl,-as-needed -shared -o $(SHLIB) -Wl,-soname,$(SONAME) $(OBJS) $(LIBS) + +grib2c.pc: grib2c.pc.in + cat grib2c.pc.in | sed -e 's!@prefix@!${PREFIX}!' | sed -e 's!@libdir@!${LIBDIR}!' > grib2c.pc + +install: $(LIB) $(SHLIB) grib2c.pc + mkdir -p $(LIBDIR) + cp $(LIB) $(SHLIB) $(LIBDIR) + mkdir -p $(LIBDIR)/pkgconfig + cp grib2c.pc $(LIBDIR)/pkgconfig + mkdir -p $(prefix)/include + cp grib2.h $(prefix)/include + +.PHONY: clean install debian/patches/libpng15.patch0000644000000000000000000000120112151020676013251 0ustar Author: Alastair McKinstry Description: Allow grib2c to build against either libpng12 or lbpng15. Forwarded: not-needed Last-Updated: 2013-05-28 Index: g2clib-1.4.0/makefile =================================================================== --- g2clib-1.4.0.orig/makefile 2013-05-28 04:17:09.000000000 +0100 +++ g2clib-1.4.0/makefile 2013-05-28 04:17:09.000000000 +0100 @@ -97,7 +97,8 @@ clean: rm -f *.o *.a *.so grib2c.pc lib* -LIBS= -ljasper -lpng12 -lc -lm +LIBS:= -ljasper -lc -lm +LIBS += `pkg-config --static --libs libpng` OBJS:= gridtemplates.o \ drstemplates.o \ pdstemplates.o \ debian/patches/series0000644000000000000000000000006412254700225012031 0ustar makefile.patch pkgconfig.patch add_prototypes.patch debian/patches/harden.patch0000644000000000000000000000150412151020214013063 0ustar Author: Alastair McKinstry Description: Ensure flags are passed from rules so that hardened library is built Forwarded: not-needed Last-Updated: 2013-05-28 Index: g2clib-1.4.0/makefile =================================================================== --- g2clib-1.4.0.orig/makefile 2012-02-15 13:54:37.000000000 +0000 +++ g2clib-1.4.0/makefile 2013-05-28 04:11:59.000000000 +0100 @@ -17,15 +17,13 @@ # can be found (jasper/*.h and png.h pngconf.h zconf.h zlib.h) # -INC=-I/export/lnx102/wd42bv/jasper-1.900.1/src/libjasper/include - # # This "C" source code contains many uses of the C++ # comment style "//". Please make sure you include the # appropriate compiler flag to allow the use of "//" comment indicators. # -CFLAGS= $(INC) $(DEFS) +CFLAGS:= $(INC) $(DEFS) $(CFLAGS) CC=cc debian/patches/pkgconfig.patch0000644000000000000000000000113612151137272013607 0ustar Description: Add a pkg-config file for g2clib Author: Alastair McKinstry Forwarded: no Last-Updated: 2011-11-30 Index: g2clib-1.4.0/grib2c.pc.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ g2clib-1.4.0/grib2c.pc.in 2013-05-28 15:25:06.000000000 +0100 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=@libdir@ +includedir=${prefix}/include + +Name: glib2c +Description: NCEP GRIB2 encoder/decoder library +Requires: libpng +Version: 1.4.0 +Libs: -lgrib2c +Libs.private: -lgrib2c -ljasper debian/patches/add_prototypes.patch0000644000000000000000000000227412254700422014701 0ustar Author: Alastair McKinstry Description: Add prototypes for functions exposed and used in python-grib Last-Updated: 2013-12-20 Forwarded: no Index: g2clib-1.4.0/grib2.h =================================================================== --- g2clib-1.4.0.orig/grib2.h 2012-07-05 13:55:00.000000000 +0100 +++ g2clib-1.4.0/grib2.h 2013-12-19 23:27:03.000000000 +0000 @@ -245,5 +245,18 @@ g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *, g2int *); +/* Used in pygrib, and hence exposed here */ +g2int g2_unpack1(unsigned char *,g2int *,g2int **,g2int *); +g2int g2_unpack2(unsigned char *,g2int *,g2int *,unsigned char **); +g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **, + g2int *,g2int **,g2int *); +g2int g2_unpack4(unsigned char *,g2int *,g2int *,g2int **, + g2int *,g2float **,g2int *); +g2int g2_unpack5(unsigned char *,g2int *,g2int *,g2int *, g2int **,g2int *); +g2int g2_unpack6(unsigned char *,g2int *,g2int ,g2int *, g2int **); +g2int g2_unpack7(unsigned char *,g2int *,g2int ,g2int *, + g2int ,g2int *,g2int ,g2float **); + + #endif /* _grib2_H */ debian/libgrib2c0d.shlibs0000644000000000000000000000003111551303372012451 0ustar libgrib2c 0d libgrib2c0d debian/control0000644000000000000000000000172012254700341010567 0ustar Source: g2clib Section: utils Priority: optional Maintainer: Alastair McKinstry Build-Depends: debhelper (>= 9), gfortran, libjasper-dev, libpng-dev, zlib1g-dev, pkg-config Standards-Version: 3.9.5 Homepage: http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/ Package: libgrib2c0d Section: libs Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Description: NCEP GRIB2 encoder/decoder library This is the libgrib2c library from NCEP for encoding and decoding 'GRIB2' data formats. Package: libgrib2c-dev Section: libdevel Architecture: any Depends: libgrib2c0d ( = ${binary:Version}), ${misc:Depends} Multi-Arch: same Recommends: pkg-config Description: NCEP GRIB2 library - development files This is the libgrib2c library from NCEP for encoding and decoding 'GRIB2' data formats. . This package contains the static libraries and headers needed to build applications against libgrib2. debian/libgrib2c0d.docs0000644000000000000000000000003211551303372012116 0ustar CHANGES README grib2c.doc debian/source/0000755000000000000000000000000011553207162010470 5ustar debian/source/format0000644000000000000000000000001411551303666011702 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000212151015145010357 0ustar 9 debian/rules0000755000000000000000000000071512151017751010251 0ustar #!/usr/bin/make -f # magic debhelper rule %: dh $@ DESTDIR:=`pwd`/debian/tmp/ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) #export DH_VERBOSE=1 override_dh_auto_clean: rm -f *.o *.a libgrib2c.so.0d *.pc dh_clean override_dh_auto_install: $(MAKE) prefix=$(DESTDIR)/usr LIBDIR=$(DESTDIR)/$(LIBDIR) install dh_link -p libgrib2c-dev $(LIBDIR)/libgrib2c.so.0d $(LIBDIR)/libgrib2c.so debian/copyright0000644000000000000000000000205711551303372011125 0ustar This package was debianised by Alastair McKinstry on Friday, 5 June 2009. The software was downloaded from NCEP, the US National Centers for Environmental Protection, http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2 From the website: "These codes are provided as is for the use of NCEP data users. NCEP does not and cannot provide any support for them". Brent A. Gordon of noaa.gov clarified that this code is in the public domain, and is covered by the disclaimer: http://www.weather.gov/disclaimer.php The information on government servers are in the public domain, unless specifically annotated otherwise, and may be used freely by the public so long as you do not 1) claim it is your own (e.g. by claiming copyright for NWS information -- see below), 2) use it in a manner that implies an endorsement or affiliation with NOAA/NWS, or 3) modify it in content and then present it as official government material. You also cannot present information of your own in a way that makes it appear to be official government information.. debian/changelog0000644000000000000000000000306712254700502011043 0ustar g2clib (1.4.0-2) unstable; urgency=medium * Standards-Version: 3.9.5 * Add prototypes for g2_unpack*() used in python-grib, to grib.h to fix implicit declarations -- Alastair McKinstry Thu, 19 Dec 2013 23:28:24 +0000 g2clib (1.4.0-1) unstable; urgency=low * New upstream. * Add watch file. * Now at Standards-Version: 3.9.4 * Add flags to harden library. * Ensure it can build twice-in-a-row: clean binaries in rules * Ensure static lib is shipped in -dev file. Closes: #701547 -- Alastair McKinstry Tue, 28 May 2013 19:45:05 +0100 g2clib (1.2.2-2) unstable; urgency=low * Fix to build with libpng15. Closes: #650486. * Now require pkg-config to build, as we use it to detect the appropriate png library at build-time. * Make Multi-Arch. * Add DEP-3 headers to all patches. -- Alastair McKinstry Wed, 30 Nov 2011 12:32:27 +0000 g2clib (1.2.2-1) unstable; urgency=low * New upstream release. * Move to source format 3, dh rules. * Standards-Version: 3.9.2. -- Alastair McKinstry Wed, 13 Apr 2011 12:23:55 +0100 g2clib (1.1.9-1) unstable; urgency=low * New upstream release. Closes: #547282. * Standards-Version: 3.8.3. -- Alastair McKinstry Tue, 20 Oct 2009 14:34:30 +0100 g2clib (1.1.8-1) unstable; urgency=low * Initial release. (Closes: #531959). * Debian/copyright contains statement on public-domain nature of code. -- Alastair McKinstry Thu, 24 Jul 2009 19:56:18 +0100 debian/libgrib2c0d.install0000644000000000000000000000003211665265410012642 0ustar usr/lib/*/libgrib2c.so.0d