forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost.spec
87 lines (77 loc) · 2.43 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
### RPM external boost 1.63.0
%define tag 68362cdf020bfed8639c09b8705476d138d884dd
%define branch cms/v%realversion
%define github_user cms-externals
Source: git+https://github.com/%github_user/%n.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Requires: python bz2lib zlib
%prep
%setup -n %{n}-%{realversion}
%build
case %cmsos in
osx*) TOOLSET=darwin ;;
*) TOOLSET=gcc ;;
esac
pushd tools/build
sh bootstrap.sh ${TOOLSET}
mkdir ./tmp-boost-build
./b2 install --prefix=./tmp-boost-build
export PATH=${PWD}/tmp-boost-build/bin:${PATH}
popd
b2 -q \
-d2 \
%{makeprocesses} \
--build-dir=build-boost \
--disable-icu \
--without-atomic \
--without-container \
--without-context \
--without-coroutine \
--without-exception \
--without-graph \
--without-graph_parallel \
--without-locale \
--without-log \
--without-math \
--without-mpi \
--without-random \
--without-wave \
toolset=${TOOLSET} \
link=shared \
threading=multi \
variant=release \
-sBZIP2_INCLUDE=${BZ2LIB_ROOT}/include \
-sBZIP2_LIBPATH=${BZ2LIB_ROOT}/lib \
-sZLIB_INCLUDE=${ZLIB_ROOT}/include \
-sZLIB_LIBPATH=${ZLIB_ROOT}/lib \
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
# 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 \$?$root != 0 || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
fi
done
%post
%{relocateConfig}etc/profile.d/dependencies-setup.*sh