@@ -21,7 +21,7 @@ Release: %{?dist}.1
2121License: MIT
2222Group: %{PROJ_NAME }/admin
2323Url: https://github.com/TACC/Lmod
24- Source0: https://github.com/TACC/Lmod/archive/%{version }.tar.gz# $ /%{pname}-%{version}.tar.gz
24+ Source0: https://github.com/TACC/Lmod/archive/%{version }/%{pname }-%{version }.tar.gz
2525
2626BuildRequires: rsync
2727BuildRequires: tcl-devel
@@ -86,7 +86,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
8686# Customize startup script to suit
8787
8888%{__mkdir_p} %{buildroot }/%{_sysconfdir }/profile.d
89- %{__cat} << EOF > %{buildroot }/%{_sysconfdir }/profile.d/lmod.sh
89+ %{__cat} << ' EOF' > %{buildroot }/%{_sysconfdir }/profile.d/lmod.sh
9090#!/bin/sh
9191# -*- shell-script -*-
9292########################################################################
@@ -96,7 +96,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
9696########################################################################
9797
9898# NOOP if running under known resource manager
99- if [ ! -z "\ $SLURM_NODELIST" ] || [ ! -z "\ $PBS_NODEFILE" ]; then
99+ if [ ! -z "$SLURM_NODELIST" ] || [ ! -z "$PBS_NODEFILE" ]; then
100100 return
101101fi
102102
@@ -105,17 +105,17 @@ export LMOD_FULL_SETTARG_SUPPORT=no
105105export LMOD_COLORIZE= no
106106export LMOD_PREPEND_BLOCK= normal
107107
108- if [ \ $EUID -eq 0 ]; then
108+ if [ $EUID -eq 0 ]; then
109109 export MODULEPATH= %{OHPC_ADMIN }/modulefiles:%{OHPC_MODULES }
110110else
111111 export MODULEPATH= %{OHPC_MODULES }
112112fi
113113
114114# Add : to MANPATH to not drop default search paths, then safely append Lmod's
115115# man directory using addto helper
116- export MANPATH= "\ ${MANPATH}:"
116+ export MANPATH= "${MANPATH}:"
117117
118- export MANPATH= \ $(%{OHPC_ADMIN }/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN }/lmod/lmod/share/man)
118+ export MANPATH= $(%{OHPC_ADMIN }/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN }/lmod/lmod/share/man)
119119
120120# Set BASH_ENV for environment
121121export BASH_ENV= %{OHPC_ADMIN }/lmod/lmod/init/bash
@@ -128,7 +128,7 @@ module try-add ohpc
128128
129129EOF
130130
131- %{__cat} << EOF > %{buildroot }/%{_sysconfdir }/profile.d/lmod.csh
131+ %{__cat} << ' EOF' > %{buildroot }/%{_sysconfdir }/profile.d/lmod.csh
132132#!/bin/csh
133133# -*- shell-script -*-
134134########################################################################
@@ -137,11 +137,11 @@ EOF
137137#
138138########################################################################
139139
140- if ( \ $?SLURM_NODELIST ) then
140+ if ( $?SLURM_NODELIST ) then
141141 exit 0
142142endif
143143
144- if ( \ $?PBS_NODEFILE ) then
144+ if ( $?PBS_NODEFILE ) then
145145 exit 0
146146endif
147147
@@ -151,15 +151,19 @@ setenv LMOD_COLORIZE "no"
151151setenv LMOD_PREPEND_BLOCK "normal"
152152
153153
154- if ( \ `id -u\ ` == "0" ) then
154+ if ( `id -u` == "0" ) then
155155 setenv MODULEPATH "%{OHPC_ADMIN }/modulefiles:%{OHPC_MODULES }"
156156else
157157 setenv MODULEPATH "%{OHPC_MODULES }"
158158endif
159159
160160# Add : to MANPATH to not drop default search paths, then safely append Lmod's
161161# man directory using addto helper
162- setenv MANPATH "\${MANPATH}:"
162+ if ( $?MANPATH ) then
163+ setenv MANPATH "${MANPATH}:"
164+ else
165+ setenv MANPATH ":"
166+ endif
163167setenv MANPATH `%{OHPC_ADMIN }/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN }/lmod/lmod/share/man`
164168
165169# Initialize modules system
0 commit comments