forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 1
/
boost.spec
90 lines (74 loc) · 2.82 KB
/
boost.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
### RPM external boost 1.51.0
%define boostver _%(echo %realversion | tr . _)
Source: http://switch.dl.sourceforge.net/project/%{n}/%{n}/%{v}/%{n}%{boostver}.tar.gz
%define online %(case %cmsplatf in (*onl_*_*) echo true;; (*) echo false;; esac)
%if "%{?cms_cxxflags:set}" != "set"
%define cms_cxxflags -std=c++0x -O2
%endif
Requires: python bz2lib
%if "%online" != "true"
Requires: zlib
%endif
Patch0: boost-1.47.0-fix-strict-overflow
Patch1: boost-1.47.0-fix-unused
Patch2: boost-1.49.0-explicit_stored_group
%prep
%setup -n %{n}%{boostver}
%patch0 -p1
%patch1 -p1
%patch2 -p1
perl -p -i -e 's/-no-cpp-precomp//' tools/build/v2/tools/darwin.jam \
tools/build/v2/tools/darwin.py
%build
case %cmsos in
osx*) TOOLSET=darwin ;;
*) TOOLSET=gcc ;;
esac
pushd tools/build/v2
sh bootstrap.sh $TOOLSET
popd
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')"
PR="PYTHON_ROOT=$PYTHON_ROOT"
# The following line assumes a version of the form x.y.z-XXXX, where the
# "-XXXX" part represents some CMS rebuild of version x.y.z
BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
if [ ! X%online = "Xtrue" ]
then
ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib"
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
fi
tools/build/v2/bjam %makeprocesses cxxflags="%{cms_cxxflags}" -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI ${ZLIBR+-s$ZLIBR} ${ZLIBI+-s$ZLIBI} toolset=$TOOLSET stage
%install
case %cmsos in osx*) so=dylib ;; *) so=so ;; esac
mkdir -p %i/lib %i/include
# copy files around in their final location.
# We use tar to reduce the number of processes required
# and because we need to build the build hierarchy for
# the files that we are copying.
pushd stage/lib
find . -name "*.$so*" -type f | tar cf - -T - | (cd %i/lib; tar xfp -)
popd
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %i/include; tar xfp -)
for l in `find %i/lib -name "*.$so.*"`
do
ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"`
done
pushd libs/python/pyste/install
python setup.py install --prefix=%i
popd
# Do all manipulation with files before creating symbolic links:
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin -type f)
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
mkdir -p %i/etc/profile.d
: > %i/etc/profile.d/dependencies-setup.sh
: > %i/etc/profile.d/dependencies-setup.csh
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
fi
done
%post
%{relocateConfig}etc/profile.d/dependencies-setup.*sh