ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-env.spec
Revision: 1.4
Committed: Fri Jun 16 12:15:00 2006 UTC (18 years, 10 months ago) by eulisse
Branch: MAIN
CVS Tags: V00-01-2, V00-01-01, V00-01-00
Changes since 1.3: +28 -9 lines
Log Message:
Fixes csh missbehaviour

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 eulisse 1.4 SCRAM_ARCH=$(cmsos)
18 eulisse 1.2
19     # We need to assume 1 compiler per platform.
20     # There is no other way around this.
21     case $SCRAM_ARCH in
22     slc3_ia32) compilerv=gcc323;;
23     slc3_amd64) compilerv=gcc345;;
24     osx104_ia32) compilerv=gcc400;;
25     osx104_pcc32) compilerv=gcc400;;
26     esac
27     SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
28 eulisse 1.4 export SCRAM_ARCH
29 eulisse 1.2
30     source %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
31     source %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
32 eulisse 1.1 EOF_CMSSET_DEFAULT_SH
33    
34     cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
35 eulisse 1.4 if (${?PATH}) then
36     setenv PATH %instroot/bin:$PATH
37     else
38     setenv PATH %instroot/bin
39     endif
40    
41     if (${?LD_LIBRARY_PATH}) then
42     setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
43     else
44     setenv LD_LIBRARY_PATH %instroot/lib
45     endif
46    
47     if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
48     setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
49     else
50     setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
51     endif
52    
53     setenv CMSOSCOMMAND `which cmsos`
54     setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
55     setenv compilerv gcc323
56     switch ( ${SCRAM_ARCH} )
57 eulisse 1.2 case slc3_ia32:
58     setenv compilerv gcc323
59     breaksw
60     case slc3_amd64:
61     setenv compilerv gcc345
62     breaksw
63     case osx104_ia32:
64     setenv compilerv gcc400
65     breaksw
66     case osx104_pcc32:
67     setenv compilerv gcc400
68     breaksw
69     endsw
70    
71 eulisse 1.4 setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
72    
73     source %instroot/${SCRAM_ARCH}/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
74     source %instroot/${SCRAM_ARCH}/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
75 eulisse 1.1 EOF_CMSSET_DEFAULT_CSH
76    
77     %post
78     echo $RPM_INSTALL_PREFIX
79 eulisse 1.3 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
80     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
81     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
82     %files
83     %i
84     %instroot/cmsset_default.sh
85     %instroot/cmsset_default.csh
86     %instroot/bin/cmsos