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 |
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$//') |
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 |
< |
|
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) |
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="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.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.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.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.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.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 |
> |
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 |