1 |
< |
### RPM external boost 1.40.0 |
1 |
> |
### RPM external boost 1.46.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) |
3 |
> |
Source: http://switch.dl.sourceforge.net/project/%{n}/%{n}/%{v}/%{n}%{boostver}.tar.gz |
4 |
> |
%define online %(case %cmsplatf in (*onl_*_*) echo true;; (*) echo false;; esac) |
5 |
|
|
6 |
|
Requires: boost-build python bz2lib |
7 |
|
%if "%online" != "true" |
12 |
|
%setup -n %{n}%{boostver} |
13 |
|
|
14 |
|
%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. |
15 |
|
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')" |
16 |
|
PR="PYTHON_ROOT=$PYTHON_ROOT" |
17 |
|
|
25 |
|
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include" |
26 |
|
|
27 |
|
case $(uname) in |
28 |
< |
Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin --toolset=darwin || true ;; |
29 |
< |
* ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;; |
28 |
> |
Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=darwin stage;; |
29 |
> |
* ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=gcc stage;; |
30 |
|
esac |
31 |
|
%else |
32 |
< |
bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI -sTOOLS=gcc |
32 |
> |
bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI toolset=gcc stage |
33 |
|
%endif |
34 |
|
|
35 |
|
%install |
36 |
|
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac |
37 |
< |
#no debug libs... |
38 |
< |
#mkdir -p %i/lib/debug |
39 |
< |
mkdir %i/lib |
40 |
< |
#(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;) |
41 |
< |
# Perhaps the following could be done with a wildcard for the darwin/gcc dir |
42 |
< |
case %cmsplatf in |
43 |
< |
osx*) |
44 |
< |
(cd bin.v2; find libs -path "libs/*/build/darwin*/release/*.$so*" -exec cp {} %i/lib/. \;) |
45 |
< |
;; |
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 |
37 |
> |
mkdir -p %i/lib %i/include |
38 |
> |
# copy files around in their final location. |
39 |
> |
# We use tar to reduce the number of processes required |
40 |
> |
# and because we need to build the build hierarchy for |
41 |
> |
# the files that we are copying. |
42 |
> |
pushd stage/lib |
43 |
> |
find . -name "*.$so*" -type f | tar cf - -T - | (cd %i/lib; tar xfp -) |
44 |
> |
popd |
45 |
> |
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %i/include; tar xfp -) |
46 |
|
|
47 |
|
for l in `find %i/lib -name "*.$so.*"` |
48 |
|
do |
49 |
|
ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"` |
50 |
|
done |
51 |
|
|
52 |
< |
(cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i) |
52 |
> |
pushd libs/python/pyste/install |
53 |
> |
python setup.py install --prefix=%i |
54 |
> |
popd |
55 |
|
|
56 |
< |
getLibName() |
57 |
< |
{ |
80 |
< |
libname=`find %i/lib -name "libboost_$1.$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 |
< |
export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.) |
92 |
< |
|
93 |
< |
# SCRAM ToolBox toolfile |
94 |
< |
mkdir -p %i/etc/scram.d |
95 |
< |
# boost toolfile |
96 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost |
97 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
98 |
< |
<Tool name=boost version=%v> |
99 |
< |
<info url="http://www.boost.org"></info> |
100 |
< |
<lib name="@BOOST_THREAD_LIB@"> |
101 |
< |
<lib name="@BOOST_SIGNALS_LIB@"> |
102 |
< |
<Client> |
103 |
< |
<Environment name=BOOST_BASE default="%i"></Environment> |
104 |
< |
<Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment> |
105 |
< |
<Environment name=INCLUDE default="$BOOST_BASE/include"></Environment> |
106 |
< |
</Client> |
107 |
< |
<use name=sockets> |
108 |
< |
<Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path> |
109 |
< |
<Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path> |
110 |
< |
</Tool> |
111 |
< |
EOF_TOOLFILE |
112 |
< |
|
113 |
< |
# boost_filesystem toolfile |
114 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem |
115 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
116 |
< |
<Tool name=boost_filesystem version=%v> |
117 |
< |
<info url="http://www.boost.org"></info> |
118 |
< |
<lib name="@BOOST_FILESYSTEM_LIB@"> |
119 |
< |
<use name=boost_system> |
120 |
< |
<use name=boost> |
121 |
< |
</Tool> |
122 |
< |
EOF_TOOLFILE |
123 |
< |
|
124 |
< |
# boost_system toolfile |
125 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system |
126 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
127 |
< |
<Tool name=boost_system version=%v> |
128 |
< |
<info url="http://www.boost.org"></info> |
129 |
< |
<lib name="@BOOST_SYSTEM_LIB@"> |
130 |
< |
<use name=boost> |
131 |
< |
</Tool> |
132 |
< |
EOF_TOOLFILE |
133 |
< |
|
134 |
< |
# boost_program_options toolfile |
135 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options |
136 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
137 |
< |
<Tool name=boost_program_options version=%v> |
138 |
< |
<info url="http://www.boost.org"></info> |
139 |
< |
<lib name="@BOOST_PROGRAM_OPTIONS_LIB@"> |
140 |
< |
<use name=boost> |
141 |
< |
</Tool> |
142 |
< |
EOF_TOOLFILE |
143 |
< |
|
144 |
< |
# boost_python toolfile |
145 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python |
146 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
147 |
< |
<Tool name=boost_python version=%v> |
148 |
< |
<info url="http://www.boost.org"></info> |
149 |
< |
<lib name="@BOOST_PYTHON_LIB@"> |
150 |
< |
<Client> |
151 |
< |
<Environment name=BOOST_PYTHON_BASE default="%i"></Environment> |
152 |
< |
<Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"></Environment> |
153 |
< |
<Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment> |
154 |
< |
<Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment> |
155 |
< |
</Client> |
156 |
< |
<use name=elementtree> |
157 |
< |
<use name=gccxml> |
158 |
< |
<use name=python> |
159 |
< |
</Tool> |
160 |
< |
EOF_TOOLFILE |
161 |
< |
|
162 |
< |
# boost_regex toolfile |
163 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex |
164 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
165 |
< |
<Tool name=boost_regex version=%v> |
166 |
< |
<info url="http://www.boost.org"></info> |
167 |
< |
<lib name="@BOOST_REGEX_LIB@"> |
168 |
< |
<use name=boost> |
169 |
< |
</Tool> |
170 |
< |
EOF_TOOLFILE |
171 |
< |
|
172 |
< |
# boost_signals toolfile |
173 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals |
174 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
175 |
< |
<Tool name=boost_signals version=%v> |
176 |
< |
<info url="http://www.boost.org"></info> |
177 |
< |
<lib name="@BOOST_SIGNALS_LIB@"> |
178 |
< |
<use name=boost> |
179 |
< |
</Tool> |
180 |
< |
EOF_TOOLFILE |
56 |
> |
# Do all manipulation with files before creating symbolic links: |
57 |
> |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin -type f) |
58 |
|
|
59 |
< |
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/* |
59 |
> |
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment. |
60 |
> |
mkdir -p %i/etc/profile.d |
61 |
> |
: > %i/etc/profile.d/dependencies-setup.sh |
62 |
> |
: > %i/etc/profile.d/dependencies-setup.csh |
63 |
> |
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do |
64 |
> |
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root |
65 |
> |
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then |
66 |
> |
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
67 |
> |
echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
68 |
> |
fi |
69 |
> |
done |
70 |
|
|
71 |
|
%post |
72 |
< |
%{relocateConfig}etc/scram.d/boost |
186 |
< |
%{relocateConfig}etc/scram.d/boost_filesystem |
187 |
< |
%{relocateConfig}etc/scram.d/boost_program_options |
188 |
< |
%{relocateConfig}etc/scram.d/boost_python |
189 |
< |
%{relocateConfig}etc/scram.d/boost_regex |
190 |
< |
%{relocateConfig}etc/scram.d/boost_signals |
72 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.*sh |