ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/boost.spec
Revision: 1.45
Committed: Thu Jun 18 16:02:47 2009 UTC (15 years, 10 months ago) by muzaffar
Branch: MAIN
CVS Tags: sm090619a, sm090618a
Changes since 1.44: +3 -3 lines
Log Message:
cleanup of hard coded online arch string

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