ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/google-perftools.spec
Revision: 1.1
Committed: Mon Jun 23 00:48:16 2008 UTC (16 years, 10 months ago) by elmer
Branch: MAIN
CVS Tags: pe20080623-for21X-gp
Log Message:
Add spec file for google-perftools (i.e. tcmalloc). 64bit build is currently
faked out, as it requires libunwind.

File Contents

# User Rev Content
1 elmer 1.1 ### RPM external google-perftools 0.98
2     Source: http://google-perftools.googlecode.com/files/%n-%{realversion}.tar.gz
3    
4     %prep
5     %setup -n %n-%realversion
6    
7     %build
8     %if (("%cmsplatf" == "slc4_ia32_gcc412")||("%cmsplatf" == "slc4_ia32_gcc422")||("%cmsplatf" == "slc4_ia32_gcc345"))
9     ./configure --prefix=%i
10     make %makeprocesses
11     %endif
12     %if ("%cmsplatf" == "slc4_amd64_gcc345")
13     # Make a fake library for now to keep everything happy. Actually building
14     # for 64bit requires building libunwind, which we are not yet doing at
15     # the moment.
16     cat << \EOF_TMPFILE > tmpgp.cc
17     namespace gptmp {
18     void foo(void*) {
19     }
20     }
21     EOF_TMPFILE
22     g++ -o tmp.o -fPIC tmpgp.cc
23     g++ -shared -o libgptmp.so tmp.o
24     %endif
25    
26     %install
27     %if (("%cmsplatf" == "slc4_ia32_gcc412")||("%cmsplatf" == "slc4_ia32_gcc422")||("%cmsplatf" == "slc4_ia32_gcc345"))
28     make install
29     %endif
30     %if ("%cmsplatf" == "slc4_amd64_gcc345")
31     # Just copy over the dummy library
32     mkdir -p %i/lib
33     cp libgptmp.so %i/lib/libtcmalloc.so
34     cp libgptmp.so %i/lib/libtcmalloc_minimal.so
35     %endif
36    
37     # SCRAM ToolBox toolfile
38     mkdir -p %i/etc/scram.d
39     cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
40     <doc type=BuildSystem::ToolDoc version=1.0>
41     <Tool name=tcmalloc_minimal version=%v>
42     <lib name=tcmalloc_minimal>
43     <client>
44     <Environment name=GOOGLE-PERFTOOLS_BASE default="%i"></Environment>
45     <Environment name=LIBDIR default="$GOOGLE-PERFTOOLS_BASE/lib"></Environment>
46     </client>
47     </Tool>
48     EOF_TOOLFILE
49    
50     cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
51     <doc type=BuildSystem::ToolDoc version=1.0>
52     <Tool name=tcmalloc version=%v>
53     <lib name=tcmalloc>
54     <client>
55     <Environment name=GOOGLE-PERFTOOLS_BASE default="%i"></Environment>
56     <Environment name=LIBDIR default="$GOOGLE-PERFTOOLS_BASE/lib"></Environment>
57     </client>
58     </Tool>
59     EOF_TOOLFILE
60    
61    
62     %post
63     %{relocateConfig}etc/scram.d/%n