1 |
< |
### RPM external boost 1.40.0 |
1 |
> |
### RPM external boost 1.42.0 |
2 |
|
%define boostver _%(echo %realversion | tr . _) |
3 |
|
Source: http://internap.dl.sourceforge.net/sourceforge/%{n}/%{n}%{boostver}.tar.gz |
4 |
|
%define closingbrace ) |
13 |
|
%setup -n %{n}%{boostver} |
14 |
|
|
15 |
|
%build |
16 |
– |
# Note that some targets will fail to build (the test programs have |
17 |
– |
# missing symbols), causing darwin to fail to link and bjam to return |
18 |
– |
# an error. So ignore the exit code from bjam on darwin to avoid |
19 |
– |
# RPM falsely detecting a problem. |
16 |
|
PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')" |
17 |
|
PR="PYTHON_ROOT=$PYTHON_ROOT" |
18 |
|
|
26 |
|
ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include" |
27 |
|
|
28 |
|
case $(uname) in |
29 |
< |
Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin --toolset=darwin || true ;; |
30 |
< |
* ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;; |
29 |
> |
Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=darwin stage;; |
30 |
> |
* ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR toolset=gcc stage;; |
31 |
|
esac |
32 |
|
%else |
33 |
< |
bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI -sTOOLS=gcc |
33 |
> |
bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI toolset=gcc stage |
34 |
|
%endif |
35 |
|
|
36 |
|
%install |
37 |
|
case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac |
38 |
< |
#no debug libs... |
39 |
< |
#mkdir -p %i/lib/debug |
40 |
< |
mkdir %i/lib |
41 |
< |
#(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;) |
42 |
< |
# Perhaps the following could be done with a wildcard for the darwin/gcc dir |
43 |
< |
case %cmsplatf in |
44 |
< |
osx*) |
45 |
< |
(cd bin.v2; find libs -path "libs/*/build/darwin*/release/*.$so*" -exec cp {} %i/lib/. \;) |
46 |
< |
;; |
51 |
< |
* ) |
52 |
< |
(cd bin.v2; find libs -path "libs/*/build/gcc*/release/*.$so*" -exec cp {} %i/lib/. \;) |
53 |
< |
;; |
54 |
< |
esac |
55 |
< |
|
56 |
< |
find boost -name '*.[hi]*' -print | |
57 |
< |
while read f; do |
58 |
< |
mkdir -p %i/include/$(dirname $f) |
59 |
< |
install -c $f %i/include/$f |
60 |
< |
done |
61 |
< |
find libs -name '*.py' -print | |
62 |
< |
while read f; do |
63 |
< |
mkdir -p %i/lib/$(dirname $f) |
64 |
< |
install -c $f %i/lib/$f |
65 |
< |
done |
66 |
< |
|
67 |
< |
# Do all manipulation with files before creating symbolic links: |
68 |
< |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin) |
69 |
< |
#strip %i/lib/*.$so |
38 |
> |
mkdir -p %i/lib %i/include |
39 |
> |
# copy files around in their final location. |
40 |
> |
# We use tar to reduce the number of processes required |
41 |
> |
# and because we need to build the build hierarchy for |
42 |
> |
# the files that we are copying. |
43 |
> |
pushd stage/lib |
44 |
> |
find . -name "*.$so*" -type f | tar cf - -T - | (cd %i/lib; tar xfp -) |
45 |
> |
popd |
46 |
> |
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %i/include; tar xfp -) |
47 |
|
|
48 |
|
for l in `find %i/lib -name "*.$so.*"` |
49 |
|
do |
50 |
|
ln -s `basename $l` `echo $l | sed -e "s|[.]$so[.].*|.$so|"` |
51 |
|
done |
52 |
|
|
53 |
< |
(cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i) |
53 |
> |
pushd libs/python/pyste/install |
54 |
> |
python setup.py install --prefix=%i |
55 |
> |
popd |
56 |
> |
|
57 |
> |
# Do all manipulation with files before creating symbolic links: |
58 |
> |
perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin -type f) |
59 |
|
|
60 |
|
getLibName() |
61 |
|
{ |
75 |
|
# SCRAM ToolBox toolfile |
76 |
|
mkdir -p %i/etc/scram.d |
77 |
|
# boost toolfile |
78 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost |
79 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
80 |
< |
<Tool name=boost version=%v> |
81 |
< |
<info url="http://www.boost.org"></info> |
82 |
< |
<lib name="@BOOST_THREAD_LIB@"> |
83 |
< |
<lib name="@BOOST_SIGNALS_LIB@"> |
84 |
< |
<Client> |
85 |
< |
<Environment name=BOOST_BASE default="%i"></Environment> |
86 |
< |
<Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment> |
87 |
< |
<Environment name=INCLUDE default="$BOOST_BASE/include"></Environment> |
88 |
< |
</Client> |
89 |
< |
<use name=sockets> |
90 |
< |
<Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path> |
91 |
< |
<Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path> |
110 |
< |
</Tool> |
78 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n.xml |
79 |
> |
<tool name="%n" version="%v"> |
80 |
> |
<info url="http://www.boost.org"/> |
81 |
> |
<lib name="@BOOST_THREAD_LIB@"/> |
82 |
> |
<lib name="@BOOST_SIGNALS_LIB@"/> |
83 |
> |
<client> |
84 |
> |
<environment name="BOOST_BASE" default="%i"/> |
85 |
> |
<environment name="LIBDIR" default="$BOOST_BASE/lib"/> |
86 |
> |
<environment name="INCLUDE" default="$BOOST_BASE/include"/> |
87 |
> |
</client> |
88 |
> |
<runtime name="LD_LIBRARY_PATH" value="$BOOST_BASE/lib" type="path"/> |
89 |
> |
<runtime name="CMSSW_FWLITE_INCLUDE_PATH" value="$BOOST_BASE/include" type="path"/> |
90 |
> |
<use name="sockets"/> |
91 |
> |
</tool> |
92 |
|
EOF_TOOLFILE |
93 |
|
|
94 |
|
# boost_filesystem toolfile |
95 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem |
96 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
97 |
< |
<Tool name=boost_filesystem version=%v> |
98 |
< |
<info url="http://www.boost.org"></info> |
99 |
< |
<lib name="@BOOST_FILESYSTEM_LIB@"> |
100 |
< |
<use name=boost_system> |
101 |
< |
<use name=boost> |
121 |
< |
</Tool> |
95 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem.xml |
96 |
> |
<tool name="boost_filesystem" version="%v"> |
97 |
> |
<info url="http://www.boost.org"/> |
98 |
> |
<lib name="@BOOST_FILESYSTEM_LIB@"/> |
99 |
> |
<use name="boost_system"/> |
100 |
> |
<use name="boost"/> |
101 |
> |
</tool> |
102 |
|
EOF_TOOLFILE |
103 |
|
|
104 |
|
# boost_system toolfile |
105 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system |
106 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
107 |
< |
<Tool name=boost_system version=%v> |
108 |
< |
<info url="http://www.boost.org"></info> |
109 |
< |
<lib name="@BOOST_SYSTEM_LIB@"> |
110 |
< |
<use name=boost> |
131 |
< |
</Tool> |
105 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_system.xml |
106 |
> |
<tool name="boost_system" version="%v"> |
107 |
> |
<info url="http://www.boost.org"/> |
108 |
> |
<lib name="@BOOST_SYSTEM_LIB@"/> |
109 |
> |
<use name="boost"/> |
110 |
> |
</tool> |
111 |
|
EOF_TOOLFILE |
112 |
|
|
113 |
|
# boost_program_options toolfile |
114 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options |
115 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
116 |
< |
<Tool name=boost_program_options version=%v> |
117 |
< |
<info url="http://www.boost.org"></info> |
118 |
< |
<lib name="@BOOST_PROGRAM_OPTIONS_LIB@"> |
119 |
< |
<use name=boost> |
141 |
< |
</Tool> |
114 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options.xml |
115 |
> |
<tool name="boost_program_options" version="%v"> |
116 |
> |
<info url="http://www.boost.org"/> |
117 |
> |
<lib name="@BOOST_PROGRAM_OPTIONS_LIB@"/> |
118 |
> |
<use name="boost"/> |
119 |
> |
</tool> |
120 |
|
EOF_TOOLFILE |
121 |
|
|
122 |
|
# boost_python toolfile |
123 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python |
124 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
125 |
< |
<Tool name=boost_python version=%v> |
126 |
< |
<info url="http://www.boost.org"></info> |
127 |
< |
<lib name="@BOOST_PYTHON_LIB@"> |
128 |
< |
<Client> |
129 |
< |
<Environment name=BOOST_PYTHON_BASE default="%i"></Environment> |
130 |
< |
<Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"></Environment> |
131 |
< |
<Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment> |
132 |
< |
<Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment> |
133 |
< |
</Client> |
134 |
< |
<use name=elementtree> |
135 |
< |
<use name=gccxml> |
136 |
< |
<use name=python> |
159 |
< |
</Tool> |
123 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python.xml |
124 |
> |
<tool name="boost_python" version="%v"> |
125 |
> |
<info url="http://www.boost.org"/> |
126 |
> |
<lib name="@BOOST_PYTHON_LIB@"/> |
127 |
> |
<client> |
128 |
> |
<environment name="BOOST_PYTHON_BASE" default="%i"/> |
129 |
> |
<environment name="PYSTE_EXEC" default="$BOOST_PYTHON_BASE/lib/python@PYTHONV@/site-packages/Pyste/pyste.py"/> |
130 |
> |
<environment name="LIBDIR" default="$BOOST_PYTHON_BASE/lib"/> |
131 |
> |
<environment name="INCLUDE" default="$BOOST_PYTHON_BASE/include"/> |
132 |
> |
</client> |
133 |
> |
<use name="elementtree"/> |
134 |
> |
<use name="gccxml"/> |
135 |
> |
<use name="python"/> |
136 |
> |
</tool> |
137 |
|
EOF_TOOLFILE |
138 |
|
|
139 |
|
# boost_regex toolfile |
140 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex |
141 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
142 |
< |
<Tool name=boost_regex version=%v> |
143 |
< |
<info url="http://www.boost.org"></info> |
144 |
< |
<lib name="@BOOST_REGEX_LIB@"> |
145 |
< |
<use name=boost> |
169 |
< |
</Tool> |
140 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex.xml |
141 |
> |
<tool name="boost_regex" version="%v"> |
142 |
> |
<info url="http://www.boost.org"/> |
143 |
> |
<lib name="@BOOST_REGEX_LIB@"/> |
144 |
> |
<use name="boost"/> |
145 |
> |
</tool> |
146 |
|
EOF_TOOLFILE |
147 |
|
|
148 |
|
# boost_signals toolfile |
149 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals |
150 |
< |
<doc type=BuildSystem::ToolDoc version=1.0> |
151 |
< |
<Tool name=boost_signals version=%v> |
152 |
< |
<info url="http://www.boost.org"></info> |
153 |
< |
<lib name="@BOOST_SIGNALS_LIB@"> |
154 |
< |
<use name=boost> |
155 |
< |
</Tool> |
149 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals.xml |
150 |
> |
<tool name="boost_signals" version="%v"> |
151 |
> |
<info url="http://www.boost.org"/> |
152 |
> |
<lib name="@BOOST_SIGNALS_LIB@"/> |
153 |
> |
<use name="boost"/> |
154 |
> |
</tool> |
155 |
> |
EOF_TOOLFILE |
156 |
> |
|
157 |
> |
# boost_header toolfile |
158 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_header.xml |
159 |
> |
<tool name="boost_header" version="%v"> |
160 |
> |
<info url="http://www.boost.org"/> |
161 |
> |
<client> |
162 |
> |
<environment name="BOOSTHEADER_BASE" default="%i"/> |
163 |
> |
<environment name="INCLUDE" default="$BOOSTHEADER_BASE/include"/> |
164 |
> |
</client> |
165 |
> |
</tool> |
166 |
|
EOF_TOOLFILE |
167 |
|
|
168 |
+ |
|
169 |
|
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/* |
170 |
|
|
171 |
+ |
# setup dependencies environment |
172 |
+ |
rm -rf %i/etc/profile.d |
173 |
+ |
mkdir -p %i/etc/profile.d |
174 |
+ |
for x in %pkgreqs; do |
175 |
+ |
case $x in /* ) continue ;; esac |
176 |
+ |
p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/') |
177 |
+ |
echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
178 |
+ |
echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
179 |
+ |
done |
180 |
+ |
|
181 |
|
%post |
182 |
< |
%{relocateConfig}etc/scram.d/boost |
183 |
< |
%{relocateConfig}etc/scram.d/boost_filesystem |
184 |
< |
%{relocateConfig}etc/scram.d/boost_program_options |
185 |
< |
%{relocateConfig}etc/scram.d/boost_python |
186 |
< |
%{relocateConfig}etc/scram.d/boost_regex |
190 |
< |
%{relocateConfig}etc/scram.d/boost_signals |
182 |
> |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find $RPM_INSTALL_PREFIX/%pkgrel/etc/scram.d -type f) |
183 |
> |
|
184 |
> |
# The relocation is also needed because of dependencies |
185 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
186 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |