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.3 by eulisse, Wed Feb 22 12:43:55 2006 UTC vs.
Revision 1.56 by muzaffar, Fri Jul 2 09:01:05 2010 UTC

# Line 1 | Line 1
1 < ### RPM external boost 1.32.0
2 < # Patches and build fudging by Lassi A. Tuura <lat@iki.fi> (FIXME: contribute to boost)
3 < # define boostver -%v <-- for 1.30.2
4 < %define boostver _%(echo %v | tr . _)
5 < Requires: boost-build python
6 < Source: http://dl.sourceforge.net/sourceforge/%n/%{n}%{boostver}.tar.gz
7 < #Patch: boost
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 "%online" != "true"
9 > Requires: zlib
10 > %endif
11  
12   %prep
13   %setup -n %{n}%{boostver}
11 #%patch
14  
15   %build
16 < # 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 < PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*$//')"
18 >
19 > # The following line assumes a version of the form x.y.z-XXXX, where the
20 > # "-XXXX" part represents some CMS rebuild of version x.y.z
21 > BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
22 > BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
23 >
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 -s$PR -s$PV -sTOOLS=darwin || true ;;
30 <  * )       bjam -s$PR -s$PV -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 toolset=gcc stage
34 + %endif
35  
36   %install
26 boost_abi=$(echo %boostver | sed 's/^_//; s/_[0-9]*$//')
37   case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
38 < mkdir -p %i/lib/debug
39 < (cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;)
40 < (cd bin/boost; find libs -path "libs/*/release/*.$so" -exec cp {} %i/lib \;)
41 < find boost -name '*.h' -o -name '*.hpp' -print |
42 <  while read f; do
43 <    mkdir -p %i/include/$(dirname $f)
44 <    install -c $f %i/include/$f
45 <  done
46 < find libs -name '*.py' -print |
47 <  while read f; do
48 <    mkdir -p %i/lib/$(dirname $f)
49 <    install -c $f %i/lib/$f
50 <  done
51 < [ $(uname) = Darwin ] &&
52 <  for f in %i/lib/*.$so %i/lib/debug/*.$so; do
53 <    install_name_tool -id $f $f
54 <  done
55 < (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
56 < (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%v ; done)
57 < (cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done)
58 < (cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%v; 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 -type f)
59 >
60 > getLibName()
61 > {
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/%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="CMSSW_FWLITE_INCLUDE_PATH" value="$BOOST_BASE/include" type="path"/>
89 >    <use name="sockets"/>
90 >  </tool>
91 > EOF_TOOLFILE
92 >
93 > # boost_filesystem toolfile
94 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem.xml
95 >  <tool name="boost_filesystem" version="%v">
96 >    <info url="http://www.boost.org"/>
97 >    <lib name="@BOOST_FILESYSTEM_LIB@"/>
98 >    <use name="boost_system"/>
99 >    <use name="boost"/>
100 >  </tool>
101 > EOF_TOOLFILE
102 >
103 > # boost_system toolfile
104 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system.xml
105 >  <tool name="boost_system" version="%v">
106 >    <info url="http://www.boost.org"/>
107 >    <lib name="@BOOST_SYSTEM_LIB@"/>
108 >    <use name="boost"/>
109 >  </tool>
110 > EOF_TOOLFILE
111 >
112 > # boost_program_options toolfile
113 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options.xml
114 >  <tool name="boost_program_options" version="%v">
115 >    <info url="http://www.boost.org"/>
116 >    <lib name="@BOOST_PROGRAM_OPTIONS_LIB@"/>
117 >    <use name="boost"/>
118 >  </tool>
119 > EOF_TOOLFILE
120 >
121 > # boost_python toolfile
122 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python.xml
123 >  <tool name="boost_python" version="%v">
124 >    <info url="http://www.boost.org"/>
125 >    <lib name="@BOOST_PYTHON_LIB@"/>
126 >    <client>
127 >      <environment name="BOOST_PYTHON_BASE" default="%i"/>
128 >      <environment name="PYSTE_EXEC" default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"/>
129 >      <environment name="LIBDIR" default="$BOOST_PYTHON_BASE/lib"/>
130 >      <environment name="INCLUDE" default="$BOOST_PYTHON_BASE/include"/>
131 >    </client>
132 >    <use name="elementtree"/>
133 >    <use name="gccxml"/>
134 >    <use name="python"/>
135 >  </tool>
136 > EOF_TOOLFILE
137 >
138 > # boost_regex toolfile
139 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex.xml
140 >  <tool name="boost_regex" version="%v">
141 >    <info url="http://www.boost.org"/>
142 >    <lib name="@BOOST_REGEX_LIB@"/>
143 >    <use name="boost"/>
144 >  </tool>
145 > EOF_TOOLFILE
146 >
147 > # boost_signals toolfile
148 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals.xml
149 >  <tool name="boost_signals" version="%v">
150 >    <info url="http://www.boost.org"/>
151 >    <lib name="@BOOST_SIGNALS_LIB@"/>
152 >    <use name="boost"/>
153 >  </tool>
154 > EOF_TOOLFILE
155 >
156 > # boost_header toolfile
157 > cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_header.xml
158 >  <tool name="boost_header" version="%v">
159 >    <info url="http://www.boost.org"/>
160 >    <client>
161 >      <environment name="BOOSTHEADER_BASE" default="%i"/>
162 >      <environment name="INCLUDE" default="$BOOSTHEADER_BASE/include"/>
163 >    </client>
164 >  </tool>
165 > EOF_TOOLFILE
166 >
167 >
168 > perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
169 >
170 > # setup dependencies environment
171 > rm -rf %i/etc/profile.d
172 > mkdir -p %i/etc/profile.d
173 > for x in %pkgreqs; do
174 >  case $x in /* ) continue ;; esac
175 >  p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/')
176 >  echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
177 >  echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
178 > done
179 >
180 > %post
181 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find $RPM_INSTALL_PREFIX/%pkgrel/etc/scram.d -type f)
182 >
183 > # The relocation is also needed because of dependencies
184 > %{relocateConfig}etc/profile.d/dependencies-setup.sh
185 > %{relocateConfig}etc/profile.d/dependencies-setup.csh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines