mirror of https://github.com/apache/cloudstack.git
Fix build for 2.1.x
This commit is contained in:
parent
50459fd30f
commit
7d0af0ff12
42
build.xml
42
build.xml
|
|
@ -10,7 +10,15 @@
|
|||
</description>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.Cloud.com Cloud Stack Build Dispatch}"/>
|
||||
<property name="build.dir" location="${base.dir}/build"/>
|
||||
|
||||
<condition property="build.dir" value="${base.dir}/build" else="${base.dir}/build"> <!-- silly no-op -->
|
||||
<and>
|
||||
<available file="cloudstack-proprietary/build/build-cloud-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
|
||||
<available file="${build.dir}/override/build-cloud.properties" />
|
||||
|
|
@ -21,57 +29,57 @@
|
|||
<property name="dist.dir" location="${base.dir}/dist"/>
|
||||
<property name="target.dir" location="${base.dir}/target"/>
|
||||
|
||||
<condition property="build.file" value="premium/build-cloud-premium.xml" else="build-cloud.xml">
|
||||
<condition property="build.file" value="cloudstack-proprietary/build/build-cloud-premium.xml" else="${build.dir}/build-cloud.xml">
|
||||
<and>
|
||||
<available file="build/premium/build-cloud-premium.xml"/>
|
||||
<available file="cloudstack-proprietary/build/build-cloud-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="package.file" value="premium/package-premium.xml" else="package.xml">
|
||||
<condition property="package.file" value="cloudstack-proprietary/build/package-premium.xml" else="${build.dir}/package.xml">
|
||||
<and>
|
||||
<available file="build/premium/package-premium.xml"/>
|
||||
<available file="cloudstack-proprietary/build/package-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="developer.file" value="premium/developer-premium.xml" else="developer.xml">
|
||||
<condition property="developer.file" value="cloudstack-proprietary/build/developer-premium.xml" else="${build.dir}/developer.xml">
|
||||
<and>
|
||||
<available file="build/premium/developer-premium.xml"/>
|
||||
<available file="cloudstack-proprietary/build/developer-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="docs.file" value="premium/build-docs-premium.xml" else="build-docs.xml">
|
||||
<condition property="docs.file" value="cloudstack-proprietary/build/build-docs-premium.xml" else="${build.dir}/build-docs.xml">
|
||||
<and>
|
||||
<available file="build/premium/build-docs-premium.xml"/>
|
||||
<available file="cloudstack-proprietary/build/build-docs-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="test.file" value="premium/build-tests-premium.xml" else="build-tests.xml">
|
||||
<condition property="test.file" value="cloudstack-proprietary/build/build-tests-premium.xml" else="${build.dir}/build-tests.xml">
|
||||
<and>
|
||||
<available file="build/premium/build-tests-premium.xml"/>
|
||||
<available file="cloudstack-proprietary/build/build-tests-premium.xml"/>
|
||||
<not>
|
||||
<isset property="OSS"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<import file="${base.dir}/plugins/zynga/build.xml" optional='true'/>
|
||||
<import file="${build.dir}/${build.file}" optional="false"/>
|
||||
<import file="${build.dir}/${docs.file}" optional="true"/>
|
||||
<import file="${build.dir}/${test.file}" optional="true"/>
|
||||
<import file="${build.dir}/${package.file}" optional="true"/>
|
||||
<import file="${build.dir}/${developer.file}" optional="true"/>
|
||||
<import file="${base.dir}/cloudstack-proprietary/plugins/zynga/build.xml" optional='true'/>
|
||||
<import file="${build.file}" optional="false"/>
|
||||
<import file="${docs.file}" optional="true"/>
|
||||
<import file="${test.file}" optional="true"/>
|
||||
<import file="${package.file}" optional="true"/>
|
||||
<import file="${developer.file}" optional="true"/>
|
||||
|
||||
</project>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@
|
|||
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
|
||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||
|
||||
<property name="thirdparty.dir" location="${base.dir}/thirdparty" />
|
||||
<property name="proprietary.dir" location="${base.dir}/cloudstack-proprietary" />
|
||||
|
||||
<property name="thirdparty.dir" location="${proprietary.dir}/thirdparty" />
|
||||
<property name="deps.dir" location="${base.dir}/deps" />
|
||||
|
||||
<!-- directories for client compilation-->
|
||||
|
|
|
|||
|
|
@ -232,7 +232,8 @@
|
|||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="sendjarfiles" depends="compile-utils, compile-core, compile-server, compile-agent, compile-console-common, compile-console-proxy, build-console-viewer">
|
||||
<!-- The following target is OBSOLETE. If you need to add a jar file / target, go to the function def runant(target): in wscrpit_build, and list the jar file and the target in the appropriate places -->
|
||||
<target name="sendjarfiles" depends="compile-utils, compile-core, compile-server, compile-agent, compile-console-common, compile-console-proxy, build-console-viewer">
|
||||
<copy todir="${waf.artifacts}">
|
||||
<fileset dir="${target.dir}/jar"/>
|
||||
</copy>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ BuildRequires: jpackage-utils
|
|||
BuildRequires: gcc
|
||||
BuildRequires: glibc-devel
|
||||
|
||||
%global _premium %(tar jtvmf %{SOURCE0} '*/premium/' --occurrence=1 2>/dev/null | wc -l)
|
||||
%global _premium %(tar jtvmf %{SOURCE0} '*/cloudstack-proprietary/' --occurrence=1 2>/dev/null | wc -l)
|
||||
|
||||
%description
|
||||
This is the Cloud.com Stack, a highly-scalable elastic, open source,
|
||||
|
|
|
|||
103
wscript
103
wscript
|
|
@ -135,9 +135,41 @@ def svninfo(*args):
|
|||
retcode = p.wait()
|
||||
# If the guess fails, just return nothing.
|
||||
if retcode: return
|
||||
return stdout
|
||||
# SVN available
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('Revision') ]
|
||||
if not rev: rev = ''
|
||||
else: rev = "SVN " + rev[0].strip()
|
||||
url = [ x for x in stdout.splitlines() if x.startswith('URL') ]
|
||||
if not url: url = ''
|
||||
else: url = "SVN " + url[0].strip()
|
||||
return rev + "\n" + url
|
||||
|
||||
def _getbuildnumber():
|
||||
def gitinfo(*args):
|
||||
try: p = _Popen(['git','remote','show','-n','origin']+list(args),stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
||||
except OSError,e:
|
||||
if e.errno == 2: return '' # svn command is not installed
|
||||
raise
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
# If the guess fails, just return nothing.
|
||||
if retcode: return
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
try: url = [ s[11:] for s in stdout if s.startswith("Fetch URL") ][0]
|
||||
except IndexError: url = [ s[5:] for s in stdout if s.startswith("URL") ][0]
|
||||
assert url
|
||||
|
||||
p = _Popen(['git','log','-1']+list(args),stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
if retcode: return
|
||||
# If the guess fails, just return nothing.
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
commitid = [ s.split()[1] for s in stdout if s.startswith("commit") ][0]
|
||||
assert commitid
|
||||
|
||||
return "Git Revision: %s"%commitid + "\n" + "Git URL: %s"%url
|
||||
|
||||
def _getbuildnumber(): # FIXME implement for git
|
||||
n = Options.options.BUILDNUMBER
|
||||
if n:
|
||||
# luntbuild prepends "build-" to the build number. we work around this here:
|
||||
|
|
@ -150,10 +182,10 @@ def _getbuildnumber():
|
|||
stdout = svninfo()
|
||||
if not stdout: return ''
|
||||
# Filter lines.
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('Revision') ]
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('SVN Revision') ]
|
||||
if not rev: return ''
|
||||
# Parse revision number.
|
||||
rev = rev[0][10:].strip()
|
||||
rev = rev[0][14:].strip()
|
||||
return rev
|
||||
Utils.getbuildnumber = _getbuildnumber
|
||||
|
||||
|
|
@ -290,7 +322,7 @@ def _install_files_filtered(self,destdir,listoffiles,**kwargs):
|
|||
if _isdir(f): continue
|
||||
if f.endswith(".in"):
|
||||
source = f ; target = f[:-3]
|
||||
tgen = self(features='subst', source=source[len(self.path.abspath())+1:], target=target[len(self.path.abspath())+1:])
|
||||
tgen = self(features='subst', source=source[len(self.path.abspath())+1:], target=target[len(self.path.abspath())+1:], name="filtered_%s"%source)
|
||||
tgen.dict = self.env.get_merged_dict()
|
||||
else:
|
||||
source = f ; target = f
|
||||
|
|
@ -467,19 +499,23 @@ def list_targets(ctx):
|
|||
for name in lst:
|
||||
print(name)
|
||||
|
||||
def dist(context):
|
||||
'''makes a tarball for redistributing the sources -- if --skip-dist is specified, does nothing'''
|
||||
if Options.options.DONTDIST:
|
||||
appname=Utils.g_module.APPNAME
|
||||
version=Utils.g_module.VERSION
|
||||
tmp_folder=appname+'-'+version
|
||||
if Scripting.g_gz in['gz','bz2']:
|
||||
arch_name=tmp_folder+'.tar.'+Scripting.g_gz
|
||||
def decorate_dist(f):
|
||||
def dist(appname='',version=''):
|
||||
'''makes a tarball for redistributing the sources -- if --skip-dist is specified, does nothing'''
|
||||
if Options.options.DONTDIST:
|
||||
if not appname: appname=Utils.g_module.APPNAME
|
||||
if not version: version=Utils.g_module.VERSION
|
||||
tmp_folder=appname+'-'+version
|
||||
if Scripting.g_gz in['gz','bz2']:
|
||||
arch_name=tmp_folder+'.tar.'+Scripting.g_gz
|
||||
else:
|
||||
arch_name=tmp_folder+'.'+'zip'
|
||||
Logs.info('New archive skipped: %s'%(arch_name))
|
||||
return arch_name
|
||||
else:
|
||||
arch_name=tmp_folder+'.'+'zip'
|
||||
return arch_name
|
||||
else:
|
||||
return Scripting.dist()
|
||||
return f(appname,version)
|
||||
return dist
|
||||
Scripting.dist = decorate_dist(Scripting.dist)
|
||||
|
||||
def dist_hook():
|
||||
# Clean the GARBAGE that clogs our repo to the tune of 300 MB
|
||||
|
|
@ -487,33 +523,16 @@ def dist_hook():
|
|||
# package over 90 MB in size
|
||||
[ shutil.rmtree(f) for f in _glob(_join("*","bin")) if _isdir(f) ]
|
||||
[ shutil.rmtree(f) for f in [ _join("build","deploy") ] if _isdir(f) ]
|
||||
[ shutil.rmtree(f) for f in _glob(_join("thirdparty","*")) if _isdir(f) ]
|
||||
[ shutil.rmtree(_join("tools",f)) for f in [
|
||||
"bin",
|
||||
"meld",
|
||||
"misc",
|
||||
"tomcat",
|
||||
"pdfdoclet",
|
||||
"taglets",
|
||||
] if _exists(_join("tools",f)) ]
|
||||
|
||||
[ shutil.rmtree(f) for f in _glob(_join("cloudstack-proprietary","thirdparty","*")) if _isdir(f) ]
|
||||
[ shutil.rmtree(f) for f in [ _join("cloudstack-proprietary","tools") ] if _isdir(f) ]
|
||||
|
||||
if Options.options.OSS:
|
||||
[ shutil.rmtree(f) for f in "premium usage thirdparty console-proxy-premium test agent-simulator core-premium plugins vendor".split() if _exists(f) ]
|
||||
[ shutil.rmtree(f) for f in [ _join("build","premium") ] if _exists(f) ]
|
||||
[ shutil.rmtree(f) for f in "cloudstack-proprietary".split() if _exists(f) ]
|
||||
|
||||
stdout = svninfo("..")
|
||||
stdout = svninfo("..") or gitinfo()
|
||||
if stdout:
|
||||
# SVN available
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('Revision') ]
|
||||
if not rev: rev = ''
|
||||
else: rev = "SVN " + rev[0].strip()
|
||||
url = [ x for x in stdout.splitlines() if x.startswith('URL') ]
|
||||
if not url: url = ''
|
||||
else: url = "SVN " + url[0].strip()
|
||||
f = file("sccs-info","w")
|
||||
if rev: f.write("%s\n"%rev)
|
||||
if url: f.write("%s\n"%url)
|
||||
f.write(stdout)
|
||||
f.flush()
|
||||
f.close()
|
||||
else:
|
||||
|
|
@ -561,12 +580,11 @@ def rpm(context):
|
|||
if not Options.options.blddir: outputdir = _join(context.curdir,blddir,"rpmbuild")
|
||||
else: outputdir = _join(_abspath(Options.options.blddir),"rpmbuild")
|
||||
Utils.pprint("GREEN","Building RPMs")
|
||||
if not Options.options.DONTDIST: Scripting.dist()
|
||||
tarball = Scripting.dist()
|
||||
|
||||
#if _isdir(outputdir): shutil.rmtree(outputdir)
|
||||
for a in ["RPMS/noarch","SRPMS","BUILD","SPECS","SOURCES"]: mkdir_p(_join(outputdir,a))
|
||||
specfile = "%s.spec"%APPNAME
|
||||
tarball = "%s-%s.tar.%s"%(APPNAME,VERSION,Scripting.g_gz)
|
||||
shutil.copy(tarball,_join(outputdir,"SOURCES"))
|
||||
checkdeps = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"--nobuild",specfile])
|
||||
dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-ba",specfile]+buildnumber+prerelease)
|
||||
|
|
@ -605,11 +623,10 @@ def deb(context):
|
|||
if not Options.options.blddir: outputdir = _join(context.curdir,blddir,"debbuild")
|
||||
else: outputdir = _join(_abspath(Options.options.blddir),"debbuild")
|
||||
Utils.pprint("GREEN","Building DEBs")
|
||||
if not Options.options.DONTDIST: Scripting.dist()
|
||||
tarball = Scripting.dist()
|
||||
|
||||
#if _isdir(outputdir): shutil.rmtree(outputdir)
|
||||
mkdir_p(outputdir)
|
||||
tarball = "%s-%s.tar.%s"%(APPNAME,VERSION,Scripting.g_gz)
|
||||
f = tarfile.open(tarball,'r:bz2')
|
||||
f.extractall(path=outputdir)
|
||||
srcdir = "%s/%s-%s"%(outputdir,APPNAME,VERSION)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ for e in required_env:
|
|||
|
||||
sourcedir = bld.srcnode.abspath()
|
||||
builddir = bld.path.abspath(bld.env)
|
||||
buildpremium = _exists(_join(sourcedir,"premium"))
|
||||
buildpremium = _exists(_join(sourcedir,"cloudstack-proprietary"))
|
||||
filelist = bld.path.ant_glob
|
||||
|
||||
sccsinfo = _join(sourcedir,"sccs-info")
|
||||
|
|
@ -65,7 +65,7 @@ if buildpremium: antxmlfiles += _glob(_join("build","premium","*.xml")) + _glob(
|
|||
targets,antprops = Utils.discover_ant_targets_and_properties(antxmlfiles)
|
||||
|
||||
javac_env = bld.env.copy()
|
||||
# FIXME trigger recompilation / cache avoidance when debuglevel changes
|
||||
# FIXME trigger recompilation / cache avoidance when debuglevel changes. ATM this does not happen.
|
||||
if antprops.get('debuglevel',None): javac_env.append_value("JAVACFLAGS",["-g:%s"%antprops['debuglevel']])
|
||||
Implementation_Version = bld.env.VERSION
|
||||
buildnumber = Utils.getbuildnumber()
|
||||
|
|
@ -74,9 +74,6 @@ if buildnumber: Implementation_Version += "." + buildnumber
|
|||
# compile .class files using waf
|
||||
classpathentries = [ _join(builddir,x[2]) for x in targets ]
|
||||
javawclasspath = pathsep.join( classpathentries + [ _abspath(x) for x in bld.env.CLASSPATH.split(pathsep) ] )
|
||||
#for entry in javawclasspath.split(pathsep):
|
||||
#print entry
|
||||
#assert os.path.exists(entry)
|
||||
javac_tgens = [
|
||||
bld( features='javac', name=name, srcdir=srcdir, outdir=classdir,
|
||||
after=" ".join(deps), classpath=javawclasspath, env=javac_env )
|
||||
|
|
@ -103,6 +100,8 @@ if not buildpremium: ant_args += ["-DOSS=true"]
|
|||
# this is to trigger recompilation / cache avoidance if the relevant environment for ant changes
|
||||
tgen = bld(features='subst', name='version-info', source="version-info.in", target="version-info")
|
||||
tgen.dict = { "Implementation_Version":Implementation_Version,"JAVACFLAGS":javac_env.JAVACFLAGS,"ant_args":ant_args }
|
||||
bld.install_files("${DOCDIR}","version-info")
|
||||
|
||||
build_targets += ["version-info"]
|
||||
ant_sources += " version-info"
|
||||
|
||||
|
|
@ -154,7 +153,7 @@ if bld.env.DISTRO not in ['Windows','Mac']:
|
|||
# ================ Third-party / dependency installation ===============
|
||||
|
||||
bld.install_files('${JAVADIR}','deps/*.jar')
|
||||
if buildpremium: bld.install_files('${PREMIUMJAVADIR}','thirdparty/*.jar')
|
||||
if buildpremium: bld.install_files('${PREMIUMJAVADIR}','cloudstack-proprietary/thirdparty/*.jar')
|
||||
|
||||
# =================== End 3rdparty/dep install ========================
|
||||
|
||||
|
|
@ -266,20 +265,20 @@ deps = " ".join( Utils.to_list(
|
|||
) )
|
||||
thirdparties = " ".join( Utils.to_list(
|
||||
"""
|
||||
thirdparty/xmlrpc-client-3.1.3.jar
|
||||
thirdparty/xmlrpc-common-3.1.3.jar
|
||||
thirdparty/ws-commons-util-1.0.2.jar
|
||||
thirdparty/log4j-1.2.15.jar
|
||||
thirdparty/gson-1.3.jar
|
||||
thirdparty/apache-log4j-extras-1.0.jar
|
||||
thirdparty/commons-httpclient-3.1.jar
|
||||
thirdparty/commons-logging-1.1.1.jar
|
||||
thirdparty/commons-collections-3.2.1.jar
|
||||
thirdparty/commons-codec-1.4.jar
|
||||
thirdparty/commons-pool-1.4.jar
|
||||
thirdparty/libvirt-0.4.5.jar
|
||||
thirdparty/jna.jar
|
||||
thirdparty/cglib-nodep-2.2.jar
|
||||
cloudstack-proprietary/thirdparty/xmlrpc-client-3.1.3.jar
|
||||
cloudstack-proprietary/thirdparty/xmlrpc-common-3.1.3.jar
|
||||
cloudstack-proprietary/thirdparty/ws-commons-util-1.0.2.jar
|
||||
cloudstack-proprietary/thirdparty/log4j-1.2.15.jar
|
||||
cloudstack-proprietary/thirdparty/gson-1.3.jar
|
||||
cloudstack-proprietary/thirdparty/apache-log4j-extras-1.0.jar
|
||||
cloudstack-proprietary/thirdparty/commons-httpclient-3.1.jar
|
||||
cloudstack-proprietary/thirdparty/commons-logging-1.1.1.jar
|
||||
cloudstack-proprietary/thirdparty/commons-collections-3.2.1.jar
|
||||
cloudstack-proprietary/thirdparty/commons-codec-1.4.jar
|
||||
cloudstack-proprietary/thirdparty/commons-pool-1.4.jar
|
||||
cloudstack-proprietary/thirdparty/libvirt-0.4.5.jar
|
||||
cloudstack-proprietary/thirdparty/jna.jar
|
||||
cloudstack-proprietary/thirdparty/cglib-nodep-2.2.jar
|
||||
"""
|
||||
) )
|
||||
|
||||
|
|
@ -295,9 +294,9 @@ patterns = Utils.to_list(
|
|||
scripts/storage/secondary/*sh
|
||||
"""
|
||||
)
|
||||
premiumpatterns = patterns + ["console-proxy-premium/certs/**"]
|
||||
premiumpatterns = patterns + ["cloudstack-proprietary/console-proxy-premium/certs/**"]
|
||||
|
||||
artifacts = "target/jar/VMOpsConsoleApplet.jar " + " ".join( "target/jar/cloud-%s.jar"%j for j in "console-proxy console-common agent utils core".split() )
|
||||
artifacts = "target/jar/VMOpsConsoleApplet.jar " + " ".join( "target/jar/cloud-%s.jar"%j for j in "console-proxy console-common agent utils api core".split() )
|
||||
premiumartifacts = artifacts + " target/jar/cloud-console-proxy-premium.jar"
|
||||
|
||||
sources = " ".join( [ filelist(x,src=True,bld=False,dir=False,flat=True) for x in patterns ] )
|
||||
|
|
@ -317,16 +316,24 @@ def zip_up(task):
|
|||
for inp in task.inputs:
|
||||
if inp.id&3==Node.BUILD:
|
||||
src = inp.bldpath(task.env)
|
||||
srcname = "/".join(src.split("/")[1:])
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off default/
|
||||
if srcname.startswith("target/jar"): srcname = "/".join(srcname.split("/")[2:]) # chop off target/jar
|
||||
else:
|
||||
src = inp.srcpath(task.env)
|
||||
srcname = "/".join(src.split("/")[2:])
|
||||
if srcname.startswith('scripts/run') or srcname.startswith('scripts/config_ssl') \
|
||||
or srcname.startswith('scripts/config_auth') or srcname.startswith('scripts/ssvm-check'): srcname = "/".join(srcname.split("/")[1:])
|
||||
elif srcname.startswith('storage'): srcname = "scripts/" + srcname
|
||||
elif srcname.startswith('VMOpsConsoleApplet'): srcname = "applet/" + srcname
|
||||
elif srcname.startswith('certs'): srcname = srcname
|
||||
srcname = src
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off ../
|
||||
if srcname.startswith("cloudstack-proprietary"): srcname = "/".join(srcname.split("/")[1:]) # chop off cloudstack proprietary
|
||||
srcname = "/".join(srcname.split("/")[1:]) # chop off project name
|
||||
# post-process the paths
|
||||
if True in [ srcname.startswith(strt) for strt in [ 'scripts/run','scripts/config_ssl','scripts/config_auth','scripts/ssvm-check' ] ]:
|
||||
srcname = "/".join(srcname.split("/")[1:])
|
||||
elif srcname.startswith('storage'):
|
||||
srcname = "scripts/" + srcname
|
||||
elif srcname.startswith('VMOpsConsoleApplet'):
|
||||
srcname = "applet/" + srcname
|
||||
elif srcname.startswith('certs'):
|
||||
srcname = srcname
|
||||
z.write(src,srcname)
|
||||
z.close()
|
||||
return 0
|
||||
|
|
@ -429,9 +436,9 @@ for src,tgt,inst in zip(src_files,subst_files,inst_files):
|
|||
|
||||
# ================== Subst / installation of scripts in bin directories ========================
|
||||
|
||||
bld.install_files_filtered("${LIBEXECDIR}","*/libexec/*",chmod=0755)
|
||||
bld.install_files_filtered("${BINDIR}","*/bindir/*",chmod=0755)
|
||||
bld.install_files_filtered("${SBINDIR}","*/sbindir/*",chmod=0755)
|
||||
bld.install_files_filtered("${LIBEXECDIR}","*/libexec/* cloudstack-proprietary/*/libexec/*",chmod=0755)
|
||||
bld.install_files_filtered("${BINDIR}","*/bindir/* cloudstack-proprietary/*/bindir/*",chmod=0755)
|
||||
bld.install_files_filtered("${SBINDIR}","*/sbindir/* cloudstack-proprietary/*/sbindir/*",chmod=0755)
|
||||
|
||||
# ================== End subst / installation of scripts in bin directories ========================
|
||||
|
||||
|
|
@ -441,16 +448,16 @@ bld.install_files_filtered("${SBINDIR}","*/sbindir/*",chmod=0755)
|
|||
# build / install declarations of test project
|
||||
if buildpremium:
|
||||
proj = 'test'
|
||||
start_path = bld.path.find_dir("test/scripts")
|
||||
start_path = bld.path.find_dir("cloudstack-proprietary/test/scripts")
|
||||
bld.install_files('${LIBDIR}/${PACKAGE}/test',
|
||||
start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True),
|
||||
cwd=start_path,relative_trick=True)
|
||||
start_path = bld.path.find_dir("test/metadata")
|
||||
start_path = bld.path.find_dir("cloudstack-proprietary/test/metadata")
|
||||
bld.install_files('${SHAREDSTATEDIR}/${PACKAGE}/test',
|
||||
start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True),
|
||||
cwd=start_path,relative_trick=True)
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files('${SYSCONFDIR}/%s/%s'%(bld.env.PACKAGE,proj),'%s/conf/*'%proj) # install config
|
||||
bld.install_files('${SYSCONFDIR}/%s/%s'%(bld.env.PACKAGE,proj),'cloudstack-proprietary/test/conf/*')
|
||||
|
||||
# build / install declarations of server project <- this is actually now in client project
|
||||
bld.install_files("${MSENVIRON}/webapps/client/WEB-INF",'client/WEB-INF/web.xml') # install web.xml file
|
||||
|
|
@ -465,7 +472,6 @@ bld.install_files("${AGENTLIBDIR}",
|
|||
cwd=start_path,relative_trick=True)
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${AGENTSYSCONFDIR}","%s/conf/*"%proj)
|
||||
bld.install_files_filtered("${BINDIR}","%s/bindir/*"%proj,chmod=0755)
|
||||
|
||||
# build / install declarations of client UI project
|
||||
|
||||
|
|
@ -476,7 +482,7 @@ bld.install_files("${MSENVIRON}/webapps/client",
|
|||
cwd=start_path,relative_trick=True)
|
||||
|
||||
# -> source files with tokens
|
||||
patterns = 'ui/*html ui/**/*html ui/**/*js ui/**/*css'
|
||||
patterns = 'ui/*html ui/**/*html ui/**/*js ui/**/*css ui/**/*properties ui/**/*jsp'
|
||||
src_files = Utils.to_list(filelist(patterns,flat=True))
|
||||
subst_files = [ x+".subst" for x in src_files ]
|
||||
inst_files = [ Utils.relpath(x,"ui") for x in src_files ]
|
||||
|
|
@ -522,12 +528,13 @@ bld.install_files("${MSENVIRON}/webapps/client/scripts", "ui/scripts/cloud.min.j
|
|||
|
||||
# substitute and install generic tomcat config
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${MSCONF}",filelist("*/tomcatconf/*"))
|
||||
bld.install_files_filtered("${MSCONF}","*/tomcatconf/* cloudstack-proprietary/*/tomcatconf/*")
|
||||
bld.install_files("${MSCONF}",'client/tomcatconf/db.properties',chmod=0640)
|
||||
bld.setownership("${MSCONF}/db.properties","root",bld.env.MSUSER)
|
||||
|
||||
# apply distro-specific config on top of the 'all' generic cloud-management config
|
||||
distrospecificdirs=_glob(_join("*","distro",bld.env.DISTRO.lower(),"*"))
|
||||
globspec = _join("*","distro",bld.env.DISTRO.lower(),"*") # matches premium/distro/centos/SYSCONFDIR
|
||||
distrospecificdirs=_glob(globspec) + _glob(_join("cloudstack-proprietary",globspec))
|
||||
for dsdir in distrospecificdirs:
|
||||
start_path = bld.srcnode.find_dir(dsdir)
|
||||
subpath,varname = _split(dsdir)
|
||||
|
|
@ -542,18 +549,20 @@ for dsdir in distrospecificdirs:
|
|||
# build / install declarations of usage
|
||||
if buildpremium:
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${USAGESYSCONFDIR}","usage/conf/*")
|
||||
#print filelist("usage/conf/* cloudstack-proprietary/usage/conf/*")
|
||||
#assert False
|
||||
bld.install_files_filtered("${USAGESYSCONFDIR}","usage/conf/* cloudstack-proprietary/usage/conf/*")
|
||||
bld.symlink_as("${USAGESYSCONFDIR}/db.properties",Utils.subst_vars("${MSCONF}/db.properties",bld.env))
|
||||
|
||||
# install db data files
|
||||
bld.install_files_filtered("${SETUPDATADIR}",filelist("*/db/*",excl=Node.exclude_regs + "\ncloud-gate"))
|
||||
bld.install_files_filtered("${SETUPDATADIR}",filelist("*/db/* cloudstack-proprietary/*/db/*",excl=Node.exclude_regs + "\ncloud-gate\ncloud-bridge"))
|
||||
|
||||
# ================== End installation of scripts / bindirs / configuration files ===========================
|
||||
|
||||
|
||||
# ====================== Feature-specific plugins ========================
|
||||
|
||||
for plugin in _glob(_join("plugins","*")):
|
||||
for plugin in _glob(_join("plugins","*")) + _glob(_join("cloudstack-proprietary","plugins","*")):
|
||||
if not _exists(_join(plugin,"build.xml")): continue
|
||||
pluginname = _basename(plugin)
|
||||
target = 'target/jar/cloud-%s.jar' % pluginname
|
||||
|
|
@ -566,7 +575,7 @@ for plugin in _glob(_join("plugins","*")):
|
|||
|
||||
# ====================== Vendor-specific plugins ========================
|
||||
|
||||
for vendor in _glob(_join("vendor","*")):
|
||||
for vendor in _glob(_join("vendor","*")) + _glob(_join("cloudstack-proprietary","vendor","*")):
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${MSCONF}/%s"%vendor,filelist("%s/tomcatconf/*"%vendor))
|
||||
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ conf.env.USAGECLASSPATH = pathsep.join(usageclasspath)
|
|||
compilecp = []# list(srcdirs)
|
||||
# 2.a) the thirdparty/ directory in the source if on Windows / Mac
|
||||
# 2.b) the deps/ directory in the source if on Linux
|
||||
if conf.env.DISTRO in ["Windows","Mac"]: compilecp+= _glob(_join("thirdparty","*.jar"))
|
||||
if conf.env.DISTRO in ["Windows","Mac"]: compilecp+= _glob(_join("cloudstack-proprietary","thirdparty","*.jar"))
|
||||
else: compilecp+= _glob(_join("deps","*.jar"))
|
||||
# 3. the system classpath (system-installed JARs)
|
||||
compilecp+= [ conf.env.SYSTEMCLASSPATH ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue