--- /dev/null
+--- hdfeos/configure.ac.orig 2012-12-22 19:37:24.849760302 +0100
++++ hdfeos/configure.ac 2012-12-22 21:44:13.192935055 +0100
+@@ -327,23 +327,6 @@
+
+ AC_PROG_AWK
+
+- AC_MSG_CHECKING([for h4cc])
+- PURE_CC=""
+- if ($CC -show &> /dev/null); then
+- dnl Since CC can be "h4cc -Df2cFortran", arguments should be removed
+- PURE_CC=`echo "$CC" | $AWK '{ split($1, array, " ") ; printf array[[1]] }'`
+- AC_MSG_RESULT([$PURE_CC])
+- else
+- AC_MSG_RESULT([$CC])
+- AC_MSG_ERROR([CC is not h4cc])
+- fi
+-
+- SZIP_CC=szip_cc
+- cat $PURE_CC | $AWK '{ if ( $0 ~ /^LDFLAGS=\"(.*)/ ) { print substr($0, 1, 9) " -L'$szlib_lib' " substr($0, 10) } else { print } } ' > $SZIP_CC
+- chmod 755 $SZIP_CC
+- saved_CC="$CC"
+- CC=./$SZIP_CC
+-
+ AC_MSG_CHECKING([for szlib encoder])
+
+ AC_CACHE_VAL([he2_cv_szlib_functional],
+@@ -373,9 +356,6 @@
+ }
+ ], [he2_cv_szlib_can_encode=yes], [he2_cv_szlib_can_encode=no],)])
+
+- CC="$saved_CC"
+- rm -f $SZIP_CC
+-
+ if test ${he2_cv_szlib_functional} = "no"; then
+ he2_cv_szlib_can_encode=broken
+ else
--- /dev/null
+#
+# Conditional build:
+%bcond_without szip # SZIP support (must match hdf build bcond)
+%bcond_without tests # don't perform "make check"
+#
+Summary: HDF-EOS 2 library
+Summary(pl.UTF-8): Biblioteka HDF-EOS 2
+Name: hdf-eos
+Version: 2.18.1.00
+Release: 1
+License: MIT-like
+Group: Libraries
+Source0: ftp://edhs1.gsfc.nasa.gov/edhs/hdfeos/latest_release/HDF-EOS2.18v1.00.tar.Z
+# Source0-md5: 755a75c7ce82f0df943c81bc94b32fe4
+# needed for auto* rebuild
+Source1: ftp://edhs1.gsfc.nasa.gov/edhs/hdfeos/latest_release/HDF-EOS2.18v1.00_TestDriver.tar.Z
+# Source1-md5: d95c510f24a598e6eeeefdf92009ba15
+Patch0: %{name}-cc.patch
+Patch1: %{name}-link.patch
+URL: http://hdfeos.org/software/library.php#HDF-EOS2
+BuildRequires: autoconf >= 2.61
+BuildRequires: automake
+BuildRequires: hdf-devel >= 4
+BuildRequires: libjpeg-devel
+BuildRequires: libtool
+%{?with_szip:BuildRequires: szip-devel}
+BuildRequires: zlib-devel
+Requires: hdf >= 4
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+HDF-EOS is a software library designed to support EOS-specific data
+structures, namely Grid, Point, and Swath. The new data structures are
+constructed from standard HDF data objects, using EOS conventions,
+through the use of a software library. A key feature of HDF-EOS files
+is that instrument-independent services, such as subsetting by
+geolocation, can be applied to the files across a wide variety of data
+products. The library is extensible and new data structures can be
+added.
+
+%description -l pl.UTF-8
+HDF-EOS to biblioteka programowa zaprojektowana w celu obsługi
+struktur danych związanych z EOS, takich jak Grid, Point i Swath. Nowe
+struktury danych są tworzone z obiektów danych HDF, przy użyciu
+konwencji EOS, poprzez bibliotekę programową. Kluczową cechą plików
+HDF-EOS jest to, że usługi niezależne od przyrządu, takie jak na
+przykład podział według geolokalizacji, można wykonywać na plikach
+zawierających różnorodne zbiory danych. Biblioteka jest rozszerzalna i
+pozwala na dodawanie nowych struktur danych.
+
+%package devel
+Summary: Header files for HDF-EOS 2 library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki HDF-EOS 2
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: hdf-devel >= 4
+Requires: libjpeg-devel
+%{?with_szip:Requires: szip-devel}
+Requires: zlib-devel
+
+%description devel
+Header files for HDF-EOS 2 library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki HDF-EOS 2.
+
+%package static
+Summary: Static HDF-EOS 2 library
+Summary(pl.UTF-8): Statyczna biblioteka HDF-EOS 2
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static HDF-EOS 2 library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka HDF-EOS 2.
+
+%prep
+%setup -q -n hdfeos -b1
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+# as hdf 4 extension, use the same include dir as hdf 4
+%configure \
+ --includedir=%{_includedir}/hdf \
+ --enable-install-include \
+ --enable-shared \
+ --with-hdf4=%{_includedir}/hdf, \
+ %{?with_szip:--with-szlib}
+
+%{__make}
+
+%{?with_tests:%{__make} check}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc doc/{HDFEOS-DEFINITION.TXT,README}
+%attr(755,root,root) %{_libdir}/libGctp.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libGctp.so.0
+%attr(755,root,root) %{_libdir}/libhdfeos.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libhdfeos.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libGctp.so
+%attr(755,root,root) %{_libdir}/libhdfeos.so
+%{_libdir}/libGctp.la
+%{_libdir}/libhdfeos.la
+%{_includedir}/hdf/HDFEOSVersion.h
+%{_includedir}/hdf/HE2_config.h
+%{_includedir}/hdf/HdfEosDef.h
+%{_includedir}/hdf/bcea.h
+%{_includedir}/hdf/cfortHdf.h
+%{_includedir}/hdf/cproj.h
+%{_includedir}/hdf/cproj_prototypes.h
+%{_includedir}/hdf/ease.h
+%{_includedir}/hdf/gctp_prototypes.h
+%{_includedir}/hdf/isin.h
+%{_includedir}/hdf/proj.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libGctp.a
+%{_libdir}/libhdfeos.a