[packages/loaddap] - new, hacked to build with Octave

qboosh qboosh at pld-linux.org
Sat Mar 15 15:02:34 CET 2014


commit de5505a7aef9372aeb42dc8399ff9efdc58fa6f5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 15 15:05:32 2014 +0100

    - new, hacked to build with Octave

 loaddap-includes.patch |  50 ++++++++++++++
 loaddap-libdap.patch   | 183 +++++++++++++++++++++++++++++++++++++++++++++++++
 loaddap.spec           |  72 +++++++++++++++++++
 3 files changed, 305 insertions(+)
---
diff --git a/loaddap.spec b/loaddap.spec
new file mode 100644
index 0000000..b20a901
--- /dev/null
+++ b/loaddap.spec
@@ -0,0 +1,72 @@
+# TODO: proper paths for .oct and *.m files
+Summary:	The OPeNDAP Matlab Command Line Interface Client
+Summary(pl.UTF-8):	Klient linii poleceń Matlaba do OPeNDAP
+Name:		loaddap
+Version:	3.7.2
+Release:	0.1
+License:	LGPL v2.1+
+Group:		Libraries
+Source0:	http://www.opendap.org/pub/source/%{name}-%{version}.tar.gz
+# Source0-md5:	121330c1568f00e6861d82d15492d3de
+Patch0:		%{name}-libdap.patch
+Patch1:		%{name}-includes.patch
+URL:		http://opendap.org/
+BuildRequires:	autoconf >= 2.68
+BuildRequires:	automake
+BuildRequires:	libdap-devel >= 3.8.0
+BuildRequires:	libstdc++-devel
+BuildRequires:	libtool >= 2:2
+BuildRequires:	octave-devel
+BuildRequires:	pkgconfig
+Requires:	libdap >= 3.8.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package contains the OPeNDAP Matlab command line interface
+client. This client can be used to read data from DAP2-compilant
+servers directly into Matlab/Octave.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera klienta linii poleceń Matlaba do OPeNDAP. Można
+go używać do odczytu danych z serwerów zgodnych z DAP2 bezpośrednio
+do Matlaba/Octave.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%{__sed} -i -e 's,/extern/include,/include/octave,' conf/matlab.m4
+
+%build
+%{__libtoolize}
+%{__aclocal} -I conf
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	MATLAB_VERSION=7.8 \
+	MEX=/usr/bin/mkoctfile \
+	MEXEXT=oct \
+	--with-matlab=/usr
+%{__make} \
+	MEX="/usr/bin/mkoctfile -I. -DHAVE_CONFIG_H" \
+	MEXFLAGS=
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc COPYRIGHT_URI ChangeLog NEWS README
+%attr(755,root,root) %{_bindir}/writedap
+# FIXME: proper location for .oct and .m files
+%attr(755,root,root) %{_bindir}/loaddap.oct
+%{_bindir}/loaddap.m
+%{_bindir}/whodap.m
diff --git a/loaddap-includes.patch b/loaddap-includes.patch
new file mode 100644
index 0000000..5b4486b
--- /dev/null
+++ b/loaddap-includes.patch
@@ -0,0 +1,50 @@
+--- loaddap-3.7.2/loaddap.c.orig	2012-05-31 19:22:55.000000000 +0200
++++ loaddap-3.7.2/loaddap.c	2014-03-15 12:32:55.367212832 +0100
+@@ -64,6 +64,7 @@
+ #define ARCH_GLNX86
+ #endif
+ 
++#include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+ #ifdef WIN32
+--- loaddap-3.7.2/extend.c.orig	2012-05-31 19:22:55.000000000 +0200
++++ loaddap-3.7.2/extend.c	2014-03-15 12:36:26.140537321 +0100
+@@ -46,6 +46,7 @@
+ 
+ static char id[]= { "$Id: extend.c 21443 2009-09-02 08:52:42Z dan $" };
+ 
++/* cannot use <stdbool.h>, it conflicts with mex.h for C */
+ #include <stdio.h>
+ #include <string.h>
+ 
+@@ -840,7 +841,7 @@
+ 	int status, nFields, idx, i, j;
+ 	int numUniqueVariables;
+ 	int start, next, count;
+-	bool Found = false;
++	bool Found = FALSE;
+ 	const char *name;
+ 	MLVars *structArray;
+ 	mxArray *ret_array;
+@@ -875,7 +876,7 @@
+ #endif
+ 		for (i=0; i<count; i++) {
+ 			if (strcmp(names[i], name)==0) {
+-				Found = true;
++				Found = TRUE;
+ 			}
+ 		}
+ 		if ( !Found ) {
+--- loaddap-3.7.2/process_values.c.orig	2012-05-31 19:22:54.000000000 +0200
++++ loaddap-3.7.2/process_values.c	2014-03-15 12:36:47.487203091 +0100
+@@ -44,6 +44,7 @@
+ static char id[] not_used = {"$Id: process_values.c 21569 2009-09-30 04:12:29Z jimg $"};
+ 
+ #include <errno.h>
++#include <stdio.h>
+ #include <string.h>
+ 
+ #include <mex.h>
+--- loaddap-3.7.2/extend.c.orig	2014-03-15 12:37:05.377202340 +0100
++++ loaddap-3.7.2/extend.c	2014-03-15 12:39:53.493861951 +0100
diff --git a/loaddap-libdap.patch b/loaddap-libdap.patch
new file mode 100644
index 0000000..982c344
--- /dev/null
+++ b/loaddap-libdap.patch
@@ -0,0 +1,183 @@
+--- loaddap-3.7.2/ClientByte.cc.orig	2012-05-31 19:22:52.000000000 +0200
++++ loaddap-3.7.2/ClientByte.cc	2014-03-15 10:24:30.344202847 +0100
+@@ -94,7 +94,7 @@ ClientByte::print_val(FILE *os, string,
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+     if (numeric_to_float) {
+-	dods_float64 df = _buf;
++	dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lf ", df);
+         else
+@@ -102,9 +102,9 @@ ClientByte::print_val(FILE *os, string,
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%d ", (unsigned int)_buf);
++            fprintf(os, "%d ", (unsigned int)d_buf);
+         else
+-            (void)fwrite((void *)&_buf, sizeof(dods_byte), 1, os);
++            (void)fwrite((void *)&d_buf, sizeof(dods_byte), 1, os);
+     }
+ }
+ 
+--- loaddap-3.7.2/ClientFloat32.cc.orig	2012-05-31 19:22:55.000000000 +0200
++++ loaddap-3.7.2/ClientFloat32.cc	2014-03-15 10:27:16.194195889 +0100
+@@ -83,7 +83,7 @@ ClientFloat32::print_val(FILE *os, strin
+     DBG( cerr << "CF32: Translate: " << translate << ";" << endl;)
+ 
+     if (translate) {
+-        dods_float64 df = _buf;
++        dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lg ", df);
+         else
+@@ -91,9 +91,9 @@ ClientFloat32::print_val(FILE *os, strin
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%g ", (dods_float32)_buf);
++            fprintf(os, "%g ", (dods_float32)d_buf);
+         else
+-            fwrite((void *)&_buf, sizeof(dods_float32), 1, os);
++            fwrite((void *)&d_buf, sizeof(dods_float32), 1, os);
+     }   
+ }
+ 
+--- loaddap-3.7.2/ClientFloat64.cc.orig	2012-05-31 19:22:53.000000000 +0200
++++ loaddap-3.7.2/ClientFloat64.cc	2014-03-15 10:25:06.720867988 +0100
+@@ -77,9 +77,9 @@ ClientFloat64::print_val(FILE *os, strin
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+         if (ascii)
+-            fprintf(os, "%lf ", _buf);
++            fprintf(os, "%lf ", d_buf);
+         else
+-            fwrite((void *)&_buf, sizeof(dods_float64), 1, os);
++            fwrite((void *)&d_buf, sizeof(dods_float64), 1, os);
+ }
+ 
+ AttrTable &
+--- loaddap-3.7.2/ClientInt16.cc.orig	2012-05-31 19:22:52.000000000 +0200
++++ loaddap-3.7.2/ClientInt16.cc	2014-03-15 10:25:49.377532864 +0100
+@@ -77,7 +77,7 @@ ClientInt16::print_val(FILE *os, string,
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+     if (numeric_to_float) {
+-        dods_float64 df = _buf;
++        dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lf ", df);
+         else
+@@ -85,9 +85,9 @@ ClientInt16::print_val(FILE *os, string,
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%d ", (unsigned int)_buf);
++            fprintf(os, "%d ", (unsigned int)d_buf);
+         else
+-            fwrite((void *)&_buf, sizeof(dods_int16), 1, os);
++            fwrite((void *)&d_buf, sizeof(dods_int16), 1, os);
+     }   
+ }
+ 
+--- loaddap-3.7.2/ClientInt32.cc.orig	2012-05-31 19:22:52.000000000 +0200
++++ loaddap-3.7.2/ClientInt32.cc	2014-03-15 10:24:53.967535189 +0100
+@@ -77,7 +77,7 @@ ClientInt32::print_val(FILE *os, string,
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+     if (numeric_to_float) {
+-        dods_float64 df = _buf;
++        dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lf ", df);
+         else
+@@ -85,9 +85,9 @@ ClientInt32::print_val(FILE *os, string,
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%d ", (unsigned int)_buf);
++            fprintf(os, "%d ", (unsigned int)d_buf);
+         else
+-            (void)fwrite((void *)&_buf, sizeof(dods_int32), 1, os);
++            (void)fwrite((void *)&d_buf, sizeof(dods_int32), 1, os);
+     }
+ }
+ 
+--- loaddap-3.7.2/ClientStr.cc.orig	2012-05-31 19:22:50.000000000 +0200
++++ loaddap-3.7.2/ClientStr.cc	2014-03-15 10:25:20.130867424 +0100
+@@ -105,7 +105,7 @@ ClientStr::print_val(FILE *os, string, b
+     // Translate all string variables to Floats. jhrg 1/9/98.
+     if (string_to_float) {
+ 	char *ptr = NULL;
+-	const char *str = _buf.c_str();
++	const char *str = d_buf.c_str();
+ 	val = strtod(str, &ptr);
+ 	print_as_float = !(val == 0.0 && (ptr == str));
+ 
+@@ -113,7 +113,7 @@ ClientStr::print_val(FILE *os, string, b
+ 	    val = MakeNaN();
+ 	    print_as_float = true;
+ 	    if (warning) {
+-		cerr << "Could not translate `" << _buf << "' to a Float64,"
++		cerr << "Could not translate `" << d_buf << "' to a Float64,"
+ 		     << endl;
+ 		cerr << "interning as NaN (not a number: " << val 
+ 		     << ")" << endl;
+@@ -140,8 +140,8 @@ ClientStr::print_val(FILE *os, string, b
+ //	    os << type_name() << endl << get_matlab_name() << endl;
+ 
+         // There's no special case for ASCII since this is a String.
+-        fprintf(os, "%s\n", _buf.c_str());
+-//	os << _buf << endl;
++        fprintf(os, "%s\n", d_buf.c_str());
++//	os << d_buf << endl;
+     }
+ }
+ 
+--- loaddap-3.7.2/ClientUInt16.cc.orig	2012-05-31 19:22:55.000000000 +0200
++++ loaddap-3.7.2/ClientUInt16.cc	2014-03-15 10:27:02.717529786 +0100
+@@ -79,7 +79,7 @@ ClientUInt16::print_val(FILE *os, string
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+     if (numeric_to_float) {
+-        dods_float64 df = _buf;
++        dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lf ", df);
+         else
+@@ -87,9 +87,9 @@ ClientUInt16::print_val(FILE *os, string
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%u ", (unsigned int)_buf);
++            fprintf(os, "%u ", (unsigned int)d_buf);
+         else
+-            fwrite((void *)&_buf, sizeof(dods_uint16), 1, os);
++            fwrite((void *)&d_buf, sizeof(dods_uint16), 1, os);
+     }   
+ }
+ 
+--- loaddap-3.7.2/ClientUInt32.cc.orig	2012-05-31 19:22:55.000000000 +0200
++++ loaddap-3.7.2/ClientUInt32.cc	2014-03-15 10:25:36.510866740 +0100
+@@ -78,7 +78,7 @@ ClientUInt32::print_val(FILE *os, string
+       fprintf(os, "%s\n%s\n", type_name().c_str(), get_matlab_name().c_str());
+ 
+     if (numeric_to_float) {
+-        dods_float64 df = _buf;
++        dods_float64 df = d_buf;
+         if (ascii)
+             fprintf(os, "%lf ", df);
+         else
+@@ -86,9 +86,9 @@ ClientUInt32::print_val(FILE *os, string
+     }
+     else {
+         if (ascii)
+-            fprintf(os, "%u ", _buf);
++            fprintf(os, "%u ", d_buf);
+         else
+-            fwrite((void *)&_buf, sizeof(dods_uint32), 1, os);
++            fwrite((void *)&d_buf, sizeof(dods_uint32), 1, os);
+     }   
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/loaddap.git/commitdiff/de5505a7aef9372aeb42dc8399ff9efdc58fa6f5



More information about the pld-cvs-commit mailing list