1 |
< |
### RPM external boost 1.33.1-XXXX |
2 |
< |
# Patches and build fudging by Lassi A. Tuura <lat@iki.fi> (FIXME: contribute to boost) |
1 |
> |
### RPM external boost 1.47.0 |
2 |
|
%define boostver _%(echo %realversion | tr . _) |
3 |
< |
Requires: boost-build python bz2lib zlib |
4 |
< |
Source: http://dl.sourceforge.net/sourceforge/%n/%{n}%{boostver}.tar.gz |
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: python bz2lib |
7 |
> |
%if "%online" != "true" |
8 |
> |
Requires: zlib |
9 |
> |
%endif |
10 |
|
|
11 |
|
%prep |
12 |
|
%setup -n %{n}%{boostver} |
13 |
+ |
perl -p -i -e 's/-no-cpp-precomp//' tools/build/v2/tools/darwin.jam \ |
14 |
+ |
tools/build/v2/tools/darwin.py |
15 |
|
|
16 |
|
%build |
17 |
< |
# Note that some targets will fail to build (the test programs have |
18 |
< |
# missing symbols), causing darwin to fail to link and bjam to return |
19 |
< |
# an error. So ignore the exit code from bjam on darwin to avoid |
20 |
< |
# RPM falsely detecting a problem. |
17 |
> |
case %cmsos in |
18 |
> |
osx*) TOOLSET=darwin ;; |
19 |
> |
*) TOOLSET=gcc ;; |
20 |
> |
esac |
21 |
> |
|
22 |
> |
pushd tools/build/v2 |
23 |
> |
|
24 |
> |
sh bootstrap.sh $TOOLSET |
25 |
> |
popd |
26 |
> |
|
27 |
> |
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')" |
28 |
|
PR="PYTHON_ROOT=$PYTHON_ROOT" |
29 |
< |
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*$//')" |
29 |
> |
|
30 |
> |
# The following line assumes a version of the form x.y.z-XXXX, where the |
31 |
> |
# "-XXXX" part represents some CMS rebuild of version x.y.z |
32 |
|
BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib" |
18 |
– |
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib" |
33 |
|
BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include" |
20 |
– |
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include" |
34 |
|
|
35 |
< |
case $(uname) in |
36 |
< |
Darwin ) bjam -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin || true ;; |
37 |
< |
* ) bjam -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;; |
38 |
< |
esac |
35 |
> |
if [ ! X%online = "Xtrue" ] |
36 |
> |
then |
37 |
> |
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib" |
38 |
> |
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include" |
39 |
> |
fi |
40 |
|
|
41 |
< |
%install |
28 |
< |
boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//') |
29 |
< |
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac |
30 |
< |
mkdir -p %i/lib/debug |
31 |
< |
(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;) |
32 |
< |
(cd bin/boost; find libs -path "libs/*/release/*.$so" -exec cp {} %i/lib \;) |
33 |
< |
find boost -name '*.[hi]*' -print | |
34 |
< |
while read f; do |
35 |
< |
mkdir -p %i/include/$(dirname $f) |
36 |
< |
install -c $f %i/include/$f |
37 |
< |
done |
38 |
< |
find libs -name '*.py' -print | |
39 |
< |
while read f; do |
40 |
< |
mkdir -p %i/lib/$(dirname $f) |
41 |
< |
install -c $f %i/lib/$f |
42 |
< |
done |
43 |
< |
[ $(uname) = Darwin ] && |
44 |
< |
for f in %i/lib/*.$so %i/lib/debug/*.$so; do |
45 |
< |
install_name_tool -id $f $f |
46 |
< |
done |
47 |
< |
|
48 |
< |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done) |
49 |
< |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%realversion ; done) |
50 |
< |
(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done) |
51 |
< |
(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%realversion; done) |
52 |
< |
(cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i) |
41 |
> |
tools/build/v2/bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI ${ZLIBR+-s$ZLIBR} ${ZLIBI+-s$ZLIBI} toolset=$TOOLSET stage |
42 |
|
|
43 |
< |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin) |
43 |
> |
%install |
44 |
> |
case %cmsos in osx*) so=dylib ;; *) so=so ;; esac |
45 |
> |
mkdir -p %i/lib %i/include |
46 |
> |
# copy files around in their final location. |
47 |
> |
# We use tar to reduce the number of processes required |
48 |
> |
# and because we need to build the build hierarchy for |
49 |
> |
# the files that we are copying. |
50 |
> |
pushd stage/lib |
51 |
> |
find . -name "*.$so*" -type f | tar cf - -T - | (cd %i/lib; tar xfp -) |
52 |
> |
popd |
53 |
> |
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %i/include; tar xfp -) |
54 |
> |
|
55 |
> |
for l in `find %i/lib -name "*.$so.*"` |
56 |
> |
do |
57 |
> |
ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"` |
58 |
> |
done |
59 |
> |
|
60 |
> |
pushd libs/python/pyste/install |
61 |
> |
python setup.py install --prefix=%i |
62 |
> |
popd |
63 |
> |
|
64 |
> |
# Do all manipulation with files before creating symbolic links: |
65 |
> |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin -type f) |
66 |
> |
|
67 |
> |
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment. |
68 |
> |
mkdir -p %i/etc/profile.d |
69 |
> |
: > %i/etc/profile.d/dependencies-setup.sh |
70 |
> |
: > %i/etc/profile.d/dependencies-setup.csh |
71 |
> |
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do |
72 |
> |
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root |
73 |
> |
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then |
74 |
> |
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
75 |
> |
echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
76 |
> |
fi |
77 |
> |
done |
78 |
|
|
79 |
+ |
%post |
80 |
+ |
%{relocateConfig}etc/profile.d/dependencies-setup.*sh |