- 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:
Egbert Eich 2017-11-20 20:03:10 +00:00 committed by Git OBS Bridge
parent 0bda09e250
commit 1bcc9c7ab4
3 changed files with 20 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<param name="exclude">.git</param> <param name="exclude">.git</param>
<param name="filename">suse-hpc</param> <param name="filename">suse-hpc</param>
<param name="versionformat">0.1.%h</param> <param name="versionformat">0.1.%h</param>
<param name="revision">960d92268df13a0806254c325e3e72e135268c77</param> <param name="revision">10f46e14ff638192561d1de900eef46bdd9bb2eb</param>
<param name="extract">general/dlinfo.c</param> <param name="extract">general/dlinfo.c</param>
<param name="extract">general/macros.hpc</param> <param name="extract">general/macros.hpc</param>
<param name="extract">general/hpc_elf.pl</param> <param name="extract">general/hpc_elf.pl</param>

View File

@ -87,8 +87,9 @@ EOF\
%hpc_mpi_requires_devel %{expand:%{hpc_%{hpc_mpi_family}_requires_devel}} %hpc_mpi_requires_devel %{expand:%{hpc_%{hpc_mpi_family}_requires_devel}}
# Base # Base
%hpc_requires %{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_requires}}\ %hpc_requires Requires: lua-lmod \
%{?hpc_mpi_family:%{!?_hpc_build_mpi:%hpc_mpi_requires}} %{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_requires}}\
%{?hpc_mpi_family:%{!?_hpc_build_mpi:%hpc_mpi_requires}}\
# Devel # Devel
%hpc_requires_devel %{?hpc_compiler_family:%{!?_hpc_build_compiler:%hpc_cf_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 # Functions
## ##
%hpc_upcase() %(echo %{**} | tr [a-z] [A-Z]) %hpc_upcase() %(echo %{**} | tr [a-z] [A-Z])
%hpc_PNAME() %(echo %{**} | tr [a-z-] [A-Z_])
## ##
# Macros specific for python packages # 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 a_arg = rpm.expand("%{?-a:-a}") \
local other_arg = rpm.expand("%{*}") \ local other_arg = rpm.expand("%{*}") \
local pname = rpm.expand("%pname") \ local pname = rpm.expand("%pname") \
local name = rpm.expand("%name") \
local python_flavor = rpm.expand("%python_flavor") \ local python_flavor = rpm.expand("%python_flavor") \
-- io.stderr:write("n_arg "..n_arg.."\\n") \ -- io.stderr:write("n_arg "..n_arg.."\\n") \
if n_arg ~= "" then \ 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") \ -- io.stderr:write("n_arg modfied "..n_arg .."\\n") \
end \ end \
local n_pname = pname:gsub("^python", python_flavor,1) \ 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("pname "..n_pname) \
rpm.define("name "..n_name) \
add_args (g_arg, "-g") \ add_args (g_arg, "-g") \
add_args (n_arg, "-n") \ add_args (n_arg, "-n") \
add_args (l_arg) \ 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! \ -- skip it entirely! \
if _hpc_python_package_list[package] == true then \ if _hpc_python_package_list[package] == true then \
rpm.define("pname " .. pname) \ rpm.define("pname " .. pname) \
rpm.define("name " .. name) \
return \ return \
else \ else \
_hpc_python_package_list[package] = true \ _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") \ io.stderr:write("%{hpc_master_package " .. arg_list .. "}\\n\\n") \
print(rpm.expand("%{hpc_master_package " .. arg_list .. "}") .."\\n") \ print(rpm.expand("%{hpc_master_package " .. arg_list .. "}") .."\\n") \
rpm.define("pname " .. pname) \ rpm.define("pname " .. pname) \
rpm.define("name " .. name) \
-- io.stderr:write("pname "..rpm.expand("%pname").."\\n\\n") \ -- io.stderr:write("pname "..rpm.expand("%pname").."\\n\\n") \
} }

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Nov 20 18:44:42 UTC 2017 - eich@suse.com
- 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 '_'.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Oct 19 11:44:50 UTC 2017 - eich@suse.com Thu Oct 19 11:44:50 UTC 2017 - eich@suse.com