%global with_mpich 1 %global with_openmpi 1 %if %{with_mpich} %global mpi_list mpich %endif %if %{with_openmpi} %global mpi_list %{?mpi_list} openmpi %endif %global so_version 200 Name: hdf5 Version: 1.12.1 Release: 4 Summary: A data model, library, and file format for storing and managing data License: GPL-2.0-or-later URL: https://portal.hdfgroup.org/display/HDF5/HDF5 Source0: https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.bz2 Source1: h5comp Patch0: hdf5-LD_LIBRARY_PATH.patch Patch1: hdf5-gfortran12.patch Patch2: hdf5-build.patch Patch3: hdf5-wrappers.patch Patch4: CVE-2018-13867.patch Patch5: CVE-2018-14031.patch Patch6: CVE-2018-16438.patch Patch7: CVE-2019-8396.patch Patch8: CVE-2020-10812.patch Patch9: CVE-2021-37501.patch BuildRequires: gcc, gcc-c++ BuildRequires: krb5-devel, openssl-devel, zlib-devel, gcc-gfortran, time BuildRequires: automake libtool BuildRequires: openssh-clients BuildRequires: libaec-devel %description HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, viewing, and analyzing data in the HDF5 format. %package devel Summary: HDF5 development files Provides: hdf5-static = %{version}-%{release} Obsoletes: hdf5-static < %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: libaec-devel%{?_isa} Requires: zlib-devel%{?_isa} Requires: gcc-gfortran%{?_isa} %description devel HDF5 development headers and libraries. %if %{with_mpich} %package mpich Summary: HDF5 mpich libraries BuildRequires: mpich-devel Provides: %{name}-mpich2 = %{version}-%{release} Obsoletes: %{name}-mpich2 < %{version}-%{release} %description mpich HDF5 parallel mpich libraries %package mpich-devel Summary: HDF5 mpich development files Requires: %{name}-mpich%{?_isa} = %{version}-%{release} Requires: libaec-devel%{?_isa} Requires: zlib-devel%{?_isa} Requires: mpich-devel%{?_isa} Provides: %{name}-mpich2-devel = %{version}-%{release} Obsoletes: %{name}-mpich2-devel < %{version}-%{release} %description mpich-devel HDF5 parallel mpich development files %package mpich-static Summary: HDF5 mpich static libraries Requires: %{name}-mpich-devel%{?_isa} = %{version}-%{release} Provides: %{name}-mpich2-static = %{version}-%{release} Obsoletes: %{name}-mpich2-static < %{version}-%{release} %description mpich-static HDF5 parallel mpich static libraries %endif %if %{with_openmpi} %package openmpi Summary: HDF5 openmpi libraries BuildRequires: openmpi-devel %description openmpi HDF5 parallel openmpi libraries %package openmpi-devel Summary: HDF5 openmpi development files Requires: %{name}-openmpi%{?_isa} = %{version}-%{release} Requires: libaec-devel%{?_isa} Requires: zlib-devel%{?_isa} Requires: openmpi-devel%{?_isa} %description openmpi-devel HDF5 parallel openmpi development files %package openmpi-static Summary: HDF5 openmpi static libraries Requires: %{name}-openmpi-devel%{?_isa} = %{version}-%{release} %description openmpi-static HDF5 parallel openmpi static libraries %endif %prep %autosetup -n %{name}-%{version} -p1 sed -i -e '/^STATIC_AVAILABLE=/s/=.*/=no/' */*/h5[cf]*.in autoreconf -f -i sed -e 's|-O -finline-functions|-O3 -finline-functions|g' -i config/gnu-flags %build %global _configure ../configure %global configure_opts \\\ --disable-silent-rules \\\ --enable-fortran \\\ --enable-fortran2003 \\\ --enable-hl \\\ --enable-shared \\\ --with-szlib \\\ %{nil} export CC=gcc export CXX=g++ export F9X=gfortran export LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" mkdir build pushd build ln -s ../configure . %configure \ %{configure_opts} \ --enable-cxx sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool make %{?_smp_mflags} LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" FCFLAGS="$FCFLAGS -fallow-argument-mismatch -fallow-invalid-boz" popd export CC=mpicc export CXX=mpicxx export F9X=mpif90 export LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" for mpi in %{?mpi_list} do mkdir $mpi pushd $mpi module load mpi/$mpi-%{_arch} ln -s ../configure . %configure \ %{configure_opts} \ FCFLAGS="$FCFLAGS -I$MPI_FORTRAN_MOD_DIR -fallow-argument-mismatch -fallow-invalid-boz" \ --enable-parallel \ --exec-prefix=%{_libdir}/$mpi \ --libdir=%{_libdir}/$mpi/lib \ --bindir=%{_libdir}/$mpi/bin \ --sbindir=%{_libdir}/$mpi/sbin \ --includedir=%{_includedir}/$mpi-%{_arch} \ --datarootdir=%{_libdir}/$mpi/share \ --mandir=%{_libdir}/$mpi/share/man sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool make %{?_smp_mflags} LDFLAGS="%{__global_ldflags} -fPIC -Wl,-z,now -Wl,--as-needed" module purge popd done %install %make_install -C build %delete_la mkdir -p ${RPM_BUILD_ROOT}%{_fmoddir} mv ${RPM_BUILD_ROOT}%{_includedir}/*.mod ${RPM_BUILD_ROOT}%{_fmoddir} for mpi in %{?mpi_list} do module load mpi/$mpi-%{_arch} make -C $mpi install DESTDIR=${RPM_BUILD_ROOT} rm $RPM_BUILD_ROOT/%{_libdir}/$mpi/lib/*.la #Fortran modules mkdir -p ${RPM_BUILD_ROOT}${MPI_FORTRAN_MOD_DIR} mv ${RPM_BUILD_ROOT}%{_includedir}/${mpi}-%{_arch}/*.mod ${RPM_BUILD_ROOT}${MPI_FORTRAN_MOD_DIR}/ module purge done find ${RPM_BUILD_ROOT}%{_datadir} \( -name '*.[ch]*' -o -name '*.f90' \) -exec chmod -x {} + %ifarch x86_64 sed -i -e s/H5pubconf.h/H5pubconf-64.h/ ${RPM_BUILD_ROOT}%{_includedir}/H5public.h mv ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf.h \ ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf-64.h for x in h5c++ h5cc h5fc do mv ${RPM_BUILD_ROOT}%{_bindir}/${x} \ ${RPM_BUILD_ROOT}%{_bindir}/${x}-64 install -m 0755 %SOURCE1 ${RPM_BUILD_ROOT}%{_bindir}/${x} done %else sed -i -e s/H5pubconf.h/H5pubconf-32.h/ ${RPM_BUILD_ROOT}%{_includedir}/H5public.h mv ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf.h \ ${RPM_BUILD_ROOT}%{_includedir}/H5pubconf-32.h for x in h5c++ h5cc h5fc do mv ${RPM_BUILD_ROOT}%{_bindir}/${x} \ ${RPM_BUILD_ROOT}%{_bindir}/${x}-32 install -m 0755 %SOURCE1 ${RPM_BUILD_ROOT}%{_bindir}/${x} done %endif mkdir -p ${RPM_BUILD_ROOT}/%{_rpmmacrodir} cat > ${RPM_BUILD_ROOT}/%{_rpmmacrodir}/macros.hdf5 < - 1.12.1-4 - Preserve the rpath of the hdf5-openmpi and hdf5-mpich subpackages * Mon Apr 10 2023 xu_ping <707078654@qq.com> - 1.12.1-3 - fix some commands failed * Tue Mar 28 2023 yaoxin - 1.12.1-2 - Fix CVE-2018-13867,CVE-2018-14031,CVE-2018-16438,CVE-2019-8396,CVE-2020-10812 and CVE-2021-37501 * Thu Jun 23 2022 wulei - 1.12.1-1 - Upgrade to 1.12.1 * Tue May 10 2022 Ge Wang - 1.8.20-15 - License compliance rectification * Fri Sep 10 2021 wangyue - 1.8.20-14 - fix rpath error * Mon Aug 2 2021 liushaofei - 1.8.20-13 - fix incorrect arguments format * Thu Mar 25 2021 maminjie - 1.8.20-12 - Support parallel compilation * Fri Jan 15 2021 yanan li - 1.8.20-11 - add sub packages hdf5-openmpi-static, hdf5-openmpi-devel, hdf5-openmpi, - hdf5-mpich-static, hdf5-mpich-devel, hdf5-mpich * Mon Dec 14 2020 openEuler Buildteam - 1.8.20-10 - fix CVE-2017-17506 CVE-2018-17432 CVE-2018-17435 CVE-2018-13869 CVE-2018-13870 CVE-2018-13873 * Mon Nov 9 2020 wangxiao - 1.8.20-9 - fix CVE-2018-17233 CVE-2018-17234 CVE-2018-17237 CVE-2018-17434 CVE-2018-17437 CVE-2018-17438 * Tue Sep 15 2020 shaoqiang kang - 1.8.20-8 - Modify source * Tue Oct 22 2019 openEuler Buildteam - 1.8.20-7 - Package init