File gnu-compilers-ohpc.spec of Package gnu-compilers-ohpc

#
# spec file for package ohpc
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%{!?compiler_family: %global compiler_family gnu}

Summary:   OpenHPC %{compiler_family} environment
Name:      gnu-compilers-ohpc
Version:   1.2
Release:   1
License:   BSD-3-Clause and MIT

Group:     Development/Languages
URL:       https://github.com/openhpc/ohpc
Source0:   template.spec.in
Source1:   LICENSE
Source2:   rpmlintrc
Source3:   spec_fix.pl
Source4:   replacements
BuildRequires: lua-lmod
BuildArch: noarch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define ccversion %{version}
%description
Provides configuration for the %{compiler_family} compiler toolchain.

%define meta README.meta

%package devel
Summary:   Devel package for OpenHPC %{compiler_family} environment
BuildArch: noarch
Group:     Development/ohpc
%if %{compiler_family} == gnu
Requires: gcc gcc-fortran
Requires: %{name}
%endif

%description devel
Provides package dependencies for building with the %{compiler_family} 
compiler toolchain.

%prep

%build

%{__cp} %{S:1} .
%{__cat} <<EOF > %{meta}
%{name}-devel is a meta package to ensure installation of the 
${compiler_family} toolchain.
EOF

%install
%{__mkdir_p} %{buildroot}/%{lua_lmod_modulesdir}/%{compiler_family}
%{__cat} <<EOF > %{buildroot}/%{lua_lmod_modulesdir}/%{compiler_family}/%{ccversion}
#%%Module1.0#####################################################################

proc ModulesHelp { } {

puts stderr " "
puts stderr "This module loads the GNU compiler collection"
puts stderr " "
puts stderr "Consult the man pages for gcc, g++, and gfortran"
puts stderr "for detailed information on the commandline syntax"
puts stderr "and compiler options."
puts stderr " "

puts stderr "\nVersion %{ccversion}\n"

}
module-whatis "Name: GNU Compiler Collection"
module-whatis "Version: %{version}"
module-whatis "Category: compiler, runtime support"
module-whatis "Description: GNU Compiler Family (C/C++/Fortran for %_arch)"
module-whatis "URL: http://gcc.gnu.org"

set     version                     %{ccversion}
# nothing to do since gcc is in the default path
prepend-path    MODULEPATH          %{lua_lmod_moduledeps}/%{compiler_family}

family "compiler"

EOF

export ccversion=%{ccversion}
export compiler_family=%{compiler_family}
%{__cat} <<EOF > %{buildroot}/%{lua_lmod_modulesdir}/%{compiler_family}/.version.%{ccversion}
#%%Module1.0#####################################################################
##
## version file for ${compiler_family}-compilers-${ccversion}
##
set     ModulesVersion      "%{ccversion}"

EOF

%files
%defattr(-,root,root,-)
%doc LICENSE

%dir %{lua_lmod_modulesdir}/%{compiler_family}
%{lua_lmod_modulesdir}/%{compiler_family}/%{ccversion}
%{lua_lmod_modulesdir}/%{compiler_family}/.version.%{ccversion}

%files devel
%defattr(-,root,root,-)
%doc %{meta}

%changelog
openSUSE Build Service is sponsored by