diff --git a/cloud.spec b/cloud.spec index 0ec003fa366..3c7a8b0e9ad 100644 --- a/cloud.spec +++ b/cloud.spec @@ -296,6 +296,14 @@ Group: System Environment/Libraries The Cloud.com usage monitor provides usage accounting across the entire cloud for cloud operators to charge based on usage parameters. +%package cloud-cli +Summary: Cloud.com command line tools +Requires: python +Group: System Environment/Libraries +%description cloud-cli +The Cloud.com command line tools contain a few Python modules that can call cloudStack APIs. + + %endif %prep @@ -539,7 +547,9 @@ fi %files python %defattr(0644,root,root,0755) -%{_prefix}/lib*/python*/site-packages/%{name}* +%{_prefix}/lib*/python*/site-packages/%{name}_PrettyPrint.* +%{_prefix}/lib*/python*/site-packages/%{name}_sxp.* +%{_prefix}/lib*/python*/site-packages/%{name}_utils.* %doc README %doc HACKING %doc debian/copyright @@ -699,6 +709,18 @@ fi %doc HACKING %doc debian/copyright +%files cloud-cli +%{_bindir}/%{name}-tool +%{_bindir}/%{name}voladm +%{_sysconfdir}/%{name}/cli/commands.xml +%dir %{_prefix}/lib*/python*/site-packages/%{name}tool +%dir %{_prefix}/lib*/python*/site-packages/%{name}apis +%{_prefix}/lib*/python*/site-packages/%{name}tool/* +%{_prefix}/lib*/python*/site-packages/%{name}apis/* +%doc README +%doc HACKING +%doc debian/copyright + %endif %changelog diff --git a/wscript_build b/wscript_build index 62cf58b8ec3..9720210e7b4 100644 --- a/wscript_build +++ b/wscript_build @@ -195,7 +195,7 @@ for src,tgt,inst in zip(src_files,subst_files,inst_files): tgen = bld(features='subst', name='patchsubst', source=src, target=tgt) tgen.dict = bld.env.get_merged_dict() bld.path.find_or_declare(tgt) - + # this is a clever little thing # given a list of nodes, build or source # construct a tar file containing them @@ -609,16 +609,21 @@ def generate_xml_api_description(task): ret = Utils.exec_command(["java","-cp",cp,"com.cloud.utils.commandlinetool.BuildCommandLineInputFile"]+arguments,log=True) return ret -props = " client/tomcatconf/commands.properties" -if buildpremium: props += " cloudstack-proprietary/premium/tomcatconf/commands-ext.properties" -jarnames = ['utils','server','core'] -if buildpremium: jarnames += ['server-extras'] -tgen = bld( - rule = generate_xml_api_description, - source = " ".join( [ 'target/jar/cloud-%s.jar'%x for x in jarnames ] ) + props, - target = 'commands.xml', - name = 'xmlapi', - after = 'runant', -) -bld.process_after(tgen) +if buildpremium: + props = " client/tomcatconf/commands.properties" + props += " cloudstack-proprietary/premium/tomcatconf/commands-ext.properties" + jarnames = ['utils','server','core'] + jarnames += ['server-extras'] + tgen = bld( + rule = generate_xml_api_description, + source = " ".join( [ 'target/jar/cloud-%s.jar'%x for x in jarnames ] ) + props, + target = 'commands.xml', + name = 'xmlapi', + after = 'runant', + install_path="${CLIDIR}" + ) + bld.process_after(tgen) + + bld.install_files("${PYTHONDIR}//cloudtool", 'cloudstack-proprietary/cloud-cli/cloudtool/*') + bld.install_files("${PYTHONDIR}/cloudapis", 'cloudstack-proprietary/cloud-cli/cloudapis/*') diff --git a/wscript_configure b/wscript_configure index 2c8d38edd62..69e29d1a169 100644 --- a/wscript_configure +++ b/wscript_configure @@ -151,6 +151,7 @@ else: conf.check_message_2("%s (assumed presence of Tomcat there)"%conf.env.TOMCATHOME,"GREEN") conf.env.AGENTPATH = _join(conf.env.PACKAGE,"agent") +conf.env.CLIPATH = _join(conf.env.PACKAGE,"cli") conf.env.CPPATH = _join(conf.env.PACKAGE,"console-proxy") conf.env.MSPATH = _join(conf.env.PACKAGE,"management") conf.env.USAGEPATH = _join(conf.env.PACKAGE,"usage") @@ -255,6 +256,7 @@ conf.env.USAGESYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${USAGEPATH}" conf.env.CPLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${CPPATH}"),conf.env) conf.env.CPSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CPPATH}"),conf.env) conf.env.CPLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${CPPATH}"),conf.env) +conf.env.CLIDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CLIPATH}"),conf.env) conf.env.MSLOG = _join(conf.env.MSLOGDIR,"management-server.log") conf.env.APISERVERLOG = _join(conf.env.MSLOGDIR,"api-server.log")