1 |
< |
### RPM external boost 1.32.0 |
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.46.0 |
2 |
> |
%define boostver _%(echo %realversion | tr . _) |
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" |
8 |
> |
Requires: zlib |
9 |
> |
%endif |
10 |
|
|
11 |
|
%prep |
12 |
|
%setup -n %{n}%{boostver} |
11 |
– |
#%patch |
13 |
|
|
14 |
|
%build |
15 |
< |
# 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. |
15 |
> |
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')" |
16 |
|
PR="PYTHON_ROOT=$PYTHON_ROOT" |
17 |
< |
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*$//')" |
17 |
> |
|
18 |
> |
# The following line assumes a version of the form x.y.z-XXXX, where the |
19 |
> |
# "-XXXX" part represents some CMS rebuild of version x.y.z |
20 |
> |
BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib" |
21 |
> |
BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include" |
22 |
> |
|
23 |
> |
%if "%online" != "true" |
24 |
> |
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib" |
25 |
> |
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include" |
26 |
> |
|
27 |
|
case $(uname) in |
28 |
< |
Darwin ) bjam -s$PR -s$PV -sTOOLS=darwin || true ;; |
29 |
< |
* ) bjam -s$PR -s$PV -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 toolset=gcc stage |
33 |
+ |
%endif |
34 |
|
|
35 |
|
%install |
26 |
– |
boost_abi=$(echo %boostver | sed 's/^_//; s/_[0-9]*$//') |
36 |
|
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac |
37 |
< |
mkdir -p %i/lib/debug |
38 |
< |
(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;) |
39 |
< |
(cd bin/boost; find libs -path "libs/*/release/*.$so" -exec cp {} %i/lib \;) |
40 |
< |
find boost -name '*.h' -o -name '*.hpp' -print | |
41 |
< |
while read f; do |
42 |
< |
mkdir -p %i/include/$(dirname $f) |
43 |
< |
install -c $f %i/include/$f |
44 |
< |
done |
45 |
< |
find libs -name '*.py' -print | |
46 |
< |
while read f; do |
47 |
< |
mkdir -p %i/lib/$(dirname $f) |
48 |
< |
install -c $f %i/lib/$f |
49 |
< |
done |
50 |
< |
[ $(uname) = Darwin ] && |
51 |
< |
for f in %i/lib/*.$so %i/lib/debug/*.$so; do |
52 |
< |
install_name_tool -id $f $f |
53 |
< |
done |
54 |
< |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done) |
55 |
< |
(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%v ; done) |
56 |
< |
(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done) |
57 |
< |
(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%v; done) |
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 |
> |
pushd libs/python/pyste/install |
53 |
> |
python setup.py install --prefix=%i |
54 |
> |
popd |
55 |
> |
|
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 |
> |
# 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/profile.d/dependencies-setup.*sh |