Signed-off-by: DJ Delorie <dj(a)delorie.com>
---
hdf-4.2.7-arm.patch | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++
hdf.spec | 7 ++++-
2 files changed, 87 insertions(+), 1 deletions(-)
create mode 100644 hdf-4.2.7-arm.patch
diff --git a/hdf-4.2.7-arm.patch b/hdf-4.2.7-arm.patch
new file mode 100644
index 0000000..0a85bdc
--- /dev/null
+++ b/hdf-4.2.7-arm.patch
@@ -0,0 +1,81 @@
+diff -r -U 3 -p hdf-4.2.7.orig/hdf/src/hconv.h hdf-4.2.7/hdf/src/hconv.h
+--- hdf-4.2.7.orig/hdf/src/hconv.h 2012-02-06 09:02:43.000000000 -0500
++++ hdf-4.2.7/hdf/src/hconv.h 2012-03-07 01:58:21.713088567 -0500
+@@ -63,7 +63,7 @@
+ /* CONSTANT DEFINITIONS */
+ /*****************************************************************************/
+ /* Generally Big-Endian machines */
+-#if !defined(VMS) && !defined(INTEL86) && !defined(MIPSEL) &&
!defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) &&
!(defined(__ia64) && !(defined(hpux) || defined(__hpux))) &&
!defined(__x86_64__)
++#if !defined(VMS) && !defined(INTEL86) && !defined(MIPSEL) &&
!defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) &&
!(defined(__ia64) && !(defined(hpux) || defined(__hpux))) &&
!defined(__x86_64__) && !defined(__arm__)
+ # if !defined(UNICOS)
+ # define UI8_IN DFKnb1b /* Unsigned Integer, 8 bits */
+ # define UI8_OUT DFKnb1b
+diff -r -U 3 -p hdf-4.2.7.orig/hdf/src/hdfi.h hdf-4.2.7/hdf/src/hdfi.h
+--- hdf-4.2.7.orig/hdf/src/hdfi.h 2012-02-06 09:02:43.000000000 -0500
++++ hdf-4.2.7/hdf/src/hdfi.h 2012-03-06 23:12:43.941269780 -0500
+@@ -79,6 +79,7 @@
+ #define DFMT_LINUXPPC 0x1111
+ #define DFMT_LINUXSPARC 0x1111
+ #define DFMT_LINUX390 0x1111
++#define DFMT_LINUXARM 0x4441
+
+ /* I/O library constants */
+ #define UNIXUNBUFIO 1
+@@ -1463,6 +1464,57 @@ typedef int hdf_pint_t;
+
+ #endif /* Linux s390/s390x */
+
++/* Linux ARM */
++#if defined __arm__
++
++#ifdef GOT_MACHINE
++If you get an error on this line more than one machine type has been defined.
++Please check your Makefile.
++#endif
++#define GOT_MACHINE
++
++#include <sys/file.h> /* for unbuffered i/o stuff */
++#include <sys/stat.h>
++#define DF_MT DFMT_LINUXARM
++typedef void VOID;
++typedef void *VOIDP;
++typedef char *_fcd;
++typedef char char8;
++typedef unsigned char uchar8;
++typedef char int8;
++typedef unsigned char uint8;
++typedef short int int16;
++typedef unsigned short int uint16;
++typedef long int int32;
++typedef unsigned long int uint32;
++typedef int intn;
++typedef unsigned int uintn;
++typedef int intf; /* size of INTEGERs in Fortran compiler */
++typedef float float32;
++typedef double float64;
++typedef int hdf_pint_t; /* an integer the same size as a pointer */
++#define FNAME_POST_UNDERSCORE
++#define _fcdtocp(desc) (desc)
++#ifdef HAVE_FMPOOL
++#define FILELIB PAGEBUFIO /* enable page buffering */
++#else
++#define FILELIB UNIXBUFIO
++#endif
++
++/* JPEG #define's - Look in the JPEG docs before changing - (Q) */
++
++/* Determine the memory manager we are going to use. Valid values are: */
++/* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */
++/* what each does */
++#define JMEMSYS MEM_ANSI
++
++#ifdef __GNUC__
++#define HAVE_STDC
++#define INCLUDES_ARE_ANSI
++#endif
++
++#endif /* Linux ARM */
++
+ /*-----------------------------------------------------*/
+ /* 64-bit Free BSD */
+
diff --git a/hdf.spec b/hdf.spec
index 26bc7c9..467e30a 100644
--- a/hdf.spec
+++ b/hdf.spec
@@ -1,6 +1,6 @@
Name: hdf
Version: 4.2.7
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A general purpose library and file format for storing scientific data
License: BSD
Group: System Environment/Libraries
@@ -10,6 +10,7 @@ Patch0: hdf-4.2.5-maxavailfiles.patch
Patch1: hdf-ppc.patch
Patch2: hdf-4.2.4-sparc.patch
Patch3: hdf-4.2.4-s390.patch
+Patch4: hdf-4.2.7-arm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: flex byacc libjpeg-devel zlib-devel
%if "%{?dist}" != ".el4"
@@ -46,6 +47,7 @@ HDF development headers and libraries.
%patch1 -p1 -b .ppc
%patch2 -p1 -b .sparc
%patch3 -p1 -b .s390
+%patch4 -p1 -b .arm
chmod a-x *hdf/*/*.c hdf/*/*.h
# restore include file timestamps modified by patching
@@ -112,6 +114,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue Mar 06 2012 DJ Delorie <dj(a)redhat.com> 4.2.7-2
+- Add patch for ARM support
+
* Wed Feb 15 2012 Orion Poplawski <orion(a)cora.nwra.com> 4.2.7-1
- Update to 4.2.7
--
1.7.4.4
Show replies by date