ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-env.spec
Revision: 1.5
Committed: Wed Jun 21 09:05:04 2006 UTC (18 years, 10 months ago) by eulisse
Branch: MAIN
Changes since 1.4: +14 -5 lines
Log Message:
- Dependency on SCRAM/SCRAMV1 removed...
- Now cmsset_default is pluggable. Packages that provide a link to their
  init.sh/init.csh in %cmsplatf/etc/profile.d/etc get it sourced. By default
  the environment is empty.

File Contents

# User Rev Content
1 eulisse 1.1 ### RPM cms cms-env 1.0
2     Source: cmsos
3     %prep
4     %build
5     echo $SCRAM_ROOT
6     %install
7     %define scramroot %(echo $SCRAM_ROOT)
8     %define scramv1root %(echo $SCRAMV1_ROOT)
9    
10     mkdir -p %instroot/bin
11     install -m 755 %_sourcedir/cmsos %instroot/bin/cmsos
12 eulisse 1.5 mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
13    
14 eulisse 1.1 cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
15     export PATH=%instroot/bin:$PATH
16     export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
17     export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
18 eulisse 1.4 SCRAM_ARCH=$(cmsos)
19 eulisse 1.2
20     # We need to assume 1 compiler per platform.
21     # There is no other way around this.
22     case $SCRAM_ARCH in
23     slc3_ia32) compilerv=gcc323;;
24     slc3_amd64) compilerv=gcc345;;
25     osx104_ia32) compilerv=gcc400;;
26     osx104_pcc32) compilerv=gcc400;;
27     esac
28     SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
29 eulisse 1.4 export SCRAM_ARCH
30 eulisse 1.2
31 eulisse 1.5 here=`dirname $0`
32     for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
33     do
34     source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
35     done
36    
37 eulisse 1.1 EOF_CMSSET_DEFAULT_SH
38    
39     cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
40 eulisse 1.4 if (${?PATH}) then
41     setenv PATH %instroot/bin:$PATH
42     else
43     setenv PATH %instroot/bin
44     endif
45    
46     if (${?LD_LIBRARY_PATH}) then
47     setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
48     else
49     setenv LD_LIBRARY_PATH %instroot/lib
50     endif
51    
52     if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
53     setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
54     else
55     setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
56     endif
57    
58     setenv CMSOSCOMMAND `which cmsos`
59     setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
60     setenv compilerv gcc323
61     switch ( ${SCRAM_ARCH} )
62 eulisse 1.2 case slc3_ia32:
63     setenv compilerv gcc323
64     breaksw
65     case slc3_amd64:
66     setenv compilerv gcc345
67     breaksw
68     case osx104_ia32:
69     setenv compilerv gcc400
70     breaksw
71     case osx104_pcc32:
72     setenv compilerv gcc400
73     breaksw
74     endsw
75    
76 eulisse 1.4 setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
77 eulisse 1.5 setenv here `dirname $0`
78    
79     foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
80     source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
81     end
82 eulisse 1.4
83 eulisse 1.1 EOF_CMSSET_DEFAULT_CSH
84    
85     %post
86     echo $RPM_INSTALL_PREFIX
87 eulisse 1.3 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
88     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
89     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
90     %files
91     %i
92     %instroot/cmsset_default.sh
93     %instroot/cmsset_default.csh
94     %instroot/bin/cmsos
95 eulisse 1.5 %instroot/%cmsplatf/etc/profile.d