1 |
### RPM external boost 1.38.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}
|
14 |
|
15 |
%build
|
16 |
# Note that some targets will fail to build (the test programs have
|
17 |
# missing symbols), causing darwin to fail to link and bjam to return
|
18 |
# an error. So ignore the exit code from bjam on darwin to avoid
|
19 |
# RPM falsely detecting a problem.
|
20 |
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')"
|
21 |
PR="PYTHON_ROOT=$PYTHON_ROOT"
|
22 |
|
23 |
# The following line assumes a version of the form x.y.z-XXXX, where the
|
24 |
# "-XXXX" part represents some CMS rebuild of version x.y.z
|
25 |
BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
|
26 |
BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
|
27 |
|
28 |
%if "%online" != "true"
|
29 |
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib"
|
30 |
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
|
31 |
|
32 |
case $(uname) in
|
33 |
Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin --toolset=darwin || true ;;
|
34 |
* ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;;
|
35 |
esac
|
36 |
%else
|
37 |
bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI -sTOOLS=gcc
|
38 |
%endif
|
39 |
|
40 |
%install
|
41 |
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
|
42 |
#no debug libs...
|
43 |
#mkdir -p %i/lib/debug
|
44 |
mkdir %i/lib
|
45 |
#(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;)
|
46 |
# Perhaps the following could be done with a wildcard for the darwin/gcc dir
|
47 |
case %cmsplatf in
|
48 |
osx*)
|
49 |
(cd bin.v2; find libs -path "libs/*/build/darwin*/release/*.$so*" -exec cp {} %i/lib/. \;)
|
50 |
;;
|
51 |
* )
|
52 |
(cd bin.v2; find libs -path "libs/*/build/gcc*/release/*.$so*" -exec cp {} %i/lib/. \;)
|
53 |
;;
|
54 |
esac
|
55 |
|
56 |
find boost -name '*.[hi]*' -print |
|
57 |
while read f; do
|
58 |
mkdir -p %i/include/$(dirname $f)
|
59 |
install -c $f %i/include/$f
|
60 |
done
|
61 |
find libs -name '*.py' -print |
|
62 |
while read f; do
|
63 |
mkdir -p %i/lib/$(dirname $f)
|
64 |
install -c $f %i/lib/$f
|
65 |
done
|
66 |
|
67 |
# Do all manipulation with files before creating symbolic links:
|
68 |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin)
|
69 |
#strip %i/lib/*.$so
|
70 |
|
71 |
for l in `find %i/lib -name "*.$so.*"`
|
72 |
do
|
73 |
ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"`
|
74 |
done
|
75 |
|
76 |
(cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i)
|
77 |
|
78 |
getLibName()
|
79 |
{
|
80 |
libname=`find %i/lib -name "libboost_$1*mt*.$so" -exec basename {} \;`
|
81 |
echo $libname | sed -e 's|[.][^-]*$||;s|^lib||'
|
82 |
}
|
83 |
|
84 |
export BOOST_THREAD_LIB=`getLibName thread`
|
85 |
export BOOST_SIGNALS_LIB=`getLibName signals`
|
86 |
export BOOST_FILESYSTEM_LIB=`getLibName filesystem`
|
87 |
export BOOST_SYSTEM_LIB=`getLibName system`
|
88 |
export BOOST_PROGRAM_OPTIONS_LIB=`getLibName program_options`
|
89 |
export BOOST_PYTHON_LIB=`getLibName python`
|
90 |
export BOOST_REGEX_LIB=`getLibName regex`
|
91 |
|
92 |
# SCRAM ToolBox toolfile
|
93 |
mkdir -p %i/etc/scram.d
|
94 |
# boost toolfile
|
95 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost
|
96 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
97 |
<Tool name=boost version=%v>
|
98 |
<info url="http://www.boost.org"></info>
|
99 |
<lib name="@BOOST_THREAD_LIB@">
|
100 |
<lib name="@BOOST_SIGNALS_LIB@">
|
101 |
<Client>
|
102 |
<Environment name=BOOST_BASE default="%i"></Environment>
|
103 |
<Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment>
|
104 |
<Environment name=INCLUDE default="$BOOST_BASE/include"></Environment>
|
105 |
</Client>
|
106 |
<use name=sockets>
|
107 |
<Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path>
|
108 |
<Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path>
|
109 |
</Tool>
|
110 |
EOF_TOOLFILE
|
111 |
|
112 |
# boost_filesystem toolfile
|
113 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem
|
114 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
115 |
<Tool name=boost_filesystem version=%v>
|
116 |
<info url="http://www.boost.org"></info>
|
117 |
<lib name="@BOOST_FILESYSTEM_LIB@">
|
118 |
<use name=boost_system>
|
119 |
<use name=boost>
|
120 |
</Tool>
|
121 |
EOF_TOOLFILE
|
122 |
|
123 |
# boost_system toolfile
|
124 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system
|
125 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
126 |
<Tool name=boost_system version=%v>
|
127 |
<info url="http://www.boost.org"></info>
|
128 |
<lib name="@BOOST_SYSTEM_LIB@">
|
129 |
<use name=boost>
|
130 |
</Tool>
|
131 |
EOF_TOOLFILE
|
132 |
|
133 |
# boost_program_options toolfile
|
134 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options
|
135 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
136 |
<Tool name=boost_program_options version=%v>
|
137 |
<info url="http://www.boost.org"></info>
|
138 |
<lib name="@BOOST_PROGRAM_OPTIONS_LIB@">
|
139 |
<use name=boost>
|
140 |
</Tool>
|
141 |
EOF_TOOLFILE
|
142 |
|
143 |
# boost_python toolfile
|
144 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python
|
145 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
146 |
<Tool name=boost_python version=%v>
|
147 |
<info url="http://www.boost.org"></info>
|
148 |
<lib name="@BOOST_PYTHON_LIB@">
|
149 |
<Client>
|
150 |
<Environment name=BOOST_PYTHON_BASE default="%i"></Environment>
|
151 |
<Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python2.4/site-packages/Pyste/pyste.py"></Environment>
|
152 |
<Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment>
|
153 |
<Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment>
|
154 |
</Client>
|
155 |
<use name=elementtree>
|
156 |
<use name=gccxml>
|
157 |
<use name=python>
|
158 |
</Tool>
|
159 |
EOF_TOOLFILE
|
160 |
|
161 |
# boost_regex toolfile
|
162 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex
|
163 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
164 |
<Tool name=boost_regex version=%v>
|
165 |
<info url="http://www.boost.org"></info>
|
166 |
<lib name="@BOOST_REGEX_LIB@">
|
167 |
<use name=boost>
|
168 |
</Tool>
|
169 |
EOF_TOOLFILE
|
170 |
|
171 |
# boost_signals toolfile
|
172 |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals
|
173 |
<doc type=BuildSystem::ToolDoc version=1.0>
|
174 |
<Tool name=boost_signals version=%v>
|
175 |
<info url="http://www.boost.org"></info>
|
176 |
<lib name="@BOOST_SIGNALS_LIB@">
|
177 |
<use name=boost>
|
178 |
</Tool>
|
179 |
EOF_TOOLFILE
|
180 |
|
181 |
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
|
182 |
|
183 |
%post
|
184 |
%{relocateConfig}etc/scram.d/boost
|
185 |
%{relocateConfig}etc/scram.d/boost_filesystem
|
186 |
%{relocateConfig}etc/scram.d/boost_program_options
|
187 |
%{relocateConfig}etc/scram.d/boost_python
|
188 |
%{relocateConfig}etc/scram.d/boost_regex
|
189 |
%{relocateConfig}etc/scram.d/boost_signals
|