ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/boost.spec
Revision: 1.41
Committed: Thu Feb 12 13:14:59 2009 UTC (16 years, 2 months ago) by eulisse
Branch: MAIN
CVS Tags: WEBTOOLS-APPS_20090212
Changes since 1.40: +22 -7 lines
Log Message:
Makes sure that library names in the tool file are correct.

* Now it works correctly also for macosx.

File Contents

# User Rev Content
1 elmer 1.40 ### RPM external boost 1.38.0
2 elmer 1.17 %define boostver _%(echo %realversion | tr . _)
3 ratnik 1.31 Source: http://internap.dl.sourceforge.net/sourceforge/%{n}/%{n}%{boostver}.tar.gz
4 argiro 1.1
5 ratnik 1.25 Requires: boost-build python bz2lib
6 ratnik 1.37 %if "%cmsplatf" != "slc4onl_ia32_gcc346"
7 ratnik 1.25 Requires: zlib
8     %endif
9    
10 argiro 1.1 %prep
11     %setup -n %{n}%{boostver}
12    
13     %build
14     # 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.
18 ratnik 1.25 PV="PYTHON_VERSION=$(echo $PYTHON_VERSION | sed 's/\.[0-9]*-.*$//')"
19 argiro 1.1 PR="PYTHON_ROOT=$PYTHON_ROOT"
20 ratnik 1.25
21 elmer 1.17 # The following line assumes a version of the form x.y.z-XXXX, where the
22     # "-XXXX" part represents some CMS rebuild of version x.y.z
23     BZ2LIBR="BZIP2_LIBPATH=$BZ2LIB_ROOT/lib"
24 ratnik 1.25 BZ2LIBI="BZIP2_INCLUDE=$BZ2LIB_ROOT/include"
25    
26 ratnik 1.37 %if "%cmsplatf" != "slc4onl_ia32_gcc346"
27 eulisse 1.8 ZLIBR="ZLIB_LIBPATH=$ZLIB_ROOT/lib"
28     ZLIBI="ZLIB_INCLUDE=$ZLIB_ROOT/include"
29    
30 argiro 1.1 case $(uname) in
31 elmer 1.33 Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin --toolset=darwin || true ;;
32 dlange 1.22 * ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=gcc ;;
33 argiro 1.1 esac
34 ratnik 1.25 %else
35     bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$BZ2LIBI -sTOOLS=gcc
36     %endif
37 argiro 1.1
38     %install
39 ratnik 1.37
40     linkgccver=%(echo %gccver | tr -d . | perl -pe 's/^(\d\d).*/$1/')
41    
42 eulisse 1.6 boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//')
43 argiro 1.1 case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
44 dlange 1.20 #no debug libs...
45     #mkdir -p %i/lib/debug
46     mkdir %i/lib
47     #(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;)
48 elmer 1.33 # Perhaps the following could be done with a wildcard for the darwin/gcc dir
49     case $(uname) in
50     Darwin )
51     (cd bin.v2; find libs -path "libs/*/build/darwin*/release/*.$so*" -exec cp {} %i/lib/. \;)
52     ;;
53     * )
54     (cd bin.v2; find libs -path "libs/*/build/gcc*/release/*.$so*" -exec cp {} %i/lib/. \;)
55     ;;
56     esac
57 eulisse 1.7 find boost -name '*.[hi]*' -print |
58 argiro 1.1 while read f; do
59     mkdir -p %i/include/$(dirname $f)
60     install -c $f %i/include/$f
61     done
62     find libs -name '*.py' -print |
63     while read f; do
64     mkdir -p %i/lib/$(dirname $f)
65     install -c $f %i/lib/$f
66     done
67     [ $(uname) = Darwin ] &&
68 elmer 1.33 for f in %i/lib/*.$so %i/lib/*.$so; do
69 argiro 1.1 install_name_tool -id $f $f
70     done
71 eulisse 1.6
72 ratnik 1.19 # Do all manipulation with files before creating symbolic links:
73     perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin)
74 elmer 1.33 #strip %i/lib/*.$so
75 ratnik 1.19
76 ratnik 1.31
77     #(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
78     #(cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%realversion ; done)
79     (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/.%{realversion}$//"); done)
80     (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/-$boost_abi//" | sed "s/.%{realversion}$//"); done)
81 dlange 1.34 (cd %i/lib; for f in lib*-$boost_abi.$so.%{realversion}; do ln -s $f $(echo $f | sed "s/-$boost_abi//" | sed "s/.%{realversion}$//" | sed "s/gcc$linkgccver/gcc/"); done)
82 dlange 1.20 #(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-d-$boost_abi//"); done)
83     #(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%realversion; done)
84 eulisse 1.4 (cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i)
85 ratnik 1.16
86 eulisse 1.41 getLibName()
87     {
88     libname=`find %i/lib -name "libboost_$1*mt*" -exec basename {} \;`
89     echo $libname | sed -e 's|[.][^-]*$||;s|^lib||'
90     }
91    
92     export BOOST_THREAD_LIB=`getLibName thread`
93     export BOOST_SIGNALS_LIB=`getLibName signals`
94     export BOOST_FILESYSTEM_LIB=`getLibName filesystem`
95     export BOOST_PROGRAM_OPTIONS_LIB=`getLibName program_options`
96     export BOOST_PYTHON_LIB=`getLibName python`
97     export BOOST_REGEX_LIB=`getLibName regex`
98    
99 muzaffar 1.21 # SCRAM ToolBox toolfile
100     mkdir -p %i/etc/scram.d
101     # boost toolfile
102     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost
103     <doc type=BuildSystem::ToolDoc version=1.0>
104     <Tool name=boost version=%v>
105     <info url="http://www.boost.org"></info>
106 eulisse 1.41 <lib name="@BOOST_THREAD_LIB@">
107     <lib name="@BOOST_SIGNALS_LIB@">
108 muzaffar 1.21 <Client>
109     <Environment name=BOOST_BASE default="%i"></Environment>
110     <Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment>
111     <Environment name=INCLUDE default="$BOOST_BASE/include"></Environment>
112     </Client>
113     <use name=sockets>
114 dlange 1.22 <Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path>
115     <Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path>
116 muzaffar 1.21 </Tool>
117     EOF_TOOLFILE
118    
119     # boost_filesystem toolfile
120     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem
121     <doc type=BuildSystem::ToolDoc version=1.0>
122     <Tool name=boost_filesystem version=%v>
123     <info url="http://www.boost.org"></info>
124 eulisse 1.41 <lib name="@BOOST_FILESYSTEM_LIB@">
125 muzaffar 1.21 <use name=boost>
126     </Tool>
127     EOF_TOOLFILE
128    
129     # boost_program_options toolfile
130     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options
131     <doc type=BuildSystem::ToolDoc version=1.0>
132     <Tool name=boost_program_options version=%v>
133     <info url="http://www.boost.org"></info>
134 eulisse 1.41 <lib name="@BOOST_PROGRAM_OPTIONS_LIB@">
135 muzaffar 1.21 <use name=boost>
136     </Tool>
137     EOF_TOOLFILE
138    
139     # boost_python toolfile
140     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python
141     <doc type=BuildSystem::ToolDoc version=1.0>
142     <Tool name=boost_python version=%v>
143     <info url="http://www.boost.org"></info>
144 eulisse 1.41 <lib name="@BOOST_PYTHON_LIB@">
145 muzaffar 1.21 <Client>
146     <Environment name=BOOST_PYTHON_BASE default="%i"></Environment>
147     <Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python2.4/site-packages/Pyste/pyste.py"></Environment>
148     <Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment>
149     <Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment>
150     </Client>
151     <use name=elementtree>
152     <use name=gccxml>
153     <use name=python>
154     </Tool>
155     EOF_TOOLFILE
156    
157     # boost_regex toolfile
158     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex
159     <doc type=BuildSystem::ToolDoc version=1.0>
160     <Tool name=boost_regex version=%v>
161     <info url="http://www.boost.org"></info>
162 eulisse 1.41 <lib name="@BOOST_REGEX_LIB@">
163 muzaffar 1.21 <use name=boost>
164     </Tool>
165     EOF_TOOLFILE
166    
167     # boost_signals toolfile
168     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals
169     <doc type=BuildSystem::ToolDoc version=1.0>
170     <Tool name=boost_signals version=%v>
171     <info url="http://www.boost.org"></info>
172 eulisse 1.41 <lib name="@BOOST_SIGNALS_LIB@">
173 muzaffar 1.21 <use name=boost>
174     </Tool>
175     EOF_TOOLFILE
176    
177 eulisse 1.41 perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
178    
179 muzaffar 1.21 %post
180     %{relocateConfig}etc/scram.d/boost
181     %{relocateConfig}etc/scram.d/boost_filesystem
182     %{relocateConfig}etc/scram.d/boost_program_options
183     %{relocateConfig}etc/scram.d/boost_python
184     %{relocateConfig}etc/scram.d/boost_regex
185     %{relocateConfig}etc/scram.d/boost_signals