summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD57
-rw-r--r--configure.patch66
3 files changed, 150 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..35f040e0dd92
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = grib_api
+ pkgdesc = A program interface for encoding and decoding GRIB messages
+ pkgver = 1.13.1
+ pkgrel = 1
+ url = https://software.ecmwf.int/wiki/display/GRIB/Home
+ arch = i686
+ arch = x86_64
+ license = LGPL3
+ license = GPL3
+ makedepends = gcc-fortran
+ makedepends = python2
+ makedepends = python2-numpy
+ depends = openjpeg
+ depends = libpng
+ depends = python2
+ depends = netcdf
+ provides = grib_api
+ conflicts = grib_def
+ replaces = grib_api
+ replaces = grib_def
+ source = http://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.13.1.tar.gz
+ source = configure.patch
+ md5sums = 2d76933cd11ed33ff4141717a8761070
+ md5sums = bd0e0fe50e6ae8ffee0bdfeeecd300f4
+
+pkgname = grib_api
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..943535eb773c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,57 @@
+# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
+# Contributor: Graziano Giuliani <graziano.giuliani@poste.it>
+
+pkgname=grib_api
+pkgver=1.13.1
+_attnum=3473437
+pkgrel=1
+pkgdesc="A program interface for encoding and decoding GRIB messages"
+arch=('i686' 'x86_64')
+url="https://software.ecmwf.int/wiki/display/GRIB/Home"
+license=('LGPL3' 'GPL3')
+#
+# Note: the default is to compile against openjpeg, and this library is
+# preferred upstream on jasper library. To compile with jasper,
+# comment the following line and uncomment the below one to drop
+# openjpeg dependency. IF both openjpeg and jasper are installed
+# and you want to compile against jasper, uncomment the line
+# below to patch configure to prefer jasper over openjpeg
+#
+depends=('openjpeg' 'libpng' 'python2' 'netcdf')
+# depends=('jasper' 'libpng' 'python2')
+makedepends=('gcc-fortran' 'python2' 'python2-numpy')
+provides=('grib_api')
+replaces=('grib_api' 'grib_def')
+conflicts=('grib_def')
+source=(http://software.ecmwf.int/wiki/download/attachments/${_attnum}/${pkgname}-${pkgver}.tar.gz configure.patch)
+md5sums=('2d76933cd11ed33ff4141717a8761070'
+ 'bd0e0fe50e6ae8ffee0bdfeeecd300f4')
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ sed -i configure -e 's|share/samples|share/grib_api/samples|'
+ # Uncomment to build with jasper if BOTH jasper and openjpeg are installed
+ # patch -p0 -i $srcdir/configure.patch
+ sed -i configure -e 's|python python2|python2 python|'
+ sed -i src/grib_openjpeg_encoding.c \
+ -e 's!"openjpeg\.h"!<openjpeg-1.5/openjpeg\.h>!'
+ ./configure F77="gfortran" FC="gfortran" CPPFLAGS="$CPPFLAGS -fPIC" \
+ --prefix=/usr --enable-python --with-png-support \
+ --with-netcdf=/usr --with-jasper=/usr \
+ --datadir=/usr/share/ \
+ --datarootdir=/usr/share/$pkgname/definitions || return 1
+ sed -i ifs_samples/grib1/Makefile \
+ -e 's|/usr/ifs_samples/grib1|/usr/share/grib_api/ifs_samples/grib1|'
+ sed -i ifs_samples/grib1_mlgrib2/Makefile \
+ -e 's|/usr/ifs_samples/grib1_mlgrib2|/usr/share/grib_api/ifs_samples/grib1_mlgrib2|'
+ sed -i ifs_samples/grib1_mlgrib2_ieee64/Makefile \
+ -e 's|/usr/ifs_samples/grib1_mlgrib2_ieee64|/usr/share/grib_api/ifs_samples/grib1_mlgrib2_ieee64|'
+ sed -i tools/grib1to2.txt -e 's|/bin/ksh|/bin/bash|'
+ make || return 1
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make DESTDIR="$pkgdir" install || return 1
+ mv $pkgdir/usr/bin/points $pkgdir/usr/bin/grib_points
+}
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 000000000000..5e6f3be3519f
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,66 @@
+--- configure.orig 2013-05-31 10:03:41.211303192 +0200
++++ configure 2013-05-31 10:04:37.696190014 +0200
+@@ -18940,62 +18940,9 @@
+ jasper_ok=0
+ fi
+
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_image_create in -lopenjpeg" >&5
+-$as_echo_n "checking for opj_image_create in -lopenjpeg... " >&6; }
+-if test "${ac_cv_lib_openjpeg_opj_image_create+set}" = set; then :
+- $as_echo_n "(cached) " >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lopenjpeg $LIBS"
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+-/* Override any GCC internal prototype to avoid an error.
+- Use char because int might match the return type of a GCC
+- builtin and then its argument prototype would still apply. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char opj_image_create ();
+-int
+-main ()
+-{
+-return opj_image_create ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_openjpeg_opj_image_create=yes
+-else
+- ac_cv_lib_openjpeg_opj_image_create=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openjpeg_opj_image_create" >&5
+-$as_echo "$ac_cv_lib_openjpeg_opj_image_create" >&6; }
+-if test "x$ac_cv_lib_openjpeg_opj_image_create" = x""yes; then :
+- openjpeg_ok=1
+-else
+- openjpeg_ok=0
+-fi
+-
+-
+ jpeg_ok=0
+
+- # prefer openjpeg over jasper
+- if test $openjpeg_ok -eq 1
+- then
+- jpeg_ok=1
+- LIB_OPENJPEG='-lopenjpeg -lm'
+- LIBS="$LIB_OPENJPEG $LIBS"
+-
+-$as_echo "#define HAVE_LIBOPENJPEG 1" >>confdefs.h
+-
+-
+- elif test $jasper_ok -eq 1
++ if test $jasper_ok -eq 1
+ then
+ jpeg_ok=1
+ LIB_JASPER='-ljasper'