ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/boost.spec
(Generate patch)

Comparing COMP/CMSDIST/boost.spec (file contents):
Revision 1.41 by eulisse, Thu Feb 12 13:14:59 2009 UTC vs.
Revision 1.55 by muzaffar, Tue Apr 20 08:32:32 2010 UTC

# Line 1 | Line 1
1 < ### RPM external boost 1.38.0
1 > ### RPM external boost 1.42.0
2   %define boostver _%(echo %realversion | tr . _)
3   Source: http://internap.dl.sourceforge.net/sourceforge/%{n}/%{n}%{boostver}.tar.gz
4 + %define closingbrace )
5 + %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo false;; esac)
6  
7   Requires: boost-build python bz2lib
8 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
8 > %if "%online" != "true"
9   Requires: zlib
10   %endif
11  
# Line 11 | Line 13 | Requires: zlib
13   %setup -n %{n}%{boostver}
14  
15   %build
14 # Note that some targets will fail to build (the test programs have
15 # missing symbols), causing darwin to fail to link and bjam to return
16 # an error.  So ignore the exit code from bjam on darwin to avoid
17 # RPM falsely detecting a problem.
16   PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')"
17   PR="PYTHON_ROOT=$PYTHON_ROOT"
18  
# Line 23 | Line 21 | PR="PYTHON_ROOT=$PYTHON_ROOT"
21   BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
22   BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
23  
24 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
24 > %if "%online" != "true"
25   ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib"
26   ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
27  
28   case $(uname) in
29 <  Darwin )  bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin --toolset=darwin || true ;;
30 <  * )       bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;;
29 >  Darwin )  bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=darwin stage;;
30 >  * )       bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=gcc stage;;
31   esac
32   %else
33 < bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI -sTOOLS=gcc
33 > bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI toolset=gcc stage
34   %endif
35  
36   %install
39
40 linkgccver=%(echo %gccver | tr -d . | perl -pe 's/^(\d\d).*/$1/')
41
42 boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//')
37   case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
38 < #no debug libs...
39 < #mkdir -p %i/lib/debug
40 < mkdir %i/lib
41 < #(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;)
42 < # Perhaps the following could be done with a wildcard for the darwin/gcc dir
43 < case $(uname) in
44 <  Darwin )
45 <    (cd bin.v2; find libs -path "libs/*/build/darwin*/release/*.$so*" -exec cp  {} %i/lib/. \;)
46 <    ;;
47 <   * )
48 <    (cd bin.v2; find libs -path "libs/*/build/gcc*/release/*.$so*" -exec cp  {} %i/lib/. \;)
49 <    ;;
50 < esac
51 < find boost -name '*.[hi]*' -print |
52 <  while read f; do
53 <    mkdir -p %i/include/$(dirname $f)
54 <    install -c $f %i/include/$f
55 <  done
62 < find libs -name '*.py' -print |
63 <  while read f; do
64 <    mkdir -p %i/lib/$(dirname $f)
65 <    install -c $f %i/lib/$f
66 <  done
67 < [ $(uname) = Darwin ] &&
68 <  for f in %i/lib/*.$so %i/lib/*.$so; do
69 <    install_name_tool -id $f $f
70 <  done
38 > mkdir -p %i/lib %i/include
39 > # copy files around in their final location.
40 > # We use tar to reduce the number of processes required
41 > # and because we need to build the build hierarchy for
42 > # the files that we are copying.
43 > pushd stage/lib
44 >  find . -name "*.$so*" -type f | tar cf - -T - | (cd %i/lib; tar xfp -)
45 > popd
46 > find boost -name '*.[hi]*' | tar cf - -T - | ( cd %i/include; tar xfp -)
47 >
48 > for l in `find %i/lib -name "*.$so.*"`
49 > do
50 >  ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"`
51 > done
52 >
53 > pushd libs/python/pyste/install
54 >  python setup.py install --prefix=%i
55 > popd
56  
57   # Do all manipulation with files before creating symbolic links:
58 < perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin)
74 < #strip %i/lib/*.$so
75 <
76 <
77 < #(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
78 < #(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%realversion ; done)
79 < (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/.%{realversion}$//"); done)
80 < (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/-$boost_abi//" | sed "s/.%{realversion}$//"); done)
81 < (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/-$boost_abi//" | sed "s/.%{realversion}$//" | sed "s/gcc$linkgccver/gcc/"); done)
82 < #(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done)
83 < #(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%realversion; done)
84 < (cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i)
58 > perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin -type f)
59  
60   getLibName()
61   {
62 <  libname=`find %i/lib -name "libboost_$1*mt*" -exec basename {} \;`
62 >  libname=`find %i/lib -name "libboost_$1.$so" -exec basename {} \;`
63    echo $libname | sed -e 's|[.][^-]*$||;s|^lib||'
64   }
65  
66   export BOOST_THREAD_LIB=`getLibName thread`
67   export BOOST_SIGNALS_LIB=`getLibName signals`
68   export BOOST_FILESYSTEM_LIB=`getLibName filesystem`
69 + export BOOST_SYSTEM_LIB=`getLibName system`
70   export BOOST_PROGRAM_OPTIONS_LIB=`getLibName program_options`
71   export BOOST_PYTHON_LIB=`getLibName python`
72   export BOOST_REGEX_LIB=`getLibName regex`
73 + export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.)
74  
75   # SCRAM ToolBox toolfile
76   mkdir -p %i/etc/scram.d
77   # boost toolfile
78 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost
79 < <doc type=BuildSystem::ToolDoc version=1.0>
80 < <Tool name=boost version=%v>
81 < <info url="http://www.boost.org"></info>
82 < <lib name="@BOOST_THREAD_LIB@">
83 < <lib name="@BOOST_SIGNALS_LIB@">
84 < <Client>
85 < <Environment name=BOOST_BASE default="%i"></Environment>
86 < <Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment>
87 < <Environment name=INCLUDE default="$BOOST_BASE/include"></Environment>
88 < </Client>
89 < <use name=sockets>
90 < <Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path>
91 < <Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path>
116 < </Tool>
78 > cat << \EOF_TOOLFILE >%i/etc/scram.d/%n.xml
79 >  <tool name="%n" version="%v">
80 >    <info url="http://www.boost.org"/>
81 >    <lib name="@BOOST_THREAD_LIB@"/>
82 >    <lib name="@BOOST_SIGNALS_LIB@"/>
83 >    <client>
84 >      <environment name="BOOST_BASE" default="%i"/>
85 >      <environment name="LIBDIR" default="$BOOST_BASE/lib"/>
86 >      <environment name="INCLUDE" default="$BOOST_BASE/include"/>
87 >    </client>
88 >    <runtime name="LD_LIBRARY_PATH" value="$BOOST_BASE/lib" type="path"/>
89 >    <runtime name="CMSSW_FWLITE_INCLUDE_PATH" value="$BOOST_BASE/include" type="path"/>
90 >    <use name="sockets"/>
91 >  </tool>
92   EOF_TOOLFILE
93  
94   # boost_filesystem toolfile
95 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem
96 < <doc type=BuildSystem::ToolDoc version=1.0>
97 < <Tool name=boost_filesystem version=%v>
98 < <info url="http://www.boost.org"></info>
99 < <lib name="@BOOST_FILESYSTEM_LIB@">
100 < <use name=boost>
101 < </Tool>
95 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem.xml
96 >  <tool name="boost_filesystem" version="%v">
97 >    <info url="http://www.boost.org"/>
98 >    <lib name="@BOOST_FILESYSTEM_LIB@"/>
99 >    <use name="boost_system"/>
100 >    <use name="boost"/>
101 >  </tool>
102 > EOF_TOOLFILE
103 >
104 > # boost_system toolfile
105 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system.xml
106 >  <tool name="boost_system" version="%v">
107 >    <info url="http://www.boost.org"/>
108 >    <lib name="@BOOST_SYSTEM_LIB@"/>
109 >    <use name="boost"/>
110 >  </tool>
111   EOF_TOOLFILE
112  
113   # boost_program_options toolfile
114 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options
115 < <doc type=BuildSystem::ToolDoc version=1.0>
116 < <Tool name=boost_program_options version=%v>
117 < <info url="http://www.boost.org"></info>
118 < <lib name="@BOOST_PROGRAM_OPTIONS_LIB@">
119 < <use name=boost>
136 < </Tool>
114 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options.xml
115 >  <tool name="boost_program_options" version="%v">
116 >    <info url="http://www.boost.org"/>
117 >    <lib name="@BOOST_PROGRAM_OPTIONS_LIB@"/>
118 >    <use name="boost"/>
119 >  </tool>
120   EOF_TOOLFILE
121  
122   # boost_python toolfile
123 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python
124 < <doc type=BuildSystem::ToolDoc version=1.0>
125 < <Tool name=boost_python version=%v>
126 < <info url="http://www.boost.org"></info>
127 < <lib name="@BOOST_PYTHON_LIB@">
128 < <Client>
129 < <Environment name=BOOST_PYTHON_BASE default="%i"></Environment>
130 < <Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python2.4/site-packages/Pyste/pyste.py"></Environment>
131 < <Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment>
132 < <Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment>
133 < </Client>
134 < <use name=elementtree>
135 < <use name=gccxml>
136 < <use name=python>
154 < </Tool>
123 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python.xml
124 >  <tool name="boost_python" version="%v">
125 >    <info url="http://www.boost.org"/>
126 >    <lib name="@BOOST_PYTHON_LIB@"/>
127 >    <client>
128 >      <environment name="BOOST_PYTHON_BASE" default="%i"/>
129 >      <environment name="PYSTE_EXEC" default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"/>
130 >      <environment name="LIBDIR" default="$BOOST_PYTHON_BASE/lib"/>
131 >      <environment name="INCLUDE" default="$BOOST_PYTHON_BASE/include"/>
132 >    </client>
133 >    <use name="elementtree"/>
134 >    <use name="gccxml"/>
135 >    <use name="python"/>
136 >  </tool>
137   EOF_TOOLFILE
138  
139   # boost_regex toolfile
140 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex
141 < <doc type=BuildSystem::ToolDoc version=1.0>
142 < <Tool name=boost_regex version=%v>
143 < <info url="http://www.boost.org"></info>
144 < <lib name="@BOOST_REGEX_LIB@">
145 < <use name=boost>
164 < </Tool>
140 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex.xml
141 >  <tool name="boost_regex" version="%v">
142 >    <info url="http://www.boost.org"/>
143 >    <lib name="@BOOST_REGEX_LIB@"/>
144 >    <use name="boost"/>
145 >  </tool>
146   EOF_TOOLFILE
147  
148   # boost_signals toolfile
149 < cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals
150 < <doc type=BuildSystem::ToolDoc version=1.0>
151 < <Tool name=boost_signals version=%v>
152 < <info url="http://www.boost.org"></info>
153 < <lib name="@BOOST_SIGNALS_LIB@">
154 < <use name=boost>
155 < </Tool>
149 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals.xml
150 >  <tool name="boost_signals" version="%v">
151 >    <info url="http://www.boost.org"/>
152 >    <lib name="@BOOST_SIGNALS_LIB@"/>
153 >    <use name="boost"/>
154 >  </tool>
155 > EOF_TOOLFILE
156 >
157 > # boost_header toolfile
158 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_header.xml
159 >  <tool name="boost_header" version="%v">
160 >    <info url="http://www.boost.org"/>
161 >    <client>
162 >      <environment name="BOOSTHEADER_BASE" default="%i"/>
163 >      <environment name="INCLUDE" default="$BOOSTHEADER_BASE/include"/>
164 >    </client>
165 >  </tool>
166   EOF_TOOLFILE
167  
168 +
169   perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
170  
171 + # setup dependencies environment
172 + rm -rf %i/etc/profile.d
173 + mkdir -p %i/etc/profile.d
174 + for x in %pkgreqs; do
175 +  case $x in /* ) continue ;; esac
176 +  p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/')
177 +  echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
178 +  echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
179 + done
180 +
181   %post
182 < %{relocateConfig}etc/scram.d/boost
183 < %{relocateConfig}etc/scram.d/boost_filesystem
184 < %{relocateConfig}etc/scram.d/boost_program_options
185 < %{relocateConfig}etc/scram.d/boost_python
186 < %{relocateConfig}etc/scram.d/boost_regex
185 < %{relocateConfig}etc/scram.d/boost_signals
182 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find $RPM_INSTALL_PREFIX/%pkgrel/etc/scram.d -type f)
183 >
184 > # The relocation is also needed because of dependencies
185 > %{relocateConfig}etc/profile.d/dependencies-setup.sh
186 > %{relocateConfig}etc/profile.d/dependencies-setup.csh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines