Add reproducible.patch to drop date+hostname from build results

(boo#1047218, boo#1084909)

OBS-URL: https://build.opensuse.org/package/show/science/hdf5?expand=0&rev=176
This commit is contained in:
Atri Bhattacharya 2025-02-05 10:02:39 +00:00 committed by Git OBS Bridge
commit 51d7e9dcf1
24 changed files with 3189 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

36
Disable-phdf5-tests.patch Normal file
View File

@ -0,0 +1,36 @@
From: Egbert Eich <eich@suse.com>
Date: Sat Nov 17 20:11:13 2018 +0100
Subject: Disable phdf5 tests
Patch-mainline: never
Git-commit: 16d758d17d9c49ab9e34d510675929b9ccc8be5a
References:
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
Index: hdf5-1.12.3/testpar/CMakeTests.cmake
===================================================================
--- hdf5-1.12.3.orig/testpar/CMakeTests.cmake
+++ hdf5-1.12.3/testpar/CMakeTests.cmake
@@ -49,7 +49,7 @@ foreach (skiptest ${SKIP_tests})
set (SKIP_testphdf5 "${SKIP_testphdf5};-x;${skiptest}")
endforeach ()
-add_test (NAME MPI_TEST_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:testphdf5> ${MPIEXEC_POSTFLAGS} ${SKIP_testphdf5})
+##add_test (NAME MPI_TEST_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:testphdf5> ${MPIEXEC_POSTFLAGS} ${SKIP_testphdf5})
set_tests_properties (MPI_TEST_testphdf5 PROPERTIES
FIXTURES_REQUIRED par_clear_testphdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_PAR_BINARY_DIR}"
Index: hdf5-1.12.3/testpar/Makefile.am
===================================================================
--- hdf5-1.12.3.orig/testpar/Makefile.am
+++ hdf5-1.12.3/testpar/Makefile.am
@@ -29,7 +29,7 @@ check_SCRIPTS = $(TEST_SCRIPT_PARA)
# Test programs. These are our main targets.
#
-TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel t_2Gio
+TEST_PROG_PARA=t_mpi t_bigio t_cache t_cache_image t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel t_2Gio
# t_pflush1 and t_pflush2 are used by testpflush.sh
check_PROGRAMS = $(TEST_PROG_PARA) t_pflush1 t_pflush2

View File

@ -0,0 +1,26 @@
From: Egbert Eich <eich@suse.com>
Date: Sun Oct 9 08:08:24 2022 +0200
Subject: Fix error message: not the name but the link information is parsed
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 7b0b8bc5703ace47aec51d7f60c1149cd3e383b1
References:
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Olink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: hdf5-1.12.3/src/H5Olink.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Olink.c
+++ hdf5-1.12.3/src/H5Olink.c
@@ -244,7 +244,7 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR
/* Make sure that length doesn't exceed buffer size, which could
occur when the file is corrupted */
if (p + len > p_end)
- HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read past end of buffer")
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "link information length causes read past end of buffer")
if (NULL == (lnk->u.ud.udata = H5MM_malloc((size_t)len)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")

View File

@ -0,0 +1,76 @@
From: Egbert Eich <eich@suse.com>
Date: Wed Oct 5 07:17:24 2022 +0200
Subject: H5O_fsinfo_decode() Make more resilient to out-of-bounds read
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 8aee14b3a19858a08e3fabdef6ff925b47d4ce2c
References:
Malformed hdf5 files may have trunkated content which does not match
the expected size. This function attempts to decode these it will read
past the end of the allocated space which may lead to a crash. Make sure
each element is within bounds before reading.
This fixes CVE-2021-45830.
Signed-off-by: Egbert Eich <eich@suse.com>
Additions
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Ofsinfo.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
Index: hdf5-1.12.3/src/H5Ofsinfo.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Ofsinfo.c
+++ hdf5-1.12.3/src/H5Ofsinfo.c
@@ -87,6 +87,13 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t);
*
*-------------------------------------------------------------------------
*/
+static char err[] = "ran off end of input buffer while decoding";
+#define VERIFY_LIMIT(p,s,l) \
+ if (p + s - 1 > l) { \
+ HCOMMON_ERROR(H5E_RESOURCE, H5E_NOSPACE, err); \
+ HGOTO_DONE(NULL) \
+ }
+
static void *
H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
@@ -111,6 +118,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_AT
fsinfo->fs_addr[ptype - 1] = HADDR_UNDEF;
/* Version of message */
+ VERIFY_LIMIT(p,1,p_end)
vers = *p++;
if (vers == H5O_FSINFO_VERSION_0) {
@@ -124,6 +132,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_AT
fsinfo->pgend_meta_thres = H5F_FILE_SPACE_PGEND_META_THRES;
fsinfo->eoa_pre_fsm_fsalloc = HADDR_UNDEF;
+ VERIFY_LIMIT(p, 1 + H5F_SIZEOF_SIZE(f), p_end);
strategy = (H5F_file_space_type_t)*p++; /* File space strategy */
H5F_DECODE_LENGTH(f, p, threshold); /* Free-space section threshold */
@@ -169,6 +178,7 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_AT
HDassert(vers >= H5O_FSINFO_VERSION_1);
fsinfo->version = vers;
+ VERIFY_LIMIT(p, 1 + 1 + 2 * H5F_SIZEOF_SIZE(f) + 2 + H5F_SIZEOF_ADDR(f), p_end);
fsinfo->strategy = (H5F_fspace_strategy_t)*p++; /* File space strategy */
fsinfo->persist = *p++; /* Free-space persist or not */
H5F_DECODE_LENGTH(f, p, fsinfo->threshold); /* Free-space section threshold */
@@ -180,9 +190,11 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_AT
/* Decode addresses of free space managers, if persisting */
if (fsinfo->persist)
- for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++)
+ for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) {
+ VERIFY_LIMIT(p, H5F_SIZEOF_SIZE(f), p_end);
H5F_addr_decode(f, &p, &(fsinfo->fs_addr[ptype - 1]));
+ }
fsinfo->mapped = FALSE;
}

View File

@ -0,0 +1,43 @@
From: Egbert Eich <eich@suse.com>
Date: Wed Oct 5 09:44:02 2022 +0200
Subject: Hot fix for CVE-2020-10812
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 2465fc41d208d57eb0d7d025286a81664148fbaf
References:
CVE-2020-10812 unveils a more fundamental design flaw in H5F__dest():
this function returns FAIL if one of multiple operations fail (in this
case H5AC_prep_for_file_close()) while it still proceeds to prepare the
close operation, free the 'shared' member in struct H5F_t and ulimately
deallocate the structure itself.
When H5F__dest() signals back FAIL to the caller, the caller itself
(H5F_try_close() in this case) will fail. This failure is signalled
up the stack, thus the file will not be considered closed and another
attempt will be made to close it - latest in the exit handler.
The next attempt to close will however need the already deallocated
H5F_t structure and the H5T_shared_t structure in its 'shared' member,
however.
This fix papers over the failure of H5AC_prep_for_file_close() by not
changing the return status of H5F__dest() to fail. There are numerous
other opportunities where this will happen.
This may call for a more fundamental solution.
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Fint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: hdf5-1.12.3/src/H5Fint.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Fint.c
+++ hdf5-1.12.3/src/H5Fint.c
@@ -1412,7 +1412,7 @@ H5F__dest(H5F_t *f, hbool_t flush, hbool
*/
if (H5AC_prep_for_file_close(f) < 0)
/* Push error, but keep going */
- HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "metadata cache prep for close failed")
+ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, ret_value, "metadata cache prep for close failed")
/* Flush at this point since the file will be closed (phase 2).
* Only try to flush the file if it was opened with write access, and if

View File

@ -0,0 +1,92 @@
From: Egbert Eich <eich@suse.com>
Date: Tue Nov 7 14:16:53 2017 +0100
Subject: [PATCH]PPC64LE: Fix long double handling
Git-commit: ad6559a71b7ba3cacb4b56d4747db63f28a12f55
References:
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.com>
---
config/cmake/ConversionTests.c | 16 ++++++++++++++++
test/dt_arith.c | 27 +++++++++++++++++++++++++--
2 files changed, 41 insertions(+), 2 deletions(-)
Index: hdf5-1.12.3/test/dt_arith.c
===================================================================
--- hdf5-1.12.3.orig/test/dt_arith.c
+++ hdf5-1.12.3/test/dt_arith.c
@@ -3035,7 +3035,19 @@ test_conv_flt_1(const char *name, int ru
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
}
else if (src_type == FLT_LDOUBLE) {
- INIT_FP_SPECIAL(src_size, src_nbits, sendian, LDBL_MANT_DIG, dst_size, buf, saved, nelmts);
+ size_t mant_dig = LDBL_MANT_DIG;
+ if (mant_dig >= src_nbits) {
+ /* This happens for IBM long double in little endian.
+ The macro LDBL_MANT_DIG says 106 mantissa bits, but the
+ HDF5 detection code actually represents it as a normal 64bit
+ double (52 bit mantissa) with the upper double being
+ unspec bits (which is sort of okay as the testsuite
+ wouldn't deal with that format correctly anyway). So
+ override the mantissa size. */
+ mant_dig = 52;
+ }
+ INIT_FP_SPECIAL(src_size, src_nbits, sendian, mant_dig, dst_size,
+ buf, saved, nelmts);
#endif
}
else
@@ -3735,7 +3747,18 @@ test_conv_int_fp(const char *name, int r
nelmts);
}
else {
- INIT_FP_SPECIAL(src_size, src_nbits, sendian, LDBL_MANT_DIG, dst_size, buf, saved, nelmts);
+ size_t mant_dig = LDBL_MANT_DIG;
+ if (mant_dig >= src_nbits) {
+ /* This happens for IBM long double in little endian.
+ The macro LDBL_MANT_DIG says 106 mantissa bits, but the
+ HDF5 detection code actually represents it as a normal 64bit
+ double (52 bit mantissa) with the upper double being
+ unspec bits (which is sort of okay as the testsuite
+ wouldn't deal with that format correctly anyway). So
+ override the mantissa size. */
+ mant_dig = 52;
+ }
+ INIT_FP_SPECIAL(src_size, src_nbits, sendian, mant_dig, dst_size, buf, saved, nelmts);
}
#endif
}
Index: hdf5-1.12.3/config/cmake/ConversionTests.c
===================================================================
--- hdf5-1.12.3.orig/config/cmake/ConversionTests.c
+++ hdf5-1.12.3/config/cmake/ConversionTests.c
@@ -34,6 +34,14 @@ int HDF_NO_UBSAN main(void)
unsigned char s2[8];
int ret = 1;
+#if defined __powerpc64__ && defined _LITTLE_ENDIAN
+ /* Don't bother checking on ppc64le, we know it'll work, and
+ that what hdf5 calls 'special algorithm' simply is
+ IBM ldouble 128 (i.e. two seperately scaled doubles).
+ The check below assumes big endian. */
+ ret = 0;
+#endif
+
if (sizeof(long double) == 16 && sizeof(long) == 8) {
/* Make sure the long double type has 16 bytes in size and
* 11 bits of exponent. If it is, the bit sequence should be
@@ -174,6 +182,14 @@ int HDF_NO_UBSAN main(void)
unsigned char s[16];
int ret = 0;
+#if defined __powerpc64__ && defined _LITTLE_ENDIAN
+ /* Don't bother checking on ppc64le, we know it'll work, and
+ that what hdf5 calls 'special algorithm' simply is
+ IBM ldouble 128 (i.e. two seperately scaled doubles).
+ The check below assumes big endian. */
+ ret = 0;
+#endif
+
if (sizeof(long double) == 16) {
/* Make sure the long double type is the same as the failing type
* which has 16 bytes in size and 11 bits of exponent. If it is,

View File

@ -0,0 +1,38 @@
From: Egbert Eich <eich@suse.com>
Date: Wed Sep 28 19:11:16 2022 +0200
Subject: Report error if dimensions of chunked storage in data layout < 2
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 34b621424504265cff3c33cf634a70efb52db180
References:
For Data Layout Messages version 1 & 2 the specification state
that the value stored in the data field is 1 greater than the
number of dimensions in the dataspace. For version 3 this is
not explicitly stated but the implementation suggests it to be
the case.
Thus the set value needs to be at least 2. For dimensionality
< 2 an out-of-bounds access occurs as in CVE-2021-45833.
This fixes CVE-2021-45833.
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Olayout.c | 4 ++++
1 file changed, 4 insertions(+)
Index: hdf5-1.12.3/src/H5Olayout.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Olayout.c
+++ hdf5-1.12.3/src/H5Olayout.c
@@ -291,6 +291,10 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_AT
if (mesg->u.chunk.ndims < 2)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "bad dimensions for chunked storage")
+ if (mesg->u.chunk.ndims < 2)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL,
+ "bad dimensions for chunked storage")
+
/* B-tree address */
if (H5_IS_BUFFER_OVERFLOW(p, H5F_SIZEOF_ADDR(f), p_end))
HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL,

View File

@ -0,0 +1,96 @@
From: Egbert Eich <eich@suse.com>
Date: Mon Oct 10 08:43:44 2022 +0200
Subject: Validate location (offset) of the accumulated metadata when comparing
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 2cf9918ae66f023a2b6d44eb591ee2ac479a6e53
References:
Initially, the accumulated metadata location is initialized to HADDR_UNDEF
- the highest available address. Bogus input files may provide a location
or size matching this value. Comparing this address against such bogus
values may provide false positives. This make sure, the value has been
initilized or fail the comparison early and let other parts of the
code deal with the bogus address/size.
Note: To avoid unnecessary checks, we have assumed that if the 'dirty'
member in the same structure is true the location is valid.
This fixes CVE-2018-13867.
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Faccum.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
Index: hdf5-1.12.3/src/H5Faccum.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Faccum.c
+++ hdf5-1.12.3/src/H5Faccum.c
@@ -47,6 +47,7 @@
#define H5F_ACCUM_THROTTLE 8
#define H5F_ACCUM_THRESHOLD 2048
#define H5F_ACCUM_MAX_SIZE (1024 * 1024) /* Max. accum. buf size (max. I/Os will be 1/2 this size) */
+#define H5F_LOC_VALID(x) (x != HADDR_UNDEF)
/******************/
/* Local Typedefs */
@@ -125,8 +126,9 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD
HDassert(!accum->buf || (accum->alloc_size >= accum->size));
/* Current read adjoins or overlaps with metadata accumulator */
- if (H5F_addr_overlap(addr, size, accum->loc, accum->size) || ((addr + size) == accum->loc) ||
- (accum->loc + accum->size) == addr) {
+ if (H5F_LOC_VALID(accum->loc) &&
+ (H5F_addr_overlap(addr, size, accum->loc, accum->size) || ((addr + size) == accum->loc) ||
+ (accum->loc + accum->size) == addr)) {
size_t amount_before; /* Amount to read before current accumulator */
haddr_t new_addr; /* New address of the accumulator buffer */
size_t new_size; /* New size of the accumulator buffer */
@@ -438,7 +440,8 @@ H5F__accum_write(H5F_shared_t *f_sh, H5F
/* Check if there is already metadata in the accumulator */
if (accum->size > 0) {
/* Check if the new metadata adjoins the beginning of the current accumulator */
- if ((addr + size) == accum->loc) {
+ if (H5F_LOC_VALID(accum->loc)
+ && (addr + size) == accum->loc) {
/* Check if we need to adjust accumulator size */
if (H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
@@ -463,7 +466,8 @@ H5F__accum_write(H5F_shared_t *f_sh, H5F
accum->dirty_off = 0;
} /* end if */
/* Check if the new metadata adjoins the end of the current accumulator */
- else if (addr == (accum->loc + accum->size)) {
+ else if (H5F_LOC_VALID(accum->loc) &&
+ addr == (accum->loc + accum->size)) {
/* Check if we need to adjust accumulator size */
if (H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
@@ -484,7 +488,8 @@ H5F__accum_write(H5F_shared_t *f_sh, H5F
accum->size += size;
} /* end if */
/* Check if the piece of metadata being written overlaps the metadata accumulator */
- else if (H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
+ else if (H5F_LOC_VALID(accum->loc) &&
+ H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
size_t add_size; /* New size of the accumulator buffer */
/* Check if the new metadata is entirely within the current accumulator */
@@ -744,7 +749,8 @@ H5F__accum_write(H5F_shared_t *f_sh, H5F
/* (Note that this could be improved by updating the accumulator
* with [some of] the information just read in. -QAK)
*/
- if (H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
+ if (H5F_LOC_VALID(accum->loc) &&
+ H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
/* Check for write starting before beginning of accumulator */
if (H5F_addr_le(addr, accum->loc)) {
/* Check for write ending within accumulator */
@@ -867,6 +873,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD
/* Adjust the metadata accumulator to remove the freed block, if it overlaps */
if ((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) &&
+ H5F_LOC_VALID(accum->loc) &&
H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
size_t overlap_size; /* Size of overlap with accumulator */

View File

@ -0,0 +1,31 @@
From: Egbert Eich <eich@suse.com>
Date: Thu Sep 29 13:47:30 2022 +0200
Subject: When evicting driver info block, NULL the corresponding entry
Patch-mainline: Not yet
Git-repo: ssh://eich@192.168.122.1:/home/eich/sources/HPC/hdf5
Git-commit: 6d5496f17ed5aa65cbb0498e0bf70b0d599dc336
References:
This prevents it from another attempt to unpin it in H5F__dest() which may
happen due to malformed hdf5 files which leads to a segfault.
This fixes CVE-2021-46242
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5Fsuper.c | 2 ++
1 file changed, 2 insertions(+)
Index: hdf5-1.12.3/src/H5Fsuper.c
===================================================================
--- hdf5-1.12.3.orig/src/H5Fsuper.c
+++ hdf5-1.12.3/src/H5Fsuper.c
@@ -1045,6 +1045,8 @@ done:
/* Evict the driver info block from the cache */
if (sblock && H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block")
+
+ f->shared->drvinfo = NULL;
} /* end if */
/* Unpin & discard superblock */

10
_constraints Normal file
View File

@ -0,0 +1,10 @@
<constraints>
<hardware>
<physicalmemory>
<size unit="M">4000</size>
</physicalmemory>
<disk>
<size unit="G">6</size>
</disk>
</hardware>
</constraints>

11
_multibuild Normal file
View File

@ -0,0 +1,11 @@
<multibuild>
<package>serial</package>
<package>openmpi4</package>
<package>openmpi5</package>
<package>mvapich2</package>
<package>gnu-openmpi4-hpc</package>
<package>gnu-openmpi5-hpc</package>
<package>gnu-mvapich2-hpc</package>
<package>gnu-mpich-hpc</package>
<package>gnu-hpc</package>
</multibuild>

3
hdf5-1.12.3.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:31cdc13b1097b34f8d5bee67a8ea2ab082b7c128d817e69e04d8f59ae8aea295
size 15433382

View File

@ -0,0 +1,12 @@
Index: hdf5-1.12.2/test/testhdf5.c
===================================================================
--- hdf5-1.12.2.orig/test/testhdf5.c
+++ hdf5-1.12.2/test/testhdf5.c
@@ -53,7 +53,6 @@ main(int argc, char *argv[])
AddTest("coords", test_coords, cleanup_coords, "Dataspace coordinates", NULL);
AddTest("sohm", test_sohm, cleanup_sohm, "Shared Object Header Messages", NULL);
AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL);
- AddTest("select", test_select, cleanup_select, "Selections", NULL);
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
AddTest("ref_deprec", test_reference_deprec, cleanup_reference_deprec, "Deprecated References", NULL);
AddTest("ref", test_reference, cleanup_reference, "References", NULL);

View File

@ -0,0 +1,26 @@
Index: configure
===================================================================
--- configure.orig
+++ configure
@@ -4962,6 +4962,8 @@ done
if test "X$host_config" != "Xnone"; then
CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`"
. $host_config
+else
+ as_fn_error $? "no usable host config found" "$LINENO" 5
fi
## Source any special site-specific file
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -346,6 +346,8 @@ done
if test "X$host_config" != "Xnone"; then
CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`"
. $host_config
+else
+ AC_MSG_ERROR([no usable host config found])
fi
## Source any special site-specific file

View File

@ -0,0 +1,22 @@
Index: hdf5-1.12.3/src/Makefile.in
===================================================================
--- hdf5-1.12.3.orig/src/Makefile.in
+++ hdf5-1.12.3/src/Makefile.in
@@ -2831,8 +2831,6 @@ help:
# Remove the generated .c file if errors occur unless HDF5_Make_Ignore
# is set to ignore the error.
H5Tinit.c: H5detect$(EXEEXT)
- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
- sed -e 's/-L/:/g' -e 's/ //g'`" \
$(RUNSERIAL) ./H5detect$(EXEEXT) $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
@@ -2843,8 +2841,6 @@ H5Tinit.c: H5detect$(EXEEXT)
# Remove the generated .c file if errors occur unless HDF5_Make_Ignore
# is set to ignore the error.
H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
- sed -e 's/-L/:/g' -e 's/ //g'`" \
$(RUNSERIAL) ./H5make_libsettings$(EXEEXT) $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)

View File

@ -0,0 +1,39 @@
From: Egbert Eich <eich@suse.com>
Date: Sat Nov 17 18:15:13 2018 +0100
Subject: hdf5: Remove timestamps from binaries
Patch-mainline: never
Git-commit: 3b88045491c0b43f385edce47e3aae07660cd9f3
References:
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/H5detect.c | 15 ---------------
1 file changed, 15 deletions(-)
Index: hdf5-1.12.3/src/H5detect.c
===================================================================
--- hdf5-1.12.3.orig/src/H5detect.c
+++ hdf5-1.12.3/src/H5detect.c
@@ -1219,22 +1219,6 @@ bit.\n";
fprintf(rawoutstream, "/* Generated automatically by H5detect -- do not edit */\n\n\n");
HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n", month_name[tm->tm_mon], tm->tm_mday,
- 1900 + tm->tm_year);
- if (pwd || real_name[0] || host_name[0]) {
- fprintf(rawoutstream, " *\t\t\t");
- if (real_name[0])
- fprintf(rawoutstream, "%s <", real_name);
-#ifdef H5_HAVE_GETPWUID
- if (pwd)
- HDfputs(pwd->pw_name, rawoutstream);
-#endif
- if (host_name[0])
- fprintf(rawoutstream, "@%s", host_name);
- if (real_name[0])
- fprintf(rawoutstream, ">");
- HDfputc('\n', rawoutstream);
- }
fprintf(rawoutstream, " *\n * Purpose:\t\t");
for (s = purpose; *s; s++) {
HDfputc(*s, rawoutstream);

30
hdf5-mpi.patch Normal file
View File

@ -0,0 +1,30 @@
diff -up hdf5-1.8.16/testpar/t_pflush1.c.mpi hdf5-1.8.16/testpar/t_pflush1.c
--- hdf5-1.8.16/testpar/t_pflush1.c.mpi 2015-10-23 23:13:44.000000000 -0600
+++ hdf5-1.8.16/testpar/t_pflush1.c 2016-03-20 21:46:42.089409776 -0600
@@ -171,6 +171,7 @@ main(int argc, char* argv[])
* because MPI_File_close wants to modify the file-handle variable.
*/
+#if 0
/* close file1 */
if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) {
printf("H5Fget_vfd_handle for file1 failed\n");
@@ -189,14 +190,17 @@ main(int argc, char* argv[])
printf("MPI_File_close for file2 failed\n");
goto error;
} /* end if */
+#endif
fflush(stdout);
fflush(stderr);
+ MPI_Finalize();
HD_exit(0);
error:
fflush(stdout);
fflush(stderr);
+ MPI_Finalize();
HD_exit(1);
}

112
hdf5-wrappers.patch Normal file
View File

@ -0,0 +1,112 @@
Index: hdf5-1.12.3/bin/h5cc.in
===================================================================
--- hdf5-1.12.3.orig/bin/h5cc.in
+++ hdf5-1.12.3/bin/h5cc.in
@@ -88,10 +88,10 @@ CLINKERBASE="@CC@"
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
-H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@"
+H5BLD_CFLAGS=
H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@"
-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
-H5BLD_LIBS="@LIBS@"
+H5BLD_LDFLAGS=
+H5BLD_LIBS=
CC="${HDF5_CC:-$CCBASE}"
CLINKER="${HDF5_CLINKER:-$CLINKERBASE}"
@@ -104,7 +104,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}"
# available library is shared, it will be used by default. The user can
# override either default, although choosing an unavailable library will result
# in link errors.
-STATIC_AVAILABLE="@enable_static@"
+# openSUSE prefers shared libraries
+STATIC_AVAILABLE=no
if test "${STATIC_AVAILABLE}" = "yes"; then
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
else
@@ -384,7 +385,7 @@ if test "x$do_link" = "xyes"; then
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
- $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link
+ $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args
status=$?
fi
Index: hdf5-1.12.3/c++/src/h5c++.in
===================================================================
--- hdf5-1.12.3.orig/c++/src/h5c++.in
+++ hdf5-1.12.3/c++/src/h5c++.in
@@ -86,10 +86,10 @@ CXXLINKERBASE="@CXX@"
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
-H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@"
+H5BLD_CXXFLAGS=
H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@"
-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
-H5BLD_LIBS="@LIBS@"
+H5BLD_LDFLAGS=
+H5BLD_LIBS=
CXX="${HDF5_CXX:-$CXXBASE}"
CXXLINKER="${HDF5_CXXLINKER:-$CXXLINKERBASE}"
@@ -102,7 +102,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}"
# available library is shared, it will be used by default. The user can
# override either default, although choosing an unavailable library will result
# in link errors.
-STATIC_AVAILABLE="@enable_static@"
+# openSUSE prefers shared libraries
+STATIC_AVAILABLE=no
if test "${STATIC_AVAILABLE}" = "yes"; then
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
else
@@ -384,7 +385,7 @@ if test "x$do_link" = "xyes"; then
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
- $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link
+ $SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args
status=$?
fi
Index: hdf5-1.12.3/fortran/src/h5fc.in
===================================================================
--- hdf5-1.12.3.orig/fortran/src/h5fc.in
+++ hdf5-1.12.3/fortran/src/h5fc.in
@@ -83,11 +83,11 @@ FLINKERBASE="@FC@"
# libraries in $link_args, followed by any external library paths and libraries
# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
# The order of the flags is intended to give precedence to the user's flags.
-H5BLD_FCFLAGS="@AM_FCFLAGS@ @FCFLAGS@"
+H5BLD_FCFLAGS=
F9XMODFLAG="@F9XMODFLAG@"
F9XSUFFIXFLAG="@F9XSUFFIXFLAG@"
-H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
-H5BLD_LIBS="@LIBS@"
+H5BLD_LDFLAGS=
+H5BLD_LIBS=
FC="${HDF5_FC:-$FCBASE}"
FLINKER="${HDF5_FLINKER:-$FLINKERBASE}"
@@ -99,7 +99,8 @@ LIBS="${HDF5_LIBS:-$LIBSBASE}"
# available library is shared, it will be used by default. The user can
# override either default, although choosing an unavailable library will result
# in link errors.
-STATIC_AVAILABLE="@enable_static@"
+# openSUSE prefers shared libraries
+STATIC_AVAILABLE=no
if test "${STATIC_AVAILABLE}" = "yes"; then
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
else
@@ -363,7 +364,7 @@ if test "x$do_link" = "xyes"; then
# libraries in $link_args, followed by any external library paths and libraries
# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
# The order of the flags is intended to give precedence to the user's flags.
- $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link
+ $SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args
status=$?
fi

1361
hdf5.changes Normal file

File diff suppressed because it is too large Load Diff

944
hdf5.spec Normal file
View File

@ -0,0 +1,944 @@
#
# spec file for package hdf5
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if 0%{?sle_version} >= 150200
%define DisOMPI1 ExclusiveArch: do_not_build
%endif
%if !0%{?is_opensuse} && 0%{?sle_version:1} && 0%{?sle_version} < 150200
%define DisOMPI3 ExclusiveArch: do_not_build
%endif
%if 0%{?sle_version:1} && 0%{?sle_version} < 150300
%define DisOMPI4 ExclusiveArch: do_not_build
%endif
# Disable until resource issue is resolved.
%bcond_with check
%define use_sz2 0
%define short_ver 1.12
%define vers %{short_ver}.3
%define _vers %( echo %{vers} | tr '.' '_' )
%define src_ver %{version}
%define pname hdf5
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%if "%{flavor}" == ""
ExclusiveArch: do_not_build
%define package_name %pname
%endif
%if "%{flavor}" == "serial"
%bcond_with hpc
%endif
%if "%{flavor}" == "openmpi4"
%{?DisOMPI4}
%global mpi_flavor openmpi
%define mpi_vers 4
%bcond_with hpc
%endif
%if "%{flavor}" == "openmpi5"
%{?DisOMPI5}
%global mpi_flavor openmpi
%define mpi_vers 5
%bcond_with hpc
%endif
%if "%{flavor}" == "mvapich2"
%global mpi_flavor %{flavor}
%bcond_with hpc
%endif
%if "%{flavor}" == "gnu-hpc"
%bcond_without hpc
%global compiler_family gnu
%undefine c_f_ver
%endif
%if "%{flavor}" == "gnu-openmpi4-hpc"
%{?DisOMPI4}
%bcond_without hpc
%define compiler_family gnu
%undefine c_f_ver
%global mpi_flavor openmpi
%define mpi_vers 4
%endif
%if "%{flavor}" == "gnu-openmpi5-hpc"
%{?DisOMPI5}
%bcond_without hpc
%define compiler_family gnu
%undefine c_f_ver
%global mpi_flavor openmpi
%define mpi_vers 5
%endif
%if "%{flavor}" == "gnu-mvapich2-hpc"
%bcond_without hpc
%define compiler_family gnu
%undefine c_f_ver
%global mpi_flavor mvapich2
%endif
%if "%{flavor}" == "gnu-mpich-hpc"
%bcond_without hpc
%define compiler_family gnu
%undefine c_f_ver
%global mpi_flavor mpich
%endif
%if "%{flavor}" == "gnu7-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu7-openmpi4-hpc"
%{?DisOMPI4}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%global mpi_flavor openmpi
%define mpi_vers 4
%endif
%if "%{flavor}" == "gnu7-openmpi5-hpc"
%{?DisOMPI5}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%global mpi_flavor openmpi
%define mpi_vers 5
%endif
%if "%{flavor}" == "gnu7-mvapich2-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%global mpi_flavor mvapich2
%endif
%if "%{flavor}" == "gnu7-mpich-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 7
%global mpi_flavor mpich
%endif
%if "%{flavor}" == "gnu8-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu8-openmpi4-hpc"
%{?DisOMPI4}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%global mpi_flavor openmpi
%define mpi_vers 4
%endif
%if "%{flavor}" == "gnu8-openmpi5-hpc"
%{?DisOMPI5}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%global mpi_flavor openmpi
%define mpi_vers 5
%endif
%if "%{flavor}" == "gnu8-mvapich2-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%global mpi_flavor mvapich2
%endif
%if "%{flavor}" == "gnu8-mpich-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 8
%global mpi_flavor mpich
%endif
%if "%{flavor}" == "gnu9-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu9-openmpi4-hpc"
%{?DisOMPI4}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%global mpi_flavor openmpi
%define mpi_vers 4
%endif
%if "%{flavor}" == "gnu9-openmpi5-hpc"
%{?DisOMPI5}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%global mpi_flavor openmpi
%define mpi_vers 5
%endif
%if "%{flavor}" == "gnu9-mvapich2-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%global mpi_flavor mvapich2
%endif
%if "%{flavor}" == "gnu9-mpich-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 9
%global mpi_flavor mpich
%endif
%if "%{flavor}" == "gnu10-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%undefine mpi_flavor
%endif
%if "%{flavor}" == "gnu10-openmpi4-hpc"
%{?DisOMPI4}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%global mpi_flavor openmpi
%define mpi_vers 4
%endif
%if "%{flavor}" == "gnu10-openmpi5-hpc"
%{?DisOMPI5}
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%global mpi_flavor openmpi
%define mpi_vers 5
%endif
%if "%{flavor}" == "gnu10-mvapich2-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%global mpi_flavor mvapich2
%endif
%if "%{flavor}" == "gnu10-mpich-hpc"
%bcond_without hpc
%define compiler_family gnu
%define c_f_ver 10
%global mpi_flavor mpich
%endif
%{?mpi_flavor:%{bcond_without mpi}}%{!?mpi_flavor:%{bcond_with mpi}}
%{?with_hpc:%{!?compiler_family:%global compiler_family gnu}}
%{?with_mpi:%{!?mpi_flavor:error "No MPI family specified!"}}
# For compatibility package names
%define mpi_ext %{?mpi_vers}
%if %{with hpc}
%{hpc_init -c %compiler_family %{?with_mpi:-m %mpi_flavor} %{?c_f_ver:-v %{c_f_ver}} %{?mpi_vers:-V %{mpi_vers}} %{?ext:-e %{ext}}}
%{?with_mpi:%global hpc_module_pname p%{pname}}
%define my_prefix %hpc_prefix
%define my_bindir %hpc_bindir
%ifarch x86_64
%define my_libdir %hpc_prefix/lib64
%else
%define my_libdir %hpc_libdir
%endif
%define my_incdir %hpc_includedir
%define package_name %{hpc_package_name %_vers}
%define libname(l:s:) lib%{pname}%{-l*}%{hpc_package_name_tail %{?_vers}}
%define vname %{pname}_%{_vers}-hpc
%else
%if %{without mpi}
%define my_prefix %_prefix
%define my_bindir %_bindir
%define my_libdir %_libdir
%define my_incdir %_includedir
%else
%define my_prefix %{_libdir}/mpi/gcc/%{mpi_flavor}%{?mpi_ext}
%define my_suffix -%{mpi_flavor}%{?mpi_ext}
%define my_bindir %{my_prefix}/bin
%define my_libdir %{my_prefix}/%{_lib}/
%define my_incdir %{my_prefix}/include/
%endif
%if 0%{!?package_name:1}
%define package_name %pname%{?my_suffix}
%endif
%define libname(l:s:) lib%{pname}%{!-l:%{-s:-}}%{-l*}%{-s*}%{?my_suffix}
%define vname %{pname}
%endif
# Run 'sh ./update_so_version.sh' when updating hdf5!
%include %{_sourcedir}/so_versions
Name: %{package_name}
Version: %vers
Release: 0
Summary: Command-line programs for the HDF5 scientific data format
License: BSD-3-Clause
Group: Productivity/Scientific/Other
URL: https://www.hdfgroup.org/HDF5/
Source0: https://www.hdfgroup.org/ftp/HDF5/releases/%{pname}-%{short_ver}/%{pname}-%{src_ver}/src/%{pname}-%{src_ver}.tar.bz2
Source100: so_versions
Source1000: update_so_version.sh
Patch0: hdf5-LD_LIBRARY_PATH.patch
# not really needed but we want to get noticed if hdf5 doesn' t know our host
Patch2: hdf5-1.8.11-abort_unknown_host_config.patch
%ifarch %arm
Patch4: hdf5-1.8.10-tests-arm.patch
%endif
Patch5: PPC64LE-Fix-long-double-handling.patch
Patch6: hdf5-Remove-timestamps-from-binaries.patch
# Could be ported but it's unknown if it's still needed
Patch7: hdf5-mpi.patch
Patch8: Disable-phdf5-tests.patch
Patch9: Fix-error-message-not-the-name-but-the-link-information-is-parsed.patch
# Imported from Fedora, strip flags from h5cc wrapper
Patch10: hdf5-wrappers.patch
Patch101: H5O_fsinfo_decode-Make-more-resilient-to-out-of-bounds-read.patch
Patch104: Report-error-if-dimensions-of-chunked-storage-in-data-layout-2.patch
Patch105: When-evicting-driver-info-block-NULL-the-corresponding-entry.patch
Patch107: Validate-location-offset-of-the-accumulated-metadata-when-comparing.patch
Patch109: Hot-fix-for-CVE-2020-10812.patch
Patch110: reproducible.patch
BuildRequires: fdupes
BuildRequires: hostname
%if 0%{?use_sz2}
BuildRequires: libsz2-devel
%endif
BuildRequires: zlib-devel
%if %{without hpc}
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
%if %{with mpi}
BuildRequires: %{mpi_flavor}%{?mpi_ext}-devel
%else
Requires: lib%{pname}_cpp%{sonum_CXX} = %{version}
Requires: lib%{pname}_hl_cpp%{sonum_HL_CXX} = %{version}
%endif
Requires: lib%{pname}-%{sonum} = %{version}
Requires: lib%{pname}_fortran%{sonum_F} = %{version}
Requires: lib%{pname}_hl%{sonum_HL} = %{version}
Requires: lib%{pname}hl_fortran%{sonum_HL_F} = %{version}
%else # hpc
%hpc_requires
Requires: %{libname -l _fortran}
%if %{without mpi}
Requires: %{libname -l _cpp}
Requires: %{libname -l _hl_cpp}
%endif
Requires: %{libname -l _hl}
Requires: %{libname -l hl_fortran}
Requires: %{libname}
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
BuildRequires: lua-lmod
BuildRequires: suse-hpc >= 0.2
%if %{with mpi}
BuildRequires: %{mpi_flavor}%{?mpi_vers}-%{compiler_family}%{?c_f_ver}-hpc-macros-devel
%endif
%endif # ?hpc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the %{flavor} version utility functions for working
with HDF5 files.
%{?with_hpc:%{hpc_master_package}}
%package -n %{libname -s %{sonum}}
Summary: Shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname} = %{version}
Obsoletes: %{libname} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -s %{sonum}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the %{flavor} version of the HDF5 runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}%{hpc_package_name_tail}}}
%package -n %{libname -l _hl -s %{sonum_HL}}
Summary: High-level shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname -l _hl} = %{version}
Obsoletes: %{libname -l _hl} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -l _hl -s %{sonum_HL}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the %{flavor} version of the high-level HDF5
runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}_hl%{hpc_package_name_tail} -N %{pname}_hl}}
%package -n %{libname -l _cpp -s %{sonum_CXX}}
Summary: Shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname -l _cpp} = %{version}
Obsoletes: %{libname -l _cpp} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -l _cpp -s %{sonum_CXX}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the HDF5 runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}_cpp%{hpc_package_name_tail} -N %{pname}_cpp}}
%package -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}}
Summary: High-level shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname -l _hl_cpp} = %{version}
Obsoletes: %{libname -l _hl_cpp} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the the high-level HDF5 runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}_hl_cpp%{hpc_package_name_tail} -N %{pname}_hl_cpp}}
%package -n %{libname -l _fortran -s %{sonum_F}}
Summary: Shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname -l _fortran} = %{version}
Obsoletes: %{libname -l _fortran} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -l _fortran -s %{sonum_F}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the %{flavor} version of the HDF5 runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}_fortran%{hpc_package_name_tail} -N %{pname}_fortran}}
%package -n %{libname -l hl_fortran -s %{sonum_HL_F}}
Summary: High-level shared libraries for the HDF5 scientific data format
# To avoid unresolvable errors due to multiple providers of the library
Group: System/Libraries
Provides: %{libname -l hl_fortran} = %{version}
Obsoletes: %{libname -l hl_fortran} < %{version}
%{?with_hpc:Requires: %{name}-module = %version}
%description -n %{libname -l hl_fortran -s %{sonum_HL_F}}
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the %{flavor} version of the high-level HDF5
runtime libraries.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}_hl_fortran%{hpc_package_name_tail} -N %{pname}hl_fortran}}
%package -n %{pname}-devel-data
Summary: Development data files for %{name}
Group: Development/Libraries/Other
%description -n %{pname}-devel-data
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains generic files needed to create projects that use
any version of HDF5.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/Parallel
Requires: %{libname -l _cpp -s %{sonum_CXX}} = %{version}
Requires: %{libname -l _hl_cpp -s %{sonum_HL_CXX}} = %{version}
Requires: %{name} = %{version}
%{!?with_hpc:Requires: %{pname}-devel-data = %{version}}
Requires: zlib-devel
%if 0%{?use_sz2}
Requires: libsz2-devel
%endif
Requires: %{libname -s %{sonum}} = %{version}
# Required by Fortran programs?
Requires: %{libname -l _fortran -s %{sonum_F}} = %{version}
Requires: %{libname -l _hl -s %{sonum_HL}} = %{version}
Requires: %{libname -l hl_fortran -s %{sonum_HL_F}} = %{version}
%{?with_hpc:%hpc_requires_devel}
%description devel
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains all files needed to create projects that use
the %{flavor} version of HDF5.
%{?with_hpc:%{hpc_master_package devel}}
%package devel-static
Summary: Static development files for %{name}
Group: Development/Libraries/Parallel
Requires: %{name}-devel = %{version}
%description devel-static
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package provides the static libraries for the %{flavor} version of HDF5.
%package -n %{vname}-examples
Summary: Examples for %{name}
Group: Documentation/Other
%description -n %{vname}-examples
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package provides examples of HDF5 library use.
%{?!with_mpi:%{?with_hpc:%{hpc_master_package -n %{pname}-hpc-examples -M %{vname}-examples}}}
%if %{with hpc}
%package module
Summary: Module files for %{name}
Group: Development/Libraries/Parallel
Provides: %{name}-module = %version
Requires: lua-lmod
%description module
HDF5 is a data model, library, and file format for storing and
managing data. It supports an unlimited variety of datatypes.
This package contains the environment module needed for the HDF5
library packages.
%endif
%prep
%{?with_hpc: %hpc_debug}
%setup -q -n %{pname}-%{version}
%patch -P 0 -p1 -b .LD_LIBRARY_PATH
%patch -P 2 -p0 -b .abort_unknown_host_config
%ifarch %arm
%patch -P 4 -p0 -b .tests-arm
%endif
%patch -P 5 -p1
%patch -P 6 -p1
# work around bot rejection for unapplied patch
%if 0
%patch -P 7 -p1
%endif
%patch -P 8 -p1
%patch -P 9 -p1
%patch -P 10 -p1
%patch -P 101 -p1
%patch -P 104 -p1
%patch -P 105 -p1
%patch -P 107 -p1
%patch -P 109 -p1
%if %{without hpc}
# baselibs looks different for different flavors - generate it on the fly
cat > %{_sourcedir}/baselibs.conf <<EOF
libhdf5-%{sonum}%{?my_suffix}
libhdf5_hl%{sonum_HL}%{?my_suffix}
libhdf5_fortran%{sonum_F}%{?my_suffix}
libhdf5hl_fortran%{sonum_HL_F}%{?my_suffix}
libhdf5_cpp%{sonum_CXX}%{?my_suffix}
libhdf5_hl_cpp%{sonum_HL_CXX}%{?my_suffix}
hdf5%{?my_suffix}-devel
requires %{?my_suffix}-<targettype>
requires "libhdf5-%{sonum}%{?my_suffix}-<targettype> = <version>"
requires "libhdf5_hl%{sonum_HL}%{?my_suffix}-<targettype> = <version>"
requires "libhdf5_fortran%{sonum_F}%{?my_suffix}-<targettype> = <version>"
requires "libhdf5hl_fortran%{sonum_HL_F}%{?my_suffix}-<targettype> = <version>"
requires "libhdf5_cpp%{sonum_CXX}%{?my_suffix}-<targettype> = <version>"
requires "libhdf5_hl_cpp%{sonum_HL_CXX}%{?my_suffix}-<targettype> = <version>"
EOF
%endif
%patch -P110 -p1
%build
%{?with_hpc:%hpc_setup}
%{?with_hpc:%hpc_debug}
export CC=gcc
export CXX=g++
export F9X=gfortran
# Ouch, how ugly! Upstream configure depends on hacking out Werror manually:
# > configure.ac:## Strip out -Werror from CFLAGS since that can cause checks to fail when
# > configure.ac:CFLAGS="`echo $CFLAGS | sed -e 's/-Werror//g'`"
# We need to clear out -Werror=return-type from our optflags otherwise we leave
# a bare '=return-type' hanging in the options passed to GCC by configure
export CFLAGS=`echo "%{optflags}" | sed -e 's/-Werror=return-type //'`
export CXXFLAGS=`echo "%{optflags}" | sed -e 's/-Werror=return-type //'`
export FFLAGS=`echo "%{optflags}" | sed -e 's/-Werror=return-type //'`
export FCFLAGS=`echo "%{optflags}" | sed -e 's/-Werror=return-type //'`
%ifarch %arm
# we want to have useful H5_CFLAGS on arm too
test -e config/linux-gnueabi || cp config/linux-gnu config/linux-gnueabi
%endif
# NOTE: --enable-unsupported is required when --enable-fortran
# and/or --enable-cxx is enabled along with --enable-threadsafe.
# Building with thise combination results in thread-safe C
# libraries and non-thread-safe fotran and/or C++ libraries. So
# you have to explicitly allow building the thread-safe C
# library and the non-thread-safe C++ and fortran libraries in
# order to make sure people don't assume that their fotran or
# C++ code is thread-safe. Since our users are going to be
# accessing this through other programs, this doesn't matter.
%if %{without hpc}
%if %{with mpi}
export CC="%{my_bindir}/mpicc"
export CXX="%{my_bindir}/mpicxx"
export FC="%{my_bindir}/mpif90"
export F77="%{my_bindir}/mpif77"
export LD_LIBRARY_PATH="%{my_libdir}"
%endif
%configure \
%if %{with mpi}
--prefix=%{my_prefix} \
--exec-prefix=%{_prefix} \
--bindir=%{my_bindir} \
--libdir=%{my_libdir} \
--includedir=%{my_incdir} \
--datadir=%{_datadir} \
%endif
--docdir=%{_docdir}/%{name} \
%else # hpc
%global _hpc_exec_prefix %hpc_exec_prefix
%global hpc_exec_prefix %_prefix
%if %{with mpi}
export CC=mpicc
export CXX=mpicxx
export F77=mpif77
export FC=mpif90
export MPICC=mpicc
export MPIFC=mpifc
export MPICXX=mpicxx
%endif
%hpc_configure \
%define hpc_exec_prefix %{expand:%_hpc_exec_prefix}
%endif # ?hpc
--disable-hltools \
--disable-dependency-tracking \
--enable-fortran \
--enable-unsupported \
--enable-hl \
--enable-shared \
--enable-threadsafe \
--enable-build-mode=production \
%if %{with mpi}
--enable-parallel \
%endif
--enable-cxx \
%if 0%{?use_sz2}
--with-szlib \
%endif
--with-pthread \
%{nil}
# Remove timestamp/buildhost/kernel version
export SDE_DATE=$(date -d @${SOURCE_DATE_EPOCH} -u)
export UNAME_M_O=$(uname -m -o)
sed -i -e "s/\(Configured on: \).*/\1 $SDE_DATE/" \
-e "s#\(Uname information: \).*#\1 $UNAME_M_O#" \
-e "s/\(Configured by: \).*/\1 abuild@OBS/" \
src/libhdf5.settings
make V=1 %{?_smp_mflags}
%install
%{?with_hpc:%hpc_setup}
%{?with_hpc:%hpc_debug}
make install DESTDIR=%{buildroot}
find %{buildroot} -type f -name "*.la" -delete -print
%if %{without mpi}
%if %{with hpc}
# copy to versioned subdir
install -m 755 -d %{buildroot}%{_prefix}/share/%{version}
install -m 755 -d %{buildroot}%{_prefix}/share/hdf5_examples
mv %{buildroot}%{_prefix}/lib/hpc/*/hdf5/*/share/hdf5_examples/* \
%{buildroot}%{_prefix}/share/%{version}/
mv %{buildroot}%{_prefix}/share/%{version} \
%{buildroot}%{_prefix}/share/hdf5_examples
%else
# rpm macro for version checking
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.hdf5 <<EOF
#
# RPM macros for hdf5 packaging
#
%_hdf5_sonum %{sonum}
%_hdf5_version %{version}
EOF
%endif
%else
# delete examples from parallel builds
find %{buildroot} -type d -name "hdf5_examples" -exec rm -rf {} +;
%endif
%fdupes -s %{buildroot}/%{_datadir}
%if %{with hpc}
%{hpc_write_pkgconfig -n hdf5 -l hdf5}
%{hpc_write_pkgconfig -n hdf5_hl -l hdf5_hl}
%{hpc_write_pkgconfig -n hdf5_fortran -l hdf5_fortran}
%{hpc_write_pkgconfig -n hdf5_hl_fortran -l hdf5hl_fortran}
%{hpc_write_pkgconfig -n hdf5_cpp -l hdf5_cpp}
%{hpc_write_pkgconfig -n hdf5_hl_cpp -l hdf5_hl_cpp}
%hpc_write_modules_files
#%%Module1.0#####################################################################
proc ModulesHelp { } {
puts stderr " "
puts stderr "This module loads the %{pname} library built with the %{compiler_family} compiler toolchain."
puts stderr "\nVersion %{version}\n"
}
module-whatis "Name: %{pname} built with %{compiler_family} toolchain"
module-whatis "Version: %{version}"
module-whatis "Category: runtime library"
module-whatis "Description: %{SUMMARY:0}"
module-whatis "%{url}"
set version %{version}
prepend-path PATH %{hpc_bindir}
prepend-path LD_LIBRARY_PATH %{hpc_libdir}
setenv %{hpc_upcase %pname}_DIR %{hpc_prefix}
setenv %{hpc_upcase %pname}_BIN %{hpc_bindir}
setenv %{hpc_upcase %pname}_LIB %{hpc_libdir}
if {[file isdirectory %{hpc_includedir}]} {
prepend-path LIBRARY_PATH %{hpc_libdir}
prepend-path CPATH %{hpc_includedir}
prepend-path C_INCLUDE_PATH %{hpc_includedir}
prepend-path CPLUS_INCLUDE_PATH %{hpc_includedir}
prepend-path INCLUDE %{hpc_includedir}
%hpc_modulefile_add_pkgconfig_path
setenv %{hpc_upcase %pname}_INC %{hpc_includedir}
}
family "%pname"
EOF
%endif
%if %{with check}
%check
%if 0%{?qemu_user_space_build}
# default timeout is 1200 seconds
export HDF5_ALARM_SECONDS=3600
%endif
%if %{with mpi}
export HDF5_Make_Ignore=yes
%endif
%{?with_hpc:%hpc_setup}
%ifarch ppc ppc64 ppc64le aarch64
make %{?_smp_mflags} check || { echo "Ignore transient make check failures for PowerPC or aarch64. boo#1058563"; }
%else
%if "%{?mpi_flavor}" != "mpich" || ("%_arch" != "s390" && "%_arch" != "s390x")
make %{?_smp_mflags} check
%endif
%endif
%endif
%post -n %{libname -l _cpp -s %{sonum_CXX}} -p /sbin/ldconfig
%postun -n %{libname -l _cpp -s %{sonum_CXX}} -p /sbin/ldconfig
%post -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}} -p /sbin/ldconfig
%postun -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}} -p /sbin/ldconfig
%post -n %{libname -s %{sonum}} -p /sbin/ldconfig
%postun -n %{libname -s %{sonum}} -p /sbin/ldconfig
%post -n %{libname -l _hl -s %{sonum_HL}} -p /sbin/ldconfig
%postun -n %{libname -l _hl -s %{sonum_HL}} -p /sbin/ldconfig
%post -n %{libname -l _fortran -s %{sonum_F}} -p /sbin/ldconfig
%postun -n %{libname -l _fortran -s %{sonum_F}} -p /sbin/ldconfig
%post -n %{libname -l hl_fortran -s %{sonum_HL_F}} -p /sbin/ldconfig
%postun -n %{libname -l hl_fortran -s %{sonum_HL_F}} -p /sbin/ldconfig
%if %{with hpc}
%postun module
%hpc_module_delete_if_default
%endif
%if 0%{?sle_version} > 120200 || 0%{?suse_version} > 1320
%define mylicense %license
%else
%define mylicense %doc
%endif
%if %{without mpi}
%files -n %{vname}-examples
%{?with_hpc:%dir %{_prefix}/share/hdf5_examples}
%{_prefix}/share/hdf5_examples%{?with_hpc:/%{version}}
%if %{without hpc}
%files -n %{pname}-devel-data
%{_rpmconfigdir}/macros.d/macros.hdf5
%endif
%endif # ?mpi
%files -n %{name}
%{?with_hpc:%dir %my_bindir}
%{my_bindir}/h5clear
%{my_bindir}/h5copy
%{my_bindir}/h5debug
%{my_bindir}/h5diff
%{my_bindir}/h5dump
%{my_bindir}/h5format_convert
%{my_bindir}/h5import
%{my_bindir}/h5jam
%{my_bindir}/h5ls
%{my_bindir}/h5mkgrp
%if %{with mpi}
%{my_bindir}/ph5diff
%{my_bindir}/h5perf
%{my_bindir}/perf
%endif
%{my_bindir}/h5perf_serial
%{my_bindir}/h5redeploy
%{my_bindir}/h5repack
%{my_bindir}/h5repart
%{my_bindir}/h5stat
%{my_bindir}/h5unjam
%{my_bindir}/h5watch
%files -n %{libname -s %{sonum}}
%doc ACKNOWLEDGMENTS README.md
%mylicense COPYING
##
%if %{without mpi}
%doc release_docs/HISTORY-1_10_0-1_12_0.txt
%doc release_docs/RELEASE.txt
%endif
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5.so.%{sonum}
%{my_libdir}/libhdf5.so.%{sonum}.*
%files -n %{libname -l _hl -s %{sonum_HL}}
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_hl.so.%{sonum_HL}
%{my_libdir}/libhdf5_hl.so.%{sonum_HL}.*
%files -n %{libname -l _cpp -s %{sonum_CXX}}
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_cpp.so.%{sonum_CXX}
%{my_libdir}/libhdf5_cpp.so.%{sonum_CXX}.*
%files -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}}
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_hl_cpp.so.%{sonum_HL_CXX}
%{my_libdir}/libhdf5_hl_cpp.so.%{sonum_HL_CXX}.*
%files -n %{libname -l _fortran -s %{sonum_F}}
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_fortran.so.%{sonum_F}
%{my_libdir}/libhdf5_fortran.so.%{sonum_F}.*
%files -n %{libname -l hl_fortran -s %{sonum_HL_F}}
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5hl_fortran.so.%{sonum_HL_F}
%{my_libdir}/libhdf5hl_fortran.so.%{sonum_HL_F}.*
%if %{with hpc}
%files module
%hpc_modules_files
%endif
%files devel
##
%{?with_hpc:%dir %{my_incdir}}
%doc release_docs/HISTORY-1_10_0-1_12_0.txt
%doc release_docs/RELEASE.txt
%doc ACKNOWLEDGMENTS README.md
%{?with_hpc:%{hpc_pkgconfig_file -n hdf5}}
%{?with_hpc:%{hpc_pkgconfig_file -N -n hdf5_hl}}
%{?with_hpc:%{hpc_pkgconfig_file -N -n hdf5_fortran}}
%{?with_hpc:%{hpc_pkgconfig_file -N -n hdf5_hl_fortran}}
%{?with_hpc:%{hpc_pkgconfig_file -N -n hdf5_cpp}}
%{?with_hpc:%{hpc_pkgconfig_file -N -n hdf5_hl_cpp}}
%{my_bindir}/h5c++
%if %{without mpi}
%{my_bindir}/h5cc
%{my_bindir}/h5fc
%else
%{my_bindir}/h5pcc
%{my_bindir}/h5pfc
%endif
%{my_incdir}/*.h
%{my_libdir}/*.so
%{my_libdir}/*.settings
%{my_incdir}/*.mod
%files devel-static
%{my_libdir}/*.a
%changelog

87
reproducible.patch Normal file
View File

@ -0,0 +1,87 @@
Date: 2025-02-03
Author: Bernhard M. Wiedemann
Fix reproducible builds
by not including date + hostname
This can be dropped after we get upstream commit d4605919f970e2f84d00d802f1b01db1b98fafc6
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index af6c5cf..d5b866d 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -135,8 +135,6 @@ print_header(void)
{
time_t now = HDtime(NULL);
struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
int i;
const char *s;
#ifdef H5_HAVE_GETPWUID
@@ -150,65 +148,12 @@ print_header(void)
This machine-generated source code contains\n\
information about the library build configuration\n";
- /*
- * The real name is the first item from the passwd gecos field.
- */
-#ifdef H5_HAVE_GETPWUID
- {
- size_t n;
- char *comma;
-
- if ((pwd = HDgetpwuid(HDgetuid()))) {
- if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
- n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
- HDstrncpy(real_name, pwd->pw_gecos, n);
- real_name[n] = '\0';
- }
- else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
- }
- }
- else
- real_name[0] = '\0';
- }
-#else
- real_name[0] = '\0';
-#endif
-
- /*
- * The FQDM of this host or the empty string.
- */
-#ifdef H5_HAVE_GETHOSTNAME
- if (HDgethostname(host_name, sizeof(host_name)) < 0)
- host_name[0] = '\0';
-#else
- host_name[0] = '\0';
-#endif
-
/*
* The file header: warning, copyright notice, build information.
*/
fprintf(rawoutstream, "/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n", month_name[tm->tm_mon], tm->tm_mday,
- 1900 + tm->tm_year);
- if (pwd || real_name[0] || host_name[0]) {
- fprintf(rawoutstream, " *\t\t\t");
- if (real_name[0])
- fprintf(rawoutstream, "%s <", real_name);
-#ifdef H5_HAVE_GETPWUID
- if (pwd)
- HDfputs(pwd->pw_name, rawoutstream);
-#endif
- if (host_name[0])
- fprintf(rawoutstream, "@%s", host_name);
- if (real_name[0])
- fprintf(rawoutstream, ">");
- HDfputc('\n', rawoutstream);
- }
-
fprintf(rawoutstream, " *\n * Purpose:\t\t");
for (s = purpose; *s; s++) {

6
so_versions Normal file
View File

@ -0,0 +1,6 @@
%define sonum 200
%define sonum_CXX 200
%define sonum_F 200
%define sonum_HL 200
%define sonum_HL_CXX 200
%define sonum_HL_F 200

64
update_so_version.sh Normal file
View File

@ -0,0 +1,64 @@
#!/bin/bash
exit_error()
{
echo "$0: $@" >&2
exit 1
}
cleanup()
{
rm -f ${spectmp}
rm -f ${shtmp}
}
## We are going to parse these variables from tarball:
# LT_VERS_INTERFACE
# LT_CXX_VERS_INTERFACE
# LT_F_VERS_INTERFACE
# LT_HL_VERS_INTERFACE
# LT_HL_CXX_VERS_INTERFACE
# LT_HL_F_VERS_INTERFACE
cleanup
spectmp=$(mktemp hdf-XXXX.spec)
shtmp=$(mktemp lt-XXXX.sh)
outtmp=$(mktemp so-XXXX)
sed -e "s/@BUILD_FLAVOR@/standard/" hdf5.spec > ${spectmp}
VER="$(rpmspec --define "_sourcedir $(pwd)" -P ${spectmp} | grep -m1 "^Version:")" || \
exit_error "can't grep version"
read x VER <<<$VER
SRC="$(rpmspec --define "_sourcedir $(pwd)" -P ${spectmp} | grep -m1 "^Source0:")" || \
exit_error "can't grep source"
read x SRC <<<$SRC
SRC=$(basename "$SRC" | sed "s/%{version}/$VER/")
test -f "$SRC" || exit_error "tarball '$SRC' does not exist"
tar --wildcards -x -O -f "$SRC" "*/config/lt_vers.am" \
| tr -d ' \t' \
| grep -E "^LT_.*INTERFACE=|^LT_.*AGE=" \
> ${shtmp} \
|| exit_error "can't grep interface versions"
source ./${shtmp} || exit_error "can't source ${shtmp}"
for infix in "" _CXX _F _HL _HL_CXX _HL_F; do
current="LT${infix}_VERS_INTERFACE"
age="LT${infix}_VERS_AGE"
currv=$(eval "echo \$$current")
agev=$(eval "echo \$$age")
if [ -n "$currv" -a -n "$agev" ]; then
echo %define sonum${infix} $((currv - agev)) >> ${outtmp}
else
rm -f ${outtmp}
cleanup
exit 1
fi
done
[ -e ${outtmp} ] && mv ${outtmp} so_versions
cleanup