ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-env.spec
Revision: 1.1
Committed: Tue Jun 13 09:48:18 2006 UTC (18 years, 10 months ago) by eulisse
Branch: MAIN
Log Message:
Creates cmsset_default.(c)sh in $RPM_INSTALL_PREFIX. Sourcing such a file will:

-detect the architecture (it uses the same cmsos command which is used widely
by install.sh)
-set the SCRAM_ARCH
-add $RPM_INSTALL_PREFIX/bin and lib to PATH/LD_LIBRARY_PATH
-source init.sh for scram and scramv1

File Contents

# User Rev Content
1 eulisse 1.1 ### RPM cms cms-env 1.0
2     Source: cmsos
3     Requires: SCRAM SCRAMV1
4     %prep
5     %build
6     echo $SCRAM_ROOT
7     %install
8     %define scramroot %(echo $SCRAM_ROOT)
9     %define scramv1root %(echo $SCRAMV1_ROOT)
10    
11     mkdir -p %instroot/bin
12     install -m 755 %_sourcedir/cmsos %instroot/bin/cmsos
13     cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
14     export PATH=%instroot/bin:$PATH
15     export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
16     export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
17     SCRAM_ARCH=$(cmsos); export SCRAM_ARCH
18     source %instroot/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
19     source %instroot/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
20     EOF_CMSSET_DEFAULT_SH
21    
22     cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
23     setenv PATH %instroot/bin:$PATH
24     setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
25     setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
26     setenv SCRAM_ARCH `cmsos`
27     . %instroot/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
28     . %instroot/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
29     EOF_CMSSET_DEFAULT_CSH
30    
31     %post
32     echo $RPM_INSTALL_PREFIX
33     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/cmsset_default.sh
34     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/cmsset_default.csh
35     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/bin/cmsos