SHA256
1
0
forked from pool/suse-hpc

- Add lua-lmod to the HPC base Requires

- Fix %name in %hpc_python_master_package
  Not only %pname but also %name needs to have python replaced
  by %python_flavor.
- Add macro to santize %pname for environment variables
  This marco up-cases the name and replaces '-' by '_'.

OBS-URL: https://build.opensuse.org/package/show/science:HPC/suse-hpc?expand=0&rev=13
This commit is contained in:
2017-11-20 20:03:10 +00:00
committed by Git OBS Bridge
parent 7ec2537086
commit f0e6739e57
3 changed files with 20 additions and 3 deletions

View File

@@ -87,8 +87,9 @@ EOF\
%hpc_mpi_requires_devel %{expand:%{hpc_%{hpc_mpi_family}_requires_devel}}
# Base
%hpc_requires %{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_requires}}\
%{?hpc_mpi_family:%{!?_hpc_build_mpi:%hpc_mpi_requires}}
%hpc_requires Requires: lua-lmod \
%{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_requires}}\
%{?hpc_mpi_family:%{!?_hpc_build_mpi:%hpc_mpi_requires}}\
# Devel
%hpc_requires_devel %{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_requires_devel}}\
@@ -418,6 +419,7 @@ The package %{n_name}%{_p_ext} provides the dependency to get the latest version
# Functions
##
%hpc_upcase() %(echo %{**} | tr [a-z] [A-Z])
%hpc_PNAME() %(echo %{**} | tr [a-z-] [A-Z_])
##
# Macros specific for python packages
@@ -464,6 +466,7 @@ The package %{n_name}%{_p_ext} provides the dependency to get the latest version
local a_arg = rpm.expand("%{?-a:-a}") \
local other_arg = rpm.expand("%{*}") \
local pname = rpm.expand("%pname") \
local name = rpm.expand("%name") \
local python_flavor = rpm.expand("%python_flavor") \
-- io.stderr:write("n_arg "..n_arg.."\\n") \
if n_arg ~= "" then \
@@ -471,7 +474,9 @@ The package %{n_name}%{_p_ext} provides the dependency to get the latest version
-- io.stderr:write("n_arg modfied "..n_arg .."\\n") \
end \
local n_pname = pname:gsub("^python", python_flavor,1) \
local n_name = name:gsub("^python", python_flavor,1) \
rpm.define("pname "..n_pname) \
rpm.define("name "..n_name) \
add_args (g_arg, "-g") \
add_args (n_arg, "-n") \
add_args (l_arg) \
@@ -487,6 +492,7 @@ The package %{n_name}%{_p_ext} provides the dependency to get the latest version
-- skip it entirely! \
if _hpc_python_package_list[package] == true then \
rpm.define("pname " .. pname) \
rpm.define("name " .. name) \
return \
else \
_hpc_python_package_list[package] = true \
@@ -497,6 +503,7 @@ The package %{n_name}%{_p_ext} provides the dependency to get the latest version
io.stderr:write("%{hpc_master_package " .. arg_list .. "}\\n\\n") \
print(rpm.expand("%{hpc_master_package " .. arg_list .. "}") .."\\n") \
rpm.define("pname " .. pname) \
rpm.define("name " .. name) \
-- io.stderr:write("pname "..rpm.expand("%pname").."\\n\\n") \
}