--- yorick-ml4-0.5.1.orig/Makefile +++ yorick-ml4-0.5.1/Makefile @@ -109,7 +109,7 @@ binaries/$(PKG_NAME)/$(PKG_NAME).info; fi distsrc: clean - cd ..; tar --exclude binaries --exclude .svn --exclude CVS --exclude *.spec -zcvf \ + cd ..; tar --exclude binaries --exclude .svn -zcvf \ $(PKG_NAME)-$(PKG_VERSION)-src.tgz yorick-$(PKG_NAME)-$(PKG_VERSION);\ ncftpput -f $(HOME)/.ncftp/maumae www/yorick/$(PKG_DEST_URL)/src/ \ $(PKG_NAME)-$(PKG_VERSION)-src.tgz --- yorick-ml4-0.5.1.orig/yorick-ml4.spec +++ yorick-ml4-0.5.1/yorick-ml4.spec @@ -0,0 +1,62 @@ +%define name yorick-ml4 +%define version 0.5.01 +%define release gemini2007dec07 + +Summary: yorick library for matlab files I/O +Name: %{name} +Version: %{version} +Release: %{release} +Source0: %{name}-%{version}.tar.bz2 +License: BSD +Group: Development/Languages +Packager: Francois Rigaut +Url: http://www.maumae.net/yorick/doc/plugins.php +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Requires: yorick >= 2.1 + + +%description +Matlab4 I/O + +This package was develop for the Gemini MCAO (RTC file exchange) + +Available functions: + * ml4scan(file[,maxvar]) + * ml4search(file,varname) + * ml4read(file,varname,leave_open) + * ml4close,file + * ml4write(file,data,varname,mode,endian=) + +%prep +%setup -q + +%build +yorick -batch make.i +make +if [ -f check.i ] ; then + mv check.i %{name}_check.i +fi; + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/usr/lib/yorick/lib +mkdir -p $RPM_BUILD_ROOT/usr/lib/yorick/i0 +mkdir -p $RPM_BUILD_ROOT/usr/lib/yorick/i-start + +install -m 755 ml4.so $RPM_BUILD_ROOT/usr/lib/yorick/lib +install -m 644 *.i $RPM_BUILD_ROOT/usr/lib/yorick/i0 +install -m 644 *_start.i $RPM_BUILD_ROOT/usr/lib/yorick/i-start + +rm $RPM_BUILD_ROOT/usr/lib/yorick/i0/*_start.i + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/usr/lib/yorick/lib/ml4.so +/usr/lib/yorick/i0/*.i +/usr/lib/yorick/i-start/*_start.i + +%changelog --- yorick-ml4-0.5.1.orig/ml4.c +++ yorick-ml4-0.5.1/ml4.c @@ -53,6 +53,7 @@ #define SWAP_SHORT(Var) Var = *(short*) swap((void*)&Var, sizeof(short)) #define SWAP_USHORT(Var) Var = *(unsigned short*)swap((void*)&Var, sizeof(short)) +#define SWAP_INT(Var) Var = *(int*) swap((void*)&Var, sizeof(int)) #define SWAP_LONG(Var) Var = *(long*) swap((void*)&Var, sizeof(long)) #define SWAP_ULONG(Var) Var = *(unsigned long*) swap((void*)&Var, sizeof(long)) #define SWAP_RGB(Var) Var = *(int*) swap((void*)&Var, 3) @@ -92,8 +93,8 @@ { int size; long nelem; - long type,namelen; - long mrows,mcols,imagf; + int type,namelen; + int mrows,mcols,imagf; int i; FILE *fs; @@ -117,8 +118,8 @@ case 'l': /* 4-byte int, row-wise */ type=20; size=4; - long *varl=data; - if (endianess=='B') { for (i=0;i255) { fseek(fs,fileptr,SEEK_SET); // leave file ptr at begginning of this variable @@ -367,10 +368,10 @@ } else if ((type==120) || (type==20)) { // 4-byte int size = 4; - Array *a= PushDataBlock(NewArray(&longStruct, tmpDims)); - long *data = a->value.l; + Array *a= PushDataBlock(NewArray(&intStruct, tmpDims)); + int *data = a->value.l; bytes_read = fread((void *)data,size,nElements,fs); - if (endian=='B') { for (i=0;i0 int matfind(FILE *fs, char *var, int maxVarsToSearch) { - long info[5]; + int info[5]; long i; long fileptr,tfileptr,tfp; long nbyt,nelem,skip; - long type,rest,prec; - long mrows,mcols; - long imagf; - long namelen; + long rest,prec; + int type,mrows,mcols; + int imagf; + int namelen; long varNumber = 0; char varname[80]; char string[200]; @@ -628,7 +629,7 @@ // info[0] changed to info[4] 2006/3/15 as double type can be 0, hence // no way to know big from little endian info[0] for doubles. if (DEBUG) printf("swapping!\n"); - for (i=0;i<5;i++) SWAP_LONG(info[i]); + for (i=0;i<5;i++) SWAP_INT(info[i]); } info[0] = info[0]%1000; @@ -636,7 +637,7 @@ tfp = ftell(fs); if (DEBUG) printf("at address %ld \n",tfp); - if (DEBUG) printf("info = %ld %ld %ld %ld %ld\n",info[0],info[1],info[2],info[3],info[4]); + if (DEBUG) printf("info = %d %d %d %d %d\n",info[0],info[1],info[2],info[3],info[4]); if ((namelen = info[4])<80L) { if (fread(varname,1,info[4],fs)==(int)info[4]) { @@ -691,14 +692,14 @@ void matscan(FILE *fs, int maxVarsToSearch, int returnString) { - long info[5]; + int info[5]; long i; long fileptr,tfileptr,tfp; long nbyt=0,nelem,skip; - long type; - long mrows,mcols; - long imagf; - long namelen; + int type; + int mrows,mcols; + int imagf; + int namelen; long varNumber = 0; char varname[80]; char *stype=""; @@ -719,7 +720,7 @@ // info[0] changed to info[4] 2006/3/15 as double type can be 0, hence // no way to know big from little endian info[0] for doubles. if (DEBUG) printf("swapping!\n"); - for (i=0;i<5;i++) SWAP_LONG(info[i]); + for (i=0;i<5;i++) SWAP_INT(info[i]); } info[0] = info[0]%1000; @@ -727,7 +728,7 @@ tfp = ftell(fs); if (DEBUG) printf("at address %ld \n",tfp); - if (DEBUG) printf("info = %ld %ld %ld %ld %ld\n",info[0],info[1],info[2],info[3],info[4]); + if (DEBUG) printf("info = %d %d %d %d %d\n",info[0],info[1],info[2],info[3],info[4]); type = info[0]%1000; @@ -752,18 +753,18 @@ // 1-byte signed or unsigned chars (50) or text (51) stype=p_strcpy("char*1 "); nbyt=1; } else { - sprintf(message,"Unknown data type %ld",type); + sprintf(message,"Unknown data type %d",type); YError(message); } if (returnString) { if (varnum!=0) a= PushDataBlock((void *)GrowArray(a, extra)); a->value.q[varnum] = p_malloc(81); - sprintf(a->value.q[varnum],"%30s %s array [%ld,%ld]",varname, \ + sprintf(a->value.q[varnum],"%30s %s array [%d,%d]",varname, \ stype,info[1],info[2]); varnum++; } else { - printf("%30s %s array [%ld,%ld]\n",varname,stype,info[1],info[2]); + printf("%30s %s array [%d,%d]\n",varname,stype,info[1],info[2]); } mrows=info[1]; --- yorick-ml4-0.5.1.orig/debian/rules +++ yorick-ml4-0.5.1/debian/rules @@ -0,0 +1,61 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +Makefile.deborig: + dh_testdir + cp -f Makefile Makefile.deborig + yorick -batch make.i + +configure: configure-stamp +configure-stamp: Makefile.deborig + dh_testdir + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch build-stamp + +clean: Makefile.deborig + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + $(MAKE) clean + -mv -f Makefile.deborig Makefile + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + +binary-indep: build install +binary-arch: build install + dh_testdir + dh_testroot + dh_installyorick + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- yorick-ml4-0.5.1.orig/debian/changelog +++ yorick-ml4-0.5.1/debian/changelog @@ -0,0 +1,19 @@ +yorick-ml4 (0.5.1-3) unstable; urgency=high + + * Fixed bug "yorick-ml4 is not 64bit-safe" (Closes: #506297). + + -- Thibaut Paumard Thu, 20 Nov 2008 13:58:21 +0100 + +yorick-ml4 (0.5.1-2) unstable; urgency=low + + * debian/copyright: fix erroneous pointer from + /usr/share/common-licenses/GPL to + /usr/share/common-licenses/GPL-2 + + -- Thibaut Paumard Wed, 23 Jan 2008 14:07:27 +0100 + +yorick-ml4 (0.5.1-1) unstable; urgency=low + + * Initial Release (closes: #460852). + + -- Thibaut Paumard Wed, 16 Jan 2008 14:06:39 +0100 --- yorick-ml4-0.5.1.orig/debian/yorick-ml4.packinfo +++ yorick-ml4-0.5.1/debian/yorick-ml4.packinfo @@ -0,0 +1,6 @@ +:newsubsection +ml4: Matlab file format support + +:ml4 +interface plugin to the Matlab file format version 4. It + includes function for reading, writing, and querying ml4 files --- yorick-ml4-0.5.1.orig/debian/watch +++ yorick-ml4-0.5.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.maumae.net/yorick/packages/src/ml4-(.*)-src\.tgz --- yorick-ml4-0.5.1.orig/debian/control +++ yorick-ml4-0.5.1/debian/control @@ -0,0 +1,14 @@ +Source: yorick-ml4 +Section: math +Priority: optional +Maintainer: Thibaut Paumard +Build-Depends: debhelper (>= 5.0.0), yorick-dev (>= 2.1.05) +Standards-Version: 3.7.3 +XS-DM-Upload-Allowed: yes + +Package: yorick-ml4 +Architecture: any +Depends: yorick (>=1.6.02), ${shlibs:Depends}, ${misc:Depends} +Description: Matlab file format support for the Yorick language + ml4 is the yorick interface plugin to the file format produced by the + commercial product Matlab 4. It include read and write support. --- yorick-ml4-0.5.1.orig/debian/compat +++ yorick-ml4-0.5.1/debian/compat @@ -0,0 +1 @@ +5 --- yorick-ml4-0.5.1.orig/debian/copyright +++ yorick-ml4-0.5.1/debian/copyright @@ -0,0 +1,28 @@ +X-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat +X-Debianized-By: Thibaut Paumard +X-Debianized-Date: Tue, 15 Jan 2008 10:01:19 +0100 +X-Source-Downloaded-From: + http://www.maumae.net/yorick/packages/src/ml4-0.5.1-src.tgz +X-Upstream-Author: François Rigaut + Gemini Observatory, 670 N A'Ohoku Place, HILO HI-96720) + +Files: * +Copyright: © 2005-2007, François Rigaut +License: GPL-2+ + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details (to receive a copy of the GNU + * General Public License, write to the Free Software Foundation, Inc., 51 + * Franklin St, Fifth Floor, Boston, MA 02110-1301, USA). +X-Comment: On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-2'. + +Files: debian/* +Copyright: © 2008, Thibaut Paumard +License: GPL-2+ --- yorick-ml4-0.5.1.orig/debian/README.Debian +++ yorick-ml4-0.5.1/debian/README.Debian @@ -0,0 +1,11 @@ +Yorick ml4 plugin for Debian +---------------------------- + +This is the `ml4' plugin by François Rigaut for the Yorick interpreted +language, prepackaged for Debian GNU/Linux. + +A sample/test file is provided in /usr/share/doc/yorick-ml4/examples/. You +can run it with "yorick -batch check.i" after decompressing the file +somewhere if necessary. + + -- Thibaut Paumard , Tue, 15 Jan 2008 10:05:44 +0100 --- yorick-ml4-0.5.1.orig/debian/examples +++ yorick-ml4-0.5.1/debian/examples @@ -0,0 +1 @@ +check.i --- yorick-ml4-0.5.1.orig/debian/yorick-ml4.keywords +++ yorick-ml4-0.5.1/debian/yorick-ml4.keywords @@ -0,0 +1 @@ +matlab4 --- yorick-ml4-0.5.1.orig/debian/ynstall +++ yorick-ml4-0.5.1/debian/ynstall @@ -0,0 +1,3 @@ +ml4.info +debian/yorick-ml4.keywords +debian/yorick-ml4.packinfo