summaryrefslogtreecommitdiff
path: root/sci-libs/hdf
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/hdf')
-rw-r--r--sci-libs/hdf/Manifest17
-rw-r--r--sci-libs/hdf/files/4.2.7_p1-autotools.patch116
-rw-r--r--sci-libs/hdf/files/hdf-4.2.11-enable-fortran-shared.patch35
-rw-r--r--sci-libs/hdf/files/hdf-4.2.11-fix-examples-dir.patch120
-rw-r--r--sci-libs/hdf/files/hdf-4.2.11-fix-szip-detection.patch27
-rw-r--r--sci-libs/hdf/files/hdf-4.2.9-autotools.patch112
-rw-r--r--sci-libs/hdf/files/hdf-ppc.patch214
-rw-r--r--sci-libs/hdf/hdf-4.2.11.ebuild65
-rw-r--r--sci-libs/hdf/hdf-4.2.13.ebuild69
-rw-r--r--sci-libs/hdf/hdf-4.2.8.ebuild56
-rw-r--r--sci-libs/hdf/hdf-4.2.9.ebuild56
-rw-r--r--sci-libs/hdf/metadata.xml19
12 files changed, 906 insertions, 0 deletions
diff --git a/sci-libs/hdf/Manifest b/sci-libs/hdf/Manifest
new file mode 100644
index 000000000000..2385ecf7285a
--- /dev/null
+++ b/sci-libs/hdf/Manifest
@@ -0,0 +1,17 @@
+AUX 4.2.7_p1-autotools.patch 3908 SHA256 1cbe8655274b7c5f5616c80e6b212e59d06205b70e328fae640f0c8b13d10ef5 SHA512 ba33a5a2e182feca790069f730dcc2a67d1ac22985a4e4b484e28b8cff7fe55da9675d8c2c60a2a0c733035b76df9325642e7e71a38d2ba7cc4c5378cc9a133c WHIRLPOOL e29d8ea043b93cee99044cff041c2dd8287acbf8c6f21d98ee1d49963f0e3c0e47eed7554332676eb2f82efe09a6deb3d9bcb90b4ee10e7f60f64563acc271c9
+AUX hdf-4.2.11-enable-fortran-shared.patch 1287 SHA256 ccc9013278d3fa01a8a82da9b5b13c9abb2e667cdb0684d6eefeb2f24c662430 SHA512 787260127abff6695e5cddbbd75290c2349ae150c01dd1c74e83539e78d503bbcb017ea8aba8f808d846e7e291e4cb13ef69d4186ff1e38780c75e0046ca6734 WHIRLPOOL 52de4c1f720bee45c46df77bb312e8be77029854ff1a5c1ddaddf43af20d27cb115634fe2659de100a4f043ddde39befda77620331daf12518dfdfa59a36abaa
+AUX hdf-4.2.11-fix-examples-dir.patch 5966 SHA256 ee092a4117cd67a71eeb02b51382c9a3d6cb351e987dac223ab502a1eaf7ec1d SHA512 f33b6e2f5de26687accba8b6ff7c1d50b96f9ad40b84771ea8a361692da88d2f376331cb8a80dc662e3213d6ddc7707ca5fcbfcaf7c1ef7224a534c0a969fabb WHIRLPOOL 5e4cd35a08ffba32fc1020ca0573aebd26168e23a428aed779de658023921bc25b2949caf65206cfb8f45339f78b75faf00259d00f925f1461694b68c3819a82
+AUX hdf-4.2.11-fix-szip-detection.patch 896 SHA256 08b33ab2e4c80bdcbf9e7fbf2a573c4ba50744b941c41ad7b0ec28cadc646bc3 SHA512 44342b4e7680a002a3dd9ae2a56dcb6689ee57824476436dc5ef5ff1884174e9de6c98972fccc88296f376a354f92e049d64c493df81da2d08ace6271cd2292a WHIRLPOOL d5fca7de482918f75448faeccd56538ee342d54754351a6464640c4a7c133ef01eb41b147d9208b38f166d38ef9b47488691d26b5d136b4c760d9bd96c43f7d9
+AUX hdf-4.2.9-autotools.patch 3486 SHA256 d6293b59a25804ee637713ac30814585ede853f79d07cc2392da6353eccd7a79 SHA512 c34fafadc39e43169d353bf6d5a01b814ae5d963da2cdf3b140e83dedae84b424dcfcd770aed3512e4ae4f3f358147cf01ec9a72be7e6db5d41c39443d6d44c7 WHIRLPOOL 2edbe50b6f0972e03f2e330bfd091145606aeac10ee215473bd3aae7068607d5dea51cb5b2790e8fdc6612e56d692f74446870ed491452b2a75e57181fb0659e
+AUX hdf-ppc.patch 10374 SHA256 2702189b0a7436a260b9ffa51ae4a68d598b5b2cd36845f1c7feea70bacbde8f SHA512 ac88c595e369709dc907b5f009429654c59ae1ac31869aace2656511687d0a7093d41af218768cc825181f623d0018991d1e49e0c48329766c01f608873d2ddb WHIRLPOOL 81462bfcf6b11b924a591060fbe0b5f914ab0b69614ba1ce3e39fa768426c79852bc226c21a3ff0c49c23bbab2ecf2702c5d7464423364999e589fda13db05ef
+DIST hdf-4.2.11.tar.bz2 3173535 SHA256 bb0e900b8cc6bc89a5730abc97e654e7705e8e1fbc4e0d4477f417822428d99b SHA512 b3be9a91c62fa258c8aa6f97d1ccbd8301225e43938b525a826c639fd8b30b7dd566f58f4d54e365606d861ad01660887163e5ca6521293791080e5ed41ef781 WHIRLPOOL 6168284c0f4cb272cfa14f12779ca2106d86d68d38d85f58ba73c137611acde6ed3d1c32bd5620496b20578de7decae6428654eb6a3afffbf7c11fff1ccebc20
+DIST hdf-4.2.13.tar.bz2 3616255 SHA256 55d3a42313bda0aba7b0463687caf819a970e0ba206f5ed2c23724f80d2ae0f3 SHA512 d7be2b3650255590b72db4a6931325ec0af256db4b846cfe886c76bf24034901b2ba7a7e546566f426d265b1793287ea3f95d8fbd818a3d018fa6813a4541657 WHIRLPOOL eba55c872ebd6d5143d1b28578ea8afd87a5708e0139f0fdec455987b8afcbe38efe0d5bbb88ea9ff06f2ab09e3cc1ad78f813d93e7e6f1f020d8b876b6e007c
+DIST hdf-4.2.8.tar.bz2 3027253 SHA256 e8a94ae2c838007ccdd55bb3cd9684adba3ded367c09803ffc84a2704f83c00f SHA512 d033007eff74d957572db8433f66e9df6fec44f67b28ddbad6e9a2d832b5504a29e9ecc5565d861b8308bab8d0dbfce19ae1e2ade0dd758d370a333819364c8e WHIRLPOOL 89ac6a092024fe2fac61bff918c14bf90e80db0b77f48e2ffe7cbf05610a3687e214c684f49e909b985c09b6baacf3dc730a15141fb44a3d59c191777c538299
+DIST hdf-4.2.9.tar.bz2 3126686 SHA256 942a54bff4da8c0733c5626b5e11162deda1adeb65c384b141f0681c935ca98a SHA512 99630177167f115f4a7f4424cf3fc77962c4eb46698f884d0e89acfe7d585aa659fd7cdf36a29246ae518675b07182223d4337a7d0aac6344ce21ccbed9aa390 WHIRLPOOL 0ed161fba7f862c1d93aebbcb6184c0b256ce71be12fa49598f9c8bf727ea1ef46c612c41908a49774b7982f5dfe577bcb8ada2c26bf2488627952040bdd9934
+EBUILD hdf-4.2.11.ebuild 1598 SHA256 7970077023befd7f9cd05d7ec96d34559b8724d4510b1b8154f6d3ce35760c7e SHA512 e873ec4aec9c1890b1a658aae3e07c6acbd304b6f4e1e90aee2930222518eccc9539dd9a4c0182f4fb352ec5e693cae2f6897a0606c56ab8055f52422e73c488 WHIRLPOOL 68c7d5eeb4bf7db198a848f8588ac1696133f55c8c5e250c3b3909af0e644c7e6ca55d778f892b9cfe1e1d440be9e82edb5befe2d5fc5aba5553d7931768bd1f
+EBUILD hdf-4.2.13.ebuild 1670 SHA256 94adac117dd1fd4ffa55762c6ee98acecf06acf3c933134b2d2fad0edf71fb66 SHA512 1d86aa88ac7fd4f9b8037d3dc5a0c0c1f3b07bf85af3508bc6bd0d29608fe0f37a52cc99001c634ac4632f3cfe1750286ac95adfdaa6d827167ed3884d573aa7 WHIRLPOOL 610d5402c4c58c9711602612ad73e4eb73ed5c2af56ffdaff0477d27d1984c135ef1d6aa00c3df16cba88999a0d10709777e7e896429d6422457b79317c22757
+EBUILD hdf-4.2.8.ebuild 1333 SHA256 3b95eb50c5821c99828024d0c51ecd90e38205bc61231cd6d4c10f61c45276bd SHA512 87e14301b2f8ffed92013aafc9dce2ebd1ab127c7bbf1bfa2ed73de9e44a57130fe18d3db1dc2b23de03d73029aee114a521278da5d9e07853f6a2375224c74f WHIRLPOOL 25beaa97d641893cc668cb0c7152143d2a5b79b878932a92417a562502776ffc217a57245d0a56bf89a2485507ec35135f5f399990efd52d170e6f2c369ce052
+EBUILD hdf-4.2.9.ebuild 1327 SHA256 4faac64628f562c1f7e780fb39f5d6776e6153ae3a106848d463e8be356549a4 SHA512 17b9ffe9ce05679f64f8bf87ad0ef69d45e6a07fee2745c9378e73d6538e00cd82e08395b272b98cf4933baa6e9ab8bf1d240b052dc991a4f5f8b2d74b3f5462 WHIRLPOOL af470d29f1d301da431b91f5c64536afebd2f212f1e4d75342816f6adccc28ee080f24c90582c3f285b4b0cd8a87deb0f4bf8f1b4e88d0203f4bd5ada231bb4a
+MISC ChangeLog 2996 SHA256 10f41fceda0afc7232375471b60db7285d51ed15b4ffed2d04128043cb6189c0 SHA512 3ecf115365572025c52741675bae730a9f9cbbdee25de38307983ab658f93bfd8d827a7818afe728c7788f2a01b91b2f2fa309c0d3c2ff393c827184cee754b8 WHIRLPOOL 4fc000c6ae6ff936112f9d41efdf50421ac360723421babb837381dd5aa94de089ac2051d0248b420e06a45dd5fb101618808e0afcdb5f635c9c5c32a2465418
+MISC ChangeLog-2015 6961 SHA256 8dfdf702ac5c59c33a64cdca56349549634a5d01085b9444f3f77a41f38f9b25 SHA512 50d67dd51d34d85c2296760907676c3b6948e8284b9983ea3d9ef48657be520ffb9999e5a357be7010f30886deb355a1ff1d49dfd70e9c32a4939b601daeb08b WHIRLPOOL 247eca969f49eb69c67496b39b5bfc5354fa7b7be72580ef28caffff337c08360749e030a1b8c3976d427871755b58730b0f2eae07bc570a59afd560e6e34a40
+MISC metadata.xml 858 SHA256 9cec2302a178524b7a74f9333d70d50a9a94d07d2312c20450c76864f8f9a02a SHA512 6cb057ab8dd9c36c571e1da011eb2838da41aff3ea6d5063f49c0068078f7b3ee865424879e400e60ac7ab8699f438a1a2a6c15c872295f3b6a55803b1098b28 WHIRLPOOL ecab00335ff0c34b04aa2839130557e2673875cdf6b72883301331132c76b9d9cdf65ff54b26d6667c62289ee3ec57829760162aff467a540a4c3d9274515d82
diff --git a/sci-libs/hdf/files/4.2.7_p1-autotools.patch b/sci-libs/hdf/files/4.2.7_p1-autotools.patch
new file mode 100644
index 000000000000..6ae9ccfc64e5
--- /dev/null
+++ b/sci-libs/hdf/files/4.2.7_p1-autotools.patch
@@ -0,0 +1,116 @@
+diff -Nur hdf-4.2.7-patch1.orig/configure.ac hdf-4.2.7-patch1/configure.ac
+--- hdf-4.2.7-patch1.orig/configure.ac 2012-03-18 03:45:46.000000000 +0000
++++ hdf-4.2.7-patch1/configure.ac 2012-04-13 03:04:17.000000000 +0100
+@@ -200,20 +200,6 @@
+ dnl Build static libraries by default. Furthermore, fortran shared libraries
+ dnl are unsupported. Disallow a user from enabling both shared libraries and
+ dnl fortran.
+-if test "X${enable_shared}" != "Xyes"; then
+- enable_shared="no"
+-fi
+-
+-if test "X${enable_shared}" = "Xyes"; then
+- if test "X${BUILD_FORTRAN}" = "Xyes"; then
+- AC_MSG_ERROR([Cannot build shared fortran libraries. Please configure with --disable-fortran flag.])
+- fi
+-fi
+-
+-AC_PROG_INSTALL
+-AC_PROG_LN_S
+-
+-AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH])
+
+ AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [none], [])
+
+@@ -404,6 +390,8 @@
+
+ if test -z "$HAVE_SZIP"; then
+ AC_MSG_ERROR([couldn't find szlib library])
++ else
++ USE_COMP_SZIP="yes"
+ fi
+ ;;
+ no)
+@@ -447,7 +435,7 @@
+
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZIP])
+
+- if test -z "$HAVE_SZIP"; then
++ if test "X$HAVE_SZIP" != "Xyes"; then
+ AC_MSG_ERROR([couldn't find szlib library])
+ else
+ USE_COMP_SZIP="yes"
+@@ -703,7 +691,7 @@
+ dnl ======================================================================
+ dnl Libtool initialization
+ dnl ======================================================================
+-LT_INIT(dlopen disable-shared)
++LT_INIT(dlopen)
+ LT_OUTPUT
+
+ dnl ======================================================================
+@@ -781,11 +769,6 @@
+ dnl ------------------------------------------------------------------------
+ dnl Check to see if libtool has enabled shared libraries. Set a conditional
+ dnl as some Makefiles will build based on availability of shared libraries.
+-if (./libtool --features | grep '^enable shared libraries' > /dev/null); then
+- enable_shared=yes
+-else
+- enable_shared=no
+-fi
+
+ dnl ------------------------------------------------------------------------
+ dnl Specify shared library extension the host machine should recognize.
+@@ -840,23 +823,8 @@
+ dnl name of the compiler and the reported version number.
+ AC_SUBST([F77_VERSION])
+ dnl Strip anything that looks like a flag off of $F77
+-F77_NOFLAGS=`echo $F77 | sed 's/ -.*//'`
+-
+-if `echo $F77_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
+- F77_VERSION="$F77"
+-else
+- F77_VERSION="$F77";
+- for x in `echo $PATH | sed -e 's/:/ /g'`; do
+- if test -x $x/$F77_NOFLAGS; then
+- F77_VERSION="$x/$F77"
+- break
+- fi
+- done
+-fi
+-if test -n "$fc_version_info"; then
+- F77_VERSION="$F77_VERSION ( $fc_version_info)"
+-fi
+
++F77_VERSION="$F77";
+
+ dnl This part doesn't work yet since HDF4 config files do not contain
+ dnl information for fortran_vendor and fortran_version.
+diff -Nur hdf-4.2.7-patch1.orig/hdf/test/fortestF.f hdf-4.2.7-patch1/hdf/test/fortestF.f
+--- hdf-4.2.7-patch1.orig/hdf/test/fortestF.f 2012-03-18 03:44:01.000000000 +0000
++++ hdf-4.2.7-patch1/hdf/test/fortestF.f 2012-04-13 02:20:45.000000000 +0100
+@@ -203,7 +203,7 @@
+
+ if (cmd .NE. 'Test' .AND. cmd .NE. 'test') then
+ print *, 'Unknown Command: ', cmd, param
+- print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'
++ print *, 'Try one of Skip, Test, Verbosity or Cleanup'
+ retcode = -1
+ return
+ endif
+diff -Nur hdf-4.2.7-patch1.orig/mfhdf/libsrc/Makefile.am hdf-4.2.7-patch1/mfhdf/libsrc/Makefile.am
+--- hdf-4.2.7-patch1.orig/mfhdf/libsrc/Makefile.am 2012-03-18 03:44:00.000000000 +0000
++++ hdf-4.2.7-patch1/mfhdf/libsrc/Makefile.am 2012-04-13 02:20:45.000000000 +0100
+@@ -32,10 +32,11 @@
+ else
+ libmfhdf_la_SOURCES = $(CSOURCES)
+ endif
++libmfhdf_la_LIBADD = $(top_builddir)/hdf/src/libdf.la
+
+ if HDF_BUILD_XDR
+ XDRLIB = ../xdr/libxdr.la
+-libmfhdf_la_LIBADD = $(XDRLIB)
++libmfhdf_la_LIBADD += $(XDRLIB)
+ endif
+
+ if HDF_BUILD_NETCDF
diff --git a/sci-libs/hdf/files/hdf-4.2.11-enable-fortran-shared.patch b/sci-libs/hdf/files/hdf-4.2.11-enable-fortran-shared.patch
new file mode 100644
index 000000000000..7d48a8a0ca97
--- /dev/null
+++ b/sci-libs/hdf/files/hdf-4.2.11-enable-fortran-shared.patch
@@ -0,0 +1,35 @@
+--- hdf-4.2.11.orig/configure.ac 2016-03-16 20:07:45.093493050 +0000
++++ hdf-4.2.11/configure.ac 2016-03-16 20:15:56.767311873 +0000
+@@ -224,20 +224,6 @@
+ ## Build static libraries by default. Furthermore, fortran shared libraries
+ ## are unsupported. Disallow a user from enabling both shared libraries and
+ ## fortran.
+-if test "X${enable_shared}" != "Xyes"; then
+- enable_shared="no"
+-fi
+-
+-if test "X${enable_shared}" = "Xyes"; then
+- if test "X${BUILD_FORTRAN}" = "Xyes"; then
+- AC_MSG_ERROR([Cannot build shared fortran libraries. Please configure with --disable-fortran flag.])
+- fi
+-fi
+-
+-AC_PROG_INSTALL
+-AC_PROG_LN_S
+-
+-AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH])
+
+ AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [none], [])
+
+@@ -847,11 +833,6 @@
+ ## ------------------------------------------------------------------------
+ ## Check to see if libtool has enabled shared libraries. Set a conditional
+ ## as some Makefiles will build based on availability of shared libraries.
+-if (./libtool --features | grep '^enable shared libraries' > /dev/null); then
+- enable_shared=yes
+-else
+- enable_shared=no
+-fi
+
+ ## ------------------------------------------------------------------------
+ ## Specify shared library extension the host machine should recognize.
diff --git a/sci-libs/hdf/files/hdf-4.2.11-fix-examples-dir.patch b/sci-libs/hdf/files/hdf-4.2.11-fix-examples-dir.patch
new file mode 100644
index 000000000000..f6f15545d66b
--- /dev/null
+++ b/sci-libs/hdf/files/hdf-4.2.11-fix-examples-dir.patch
@@ -0,0 +1,120 @@
+diff -Nur hdf-4.2.11.orig/hdf/examples/Makefile.am hdf-4.2.11/hdf/examples/Makefile.am
+--- hdf-4.2.11.orig/hdf/examples/Makefile.am 2016-03-16 20:07:45.103492925 +0000
++++ hdf-4.2.11/hdf/examples/Makefile.am 2016-03-16 22:16:35.836304451 +0000
+@@ -46,8 +46,8 @@
+ INSTALL_TOP_FILES = README
+
+ # Where to install example files
+-EXAMPLEDIR=$(prefix)/examples/c
+-EXAMPLETOPDIR=$(prefix)/examples
++EXAMPLEDIR=$(docdir)/examples/c
++EXAMPLETOPDIR=$(docdir)/examples
+
+ # How to build C programs using h4cc
+ $(EXTRA_PROG): $(H4CC)
+diff -Nur hdf-4.2.11.orig/hdf/fortran/examples/Makefile.am hdf-4.2.11/hdf/fortran/examples/Makefile.am
+--- hdf-4.2.11.orig/hdf/fortran/examples/Makefile.am 2016-03-16 20:07:45.103492925 +0000
++++ hdf-4.2.11/hdf/fortran/examples/Makefile.am 2016-03-16 22:17:58.775261767 +0000
+@@ -41,7 +41,7 @@
+ INSTALL_SCRIPT_FILES = run-fortran-ex.sh
+
+ # Where to install Fortran example files
+-EXAMPLEDIR=$(prefix)/examples/fortran
++EXAMPLEDIR=$(docdir)/examples/fortran
+
+ # How to build Fortran programs using h4fc
+ $(EXTRA_PROG): $(H4FC)
+diff -Nur hdf-4.2.11.orig/mfhdf/examples/Makefile.am hdf-4.2.11/mfhdf/examples/Makefile.am
+--- hdf-4.2.11.orig/mfhdf/examples/Makefile.am 2016-03-16 20:07:45.183491919 +0000
++++ hdf-4.2.11/mfhdf/examples/Makefile.am 2016-03-16 22:18:38.304764814 +0000
+@@ -23,7 +23,7 @@
+ SD_get_info.c SD_find_sds_by_name.c SD_set_get_dim_info.c \
+ SD_dimscale_vs_sds.c SD_set_attr.c SD_get_attr.c SD_chunking_example.c
+
+-EXAMPLEDIR=$(prefix)/examples/c
++EXAMPLEDIR=$(docdir)/examples/c
+
+ # How to build programs using h4cc
+ $(EXTRA_PROG): $(H4CC)
+diff -Nur hdf-4.2.11.orig/mfhdf/fortran/examples/Makefile.am hdf-4.2.11/mfhdf/fortran/examples/Makefile.am
+--- hdf-4.2.11.orig/mfhdf/fortran/examples/Makefile.am 2016-03-16 20:07:45.183491919 +0000
++++ hdf-4.2.11/mfhdf/fortran/examples/Makefile.am 2016-03-16 22:18:15.075056851 +0000
+@@ -24,7 +24,7 @@
+ SD_set_attr.f SD_get_attr.f SD_compress_sds.f SD_chunking_example.f
+
+ # Where to install example files
+-EXAMPLEDIR=$(prefix)/examples/fortran
++EXAMPLEDIR=$(docdir)/examples/fortran
+
+ # How to build Fortran programs using h4fc
+ $(EXTRA_PROG): $(H4FC)
+diff -up hdf-4.2.11/config/examples.am.destdir hdf-4.2.11/config/examples.am
+--- hdf-4.2.11/config/examples.am.destdir 2015-02-09 09:43:05.000000000 -0700
++++ hdf-4.2.11/config/examples.am 2015-02-13 13:24:09.008230956 -0700
+@@ -44,7 +44,7 @@ CHECK_CLEANFILES+= *.hdf
+ CLEANFILES=$(EXAMPLE_PROG)
+
+ # How to create EXAMPLEDIR if it doesn't already exist
+-$(EXAMPLEDIR):
++$(DESTDIR)$(EXAMPLEDIR):
+ mkdir -p $@
+
+ # Install and uninstall rules. We install the source files, not the
+@@ -54,42 +54,42 @@ install-data-local:
+ uninstall-local:
+ @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
+
+-install-examples: $(EXAMPLEDIR)
++install-examples: $(DESTDIR)$(EXAMPLEDIR)
+ @for f in X $(INSTALL_FILES); do \
+ if test $$f != X; then \
+- (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
+- chmod a-x $(EXAMPLEDIR)/$$f; \
++ (set -x; $(INSTALL) $(srcdir)/$$f $(DESTDIR)$(EXAMPLEDIR)/. || exit 1); \
++ chmod a-x $(DESTDIR)$(EXAMPLEDIR)/$$f; \
+ fi; \
+ done
+ @for f in X $(INSTALL_SCRIPT_FILES); do \
+ if test $$f != X; then \
+- (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
++ (set -x; $(INSTALL) $(srcdir)/$$f $(DESTDIR)$(EXAMPLEDIR)/. || exit 1); \
+ fi; \
+ done
+ @for f in X $(INSTALL_TOP_FILES); do \
+ if test $$f != X; then \
+- (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
+- chmod a-x $(EXAMPLETOPDIR)/$$f; \
++ (set -x; $(INSTALL) $(srcdir)/$$f $(DESTDIR)$(EXAMPLETOPDIR)/. || exit 1); \
++ chmod a-x $(DESTDIR)$(EXAMPLETOPDIR)/$$f; \
+ fi; \
+ done
+ @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \
+ if test $$f != X; then \
+- (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
++ (set -x; $(INSTALL) $(srcdir)/$$f $(DESTDIR)$(EXAMPLETOPDIR)/. || exit 1); \
+ fi; \
+ done
+
+ uninstall-examples:
+- @if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
+- set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
++ @if test -n "$(INSTALL_FILES)" -a -d $(DESTDIR)$(EXAMPLEDIR); then \
++ set -x; cd $(DESTDIR)$(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
+ fi
+- @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \
+- set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
++ @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(DESTDIR)$(EXAMPLEDIR); then \
++ set -x; cd $(DESTDIR)$(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
+ fi
+- @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \
+- set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
++ @if test -n "$(INSTALL_TOP_FILES)" -a -d $(DESTDIR)$(EXAMPLETOPDIR); then \
++ set -x; cd $$(DESTDIR)(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
+ fi
+- @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \
+- set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
++ @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(DESTDIR)$(EXAMPLETOPDIR); then \
++ set -x; cd $(DESTDIR)$(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
+ fi
+
+ installcheck-local:
diff --git a/sci-libs/hdf/files/hdf-4.2.11-fix-szip-detection.patch b/sci-libs/hdf/files/hdf-4.2.11-fix-szip-detection.patch
new file mode 100644
index 000000000000..4486eb959b82
--- /dev/null
+++ b/sci-libs/hdf/files/hdf-4.2.11-fix-szip-detection.patch
@@ -0,0 +1,27 @@
+--- hdf-4.2.11.orig/configure.ac 2016-03-16 20:07:45.093493050 +0000
++++ hdf-4.2.11/configure.ac 2016-03-16 22:08:06.232711036 +0000
+@@ -473,12 +473,14 @@
+ yes)
+ HAVE_SZIP="yes"
+ AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [unset HAVE_SZIP])
+- if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
++ if test "x$HAVE_SZIP" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZIP])
+ fi
+
+ if test -z "$HAVE_SZIP"; then
+ AC_MSG_ERROR([couldn't find szlib library])
++ else
++ USE_COMP_SZIP="yes"
+ fi
+ ;;
+ no)
+@@ -525,7 +527,7 @@
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZIP])
+ fi
+
+- if test -z "$HAVE_SZIP"; then
++ if test "x$HAVE_SZIP" != "xyes"; then
+ AC_MSG_ERROR([couldn't find szlib library])
+ else
+ USE_COMP_SZIP="yes"
diff --git a/sci-libs/hdf/files/hdf-4.2.9-autotools.patch b/sci-libs/hdf/files/hdf-4.2.9-autotools.patch
new file mode 100644
index 000000000000..a31946a0dfee
--- /dev/null
+++ b/sci-libs/hdf/files/hdf-4.2.9-autotools.patch
@@ -0,0 +1,112 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -216,20 +216,6 @@ AC_SUBST([BUILD_FORTRAN])
+ ## Build static libraries by default. Furthermore, fortran shared libraries
+ ## are unsupported. Disallow a user from enabling both shared libraries and
+ ## fortran.
+-if test "X${enable_shared}" != "Xyes"; then
+- enable_shared="no"
+-fi
+-
+-if test "X${enable_shared}" = "Xyes"; then
+- if test "X${BUILD_FORTRAN}" = "Xyes"; then
+- AC_MSG_ERROR([Cannot build shared fortran libraries. Please configure with --disable-fortran flag.])
+- fi
+-fi
+-
+-AC_PROG_INSTALL
+-AC_PROG_LN_S
+-
+-AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH])
+
+ AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [none], [])
+
+@@ -261,7 +247,7 @@ AC_SUBST([LT_STATIC_EXEC])
+ ## ======================================================================
+ ## Libtool initialization
+ ## ======================================================================
+-LT_INIT([dlopen disable-shared])
++LT_INIT([dlopen])
+ LT_OUTPUT
+
+ ## ----------------------------------------------------------------------
+@@ -453,6 +439,8 @@ case "$withval" in
+
+ if test -z "$HAVE_SZIP"; then
+ AC_MSG_ERROR([couldn't find szlib library])
++ else
++ USE_COMP_SZIP="yes"
+ fi
+ ;;
+ no)
+@@ -496,7 +484,7 @@ case "$withval" in
+
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZIP])
+
+- if test -z "$HAVE_SZIP"; then
++ if test "X$HAVE_SZIP" != "Xyes"; then
+ AC_MSG_ERROR([couldn't find szlib library])
+ else
+ USE_COMP_SZIP="yes"
+@@ -837,11 +825,6 @@ done
+ ## ------------------------------------------------------------------------
+ ## Check to see if libtool has enabled shared libraries. Set a conditional
+ ## as some Makefiles will build based on availability of shared libraries.
+-if (./libtool --features | grep '^enable shared libraries' > /dev/null); then
+- enable_shared=yes
+-else
+- enable_shared=no
+-fi
+
+ ## ------------------------------------------------------------------------
+ ## Specify shared library extension the host machine should recognize.
+@@ -911,22 +894,7 @@ fi
+ ## name of the compiler and the reported version number.
+ AC_SUBST([F77_VERSION])
+ ## Strip anything that looks like a flag off of $F77
+-F77_NOFLAGS=`echo $F77 | sed 's/ -.*//'`
+-
+-if `echo $F77_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
+- F77_VERSION="$F77"
+-else
+- F77_VERSION="$F77";
+- for x in `echo $PATH | sed -e 's/:/ /g'`; do
+- if test -x $x/$F77_NOFLAGS; then
+- F77_VERSION="$x/$F77"
+- break
+- fi
+- done
+-fi
+-if test -n "$fc_version_info"; then
+- F77_VERSION="$F77_VERSION ( $fc_version_info)"
+-fi
++F77_VERSION="$F77"
+
+ ## This part doesn't work yet since HDF4 config files do not contain
+ ## information for fortran_vendor and fortran_version.
+--- a/hdf/test/fortestF.f
++++ b/hdf/test/fortestF.f
+@@ -203,7 +203,7 @@ C Skip command
+
+ if (cmd .NE. 'Test' .AND. cmd .NE. 'test') then
+ print *, 'Unknown Command: ', cmd, param
+- print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'
++ print *, 'Try one of Skip, Test, Verbosity or Cleanup'
+ retcode = -1
+ return
+ endif
+--- a/mfhdf/libsrc/Makefile.am
++++ b/mfhdf/libsrc/Makefile.am
+@@ -32,10 +32,11 @@ libmfhdf_la_SOURCES = $(CSOURCES) $(FSOURCES)
+ else
+ libmfhdf_la_SOURCES = $(CSOURCES)
+ endif
++libmfhdf_la_LIBADD = $(top_builddir)/hdf/src/libdf.la
+
+ if HDF_BUILD_XDR
+ XDRLIB = $(top_builddir)/mfhdf/xdr/libxdr.la
+-libmfhdf_la_LIBADD = $(XDRLIB)
++libmfhdf_la_LIBADD += $(XDRLIB)
+ endif
+
+ if HDF_BUILD_NETCDF
diff --git a/sci-libs/hdf/files/hdf-ppc.patch b/sci-libs/hdf/files/hdf-ppc.patch
new file mode 100644
index 000000000000..3cf62d09371d
--- /dev/null
+++ b/sci-libs/hdf/files/hdf-ppc.patch
@@ -0,0 +1,214 @@
+Fix FTBS on ppc
+
+https://bugs.gentoo.org/show_bug.cgi?id=450188
+
+Source: http://pkgs.fedoraproject.org/cgit/hdf.git
+--- a/hdf/src/hdfi.h
++++ b/hdf/src/hdfi.h
+@@ -76,6 +76,7 @@
+ #define DFMT_IA64 0x4441
+ #define DFMT_LINUX64 0x4441
+ #define DFMT_POWERPC64 0x1111
++#define DFMT_LINUXPPC 0x1111
+
+ /* I/O library constants */
+ #define UNIXUNBUFIO 1
+@@ -1289,6 +1290,57 @@ typedef long hdf_pint_t;
+
+ #endif /*Linux 64 */
+
++/* Linux PPC */
++#if defined __powerpc__ && !defined __powerpc64__
++
++#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_LINUXPPC
++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 int int32;
++typedef unsigned 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 long 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 PPC */
++
+ /*-----------------------------------------------------*/
+ /* 64-bit Free BSD */
+
+--- a/mfhdf/fortran/config/jackets-linux.c
++++ b/mfhdf/fortran/config/jackets-linux.c
+@@ -34,7 +34,7 @@
+
+ struct ncfils { /* This will be a common block from Fortran */
+ double dd;
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ int ll;
+ #else
+ long ll;
+@@ -65,7 +65,7 @@ struct ncfils { /* This will be a comm
+
+ struct ncfils { /* This will be a common block from Fortran */
+ double dd;
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ int ll;
+ #else
+ long ll;
+@@ -430,7 +430,7 @@ stoig(shorts, ints, dims, basis, ndims)
+ }
+ #endif /* FORTRAN_HAS_NO_SHORT */
+
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ /*
+ * Convert multi-dimensional array of NCLONGs stored in ints to packed
+ * array of longs, in malloc'ed space. Returns pointer to longs or NULL
+@@ -916,7 +916,7 @@ nncvpt1(cdfid, varid, indices, value, rc
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long longs = *(int *)value;
+@@ -1030,7 +1030,7 @@ nncvpt(cdfid, varid, start, count, value
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long *longs = itol (value, ncount, ndims);
+@@ -1141,7 +1141,7 @@ nncvptg(cdfid, varid, start, count, stri
+ tmpbasis = nctypelen(NC_LONG);
+ else
+ #endif
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ if (datatype == NC_LONG)
+ tmpbasis = sizeof(int);
+ else
+@@ -1198,7 +1198,7 @@ nncvptg(cdfid, varid, start, count, stri
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long *longs = itolg (value, ncount, nbasis, ndims);
+@@ -1334,7 +1334,7 @@ nncvgt1(cdfid, varid, indices, value, rc
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long longs;
+@@ -1476,7 +1476,7 @@ nncvgt(cdfid, varid, start, count, value
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long iocount = dimprod (ncount, ndims); /* product of dimensions */
+@@ -1614,7 +1614,7 @@ nncvgtg(cdfid, varid, start, count, stri
+ tmpbasis = nctypelen(NC_LONG);
+ else
+ #endif
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ if (datatype == NC_LONG)
+ tmpbasis = sizeof(int);
+ else
+@@ -1685,7 +1685,7 @@ nncvgtg(cdfid, varid, start, count, stri
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long iocount = dimprod (ncount, ndims); /* product of dimensions */
+@@ -1851,7 +1851,7 @@ nncapt(cdfid, varid, attname, datatype,
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) *datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ long *longs = itol (value, attlen, 1);
+@@ -2016,7 +2016,7 @@ nncagt(cdfid, varid, attname, value, rco
+ return;
+ } /* else */
+ #endif /* FORTRAN_HAS_NO_SHORT */
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ #ifdef HDF
+ if ((nc_type) datatype == NC_LONG && handle->file_type!=HDF_FILE) {
+ /* EIP We need to use int buffer to read data in on the platforms where long is 8 bytes
+--- a/mfhdf/libsrc/netcdf.h.in
++++ b/mfhdf/libsrc/netcdf.h.in
+@@ -295,7 +295,7 @@ typedef double ncdouble;
+ */
+ #if defined _CRAYMPP
+ typedef short nclong;
+-#elif defined __alpha || (_MIPS_SZLONG == 64) || defined IA64 || (defined __sun__ && defined _LP64) || defined AIX5L64
++#elif defined __alpha || (_MIPS_SZLONG == 64) || defined IA64 || (defined __sun__ && defined _LP64) || defined AIX5L64 || defined __powerpc64__
+ typedef int nclong;
+ #else
+ typedef long nclong; /* default, compatible type */
+--- a/mfhdf/ncgen/ncgen.l
++++ b/mfhdf/ncgen/ncgen.l
+@@ -134,7 +134,7 @@ FloatInf|Infinity|Inf { /* float miss
+ yyerror(errstr);
+ }
+
+-#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || __powerpc64__
++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__
+ if (dd < INT_MIN || dd > INT_MAX)
+ #else
+ #if defined (_CRAYMPP)
diff --git a/sci-libs/hdf/hdf-4.2.11.ebuild b/sci-libs/hdf/hdf-4.2.11.ebuild
new file mode 100644
index 000000000000..1d23a4cfe970
--- /dev/null
+++ b/sci-libs/hdf/hdf-4.2.11.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_NEEDED=fortran
+
+inherit fortran-2 toolchain-funcs autotools flag-o-matic
+
+MYP=${P/_p/-patch}
+
+DESCRIPTION="General purpose library and format for storing scientific data"
+HOMEPAGE="http://www.hdfgroup.org/hdf4.html"
+SRC_URI="http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/${MYP}.tar.bz2"
+
+SLOT="0"
+LICENSE="NCSA-HDF"
+KEYWORDS="~amd64 ~ia64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples fortran szip static-libs test"
+REQUIRED_USE="test? ( szip )"
+
+RDEPEND="
+ sys-libs/zlib
+ virtual/jpeg:0
+ szip? ( virtual/szip )"
+DEPEND="${RDEPEND}
+ test? ( virtual/szip )"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.2.11-fix-szip-detection.patch
+ "${FILESDIR}"/${PN}-4.2.11-enable-fortran-shared.patch
+ "${FILESDIR}"/${PN}-4.2.11-fix-examples-dir.patch
+)
+
+src_prepare() {
+ default
+ sed -i -e 's/-R/-L/g' config/commence.am || die #rpath
+ eautoreconf
+ [[ $(tc-getFC) = *gfortran ]] && append-fflags -fno-range-check
+}
+
+src_configure() {
+ econf \
+ --enable-shared \
+ --enable-production=gentoo \
+ --disable-netcdf \
+ $(use_enable fortran) \
+ $(use_enable static-libs static) \
+ $(use_with szip szlib) \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files --all
+ dodoc release_notes/{RELEASE,HISTORY,bugs_fixed,misc_docs}.txt
+ cd "${ED}"usr
+ use examples || rm -rf share/doc/${PF}/examples
+ mv bin/ncgen{,-hdf} || die
+ mv bin/ncdump{,-hdf} || die
+ mv share/man/man1/ncgen{,-hdf}.1 || die
+ mv share/man/man1/ncdump{,-hdf}.1 || die
+}
diff --git a/sci-libs/hdf/hdf-4.2.13.ebuild b/sci-libs/hdf/hdf-4.2.13.ebuild
new file mode 100644
index 000000000000..103ea3b4428a
--- /dev/null
+++ b/sci-libs/hdf/hdf-4.2.13.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_NEEDED=fortran
+
+inherit fortran-2 toolchain-funcs autotools flag-o-matic
+
+MYP=${P/_p/-patch}
+
+DESCRIPTION="General purpose library and format for storing scientific data"
+HOMEPAGE="http://www.hdfgroup.org/hdf4.html"
+SRC_URI="http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/${MYP}.tar.bz2"
+
+SLOT="0"
+LICENSE="NCSA-HDF"
+KEYWORDS="~amd64 ~ia64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples fortran szip static-libs test"
+REQUIRED_USE="test? ( szip )"
+
+RDEPEND="
+ sys-libs/zlib
+ virtual/jpeg:0
+ szip? ( virtual/szip )"
+DEPEND="${RDEPEND}
+ test? ( virtual/szip )"
+
+S="${WORKDIR}/${MYP}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.2.11-fix-szip-detection.patch
+ "${FILESDIR}"/${PN}-4.2.11-enable-fortran-shared.patch
+)
+
+src_prepare() {
+ default
+ sed -i -e 's/-R/-L/g' config/commence.am || die #rpath
+ eautoreconf
+ [[ $(tc-getFC) = *gfortran ]] && append-fflags -fno-range-check
+}
+
+src_configure() {
+ econf \
+ --enable-shared \
+ --enable-production=gentoo \
+ --disable-netcdf \
+ $(use_enable fortran) \
+ $(use_enable static-libs static) \
+ $(use_with szip szlib) \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files --all
+ dodoc release_notes/{RELEASE,HISTORY,bugs_fixed,misc_docs}.txt
+ cd "${ED}"usr
+ if use examples; then
+ mv share/hdf4_examples share/doc/${PF}/examples || die
+ docompress -x /usr/share/doc/${PF}/examples
+ else
+ rm -r share/hdf4_examples || die
+ fi
+ mv bin/ncgen{,-hdf} || die
+ mv bin/ncdump{,-hdf} || die
+ mv share/man/man1/ncgen{,-hdf}.1 || die
+ mv share/man/man1/ncdump{,-hdf}.1 || die
+}
diff --git a/sci-libs/hdf/hdf-4.2.8.ebuild b/sci-libs/hdf/hdf-4.2.8.ebuild
new file mode 100644
index 000000000000..3561a95953c1
--- /dev/null
+++ b/sci-libs/hdf/hdf-4.2.8.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+FORTRAN_NEEDED=fortran
+
+inherit eutils fortran-2 toolchain-funcs autotools flag-o-matic
+
+MYP=${P/_p/-patch}
+
+DESCRIPTION="General purpose library and format for storing scientific data"
+HOMEPAGE="http://www.hdfgroup.org/hdf4.html"
+SRC_URI="http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/${MYP}.tar.bz2"
+
+SLOT="0"
+LICENSE="NCSA-HDF"
+KEYWORDS="amd64 ia64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE="fortran szip static-libs"
+
+RDEPEND="
+ sys-libs/zlib
+ virtual/jpeg
+ szip? ( virtual/szip )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MYP}
+
+src_prepare() {
+ epatch "${FILESDIR}"/4.2.7_p1-autotools.patch \
+ "${FILESDIR}"/${PN}-ppc.patch
+ sed -i -e 's/-R/-L/g' config/commence.am || die #rpath
+ eautoreconf
+ [[ $(tc-getFC) = *gfortran ]] && append-fflags -fno-range-check
+}
+
+src_configure() {
+ econf \
+ --enable-shared \
+ --enable-production=gentoo \
+ --disable-netcdf \
+ $(use_enable fortran) \
+ $(use_enable static-libs static) \
+ $(use_with szip szlib) \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+ dodoc release_notes/{RELEASE,HISTORY,bugs_fixed,misc_docs}.txt
+ cd "${ED}"usr
+ mv bin/ncgen{,-hdf} || die
+ mv bin/ncdump{,-hdf} || die
+ mv share/man/man1/ncgen{,-hdf}.1 || die
+ mv share/man/man1/ncdump{,-hdf}.1 || die
+}
diff --git a/sci-libs/hdf/hdf-4.2.9.ebuild b/sci-libs/hdf/hdf-4.2.9.ebuild
new file mode 100644
index 000000000000..3d7f73a04cda
--- /dev/null
+++ b/sci-libs/hdf/hdf-4.2.9.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+FORTRAN_NEEDED=fortran
+
+inherit eutils fortran-2 toolchain-funcs autotools flag-o-matic
+
+MYP=${P/_p/-patch}
+
+DESCRIPTION="General purpose library and format for storing scientific data"
+HOMEPAGE="http://www.hdfgroup.org/hdf4.html"
+SRC_URI="http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/${MYP}.tar.bz2"
+
+SLOT="0"
+LICENSE="NCSA-HDF"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="fortran szip static-libs"
+
+RDEPEND="
+ sys-libs/zlib
+ virtual/jpeg
+ szip? ( virtual/szip )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MYP}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-autotools.patch \
+ "${FILESDIR}"/${PN}-ppc.patch
+ sed -i -e 's/-R/-L/g' config/commence.am || die #rpath
+ eautoreconf
+ [[ $(tc-getFC) = *gfortran ]] && append-fflags -fno-range-check
+}
+
+src_configure() {
+ econf \
+ --enable-shared \
+ --enable-production=gentoo \
+ --disable-netcdf \
+ $(use_enable fortran) \
+ $(use_enable static-libs static) \
+ $(use_with szip szlib) \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+ dodoc release_notes/{RELEASE,HISTORY,bugs_fixed,misc_docs}.txt
+ cd "${ED}"usr
+ mv bin/ncgen{,-hdf} || die
+ mv bin/ncdump{,-hdf} || die
+ mv share/man/man1/ncgen{,-hdf}.1 || die
+ mv share/man/man1/ncdump{,-hdf}.1 || die
+}
diff --git a/sci-libs/hdf/metadata.xml b/sci-libs/hdf/metadata.xml
new file mode 100644
index 000000000000..396675338791
--- /dev/null
+++ b/sci-libs/hdf/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ The Hierarchical Data Format is a general purpose library and
+ file format for storing scientific data.
+ HDF can store two primary objects: datasets and groups. A dataset is
+ essentially a multidimensional array of data elements, and a group is
+ a structure for organizing objects in an HDF file. Using these two basic
+ objects, one can create and store almost any kind of scientific data
+ structure, such as images, arrays of vectors, and structured and
+ unstructured grids. You can also mix and match them in HDF files
+ according to your needs.
+</longdescription>
+</pkgmetadata>