- Create separate compiler version dependent packages

to make sure the correct compiler version is installed.

OBS-URL: https://build.opensuse.org/package/show/science:HPC/gnu-compilers-hpc?expand=0&rev=10
This commit is contained in:
Egbert Eich 2018-01-29 21:23:08 +00:00 committed by Git OBS Bridge
parent 31dcbe4d43
commit fa17ee7a96
2 changed files with 57 additions and 14 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 29 21:22:16 UTC 2018 - eich@suse.com
- Create separate compiler version dependent packages
to make sure the correct compiler version is installed.
-------------------------------------------------------------------
Fri Nov 10 20:17:48 UTC 2017 - eich@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package compilers-hpc
# spec file for package gnu
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -41,6 +41,7 @@ ExclusiveArch: do_not_build
%global hpc_gnu_full_version %( gcc%{hpc_gnu_bin_version} --version |\
head -1 |\
sed -e "s#.* \\([0-9]\\+\\.[0-9.]\\+\\)\\(\$\\| .*\\)#\\1#" )
%global _hpc_gnu_full_version %(echo %hpc_gnu_full_version | tr "." "_")
%global hpc_gnu_dep_version %(HPC_CF_FULL_VERSION=%hpc_gnu_full_version; \
echo ${HPC_CF_FULL_VERSION%.*})
%global hpc_gnu_pack_version %{?c_f_ver}
@ -49,7 +50,7 @@ ExclusiveArch: do_not_build
Summary: SUSE HPC GNU Compiler Toolchain environment
License: BSD-3-Clause
Group: Development/Languages
Group: Development/Tools/Other
Name: %myname
Version: 1.3
Release: 0
@ -59,33 +60,52 @@ Source0: https://raw.githubusercontent.com/openSUSE/hpc/master/compiler/m
Source1: LICENSE
Source2: gnu-compilers-hpc-rpmlintrc
Source3: _multibuild
BuildRequires: gcc%{?c_f_ver}
BuildRequires: lua-lmod
BuildRequires: suse-hpc
Requires: lua-lmod
BuildArch: noarch
Requires: gnu-compilers_%{_hpc_gnu_full_version} = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Provides HPC-compatible setup and configuration for the GNU compiler toolchain.
%define meta README.meta
%define meta_devel README.meta-devel
%package -n gnu-compilers_%{_hpc_gnu_full_version}
Summary: SUSE HPC GNU Compiler Toolchain environment
Group: Development/Tools/Other
BuildArch: noarch
BuildRequires: gcc%{?c_f_ver}
BuildRequires: lua-lmod
BuildRequires: suse-hpc
Requires: lua-lmod
%description -n gnu-compilers_%{_hpc_gnu_full_version}
Package for environment modules for the GNU toolchain version %{hpc_gnu_full_version}.
%package devel
Summary: Devel package for HPC GNU compiler environment
Group: Development/Languages
Group: Development/Tools/Other
BuildArch: noarch
Requires: %{name} = %{version}
Requires: gcc%{hpc_cf_pack_version}
Requires: gcc%{hpc_cf_pack_version}-c++
Requires: gcc%{hpc_cf_pack_version}-fortran
Requires: gnu-compilers_%{_hpc_gnu_full_version}-devel = %{version}
%description devel
Provides master dependency package for building with the GNU compiler toolchain.
%package -n gnu-compilers_%{_hpc_gnu_full_version}-devel
Summary: Devel package for HPC GNU compiler environment
Group: Development/Tools/Other
BuildArch: noarch
Requires: gcc%{hpc_cf_pack_version} = %{hpc_gnu_full_version}
Requires: gcc%{hpc_cf_pack_version}-c++ = %{hpc_gnu_full_version}
Requires: gcc%{hpc_cf_pack_version}-fortran = %{hpc_gnu_full_version}
%description -n gnu-compilers_%{_hpc_gnu_full_version}-devel
Provides package dependencies for building with the GNU compiler toolchain.
%package macros-devel
Summary: Macro package for HPC GNU compiler environment
Group: Development/Languages
Group: Development/Tools/Other
Provides: %{pname}-hpc-macros-devel = %{version}
Conflicts: otherproviders(%{pname}-hpc-macros-devel)
BuildArch: noarch
@ -99,7 +119,17 @@ Provides macros for building HPC compliant RPM with the GNU compiler toolchain.
%build
%{__cat} <<EOF > %{meta}
%{name}-devel is a meta package to ensure installation of the
%{name} is a dependency package to ensure installation of the
gnu toolchain.
EOF
%{__cat} <<EOF > %{meta_devel}
%{name}-devel is a dependency package to ensure installation of the
gnu toolchain.
EOF
%{__cat} <<EOF > %{meta_devel}_%{_hpc_gnu_full_version}
%{name}_%{_hpc_gnu_full_version}-devel is a meta package to ensure installation of the
gnu toolchain.
EOF
@ -190,6 +220,9 @@ done
%files
%defattr(-,root,root,-)
%doc %{meta}
%files -n gnu-compilers_%{_hpc_gnu_full_version}
%doc LICENSE
%dir %{lua_lmod_modulesdir}/%{pname}
%dir %{hpc_modulepath}
@ -201,7 +234,11 @@ done
%files devel
%defattr(-,root,root,-)
%doc %{meta}
%doc %{meta_devel}
%files -n gnu-compilers_%{_hpc_gnu_full_version}-devel
%defattr(-,root,root,-)
%doc %{meta_devel}_%{_hpc_gnu_full_version}
%files macros-devel
%defattr(-,root,root,-)