ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/boost.spec
Revision: 1.26
Committed: Tue Oct 16 08:38:00 2007 UTC (17 years, 6 months ago) by ratnik
Branch: MAIN
CVS Tags: forTony_001, nr071017_170p5onl2, nr071016_170p5onl1
Changes since 1.25: +1 -1 lines
Log Message:
Undo onl version suffix: causes difficulties with downloading source

File Contents

# User Rev Content
1 ratnik 1.26 ### RPM external boost 1.33.1-CMS9
2 argiro 1.1 # Patches and build fudging by Lassi A. Tuura <lat@iki.fi> (FIXME: contribute to boost)
3 elmer 1.17 %define boostver _%(echo %realversion | tr . _)
4 argiro 1.2 Source: http://dl.sourceforge.net/sourceforge/%n/%{n}%{boostver}.tar.gz
5 argiro 1.1
6 ratnik 1.25 Requires: boost-build python bz2lib
7     %if "%{?online_release:set}" != "set"
8     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     %if "%{?online_release:set}" != "set"
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 dlange 1.22 Darwin ) bjam %makeprocesses -s$PR -s$PV -s$BZ2LIBR -s$ZLIBR -sTOOLS=darwin || true ;;
33     * ) 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 eulisse 1.6 boost_abi=$(echo %boostver | sed 's/^_//; s/_0$//')
41 argiro 1.1 case $(uname) in Darwin ) so=dylib ;; * ) so=so ;; esac
42 dlange 1.20 #no debug libs...
43     #mkdir -p %i/lib/debug
44     mkdir %i/lib
45     #(cd bin/boost; find libs -path "libs/*/debug/*.$so" -exec cp {} %i/lib/debug \;)
46     (cd bin/boost; find libs -path "libs/*/release/*.$so" -exec cp {} %i/lib/. \;)
47 eulisse 1.7 find boost -name '*.[hi]*' -print |
48 argiro 1.1 while read f; do
49     mkdir -p %i/include/$(dirname $f)
50     install -c $f %i/include/$f
51     done
52     find libs -name '*.py' -print |
53     while read f; do
54     mkdir -p %i/lib/$(dirname $f)
55     install -c $f %i/lib/$f
56     done
57     [ $(uname) = Darwin ] &&
58     for f in %i/lib/*.$so %i/lib/debug/*.$so; do
59     install_name_tool -id $f $f
60     done
61 eulisse 1.6
62 ratnik 1.19 # Do all manipulation with files before creating symbolic links:
63     perl -p -i -e "s|^#!.*python|/usr/bin/env python|" $(find %{i}/lib %{i}/bin)
64 dlange 1.20 strip %i/lib/*.$so
65 ratnik 1.19
66 argiro 1.1 (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $(echo $f | sed "s/-$boost_abi//"); done)
67 elmer 1.17 (cd %i/lib; for f in lib*-$boost_abi.$so; do ln -s $f $f.%realversion ; done)
68 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)
69     #(cd %i/lib/debug; for f in lib*-d-$boost_abi.$so; do ln -s $f $f.%realversion; done)
70 eulisse 1.4 (cd %i/lib/libs/python/pyste/install; python setup.py install --prefix=%i)
71 ratnik 1.16
72 muzaffar 1.21 # SCRAM ToolBox toolfile
73     mkdir -p %i/etc/scram.d
74     # boost toolfile
75     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost
76     <doc type=BuildSystem::ToolDoc version=1.0>
77     <Tool name=boost version=%v>
78     <info url="http://www.boost.org"></info>
79     <lib name=boost_thread-gcc-mt>
80     <lib name=boost_signals-gcc-mt>
81     <Client>
82     <Environment name=BOOST_BASE default="%i"></Environment>
83     <Environment name=LIBDIR default="$BOOST_BASE/lib"></Environment>
84     <Environment name=INCLUDE default="$BOOST_BASE/include"></Environment>
85     </Client>
86     <use name=sockets>
87 dlange 1.22 <Runtime name=LD_LIBRARY_PATH value="$BOOST_BASE/lib" type=path>
88     <Runtime name=CMSSW_FWLITE_INCLUDE_PATH value="$BOOST_BASE/include" type=path>
89 muzaffar 1.21 </Tool>
90     EOF_TOOLFILE
91    
92     # boost_filesystem toolfile
93     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_filesystem
94     <doc type=BuildSystem::ToolDoc version=1.0>
95     <Tool name=boost_filesystem version=%v>
96     <info url="http://www.boost.org"></info>
97     <lib name=boost_filesystem-gcc-mt>
98     <use name=boost>
99     </Tool>
100     EOF_TOOLFILE
101    
102     # boost_program_options toolfile
103     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_program_options
104     <doc type=BuildSystem::ToolDoc version=1.0>
105     <Tool name=boost_program_options version=%v>
106     <info url="http://www.boost.org"></info>
107     <lib name=boost_program_options-gcc-mt>
108     <use name=boost>
109     </Tool>
110     EOF_TOOLFILE
111    
112     # boost_python toolfile
113     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_python
114     <doc type=BuildSystem::ToolDoc version=1.0>
115     <Tool name=boost_python version=%v>
116     <info url="http://www.boost.org"></info>
117     <lib name=boost_python-gcc-mt>
118     <Client>
119     <Environment name=BOOST_PYTHON_BASE default="%i"></Environment>
120     <Environment name=PYSTE_EXEC default="$BOOST_PYTHON_BASE/lib/python2.4/site-packages/Pyste/pyste.py"></Environment>
121     <Environment name=LIBDIR default="$BOOST_PYTHON_BASE/lib"></Environment>
122     <Environment name=INCLUDE default="$BOOST_PYTHON_BASE/include"></Environment>
123     </Client>
124     <use name=elementtree>
125     <use name=gccxml>
126     <use name=python>
127     </Tool>
128     EOF_TOOLFILE
129    
130     # boost_regex toolfile
131     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_regex
132     <doc type=BuildSystem::ToolDoc version=1.0>
133     <Tool name=boost_regex version=%v>
134     <info url="http://www.boost.org"></info>
135     <lib name=boost_regex-gcc-mt>
136     <use name=boost>
137     </Tool>
138     EOF_TOOLFILE
139    
140     # boost_signals toolfile
141     cat << \EOF_TOOLFILE >%i/etc/scram.d/boost_signals
142     <doc type=BuildSystem::ToolDoc version=1.0>
143     <Tool name=boost_signals version=%v>
144     <info url="http://www.boost.org"></info>
145     <lib name=boost_signals-gcc-mt>
146     <use name=boost>
147     </Tool>
148     EOF_TOOLFILE
149    
150     %post
151     %{relocateConfig}etc/scram.d/boost
152     %{relocateConfig}etc/scram.d/boost_filesystem
153     %{relocateConfig}etc/scram.d/boost_program_options
154     %{relocateConfig}etc/scram.d/boost_python
155     %{relocateConfig}etc/scram.d/boost_regex
156     %{relocateConfig}etc/scram.d/boost_signals