forked from iLCSoft/iLCInstall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dcap.py
62 lines (46 loc) · 2.06 KB
/
dcap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
##################################################
#
# dcap module
#
# Author: Jan Engels, DESY
# Date: Nov, 2009
#
##################################################
# custom imports
from .baseilc import BaseILC
from .util import *
class dcap(BaseILC):
""" Responsible for building dcap library """
def __init__(self, userInput):
BaseILC.__init__(self, userInput, "dcap", "dcap")
self.hasCMakeBuildSupport = False
self.hasCMakeFindSupport = False
self.download.supportedTypes = [ "svn", "svn-export" ]
self.reqfiles = [ ["lib/libdcap.so"] ]
def setMode(self, mode):
BaseILC.setMode(self, mode)
# avoid warning 'download forced....'
if self.download.type != "svn":
self.download.type='svn-export'
if( Version( self.version ) == 'HEAD' ):
self.download.svnurl = 'http://svn.dcache.org/dCache/trunk/modules/dcap'
else:
# 1.9.5-5
self.download.svnurl = 'http://svn.dcache.org/dCache/tags/%s/modules/dcap' % self.version
def compile(self):
os.chdir( self.installPath )
if self.rebuild:
os_system( "make clean 2>&1 | tee -a " + self.logfile )
# 'make install' crashes if MAKEFLAGS includes "-j2"
if( os_system( "unset MAKEFLAGS; make CC=\"gcc ${CFLAGS}\" LD=\"gcc ${LDFLAGS}\" BIN_PATH=${PWD} install 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to compile!!" )
#if( os_system( 'export MAKEFLAGS="CC=gcc\ ${CFLAGS} LD=gcc\ ${LDFLAGS} BIN_PATH=${PWD}" ; make install 2>&1 | tee -a ' + self.logfile ) != 0 ):
# self.abort( "failed to compile!!" )
def postCheckDeps(self):
BaseILC.postCheckDeps(self)
self.env["DCAP"] = self.installPath
self.envpath["LD_LIBRARY_PATH"].append( "$DCAP/lib" )
# set LD_PRELOAD with envcmds instead of env to
# avoid endless ERROR messages building the dcap library
# self.env["LD_PRELOAD"] = "libdcap.so"
self.envcmds.append( "export LD_PRELOAD=libdcap.so" )