cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [8/50] [abbrv] git commit: Add an option to select a build with or without non-OSS components using waf
Date Tue, 04 Sep 2012 22:12:51 GMT
Add an option to select a build with or without non-OSS components using waf


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/1f207506
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/1f207506
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/1f207506

Branch: refs/heads/4.0
Commit: 1f207506daa1874421b01ad8ea733e6bc8b8ce60
Parents: 79004fc
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Tue Sep 4 14:59:38 2012 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Tue Sep 4 15:16:18 2012 +0200

----------------------------------------------------------------------
 cloud.spec    |   42 +++++++++++++++++++++++++++++++++---------
 wscript       |   10 +++++++---
 wscript_build |    3 +++
 3 files changed, 43 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f207506/cloud.spec
----------------------------------------------------------------------
diff --git a/cloud.spec b/cloud.spec
index 0a1de44..d0bf0c6 100644
--- a/cloud.spec
+++ b/cloud.spec
@@ -18,6 +18,13 @@
 %define __os_install_post %{nil}
 %global debug_package %{nil}
 
+%if "%{?_nonoss}" != ""
+%define _wafargs %{nil}
+%else
+%define _wafargs "--oss"
+%endif
+
+
 # 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
 
@@ -83,6 +90,18 @@ Group:     System Environment/Libraries
 %description server
 The CloudStack server libraries provide a set of Java classes for CloudStack.
 
+%if "%{?_nonoss}" != ""
+%package server-nonoss
+Summary:   CloudStack server library with non-oss dependencies
+Requires: java >= 1.6.0
+Obsoletes: vmops-server < %{version}-%{release}
+Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version},
%{name}-server = %{version}, tomcat6-servlet-2.5-api
+Group:     System Environment/Libraries
+%description server-nonoss
+The CloudStack server libraries provide a set of Java classes for CloudStack. This package
contain the classes ther require
+external non-oss libraries.
+%endif
+
 %package agent-scripts
 Summary:   CloudStack agent scripts
 # FIXME nuke the archdependency
@@ -303,13 +322,13 @@ echo Doing CloudStack build
 # this fixes the /usr/com bug on centos5
 %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} --package-version=%{_ver}
-./waf build --build-number=%{?_build_number} --package-version=%{_ver}
+./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} --package-version=%{_ver} %{_wafargs}
+./waf build --build-number=%{?_build_number} --package-version=%{_ver} %{_wafargs}
 
 %install
 [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
 # we put the build number again here, otherwise state checking will cause an almost-full
recompile
-./waf install --destdir=$RPM_BUILD_ROOT --nochown --build-number=%{?_build_number}
+./waf install --destdir=$RPM_BUILD_ROOT --nochown --build-number=%{?_build_number} %{_wafargs}
 rm $RPM_BUILD_ROOT/etc/rc.d/init.d/cloud-console-proxy
 rm $RPM_BUILD_ROOT/usr/bin/cloud-setup-console-proxy
 rm $RPM_BUILD_ROOT/usr/libexec/console-proxy-runner
@@ -525,12 +544,17 @@ fi
 %{_javadir}/%{name}-plugin-user-authenticator-md5-%{_maven_ver}.jar
 %{_javadir}/%{name}-plugin-user-authenticator-plaintext-%{_maven_ver}.jar
 %config(noreplace) %{_sysconfdir}/%{name}/server/*
-#%{_javadir}/%{name}-plugin-f5-%{_maven_ver}.jar
-#%{_javadir}/%{name}-plugin-netscaler-%{_maven_ver}.jar
-#%{_javadir}/%{name}-plugin-srx-%{_maven_ver}.jar
-#%{_javadir}/%{name}-vmware-%{_maven_ver}.jar
-#%{_javadir}/%{name}-plugin-netapp-%{_maven_ver}.jar
-#%{_javadir}/%{name}-plugin-hypervisor-kvm-%{_maven_ver}.jar
+
+%if "%{?_nonoss}" != ""
+%files server-nonoss
+%defattr(0644,root,root,0755)
+%{_javadir}/%{name}-plugin-hypervisor-kvm-4.0.0-SNAPSHOT.jar
+%{_javadir}/%{name}-plugin-hypervisor-vmware-4.0.0-SNAPSHOT.jar
+%{_javadir}/%{name}-plugin-netapp-4.0.0-SNAPSHOT.jar
+%{_javadir}/%{name}-plugin-network-f5-4.0.0-SNAPSHOT.jar
+%{_javadir}/%{name}-plugin-network-netscaler-4.0.0-SNAPSHOT.jar
+%{_javadir}/%{name}-plugin-network-srx-4.0.0-SNAPSHOT.jar
+%endif
 
 %files agent-scripts
 %defattr(-,root,root,-)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f207506/wscript
----------------------------------------------------------------------
diff --git a/wscript b/wscript
index e21e23c..ce73e99 100644
--- a/wscript
+++ b/wscript
@@ -320,7 +320,7 @@ def runmvn(tsk):
 		stanzas = [
 			_join(environ["M2_HOME"],"bin","mvn")
 		]
-	#stanzas += tsk.generator.mvnargs
+	stanzas += tsk.generator.mvnargs
 	ret = Utils.exec_command(" ".join(stanzas),cwd=tsk.generator.bld.srcnode.abspath(),env=environ,log=True)
 	if ret != 0: raise Utils.WafError("Maven phase %s failed with error value %s"%(stanzas,ret))
 	return ret
@@ -642,6 +642,10 @@ def rpm(context):
 	else: ver = SHORTVERSION
 
 	packagever = ["--define", "_ver %s" % ver]
+
+        nonoss = [ ]
+        if not Options.options.OSS:
+                 nonoss = ["--define", "_nonoss 1"]
 	
 	# FIXME wrap the source tarball in POSIX locking!
 	if not Options.options.blddir: outputdir = _join(context.curdir,blddir,"rpmbuild")
@@ -656,8 +660,8 @@ def rpm(context):
 	shutil.move(tarball,_join(sourcedir,tarball))
 
 	specfile = "%s.spec"%APPNAME
-	checkdeps = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"--nobuild",specfile]+packagever+releasever)
-	dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-bb",specfile]+buildnumber+prerelease+packagever+releasever)
+	checkdeps = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"--nobuild",specfile]+packagever+releasever+nonoss)
+	dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-bb",specfile]+buildnumber+prerelease+packagever+releasever+nonoss)
 	try: checkdeps()
 	except (CalledProcessError,OSError),e:
 		Utils.pprint("YELLOW","Dependencies might be missing.  Trying to auto-install them...")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f207506/wscript_build
----------------------------------------------------------------------
diff --git a/wscript_build b/wscript_build
index b182097..77e37f9 100644
--- a/wscript_build
+++ b/wscript_build
@@ -112,6 +112,9 @@ def build_jars ():
 		"-Ddist.dir=%s" % distdir,
 		"-Dbase.dir=%s" % sourcedir
 	]
+   
+        if not Options.options.OSS:
+		mvn_args.append("-Dnonoss")
 
 	if buildpremium:
 		mvn_args.append("-Dbuild.premium=true")


Mime
View raw message