11 |
|
install -m 755 %_sourcedir/cmsos %instroot/bin/cmsos |
12 |
|
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d |
13 |
|
|
14 |
+ |
### BASH code |
15 |
+ |
|
16 |
|
cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh |
17 |
|
export PATH=%instroot/bin:$PATH |
18 |
|
export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH |
30 |
|
SCRAM_ARCH=${SCRAM_ARCH}_$compilerv |
31 |
|
export SCRAM_ARCH |
32 |
|
|
33 |
< |
here=`dirname $0` |
33 |
> |
if [ "$VO_CMS_SW_DIR" != "" ] |
34 |
> |
then |
35 |
> |
here=$VO_CMS_SW_DIR |
36 |
> |
else |
37 |
> |
here=`dirname $0` |
38 |
> |
|
39 |
> |
if [ "$OSG_APP" != "" ] |
40 |
> |
then |
41 |
> |
here=$OSG_APP/cmssoft/cms |
42 |
> |
fi |
43 |
> |
fi |
44 |
> |
|
45 |
> |
if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ] |
46 |
> |
then |
47 |
> |
echo "Your shell is not able to find where cmsset_default.sh is. Either cd into the directory where it is or move to zsh" |
48 |
> |
exit 1 |
49 |
> |
fi |
50 |
> |
|
51 |
|
for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'` |
52 |
|
do |
53 |
|
source $here/${SCRAM_ARCH}/etc/profile.d/$pkg |
54 |
|
done |
55 |
< |
|
55 |
> |
export CMS_PATH=$here |
56 |
|
EOF_CMSSET_DEFAULT_SH |
57 |
|
|
58 |
+ |
|
59 |
+ |
### CSH code |
60 |
+ |
|
61 |
|
cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh |
62 |
|
|
63 |
|
if (${?PATH}) then |
101 |
|
setenv here $VO_CMS_SW_DIR |
102 |
|
else |
103 |
|
setenv here . |
104 |
+ |
# OSG |
105 |
+ |
if ( ${?OSG_APP} ) then |
106 |
+ |
setenv here $OSG_APP/cmssoft/cms |
107 |
+ |
endif |
108 |
+ |
# OSG |
109 |
|
endif |
110 |
|
|
111 |
|
if ( ! -e $here/cmsset_default.csh ) then |
115 |
|
foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` ) |
116 |
|
source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg |
117 |
|
end |
118 |
< |
|
118 |
> |
setenv CMS_PATH $here |
119 |
|
EOF_CMSSET_DEFAULT_CSH |
120 |
|
|
121 |
|
%pre |