1 |
elmer |
1.13 |
### RPM external boost 1.33.1-XXXX
|
2 |
argiro |
1.1 |
# Patches and build fudging by Lassi A. Tuura <lat@iki.fi> (FIXME: contribute to boost)
|
3 |
elmer |
1.13 |
%define boostver _%(echo %realversion | tr . _)
|
4 |
eulisse |
1.8 |
Requires: boost-build python bz2lib zlib
|
5 |
argiro |
1.2 |
Source: http://dl.sourceforge.net/sourceforge/%n/%{n}%{boostver}.tar.gz
|
6 |
argiro |
1.1 |
|
7 |
|
|
%prep
|
8 |
|
|
%setup -n %{n}%{boostver}
|
9 |
|
|
|
10 |
|
|
%build
|
11 |
|
|
# Note that some targets will fail to build (the test programs have
|
12 |
|
|
# missing symbols), causing darwin to fail to link and bjam to return
|
13 |
|
|
# an error. So ignore the exit code from bjam on darwin to avoid
|
14 |
|
|
# RPM falsely detecting a problem.
|
15 |
|
|
PR="PYTHON_ROOT=$PYTHON_ROOT"
|
16 |
|
|
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*$//')"
|
17 |
elmer |
1.12 |
BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
|
18 |
eulisse |
1.8 |
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib"
|
19 |
elmer |
1.12 |
BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
|
20 |
eulisse |
1.8 |
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
|
21 |
|
|
|
22 |
argiro |
1.1 |
case $(uname) in
|
23 |
eulisse |
1.8 |
Darwin ) bjam -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin || true ;;
|
24 |
|
|
* ) bjam -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;;
|
25 |
argiro |
1.1 |
esac
|
26 |
|
|
|
27 |
|
|
%install
|
28 |
eulisse |
1.6 |
boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//')
|
29 |
argiro |
1.1 |
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 |
eulisse |
1.7 |
find boost -name '*.[hi]*' -print |
|
34 |
argiro |
1.1 |
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 |
eulisse |
1.6 |
|
48 |
argiro |
1.1 |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
|
49 |
elmer |
1.13 |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%realversion ; done)
|
50 |
argiro |
1.1 |
(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 |
elmer |
1.13 |
(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%realversion; done)
|
52 |
eulisse |
1.4 |
(cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i)
|
53 |
eulisse |
1.8 |
|
54 |
|
|
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin)
|
55 |
|
|
|