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.14 by ratnik, Fri Jun 15 18:59:46 2007 UTC vs.
Revision 1.52 by eulisse, Fri Feb 12 09:26:14 2010 UTC

# Line 1 | Line 1
1 < ### RPM external boost 1.33.1
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 bz2lib zlib
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]*$//')"
19 < BZ2LIBR="BZ2LIB_LIBPATH=$BZ2LIB_ROOT/lib"
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"
22 BZ2LIBI="BZ2LIB_INCLUDE=$BZ2LIB_ROOT/include"
26   ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
27  
28   case $(uname) in
29 <  Darwin )  bjam -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin || true ;;
30 <  * )       bjam -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 toolset=gcc stage
34 + %endif
35  
36   %install
31 boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//')
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 '*.[hi]*' -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 <
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)
54 < strip %i/lib/*.$so %i/lib/debug/*.$so
55 <
56 < (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
57 < (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%v ; done)
58 < (cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done)
59 < (cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%v; done)
60 < (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.$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>
92 + </Tool>
93 + EOF_TOOLFILE
94 +
95 + # boost_filesystem toolfile
96 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem
97 + <doc type=BuildSystem::ToolDoc version=1.0>
98 + <Tool name=boost_filesystem version=%v>
99 + <info url="http://www.boost.org"></info>
100 + <lib name="@BOOST_FILESYSTEM_LIB@">
101 + <use name=boost_system>
102 + <use name=boost>
103 + </Tool>
104 + EOF_TOOLFILE
105 +
106 + # boost_system toolfile
107 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system
108 + <doc type=BuildSystem::ToolDoc version=1.0>
109 + <Tool name=boost_system version=%v>
110 + <info url="http://www.boost.org"></info>
111 + <lib name="@BOOST_SYSTEM_LIB@">
112 + <use name=boost>
113 + </Tool>
114 + EOF_TOOLFILE
115 +
116 + # boost_program_options toolfile
117 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options
118 + <doc type=BuildSystem::ToolDoc version=1.0>
119 + <Tool name=boost_program_options version=%v>
120 + <info url="http://www.boost.org"></info>
121 + <lib name="@BOOST_PROGRAM_OPTIONS_LIB@">
122 + <use name=boost>
123 + </Tool>
124 + EOF_TOOLFILE
125 +
126 + # boost_python toolfile
127 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python
128 + <doc type=BuildSystem::ToolDoc version=1.0>
129 + <Tool name=boost_python version=%v>
130 + <info url="http://www.boost.org"></info>
131 + <lib name="@BOOST_PYTHON_LIB@">
132 + <Client>
133 + <Environment name=BOOST_PYTHON_BASE default="%i"></Environment>
134 + <Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"></Environment>
135 + <Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment>
136 + <Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment>
137 + </Client>
138 + <use name=elementtree>
139 + <use name=gccxml>
140 + <use name=python>
141 + </Tool>
142 + EOF_TOOLFILE
143 +
144 + # boost_regex toolfile
145 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex
146 + <doc type=BuildSystem::ToolDoc version=1.0>
147 + <Tool name=boost_regex version=%v>
148 + <info url="http://www.boost.org"></info>
149 + <lib name="@BOOST_REGEX_LIB@">
150 + <use name=boost>
151 + </Tool>
152 + EOF_TOOLFILE
153 +
154 + # boost_signals toolfile
155 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals
156 + <doc type=BuildSystem::ToolDoc version=1.0>
157 + <Tool name=boost_signals version=%v>
158 + <info url="http://www.boost.org"></info>
159 + <lib name="@BOOST_SIGNALS_LIB@">
160 + <use name=boost>
161 + </Tool>
162 + EOF_TOOLFILE
163 +
164 + # boost_header toolfile
165 + cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_header
166 + <doc type=BuildSystem::ToolDoc version=1.0>
167 + <Tool name=boost_header version=%v>
168 + <info url="http://www.boost.org"></info>
169 + <Client>
170 + <Environment name=BOOSTHEADER_BASE default="%i"></Environment>
171 + <Environment name=INCLUDE default="$BOOSTHEADER_BASE/include"></Environment>
172 + </Client>
173 + </Tool>
174 + EOF_TOOLFILE
175 +
176 +
177 + perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
178 +
179 + %post
180 + %{relocateConfig}etc/scram.d/boost
181 + %{relocateConfig}etc/scram.d/boost_filesystem
182 + %{relocateConfig}etc/scram.d/boost_program_options
183 + %{relocateConfig}etc/scram.d/boost_python
184 + %{relocateConfig}etc/scram.d/boost_regex
185 + %{relocateConfig}etc/scram.d/boost_signals
186 + %{relocateConfig}etc/scram.d/boost_header

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines