Accepting request 618379 from science

- Handle license file using %license where applicable.
- Package example package also for HPC build and create
  a master file for it. (forwarded request 618378 from eeich)

OBS-URL: https://build.opensuse.org/request/show/618379
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hdf5?expand=0&rev=46
This commit is contained in:
Dominique Leuenberger 2018-06-25 09:38:45 +00:00 committed by Git OBS Bridge
commit 97cb1447fe
2 changed files with 46 additions and 17 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jun 19 06:15:06 UTC 2018 - eich@suse.com
- Handle license file using %license where applicable.
- Package example package also for HPC build and create
a master file for it.
-------------------------------------------------------------------
Fri Apr 27 14:20:25 UTC 2018 - eich@suse.com

View File

@ -171,6 +171,7 @@ ExclusiveArch: do_not_build
%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
@ -187,6 +188,7 @@ ExclusiveArch: do_not_build
%define package_name %pname%{?my_suffix}
%endif
%define libname(l:s:) lib%{pname}%{!-l:%{-s:-}}%{-l*}%{-s*}%{?my_suffix}
%define vname %{pname}
%endif
# TODO: The so numbers autodetected by update_so_version.sh
@ -241,7 +243,7 @@ Requires: lib%{pname}hl_fortran%{sonum_HL_F} = %{version}
%hpc_requires
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
BuildRequires: lua-lmod
BuildRequires: suse-hpc
BuildRequires: suse-hpc >= 0.2
%if %{with mpi}
BuildRequires: %{mpi_flavor}%{?mpi_vers}-%{compiler_family}%{?c_f_ver}-hpc-macros-devel
%endif
@ -409,16 +411,18 @@ managing data. It supports an unlimited variety of datatypes.
This package provides the static libraries for the %{flavor} version of HDF5.
%package -n %{pname}-examples
%package -n %{vname}-examples
Summary: Examples for %{name}
Group: Documentation/Other
%description -n %{pname}-examples
%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}
@ -551,12 +555,19 @@ make V=1 %{?_smp_mflags}
%{?with_hpc:%hpc_debug}
make install DESTDIR=%{buildroot}
find %{buildroot} -type f -name "*.la" -delete -print
%if %{without mpi} && %{without hpc}
find %{buildroot}%{_datadir}/hdf5_examples -type f \
%if %{without mpi}
find %{buildroot}%{_prefix}/share/hdf5_examples -type f \
| grep -v ".sh$" | xargs chmod 644
%if %{with hpc}
# copy to versioned subdir
install -m 755 -d %{buildroot}%{_prefix}/share/%{version}
mv %{buildroot}%{_prefix}/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}%{_sysconfdir}/rpm
cat > %{buildroot}%{_sysconfdir}/rpm/macros.hdf5 <<EOF
@ -566,9 +577,10 @@ cat > %{buildroot}%{_sysconfdir}/rpm/macros.hdf5 <<EOF
%_hdf5_sonum %{sonum}
%_hdf5_version %{version}
EOF
%endif
%else
# delete examples from parallel builds
rm -rf %{buildroot}%{_datadir}/hdf5_examples
rm -rf %{buildroot}%{_prefix}/share/hdf5_examples
%endif
%if 0%{?suse_version} >= 1110
@ -666,15 +678,24 @@ export HDF5_Make_Ignore=yes
%hpc_module_delete_if_default
%endif
%if %{without mpi} && %{without hpc}
%files -n %{pname}-examples
%defattr(-,root,root)
%{_datadir}/hdf5_examples
%if 0%{?sle_version} > 120200 || 0%{?suse_version} > 1320
%define mylicense %license
%else
%define mylicense %doc
%endif
%if %{without mpi}
%files -n %{vname}-examples
%defattr(-,root,root)
%{?with_hpc:%dir %{_prefix}/share/hdf5_examples}
%{_prefix}/share/hdf5_examples%{?with_hpc:/%{version}}
%if %{without hpc}
%files -n %{pname}-devel-data
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/rpm/macros.hdf5
%endif
%endif
%files -n %{name}
%defattr(-,root,root)
@ -705,7 +726,8 @@ export HDF5_Make_Ignore=yes
%files -n %{libname -s %{sonum}}
%defattr(-,root,root)
%doc COPYING ACKNOWLEDGMENTS README.txt
%doc ACKNOWLEDGMENTS README.txt
%mylicense COPYING
##
%if %{without mpi}
%doc release_docs/HISTORY-1_8_0-1_10_0.txt
@ -718,7 +740,7 @@ export HDF5_Make_Ignore=yes
%files -n %{libname -l _hl -s %{sonum_HL}}
%defattr(-,root,root)
%doc COPYING
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_hl.so.%{sonum_HL}
@ -727,7 +749,7 @@ export HDF5_Make_Ignore=yes
%if %{without mpi}
%files -n %{libname -l _cpp -s %{sonum_CXX}}
%defattr(-,root,root)
%doc COPYING
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_cpp.so.%{sonum_CXX}
@ -735,7 +757,7 @@ export HDF5_Make_Ignore=yes
%files -n %{libname -l _hl_cpp -s %{sonum_HL_CXX}}
%defattr(-,root,root)
%doc COPYING
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_hl_cpp.so.%{sonum_HL_CXX}
@ -744,7 +766,7 @@ export HDF5_Make_Ignore=yes
%files -n %{libname -l _fortran -s %{sonum_F}}
%defattr(-,root,root)
%doc COPYING
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5_fortran.so.%{sonum_F}
@ -752,7 +774,7 @@ export HDF5_Make_Ignore=yes
%files -n %{libname -l hl_fortran -s %{sonum_HL_F}}
%defattr(-,root,root)
%doc COPYING
%mylicense COPYING
%defattr(0755,root,root)
%{?with_hpc:%hpc_dirs}
%{my_libdir}/libhdf5hl_fortran.so.%{sonum_HL_F}