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 |
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 |
|
|
|
29 |
|
|
source %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
|
30 |
|
|
source %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
|
31 |
eulisse |
1.1 |
EOF_CMSSET_DEFAULT_SH
|
32 |
|
|
|
33 |
|
|
cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
|
34 |
|
|
setenv PATH %instroot/bin:$PATH
|
35 |
|
|
setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
|
36 |
|
|
setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
|
37 |
|
|
setenv SCRAM_ARCH `cmsos`
|
38 |
eulisse |
1.2 |
sentenv compilerv gcc323
|
39 |
|
|
switch ( $SCRAM_ARCH )
|
40 |
|
|
case slc3_ia32:
|
41 |
|
|
setenv compilerv gcc323
|
42 |
|
|
breaksw
|
43 |
|
|
case slc3_amd64:
|
44 |
|
|
setenv compilerv gcc345
|
45 |
|
|
breaksw
|
46 |
|
|
case osx104_ia32:
|
47 |
|
|
setenv compilerv gcc400
|
48 |
|
|
breaksw
|
49 |
|
|
case osx104_pcc32:
|
50 |
|
|
setenv compilerv gcc400
|
51 |
|
|
breaksw
|
52 |
|
|
endsw
|
53 |
|
|
|
54 |
|
|
. %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
|
55 |
|
|
. %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
|
56 |
eulisse |
1.1 |
EOF_CMSSET_DEFAULT_CSH
|
57 |
|
|
|
58 |
|
|
%post
|
59 |
|
|
echo $RPM_INSTALL_PREFIX
|
60 |
eulisse |
1.3 |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
|
61 |
|
|
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
|
62 |
|
|
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
|
63 |
|
|
%files
|
64 |
|
|
%i
|
65 |
|
|
%instroot/cmsset_default.sh
|
66 |
|
|
%instroot/cmsset_default.csh
|
67 |
|
|
%instroot/bin/cmsos
|