mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Add --package-version option for waf build
the version will be used for rpm version number as well as version number of jar manifest file. manifest info could retrieve by listcapbilities API
This commit is contained in:
parent
53b15e32ca
commit
4841afe64c
@ -4,7 +4,6 @@
|
||||
# DISABLE the post-percentinstall java repacking and line number stripping
|
||||
# we need to find a way to just disable the java repacking and line number stripping, but not the autodeps
|
||||
|
||||
%define _ver 2.1.97
|
||||
%define _rel 1
|
||||
|
||||
Name: cloud
|
||||
@ -342,7 +341,7 @@ echo Doing open source build
|
||||
%define _localstatedir /var
|
||||
%define _sharedstatedir /var/lib
|
||||
./waf configure --prefix=%{_prefix} --libdir=%{_libdir} --bindir=%{_bindir} --javadir=%{_javadir} --sharedstatedir=%{_sharedstatedir} --localstatedir=%{_localstatedir} --sysconfdir=%{_sysconfdir} --mandir=%{_mandir} --docdir=%{_docdir}/%{name}-%{version} --with-tomcat=%{_datadir}/tomcat6 --tomcat-user=%{name} --fast --build-number=%{_ver}-%{release}
|
||||
./waf build --build-number=%{?_build_number}
|
||||
./waf build --build-number=%{?_build_number} --package-version=%{_ver}
|
||||
|
||||
%install
|
||||
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
14
wscript
14
wscript
@ -427,6 +427,10 @@ def set_options(opt):
|
||||
help = 'Build number [Default: SVN revision number for builds from checkouts, or empty for builds from source releases]',
|
||||
default = '',
|
||||
dest = 'BUILDNUMBER')
|
||||
rpmopts.add_option('--package-version',
|
||||
help = 'package version',
|
||||
default = '',
|
||||
dest = 'VERNUM')
|
||||
rpmopts.add_option('--prerelease',
|
||||
help = 'Branch name to append to the release number (if specified, alter release number to be a prerelease); this option requires --build-number=X [Default: nothing]',
|
||||
default = '',
|
||||
@ -567,13 +571,19 @@ def rpm(context):
|
||||
raise Utils.WafError("Please specify a build number to go along with --prerelease")
|
||||
prerelease = ["--define","_prerelease %s"%Options.options.PRERELEASE]
|
||||
else: prerelease = []
|
||||
|
||||
if Options.options.VERNUM:
|
||||
ver = Options.options.VERNUM
|
||||
else: ver = "2.2"
|
||||
|
||||
packagever = ["--define", "_ver %s" % ver]
|
||||
|
||||
# FIXME wrap the source tarball in POSIX locking!
|
||||
if not Options.options.blddir: outputdir = _join(context.curdir,blddir,"rpmbuild")
|
||||
else: outputdir = _join(_abspath(Options.options.blddir),"rpmbuild")
|
||||
Utils.pprint("GREEN","Building RPMs")
|
||||
|
||||
tarball = Scripting.dist()
|
||||
tarball = Scripting.dist('', ver)
|
||||
sourcedir = _join(outputdir,"SOURCES")
|
||||
|
||||
if _exists(sourcedir): shutil.rmtree(sourcedir)
|
||||
@ -582,7 +592,7 @@ def rpm(context):
|
||||
|
||||
specfile = "%s.spec"%APPNAME
|
||||
checkdeps = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"--nobuild",specfile])
|
||||
dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-ba",specfile]+buildnumber+prerelease)
|
||||
dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-ba",specfile]+buildnumber+prerelease+packagever)
|
||||
try: checkdeps()
|
||||
except (CalledProcessError,OSError),e:
|
||||
Utils.pprint("YELLOW","Dependencies might be missing. Trying to auto-install them...")
|
||||
|
||||
@ -41,9 +41,10 @@ def build_utils_docs ():
|
||||
# ant only needs to be reinvoked if the version with build number changes
|
||||
# we here trim all the depended targets from the target list:
|
||||
def build_jars ():
|
||||
Implementation_Version = bld.env.VERSION
|
||||
buildnumber = Utils.getbuildnumber()
|
||||
if buildnumber: Implementation_Version += "." + buildnumber
|
||||
if Options.options.VERNUM:
|
||||
Implementation_Version = Options.options.VERNUM
|
||||
else:
|
||||
Implementation_Version = "2.2"
|
||||
|
||||
# this is to trigger recompilation / cache avoidance if the relevant environment for ant changes
|
||||
ant_args = [
|
||||
@ -53,8 +54,8 @@ def build_jars ():
|
||||
"-Ddist.dir=%s" % distdir,
|
||||
"-Dbase.dir=%s" % sourcedir,
|
||||
"-f %s" % Utils.relpath (_join(sourcedir, "build.xml")),
|
||||
"-Dimpl.version=%s" % Utils.getbuildnumber (),
|
||||
]
|
||||
|
||||
if buildpremium:
|
||||
ant_args.append("-Dbuild.premium=true")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user