You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/02/05 19:06:57 UTC
[12/51] [abbrv] Remove the last remnants of the old build system
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e138596a/cloud.spec
----------------------------------------------------------------------
diff --git a/cloud.spec b/cloud.spec
deleted file mode 100644
index bde3958..0000000
--- a/cloud.spec
+++ /dev/null
@@ -1,647 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-%define __os_install_post %{nil}
-%global debug_package %{nil}
-
-# 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
-
-Name: cloud
-Summary: CloudStack IaaS Platform
-Version: %{_ver}
-#http://fedoraproject.org/wiki/PackageNamingGuidelines#Pre-Release_packages
-%if "%{?_prerelease}" != ""
-Release: 0.%{_build_number}%{dist}.%{_prerelease}
-%else
-Release: %{_rel}%{dist}
-%endif
-License: Apache License 2.0
-Vendor: CloudStack <en...@cloud.com>
-Packager: CloudStack <en...@cloud.com>
-Group: System Environment/Libraries
-# FIXME do groups for every single one of the subpackages
-Source0: %{name}-%{_ver}.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{_ver}-%{release}-build
-
-%if 0%{?fedora} >= 17
-BuildRequires: java-1.7.0-openjdk-devel
-%else
-BuildRequires: java-1.6.0-openjdk-devel
-%endif
-BuildRequires: tomcat6
-BuildRequires: ws-commons-util
-BuildRequires: jpackage-utils
-BuildRequires: gcc
-BuildRequires: glibc-devel
-BuildRequires: /usr/bin/mkisofs
-BuildRequires: MySQL-python
-
-%description
-CloudStack is a highly-scalable elastic, open source,
-intelligent IaaS cloud implementation.
-
-%package utils
-Summary: CloudStack utility library
-Requires: java >= 1.6.0
-Requires: python
-Group: System Environment/Libraries
-Obsoletes: vmops-utils < %{version}-%{release}
-%description utils
-Utility libraries and set of Java classes used
-by CloudStack.
-
-%package client-ui
-Summary: CloudStack management server UI
-Requires: %{name}-client
-Group: System Environment/Libraries
-Obsoletes: vmops-client-ui < %{version}-%{release}
-%description client-ui
-The CloudStack management server is the central point of coordination,
-management, and intelligence in CloudStack. This package
-is a requirement of the %{name}-client package, which installs the
-CloudStack management server.
-
-%package server
-Summary: CloudStack server library
-Requires: java >= 1.6.0
-Obsoletes: vmops-server < %{version}-%{release}
-Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}, %{name}-scripts = %{version}, tomcat6-servlet-2.5-api
-Group: System Environment/Libraries
-%description server
-The CloudStack server libraries provide a set of Java classes for CloudStack.
-
-%package scripts
-Summary: CloudStack scripts
-# FIXME nuke the archdependency
-Requires: python
-Requires: bash
-Requires: bzip2
-Requires: gzip
-Requires: unzip
-Requires: /sbin/mount.nfs
-Requires: openssh-clients
-Requires: nfs-utils
-Requires: wget
-# there is a fsimage.so in the source code, which adds xen-libs as a dependence, needs to supress it, as rhel doesn't have this pacakge
-AutoReqProv: no
-Provides: cloud-agent-scripts = %{version}-%{release}
-Obsoletes: cloud-agent-scripts < %{version}-%{release}
-Group: System Environment/Libraries
-%description scripts
-This package contains common scripts used by the Agent and Management server
-
-%package python
-Summary: CloudStack Python library
-# FIXME nuke the archdependency
-Requires: python
-Group: System Environment/Libraries
-%description python
-The CloudStack Python library contains a few Python modules that the
-CloudStack uses.
-
-%package deps
-Summary: CloudStack library dependencies
-Requires: java >= 1.6.0
-Requires: mysql-connector-java
-Obsoletes: vmops-deps < %{version}-%{release}
-Group: System Environment/Libraries
-%description deps
-This package contains a number of third-party dependencies
-not shipped by distributions, required to run CloudStack
-
-
-%package core
-Summary: CloudStack core library
-Requires: java >= 1.6.0
-Requires: %{name}-utils = %{version}, %{name}-deps = %{version}
-Group: System Environment/Libraries
-Obsoletes: vmops-core < %{version}-%{release}
-%description core
-The CloudStack core libraries provide a set of Java classes used
-in CloudStack.
-
-%package client
-Summary: CloudStack management server
-# If GCJ is present, a setPerformanceSomething method fails to load Catalina
-Conflicts: java-1.5.0-gcj-devel
-Obsoletes: vmops-client < %{version}-%{release}
-Obsoletes: cloud-premium < %{version}-%{release}
-Requires: java >= 1.6.0
-Requires: %{name}-deps = %{version}, %{name}-utils = %{version}, %{name}-server = %{version}
-Requires: %{name}-client-ui = %{version}
-Requires: %{name}-setup = %{version}
-Requires: %{name}-scripts = %{version}
-Requires: %{name}-python = %{version}
-Requires: %{name}-aws-api = %{version}
-# for consoleproxy
-# Requires: %{name}-agent
-Requires: tomcat6
-Requires: ws-commons-util
-Requires: jpackage-utils
-Requires: sudo
-Requires: /sbin/service
-Requires: /sbin/chkconfig
-Requires: /usr/bin/ssh-keygen
-Requires: mkisofs
-Requires: MySQL-python
-Requires: python-paramiko
-Requires: ipmitool
-Requires: %{name}-utils = %{version}
-%if 0%{?fedora} > 14
-Requires: apache-commons-dbcp
-Requires: apache-commons-collections
-Requires: jakarta-commons-httpclient
-Requires: jakarta-taglibs-standard
-Requires: mysql-connector-java
-%endif
-
-Group: System Environment/Libraries
-%description client
-The CloudStack management server is the central point of coordination,
-management, and intelligence in CloudStack and installs the management server.
-
-%package setup
-Summary: CloudStack setup tools
-Obsoletes: vmops-setup < %{version}-%{release}
-Requires: java >= 1.6.0
-Requires: python
-Requires: MySQL-python
-Requires: %{name}-utils = %{version}
-Requires: %{name}-server = %{version}
-Requires: %{name}-deps = %{version}
-Requires: %{name}-python = %{version}
-Group: System Environment/Libraries
-%description setup
-The CloudStack setup tools let you set up your Management Server and Usage Server.
-
-%package agent-libs
-Summary: CloudStack agent libraries
-Requires: java >= 1.6.0
-Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
-Requires: commons-httpclient
-Requires: jakarta-commons-logging
-Requires: jpackage-utils
-Group: System Environment/Libraries
-%description agent-libs
-The CloudStack agent libraries are used by the KVM Agent
-
-%package agent
-Summary: CloudStack agent
-Obsoletes: vmops-agent < %{version}-%{release}
-Obsoletes: vmops-console < %{version}-%{release}
-Obsoletes: cloud-console < %{version}-%{release}
-Obsoletes: cloud-vnet < %{version}-%{release}
-Obsoletes: cloud-premium-agent < %{version}-%{release}
-Requires: java >= 1.6.0
-Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
-Requires: %{name}-agent-libs = %{version}
-Requires: %{name}-scripts = %{version}
-Requires: python
-Requires: %{name}-python = %{version}
-Requires: commons-httpclient
-Requires: jakarta-commons-logging
-Requires: libvirt
-Requires: /usr/sbin/libvirtd
-Requires: jpackage-utils
-Requires: /sbin/service
-Requires: /sbin/chkconfig
-Requires: jna
-Requires: ebtables
-Requires: jsvc
-Requires: jakarta-commons-daemon
-Requires: bridge-utils
-Group: System Environment/Libraries
-
-Requires: kvm
-
-%if 0%{?fedora} >= 14 && 0%{?fedora} != 16
-Requires: cloud-qemu-kvm
-Requires: cloud-qemu-img
-%endif
-
-%if 0%{?rhel} >= 5
-Requires: qemu-img
-%endif
-
-Requires: libcgroup
-%if 0%{?fedora} >= 16
-Requires: libcgroup-tools
-%endif
-Requires: /usr/bin/uuidgen
-Requires: rsync
-Requires: /bin/egrep
-Requires: /sbin/ip
-Requires: vconfig
-Group: System Environment/Libraries
-%description agent
-The CloudStack agent is in charge of managing KVM shared computing resources in
-a CloudStack-powered cloud. Install this package if this computer
-will participate in your cloud.
-
-%package baremetal-agent
-Summary: CloudStack baremetal agent
-Requires: PING
-Requires: tftp-server
-Requires: xinetd
-Requires: syslinux
-Requires: chkconfig
-Requires: dhcp
-Group: System Environment/Libraries
-%description baremetal-agent
-The CloudStack baremetal agent
-
-%package cli
-Summary: CloudStack command line tools
-Requires: python
-Group: System Environment/Libraries
-%description cli
-The CloudStack command line tools contain a few Python modules that can call cloudStack APIs.
-
-%package usage
-Summary: CloudStack usage monitor
-Obsoletes: vmops-usage < %{version}-%{release}
-Requires: java >= 1.6.0
-Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}, %{name}-server = %{version}
-Requires: %{name}-setup = %{version}
-Requires: %{name}-client = %{version}
-Requires: jsvc
-License: Apache License 2.0
-Group: System Environment/Libraries
-%description usage
-The CloudStack usage monitor provides usage accounting across the entire cloud for
-cloud operators to charge based on usage parameters.
-
-%package aws-api
-Summary: CloudStack CloudBridge
-Group: System Environment/Libraries
-Requires: java >= 1.6.0
-Requires: tomcat6
-Requires: %{name}-deps = %{version}
-%if 0%{?fedora} > 15
-Requires: apache-commons-lang
-%endif
-%if 0%{?rhel} >= 5
-Requires: jakarta-commons-lang
-%endif
-Obsoletes: cloud-bridge < %{version}-%{release}
-%description aws-api
-This is the CloudStack CloudBridge
-
-%prep
-
-echo Doing CloudStack build
-
-%setup -q -n %{name}-%{_ver}
-
-%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}
-
-%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}
-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
-ant deploy-rpm-install -Drpm.install.dir=$RPM_BUILD_ROOT
-
-%clean
-
-[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
-
-
-%preun client
-/sbin/service %{name}-management stop || true
-if [ "$1" == "0" ] ; then
- /sbin/chkconfig --del %{name}-management > /dev/null 2>&1 || true
- /sbin/service %{name}-management stop > /dev/null 2>&1 || true
-fi
-
-%pre aws-api
-id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
- -r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
-
-rm -rf %{_localstatedir}/cache/%{name}
-# user harcoded here, also hardcoded on wscript
-
-%pre client-ui
-if [ -d %{_datadir}/%{name}/management/webapps/client/ ]; then
- pushd /tmp &>/dev/null
- file=cloud-ui-backup-%(date +%%F).tar.bz2
- cp -r %{_datadir}/%{name}/management/webapps/client/ .
- tar cjf "$file" client/
- rm -rf client/
- mkdir -p /usr/share/cloud/ui-backup/
- mv "$file" /usr/share/cloud/ui-backup/
- popd &>/dev/null
-fi
-
-%preun usage
-if [ "$1" == "0" ] ; then
- /sbin/chkconfig --del %{name}-usage > /dev/null 2>&1 || true
- /sbin/service %{name}-usage stop > /dev/null 2>&1 || true
-fi
-
-%pre usage
-id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
- -r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
-# user harcoded here, also hardcoded on wscript
-
-%post usage
-if [ "$1" == "1" ] ; then
- /sbin/chkconfig --add %{name}-usage > /dev/null 2>&1 || true
- /sbin/chkconfig --level 345 %{name}-usage on > /dev/null 2>&1 || true
-else
- /sbin/service %{name}-usage condrestart >/dev/null 2>&1 || true
-fi
-
-%preun agent
-if [ "$1" == "0" ] ; then
- /sbin/chkconfig --del %{name}-agent > /dev/null 2>&1 || true
- /sbin/service %{name}-agent stop > /dev/null 2>&1 || true
-fi
-
-%post agent
-if [ "$1" == "1" ] ; then
- /sbin/chkconfig --add %{name}-agent > /dev/null 2>&1 || true
- /sbin/chkconfig --level 345 %{name}-agent on > /dev/null 2>&1 || true
-else
- /sbin/service %{name}-agent condrestart >/dev/null 2>&1 || true
-fi
-
-if [ -x /etc/sysconfig/modules/kvm.modules ] ; then
- /bin/sh /etc/sysconfig/modules/kvm.modules
-fi
-
-%post client
- /sbin/chkconfig --add %{name}-management > /dev/null 2>&1 || true
- /sbin/chkconfig --level 345 %{name}-management on > /dev/null 2>&1 || true
-
- root=/usr/share/cloud/bridge
- target=/usr/share/cloud/management
-
- mkdir -p $target/webapps7080
- if [ ! -h $target/webapps7080/awsapi ]; then
- ln -sf $root/webapps7080/awsapi $target/webapps7080/awsapi
- fi
-
-# jars=`ls $root/lib`
-# for j in $jars
-# do
-# cp -f $root/lib/$j $root/webapps/awsapi/WEB-INF/lib/
-# done
-
- confs="cloud-bridge.properties ec2-service.properties"
- for c in $confs
- do
- cp -f $root/conf/$c $target/conf
- done
-
-%files utils
-%defattr(0644,root,root,0755)
-%{_javadir}/%{name}-utils.jar
-%{_javadir}/%{name}-api.jar
-%attr(0755,root,root) %{_bindir}/cloud-sccs
-%attr(0755,root,root) %{_bindir}/cloud-gitrevs
-%doc %{_docdir}/%{name}-%{version}/version-info
-%doc LICENSE
-%doc NOTICE
-
-%files client-ui
-%defattr(0644,root,root,0755)
-%{_datadir}/%{name}/management/webapps/client/*
-%doc LICENSE
-%doc NOTICE
-
-%files server
-%defattr(0644,root,root,0755)
-%{_javadir}/%{name}-server.jar
-%{_javadir}/%{name}-ovm.jar
-%{_javadir}/%{name}-dp-user-concentrated-pod.jar
-%{_javadir}/%{name}-dp-user-dispersing.jar
-%{_javadir}/%{name}-host-allocator-random.jar
-%{_javadir}/%{name}-plugin-ovs.jar
-%{_javadir}/%{name}-storage-allocator-random.jar
-%{_javadir}/%{name}-user-authenticator-ldap.jar
-%{_javadir}/%{name}-user-authenticator-md5.jar
-%{_javadir}/%{name}-user-authenticator-plaintext.jar
-%{_javadir}/%{name}-plugin-hypervisor-xen.jar
-%{_javadir}/%{name}-plugin-elb.jar
-%{_javadir}/%{name}-plugin-nicira-nvp.jar
-%{_javadir}/%{name}-plugin-bigswitch-vns.jar
-%config(noreplace) %{_sysconfdir}/%{name}/server/*
-%doc LICENSE
-%doc NOTICE
-
-%files scripts
-%defattr(-,root,root,-)
-%{_libdir}/%{name}/common/scripts/*
-# maintain the following list in sync with files scripts
-%{_libdir}/%{name}/common/vms/systemvm.zip
-%{_libdir}/%{name}/common/vms/systemvm.iso
-%doc LICENSE
-%doc NOTICE
-
-%files deps
-%defattr(0644,root,root,0755)
-%{_javadir}/axiom-*.jar
-%{_javadir}/axis2-*.jar
-%{_javadir}/antlr*.jar
-%{_javadir}/XmlSchema-*.jar
-%{_javadir}/json-simple*.jar
-%{_javadir}/neethi*.jar
-%{_javadir}/woden*.jar
-%{_javadir}/xercesImpl*.jar
-%{_javadir}/xml-apis*.jar
-%{_javadir}/dom4j*.jar
-%{_javadir}/javassist*.jar
-%{_javadir}/commons-fileupload*.jar
-%{_javadir}/commons-codec-1.6.jar
-%{_javadir}/commons-dbcp-1.4.jar
-%{_javadir}/commons-pool-1.6.jar
-%{_javadir}/gson-1.7.1.jar
-%{_javadir}/CAStorSDK-*.jar
-%{_javadir}/backport-util-concurrent-3.1.jar
-%{_javadir}/ehcache-1.5.0.jar
-%{_javadir}/httpcore-4.0.jar
-%{_javadir}/mail-1.4.jar
-%{_javadir}/activation-1.1.jar
-%{_javadir}/xapi-5.6.100-1-SNAPSHOT.jar
-%{_javadir}/log4j-*.jar
-%{_javadir}/apache-log4j-extras-1.1.jar
-%{_javadir}/trilead-ssh2-build213-svnkit-1.3-patch.jar
-%{_javadir}/cglib-nodep-2.2.2.jar
-%{_javadir}/xmlrpc-common-3.*.jar
-%{_javadir}/xmlrpc-client-3.*.jar
-%{_javadir}/wsdl4j-1.6.2.jar
-%{_javadir}/jsch-0.1.42.jar
-%{_javadir}/jasypt-1.*.jar
-%{_javadir}/commons-configuration-1.8.jar
-%{_javadir}/ejb-api-3.0.jar
-%{_javadir}/axis2-1.5.1.jar
-%{_javadir}/commons-discovery-0.5.jar
-%{_javadir}/jstl-1.2.jar
-%{_javadir}/javax.persistence-2.0.0.jar
-%{_javadir}/bcprov-jdk16-1.45.jar
-%doc LICENSE
-%doc NOTICE
-
-%files core
-%defattr(0644,root,root,0755)
-%{_javadir}/%{name}-core.jar
-%doc LICENSE
-%doc NOTICE
-
-%files python
-%defattr(0644,root,root,0755)
-%{_prefix}/lib*/python*/site-packages/%{name}*
-%attr(0755,root,root) %{_bindir}/cloud-external-ipallocator.py
-%attr(0755,root,root) %{_initrddir}/cloud-ipallocator
-%dir %attr(0770,root,root) %{_localstatedir}/log/%{name}/ipallocator
-%doc LICENSE
-%doc NOTICE
-
-%files setup
-%attr(0755,root,root) %{_bindir}/%{name}-setup-databases
-%attr(0755,root,root) %{_bindir}/%{name}-migrate-databases
-%attr(0755,root,root) %{_bindir}/%{name}-set-guest-password
-%attr(0755,root,root) %{_bindir}/%{name}-set-guest-sshkey
-%attr(0755,root,root) %{_bindir}/%{name}-sysvmadm
-%attr(0755,root,root) %{_bindir}/%{name}-setup-encryption
-%dir %{_datadir}/%{name}/setup
-%{_datadir}/%{name}/setup/*.sql
-%{_datadir}/%{name}/setup/db/*.sql
-%{_datadir}/%{name}/setup/*.sh
-%{_datadir}/%{name}/setup/server-setup.xml
-%doc LICENSE
-%doc NOTICE
-
-%files client
-%defattr(0644,root,root,0775)
-%config(noreplace) %{_sysconfdir}/%{name}/management
-%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/management/db.properties
-%config(noreplace) %{_sysconfdir}/%{name}/management/log4j-%{name}.xml
-%config(noreplace) %{_sysconfdir}/%{name}/management/tomcat6.conf
-%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina
-%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost
-%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost/client
-%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-management
-%attr(0755,root,root) %{_initrddir}/%{name}-management
-%dir %{_datadir}/%{name}/management
-%{_datadir}/%{name}/management/*
-%attr(0755,root,root) %{_bindir}/%{name}-setup-management
-%attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses
-%dir %attr(0770,root,%{name}) %{_sharedstatedir}/%{name}/mnt
-%dir %attr(0770,%{name},%{name}) %{_sharedstatedir}/%{name}/management
-%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management
-%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/work
-%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/temp
-%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/management
-%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/agent
-%doc LICENSE
-%doc NOTICE
-
-%files agent-libs
-%defattr(0644,root,root,0755)
-%{_javadir}/%{name}-agent.jar
-%{_javadir}/%{name}-plugin-hypervisor-kvm.jar
-%{_javadir}/libvirt-0.4.9.jar
-%doc LICENSE
-%doc NOTICE
-
-%files agent
-%defattr(0644,root,root,0755)
-%config(noreplace) %{_sysconfdir}/%{name}/agent/agent.properties
-%config(noreplace) %{_sysconfdir}/%{name}/agent/developer.properties.template
-%config(noreplace) %{_sysconfdir}/%{name}/agent/environment.properties
-%config(noreplace) %{_sysconfdir}/%{name}/agent/log4j-%{name}.xml
-%attr(0755,root,root) %{_initrddir}/%{name}-agent
-%attr(0755,root,root) %{_bindir}/%{name}-setup-agent
-%attr(0755,root,root) %{_bindir}/%{name}-ssh
-%dir %attr(0770,root,root) %{_localstatedir}/log/%{name}/agent
-%doc LICENSE
-%doc NOTICE
-
-%files cli
-%{_bindir}/%{name}-tool
-%{_bindir}/cloudvoladm
-%{_bindir}/cloud-grab-dependent-library-versions
-%config(noreplace) %{_sysconfdir}/%{name}/cli/commands.xml
-%dir %{_prefix}/lib*/python*/site-packages/%{name}tool
-%{_prefix}/lib*/python*/site-packages/%{name}tool/*
-%{_prefix}/lib*/python*/site-packages/%{name}apis.py
-%doc LICENSE
-%doc NOTICE
-
-%files baremetal-agent
-%attr(0755,root,root) %{_bindir}/cloud-setup-baremetal
-%doc LICENSE
-%doc NOTICE
-
-%files usage
-%defattr(0644,root,root,0775)
-%{_javadir}/%{name}-usage.jar
-%attr(0755,root,root) %{_initrddir}/%{name}-usage
-%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/usage
-%config(noreplace) %{_sysconfdir}/%{name}/usage/usage-components.xml
-%config(noreplace) %{_sysconfdir}/%{name}/usage/log4j-%{name}_usage.xml
-%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/usage/db.properties
-%doc LICENSE
-%doc NOTICE
-
-%files aws-api
-%defattr(0644,cloud,cloud,0755)
-%{_datadir}/cloud/bridge/conf/*
-%{_datadir}/cloud/bridge/webapps7080/*
-%attr(0644,root,root) %{_datadir}/cloud/setup/bridge/db/*
-%attr(0755,root,root) %{_bindir}/cloudstack-aws-api-register
-%attr(0755,root,root) %{_bindir}/cloud-setup-bridge
-%doc LICENSE
-%doc NOTICE
-
-%changelog
-* Mon Nov 19 2012 Satoshi Kobayashi <sa...@stratosphere.co.jp> 4.0.1
-- adding dependency bridge-utils to fix a system requirement
-
-* Fri Sep 14 2012 Marcus Sorensen <sh...@gmail.com> 4.0.1
-- adding dependency jakarta-commons-daemon to fix "cannot find daemon loader"
-
-* Thu Aug 16 2012 Marcus Sorensen <sh...@gmail.com> 4.0
-- rearranged files sections to match currently built files
-
-* Mon May 3 2010 Manuel Amador (Rudd-O) <ma...@vmops.com> 1.9.12
-- Bump version for RC4 release
-
-* Fri Apr 30 2010 Manuel Amador (Rudd-O) <ma...@vmops.com> 1.9.11
-- Rename to CloudStack everywhere
-
-* Wed Apr 28 2010 Manuel Amador (Rudd-O) <ma...@vmops.com> 1.9.10
-- FOSS release
-
-* Mon Apr 05 2010 Manuel Amador (Rudd-O) <ma...@vmops.com> 1.9.8
-- RC3 branched
-
-* Wed Feb 17 2010 Manuel Amador (Rudd-O) <ma...@vmops.com> 1.9.7
-- First initial broken-up release
-
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e138596a/waf
----------------------------------------------------------------------
diff --git a/waf b/waf
deleted file mode 100755
index a2c4138..0000000
Binary files a/waf and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e138596a/waf.bat
----------------------------------------------------------------------
diff --git a/waf.bat b/waf.bat
deleted file mode 100755
index afc94cd..0000000
--- a/waf.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@echo off
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements. See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership. The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied. See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-
-if exist jython.jar goto runjython
-if exist C:\Python26\Python.exe goto runpython
-goto helprun
-
-:helprun
-echo To run waf with Python
-echo 1. Download Python 2.6 for Windows from http://www.python.org/
-echo 2. Install it in C:\Python2.6 (the default path)
-echo 3. Use this batch file to run waf
-echo ""
-echo To run waf without installing Python
-echo 1. Download the Jython installer from http://wiki.python.org/jython/
-echo 2. Install it to this directory in standalone mode
-echo 3. Ensure the java command is on your PATH variable
-echo 3. Use this batch file to run waf
-goto end
-
-:runjython
-java -jar jython.jar waf %*
-goto end
-
-:runpython
-C:\Python26\Python.exe waf %*
-goto end
-
-:end
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e138596a/wscript
----------------------------------------------------------------------
diff --git a/wscript b/wscript
deleted file mode 100644
index 077fc71..0000000
--- a/wscript
+++ /dev/null
@@ -1,782 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -*-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# the following variables are used by the target "waf dist"
-# if you change APPNAME here, you need to change 'Name' also
-# in cloud.spec, add a %changelog entry there, and add an
-# entry in debian/changelog. SHORTVERSION is used in package
-# naming for deb/rpm, VERSION is used for tarball and bin
-VERSION = '4.0.0.2012-08-15T18:03:12Z'
-SHORTVERSION = '4.0.0'
-APPNAME = 'cloud'
-
-import shutil,os
-import email,time
-import optparse
-import Utils,Node,Options,Logs,Scripting,Environment,Build,Configure
-from subprocess import Popen as _Popen,PIPE
-import os
-import sys
-from os import unlink as _unlink, makedirs as _makedirs, getcwd as _getcwd, chdir as _chdir
-from os.path import abspath as _abspath, basename as _basename, dirname as _dirname, exists as _exists, isdir as _isdir, split as _split, join as _join, sep, pathsep, pardir, curdir
-from glob import glob as _glob
-import zipfile,tarfile
-try:
- from os import chmod as _chmod,chown as _chown
- import pwd,stat,grp
-except ImportError:
- _chmod,_chown,pwd,stat,grp = (None,None,None,None,None)
-import xml.dom.minidom
-import re
-
-# these variables are mandatory ('/' are converted automatically)
-srcdir = '.'
-blddir = 'artifacts'
-
-Configure.autoconfig = True
-
-# things not to include in the source tarball
-# exclude by file name or by _glob (wildcard matching)
-for _globber in [
- ["dist", # does not belong in the source tarball
- "system", # for windows
- "override", # not needed
- "eclipse", # only there to please eclipse
- "repomanagement", # internal management stuff
- "client-api", # obsolete
- "cloud-bridge", # not compiled and packaged yet
- "target", # eclipse workdir
- "apache-log4j-1.2.16",
- "apache-log4j-extras-1.1",
- "cglib",
- "gson",
- "ehcache",
- "vhd-tools",
- "xmlrpc",
- "PreviousDatabaseSchema",
- "mockito",
- "gcc",
- "junit" ],
- _glob("./*.disabledblahxml"),
- ]:
- for f in _globber: Scripting.excludes.append(_basename(f)) # _basename() only the filename
-
-# things never to consider when building or installing
-for pattern in ["**/.project","**/.classpath","**/.pydevproject"]: Node.exclude_regs += "\n%s"%pattern
-
-# Support functions
-
-def distclean(ctx):
- """Clear the build artifacts"""
- for root, folder, files in os.walk(blddir):
- for f in files:
- path = os.path.join(root, f)
- print "Removing artifact %s"%path
- os.remove(path)
-
-def inspectobj(x):
- """Look inside an object"""
- for m in dir(x): print m,": ",getattr(x,m)
-Utils.inspectobj = inspectobj
-
-def _trm(x,y):
- if len(x) > y: return x[:y] + "..."
- return x
-
-def getrpmdeps():
- def rpmdeps(fileset):
- for f in fileset:
- lines = file(f).readlines()
- lines = [ x[len("BuildRequires: "):] for x in lines if x.startswith("BuildRequires") ]
- for l in lines:
- deps = [ x.strip() for x in l.split(",") ]
- for d in deps:
- if "%s-"%APPNAME in d: continue
- yield d
- yield "rpm-build"
-
- deps = set(rpmdeps(_glob("./*.spec")))
- deps.add("ant")
- return deps
-
-# CENTOS does not have this -- we have to put this here
-try:
- from subprocess import check_call as _check_call
- from subprocess import CalledProcessError
-except ImportError:
- def _check_call(*popenargs, **kwargs):
- import subprocess
- retcode = subprocess.call(*popenargs, **kwargs)
- cmd = kwargs.get("args")
- if cmd is None: cmd = popenargs[0]
- if retcode: raise CalledProcessError(retcode, cmd)
- return retcode
-
- class CalledProcessError(Exception):
- def __init__(self, returncode, cmd):
- self.returncode = returncode ; self.cmd = cmd
- def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
-def throws_command_errors(f):
- def g(*args,**kwargs):
- try: return f(*args,**kwargs)
- except CalledProcessError,e:
- raise Utils.WafError("system command %s failed with error value %s"%(e.cmd[0],e.returncode))
- except IOError,e:
- if e.errno is 32:
- raise Utils.WafError("system command %s terminated abruptly, closing communications with parent's pipe"%e.cmd[0])
- raise
- return g
-
-def c(cmdlist,cwd=None):
- # Run a command with _check_call, pretty-printing the cmd list
- Utils.pprint("BLUE"," ".join(cmdlist))
- return _check_call(cmdlist,cwd=cwd)
-
-def svninfo(*args):
- try: p = _Popen(['svn','info']+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
- # 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 gitinfo(dir=None):
- if dir and not _isdir(dir): return ''
- try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
- 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'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
- 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 allgitinfo():
- t = gitinfo()
- if not t: return t
-
- u = gitinfo(_join(pardir,"cloudstack-proprietary"))
- if not u: return t
-
- return t + "\n\ncloustack-proprietary:\n" + u
-
-def _getbuildnumber(): # FIXME implement for git
- n = Options.options.BUILDNUMBER
- if n:
- # luntbuild prepends "build-" to the build number. we work around this here:
- if n.startswith("build-"): n = n[6:]
- # SVN identifiers prepend "$Revision:" to the build number. we work around this here:
- if n.startswith("$Revision:"): n = n[11:-2].strip()
- return n
- else:
- # Try to guess the SVN revision number by calling SVN info.
- stdout = svninfo()
- if not stdout: return ''
- # Filter lines.
- rev = [ x for x in stdout.splitlines() if x.startswith('SVN Revision') ]
- if not rev: return ''
- # Parse revision number.
- rev = rev[0][14:].strip()
- return rev
-Utils.getbuildnumber = _getbuildnumber
-
-def mkdir_p(directory):
- if not _isdir(directory):
- Utils.pprint("GREEN","Creating directory %s and necessary parents"%directory)
- _makedirs(directory)
-
-def relpath(path, start="."):
- if not path: raise ValueError("no path specified")
-
- start_list = os.path.abspath(start).split(sep)
- path_list = os.path.abspath(path).split(sep)
-
- # Work out how much of the filepath is shared by start and path.
- i = len(os.path.commonprefix([start_list, path_list]))
-
- rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
- if not rel_list:
- return curdir
- return os.path.join(*rel_list)
-Utils.relpath = relpath
-
-def dev_override(pathname):
- p,e = _split(pathname)
- overridden = _join(p,"override",e)
- if _exists(overridden): return overridden
- return pathname
-
-def discover_ant_targets_and_properties(files):
- doms = [ xml.dom.minidom.parseString(file(f).read(-1)) for f in files if f.endswith(".xml") ]
- targets = dict( [ (target.getAttribute("name"),target) for dom in doms for target in dom.getElementsByTagName("target") if target.getElementsByTagName("compile-java") ] )
- propsinxml = [ (prop.getAttribute("name"),prop.getAttribute("value") or prop.getAttribute("location")) for dom in doms for prop in dom.getElementsByTagName("property") ]
- propsinpropfiles = [ l.strip().split("=",1) for f in files if f.endswith(".properties") for l in file(f).readlines() if "=" in l and not l.startswith("#") ]
- props = dict( propsinxml + propsinpropfiles )
- props["base.dir"] = '.'
- props["p.base.dir"] = '.'
-
- result = []
- for name,target in targets.items():
- sourcedir = target.getElementsByTagName("compile-java")[0].getAttribute("top.dir") + "/src"
- classdir = "${classes.dir}/" + target.getElementsByTagName("compile-java")[0].getAttribute("jar.name")
- jarpath = "${jar.dir}/" + target.getElementsByTagName("compile-java")[0].getAttribute("jar.name")
- def lookup(matchobject): return props[matchobject.group(1)]
- while "$" in sourcedir: sourcedir = re.sub("\${(.+?)}",lookup,sourcedir)
- while "$" in classdir: classdir = re.sub("\${(.+?)}",lookup,classdir)
- while "$" in jarpath: jarpath= re.sub("\${(.+?)}",lookup,jarpath)
- dependencies = [ dep.strip() for dep in target.getAttribute("depends").split(",") if dep.strip() in targets ]
- result.append([str(name),str(relpath(sourcedir)),str(relpath(classdir)),str(relpath(jarpath)),[str(s) for s in dependencies]])
- # hardcoded here because the discovery process does not get it
- result.append( ["build-console-viewer","console-viewer/src", "target/classes/console-viewer", "target/jar/VMOpsConsoleApplet.jar", ["compile-utils","compile-console-common"] ] )
- return result,props
-Utils.discover_ant_targets_and_properties = discover_ant_targets_and_properties
-
-# this snippet of code runs a list of ant targets
-# then it expects a certain set of JAR files to be output in the artifacts/default/ant/jar directory
-# this set of jar files is defined here in the variable jartgts, and must match the definitions at the bottom of
-# build/package.xml and build/premium/package-premium.xml
-# this is NOT a task for a task generator -- it is a plain function.
-# If you want to use it as a task function in a task generator, use a lambda x: runant("targetname")
-def runant(tsk):
-
- environ = dict(os.environ)
- environ["CATALINA_HOME"] = tsk.env.TOMCATHOME
- if tsk.generator.env.DISTRO == "Windows":
- stanzas = [
- "ant",
- "-Dthirdparty.classpath=\"%s\""%(tsk.env.CLASSPATH.replace(os.pathsep,",")),
- ]
- else:
- stanzas = [
- "ant",
- "-Dthirdparty.classpath=%s"%(tsk.env.CLASSPATH.replace(os.pathsep,",")),
- ]
- stanzas += tsk.generator.antargs
- ret = Utils.exec_command(" ".join(stanzas),cwd=tsk.generator.bld.srcnode.abspath(),env=environ,log=True)
- if ret != 0: raise Utils.WafError("Ant command %s failed with error value %s"%(stanzas,ret))
- return ret
-Utils.runant = runant
-
-@throws_command_errors
-def run_java(classname,classpath,options=None,arguments=None):
- if not options: options = []
- if not arguments: arguments = []
- if type(classpath) in [list,tuple]: classpath = pathsep.join(classpath)
-
- Utils.pprint("BLUE","Run-time CLASSPATH:")
- for v in classpath.split(pathsep): Utils.pprint("BLUE"," %s"%v)
-
- cmd = ["java","-classpath",classpath] + options + [classname] + arguments
- Utils.pprint("BLUE"," ".join([ _trm(x,32) for x in cmd ]))
- _check_call(cmd)
-
-# this will enforce the after= ordering constraints in the javac task generators
-from TaskGen import after, feature
-@feature('*')
-@after('apply_core', 'apply_java', 'apply_subst')
-def process_after(self):
- lst = self.to_list(getattr(self, 'after', []))
- for x in lst:
- obj = self.bld.name_to_obj(x,self.bld.env)
- if not obj: break
- obj.post()
- for a in obj.tasks:
- for b in self.tasks:
- b.set_run_after(a)
-
-Build.BuildContext.process_after = staticmethod(process_after)
-
-def _getbuildcontext():
- ctx = Build.BuildContext()
- ctx.load_dirs(_abspath(srcdir),_abspath(blddir))
- ctx.load_envs()
- return ctx
-
-def _install_files_filtered(self,destdir,listoffiles,**kwargs):
- if "cwd" in kwargs: cwd = kwargs["cwd"]
- else: cwd = self.path
- if isinstance(listoffiles,str) and '**' in listoffiles:
- listoffiles = cwd.ant_glob(listoffiles,flat=True)
- elif isinstance(listoffiles,str) and '*' in listoffiles:
- listoffiles = [ n for x in listoffiles.split() for n in _glob(cwd.abspath() + os.sep + x.replace("/",os.sep)) ]
- listoffiles = Utils.to_list(listoffiles)[:]
- listoffiles = [ x for x in listoffiles if not ( x.endswith("~") or x == "override" or "%soverride"%os.sep in x ) ]
- for n,f in enumerate(listoffiles):
- f = os.path.abspath(f)
- f = dev_override(f)
- 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:], name="filtered_%s"%source)
- tgen.dict = self.env.get_merged_dict()
- else:
- source = f ; target = f
- listoffiles[n] = target[len(cwd.abspath())+1:]
- if "postpone" not in kwargs: kwargs["postpone"] = True
- ret = self.install_files(destdir,listoffiles,**kwargs)
- return ret
-Build.BuildContext.install_files_filtered = _install_files_filtered
-
-def _substitute(self,listoffiles,install_to=None,cwd=None,dict=None,name=None,**kwargs):
- if cwd is None: cwd = self.path
- tgenkwargs = {}
- if name is not None: tgenkwargs["name"] = name
- if isinstance(listoffiles,str) and '**' in listoffiles:
- listoffiles = cwd.ant_glob(listoffiles,flat=True)
- elif isinstance(listoffiles,str) and '*' in listoffiles:
- listoffiles = [ n for x in listoffiles.split() for n in _glob(cwd.abspath() + os.sep + x.replace("/",os.sep)) ]
- for src in Utils.to_list(listoffiles):
- tgt = src + ".subst"
- inst = src # Utils.relpath(src,relative_to) <- disabled
-
- # Use cwd path when creating task and shift back later
- tmp = self.path
- self.path = cwd
- tgen = self(features='subst', source=src, target=tgt, **tgenkwargs)
- self.path = tmp
-
- if dict is not None: tgen.dict = dict
- else: tgen.dict = self.env.get_merged_dict()
- self.path.find_or_declare(tgt)
- if install_to is not None: self.install_as("%s/%s"%(install_to,inst), tgt, cwd=cwd, **kwargs)
-Build.BuildContext.substitute = _substitute
-
-def set_options(opt):
- """Register command line options"""
- opt.tool_options('gnu_dirs')
- opt.tool_options('python')
- opt.tool_options('tar',tooldir='tools/waf')
- opt.tool_options('mkisofs',tooldir='tools/waf')
- if Options.platform not in ['darwin','win32']: opt.tool_options('usermgmt',tooldir='tools/waf')
- if Options.platform not in ['darwin','win32']: opt.tool_options('javadir',tooldir='tools/waf')
- opt.tool_options('tomcat',tooldir='tools/waf')
- if Options.platform not in ['darwin',"win32"]: opt.tool_options('compiler_cc')
-
- inst_dir = opt.get_option_group('--srcdir')
- inst_dir.add_option('--with-db-host',
- help = 'Database host to use for waf deploydb [Default: 127.0.0.1]',
- default = '127.0.0.1',
- dest = 'DBHOST')
- inst_dir.add_option('--with-db-user',
- help = 'Database user to use for waf deploydb [Default: root]',
- default = 'root',
- dest = 'DBUSER')
- inst_dir.add_option('--with-db-pw',
- help = 'Database password to use for waf deploydb [Default: ""]',
- default = '',
- dest = 'DBPW')
- inst_dir.add_option('--tomcat-user',
- help = 'UNIX user that the management server initscript will switch to [Default: <autodetected>]',
- default = '',
- dest = 'MSUSER')
- inst_dir.add_option('--no-dep-check',
- action='store_true',
- help = 'Skip dependency check and assume JARs already exist',
- default = False,
- dest = 'NODEPCHECK')
- inst_dir.add_option('--fast',
- action='store_true',
- help = 'does ---no-dep-check',
- default = False,
- dest = 'NODEPCHECK')
- inst_dir = opt.get_option_group('--force')
- inst_dir.add_option('--preserve-config',
- action='store_true',
- help = 'do not install configuration files',
- default = False,
- dest = 'PRESERVECONFIG')
-
- debugopts = optparse.OptionGroup(opt.parser,'run/debug options')
- opt.add_option_group(debugopts)
- debugopts.add_option('--debug-port',
- help = 'Port on which the debugger will listen when running waf debug [Default: 8787]',
- default = '8787',
- dest = 'DEBUGPORT')
- debugopts.add_option('--debug-suspend',
- action='store_true',
- help = 'Suspend the process upon startup so that a debugger can attach and set breakpoints',
- default = False,
- dest = 'DEBUGSUSPEND')
- debugopts.add_option('--run-verbose',
- action='store_true',
- help = 'Run Tomcat in verbose mode (java option -verbose)',
- default = False,
- dest = 'RUNVERBOSE')
-
- rpmopts = optparse.OptionGroup(opt.parser,'RPM/DEB build options')
- opt.add_option_group(rpmopts)
- rpmopts.add_option('--build-number',
- 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('--release-version',
- help = 'release version',
- default = '',
- dest = 'RELEASENUM')
- 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 = '',
- dest = 'PRERELEASE')
- rpmopts.add_option('--skip-dist',
- action='store_true',
- help = 'Normally, dist() is called during package build. This makes the package build assume that a distribution tarball has already been made, and use that. This option is also valid during distcheck and dist.',
- default = False,
- dest = 'DONTDIST')
-
- distopts = optparse.OptionGroup(opt.parser,'dist options')
- opt.add_option_group(distopts)
- distopts.add_option('--oss',
- help = 'Only include open source components',
- action = 'store_true',
- default = False,
- dest = 'OSS')
-
-def showconfig(conf):
- """prints out the current configure environment configuration"""
- conf = _getbuildcontext()
-
- Utils.pprint("WHITE","Build environment:")
- for key,val in sorted(conf.env.get_merged_dict().items()):
- if "CLASSPATH" in key:
- Utils.pprint("BLUE"," %s:"%key)
- for v in val.split(pathsep):
- Utils.pprint("BLUE"," %s"%v)
- continue
- Utils.pprint("BLUE"," %s: %s"%(key,val))
-
-def _getconfig(self):
- lines = []
- for key,val in sorted(self.env.get_merged_dict().items()):
- if "CLASSPATH" in key:
- lines.append(" %s:"%key)
- for v in val.split(pathsep):
- lines.append(" %s"%v)
- continue
- lines.append(" %s: %s"%(key,val))
- return "\n".join(lines)
-Build.BuildContext.getconfig = _getconfig
-
-def list_targets(ctx):
- """return the list of buildable and installable targets"""
-
- bld = Build.BuildContext()
- proj = Environment.Environment(Options.lockfile)
- bld.load_dirs(proj['srcdir'], proj['blddir'])
- bld.load_envs()
-
- bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]])
-
- names = set([])
- for x in bld.all_task_gen:
- try:
- names.add(x.name or x.target)
- except AttributeError:
- pass
-
- lst = list(names)
- lst.sort()
- for name in lst:
- print(name)
-
-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:
- 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
- # so downloaders won't have to cry every time they download a "source"
- # package over 90 MB in size
- [ shutil.rmtree(f) for f in _glob(_join("*","bin")) if _isdir(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 "cloudstack-proprietary".split() if _exists(f) ]
-
- stdout = svninfo("..") or allgitinfo()
- if stdout:
- f = file("sccs-info","w")
- f.write(stdout)
- f.flush()
- f.close()
- else:
- # No SVN available
- if _exists("sccs-info"):
- # If the file already existed, we preserve it
- return
- else:
- f = file("sccs-info","w")
- f.write("No revision control information could be detected when the source distribution was built.")
- f.flush()
- f.close()
-
-def bindist(ctx):
- """creates a binary distribution that, when unzipped in the root directory of a machine, deploys the entire stack"""
- ctx = _getbuildcontext()
-
- if Options.options.VERNUM:
- VERSION = Options.options.VERNUM
-
- tarball = "%s-bindist-%s.tar.%s"%(APPNAME,VERSION,Scripting.g_gz)
- zf = _join(ctx.bldnode.abspath(),tarball)
- Options.options.destdir = _join(ctx.bldnode.abspath(),"bindist-destdir")
- Scripting.install(ctx)
-
- if _exists(zf): _unlink(zf)
- Utils.pprint("GREEN","Creating %s"%(zf))
- z = tarfile.open(zf,"w:bz2")
- cwd = _getcwd()
- _chdir(Options.options.destdir)
- z.add(".")
- z.close()
- _chdir(cwd)
-
-@throws_command_errors
-def deb(context):
- raise Utils.WafError("Debian packages are no longer build with waf. Use dpkg-buildpackage instead.")
-
-@throws_command_errors
-def rpm(context):
- buildnumber = Utils.getbuildnumber()
- if buildnumber: buildnumber = ["--define","_build_number %s"%buildnumber]
- else: buildnumber = []
-
- if Options.options.PRERELEASE:
- if not buildnumber:
- 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.RELEASENUM:
- release = Options.options.RELEASENUM
- else: release = "1"
-
- releasever = ["--define", "_rel %s" % release]
-
- if Options.options.VERNUM:
- ver = Options.options.VERNUM
- else: ver = SHORTVERSION
-
- 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('', ver)
- sourcedir = _join(outputdir,"SOURCES")
-
- if _exists(sourcedir): shutil.rmtree(sourcedir)
- for a in ["RPMS/noarch","SRPMS","BUILD","SPECS","SOURCES"]: mkdir_p(_join(outputdir,a))
- 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)
- try: checkdeps()
- except (CalledProcessError,OSError),e:
- Utils.pprint("YELLOW","Dependencies might be missing. Trying to auto-install them...")
- installrpmdeps(context)
- dorpm()
-
-def uninstallrpms(context):
- """uninstalls any Cloud Stack RPMs on this system"""
- Utils.pprint("GREEN","Uninstalling any installed RPMs")
- cmd = "rpm -qa | grep %s- | xargs -r sudo rpm -e"%APPNAME
- Utils.pprint("BLUE",cmd)
- system(cmd)
-
-def viewrpmdeps(context):
- """shows all the necessary dependencies to build the RPM packages of the stack"""
- for dep in getrpmdeps(): print dep
-
-@throws_command_errors
-def installrpmdeps(context):
- """installs all the necessary dependencies to build the RPM packages of the stack"""
- runnable = ["sudo","yum","install","-y"]+list(getrpmdeps())
- Utils.pprint("GREEN","Installing RPM build dependencies")
- Utils.pprint("BLUE"," ".join(runnable))
- _check_call(runnable)
-
-@throws_command_errors
-def deploydb(ctx,virttech=None):
- if not virttech: raise Utils.WafError('use deploydb_xenserver, deploydb_vmware or deploydb_kvm rather than deploydb')
-
- ctx = _getbuildcontext()
- setupdatabases = _join(ctx.env.BINDIR,"cloud-setup-databases")
- serversetup = _join(ctx.env.SETUPDATADIR,"server-setup.xml")
-
- if not _exists(setupdatabases): # Needs install!
- Scripting.install(ctx)
-
- cmd = [
- ctx.env.PYTHON,
- setupdatabases,
- "cloud@%s"%ctx.env.DBHOST,
- virttech,
- "--auto=%s"%serversetup,
- "--deploy-as=%s:%s"%(ctx.env.DBUSER,ctx.env.DBPW),
- ]
-
- Utils.pprint("BLUE"," ".join(cmd))
- retcode = Utils.exec_command(cmd,shell=False,stdout=None,stderr=None,log=True)
- if retcode: raise CalledProcessError(retcode,cmd)
-
-def deploydb_xenserver(ctx):
- """re-deploys the database using the MySQL connection information and the XenServer templates.sql"""
- return deploydb(ctx,"xenserver")
-def deploydb_kvm(ctx):
- """re-deploys the database using the MySQL connection information and the KVM templates.sql"""
- return deploydb(ctx,"kvm")
-def deploydb_vmware(ctx):
- """re-deploys the database using the MySQL connection information and the KVM templates.sql"""
- return deploydb(ctx,"vmware")
-
-def run(args):
- """runs the management server"""
- conf = _getbuildcontext()
-
- runverbose = []
- if Options.options.RUNVERBOSE: runverbose = ['-verbose']
- if args == "debug":
- suspend = "n"
- if Options.options.DEBUGSUSPEND: suspend = "y"
- debugargs = [
- "-Xdebug","-Xrunjdwp:transport=dt_socket,address=%s,server=y,suspend=%s"%(
- Options.options.DEBUGPORT,suspend),
- "-ea"]
- Utils.pprint("GREEN","Starting Tomcat in debug mode")
- else:
- Utils.pprint("GREEN","Starting Tomcat in foreground mode")
- debugargs = []
-
- options = runverbose + debugargs + [
- "-Dcatalina.base=" + conf.env.MSENVIRON,
- "-Dcatalina.home=" + conf.env.MSENVIRON,
- "-Djava.io.tmpdir="+_join(conf.env.MSENVIRON,"temp"), ]
-
- if not _exists(_join(conf.env.BINDIR,"cloud-setup-databases")): Scripting.install(conf)
-
- cp = [conf.env.MSCONF]
- cp += _glob(_join(conf.env.MSENVIRON,'bin',"*.jar"))
- cp += _glob(_join(conf.env.MSENVIRON,'lib',"*.jar"))
- cp += _glob( _join ( conf.env.PREMIUMJAVADIR , "*" ) )
- cp += [conf.env.SYSTEMCLASSPATH]
- cp += [conf.env.DEPSCLASSPATH]
- cp += [conf.env.MSCLASSPATH]
-
- # FIXME Make selectable at runtime
- #plugins = _glob( _join(conf.env.PLUGINJAVADIR,"*") )
- #if plugins: cp = plugins + cp
- #vendorconfs = _glob( _join(conf.env.MSCONF,"vendor","*") )
- #if vendorconfs: cp = plugins + cp
-
- run_java("org.apache.catalina.startup.Bootstrap",cp,options,["start"])
-
-def debug(ctx):
- """runs the management server in debug mode"""
- run("debug")
-
-@throws_command_errors
-def run_agent(args):
- """runs the agent""" # FIXME: make this use the run/debug options
- conf = _getbuildcontext()
- if not _exists(_join(conf.env.LIBEXECDIR,"agent-runner")): Scripting.install(conf)
- _check_call("sudo",[_join(conf.env.LIBEXECDIR,"agent-runner")])
-
-@throws_command_errors
-#def run_console_proxy(args):
-# """runs the console proxy""" # FIXME: make this use the run/debug options
-# conf = _getbuildcontext()
-# if not _exists(_join(conf.env.LIBEXECDIR,"console-proxy-runner")): Scripting.install(conf)
-# _check_call("sudo",[_join(conf.env.LIBEXECDIR,"console-proxy-runner")])
-
-def simulate_agent(args):
- """runs the agent simulator, compiling and installing files as needed
- - Any parameter specified after the simulate_agent is appended to
- the java command line. To inhibit waf from interpreting the
- command-line options that you specify to the agent, put a --
- (double-dash) between the waf simulate_agent and the options, like this:
-
- python waf simulate_agent -- -z KY -p KY
-"""
-
- # to get this to work smoothly from the configure onwards, you need to
- # create an override directory in java/agent/conf, then add an agent.properties
- # there, with the correct configuration that you desire
- # that is it -- you are now ready to simulate_agent
- conf = _getbuildcontext()
- args = sys.argv[sys.argv.index("simulate_agent")+1:]
- if '--' in args: args.remove('--')
-
- cp = [conf.env.AGENTSYSCONFDIR]
- cp += _glob( _join ( conf.env.PREMIUMJAVADIR , "*" ) )
- cp += [conf.env.SYSTEMCLASSPATH]
- cp += [conf.env.DEPSCLASSPATH]
- cp += [conf.env.AGENTSIMULATORCLASSPATH]
-
- if not _exists(_join(conf.env.LIBEXECDIR,"agent-runner")): Scripting.install(conf)
-
- run_java("com.cloud.agent.AgentSimulator",cp,arguments=args)
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e138596a/wscript_build
----------------------------------------------------------------------
diff --git a/wscript_build b/wscript_build
deleted file mode 100644
index 1c12c61..0000000
--- a/wscript_build
+++ /dev/null
@@ -1,457 +0,0 @@
-#!/usr/bin/env python
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-"""builds the entire stack"""
-#For every matching build change here, that produces new installable
-#files, the cloud.spec file and the Debian control files must be
-#revised and tested.
-
-import shutil,os
-import Utils,Node,Options,Logs,Scripting,Environment,Build,Configure
-from os import unlink as _unlink, makedirs as _makedirs, getcwd as _getcwd, chdir as _chdir
-from os.path import abspath as _abspath, basename as _basename, dirname as _dirname, exists as _exists, isdir as _isdir, split as _split, join as _join, sep, pathsep, pardir, curdir
-from glob import glob as _glob
-from subprocess import Popen as _Popen,PIPE
-try: set([1,2,3])
-except Exception: from Sets import set
-import re
-import zipfile,tarfile
-import time
-try:
- from os import chmod as _chmod,chown as _chown
- import pwd,stat,grp
-except ImportError:
- _chmod,_chown,pwd,stat,grp = (None,None,None,None,None)
-
-
-# Global variables setup
-sourcedir = bld.srcnode.abspath()
-builddir = bld.path.abspath(bld.env)
-#buildpremium = _exists(_join(sourcedir,"cloudstack-proprietary"))
-buildpremium = False
-filelist = bld.path.ant_glob
-distdir = Utils.relpath(_join(sourcedir,"dist"))
-targetdir = Utils.relpath(_join(sourcedir,"target"))
-
-def gitinfo(dir=None):
- if dir and not _isdir(dir): return ''
- try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
- 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'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
- 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 + "\n"
-
-def build_utils_docs ():
- stdout = gitinfo()
- if stdout:
- f = file("sccs-info","w")
- f.write(stdout)
- f.flush()
- f.close()
- else:
- if _exists("sccs-info"):
- # If the file already existed, we preserve it
- return
- else:
- f = file("sccs-info","w")
- f.write("No revision control information could be detected when the source distribution was built.")
- f.flush()
- f.close()
-
- sccsinfo = _join(sourcedir,"sccs-info")
- if _exists(sccsinfo): bld.install_files("${DOCDIR}","sccs-info")
-
- tgen = bld(features='subst', name='configure-info', source="configure-info.in", target="configure-info")
- tgen.dict = {"CONFIGUREVARS":bld.getconfig()}
- bld.install_files("${DOCDIR}","configure-info")
-
-# compile jar files using ant
-# 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
-
- # this is to trigger recompilation / cache avoidance if the relevant environment for ant changes
- ant_args = [
- "build-all",
- "-Dimpl.version=%s" % Implementation_Version,
- "-Dtarget.dir=%s" % targetdir,
- "-Ddist.dir=%s" % distdir,
- "-Dbase.dir=%s" % sourcedir,
- "-f %s" % Utils.relpath (_join(sourcedir, "build.xml")),
- ]
-
- if buildpremium:
- ant_args.append("-Dbuild.premium=true")
-
- tgen = bld(features='subst', name='version-info', source="version-info.in", target="version-info")
- tgen.dict = { "Implementation_Version":Implementation_Version,"ant_args":ant_args }
- bld.install_files("${DOCDIR}","version-info")
-
- bld.srcnode.ensure_dir_node_from_path("target/jar")
- bld.srcnode.ensure_dir_node_from_path("dist")
-
- tgen = bld.new_task_gen (rule = Utils.runant,
- name = "runant",
- antargs = ant_args)
-
- jarnode = bld.srcnode.find_dir ('target/jar')
- jars_str = jarnode.ant_glob ('*.jar').split ()
- ant_jars = []
- excludes = ["cloud-xstream-1.3.1.jar", "cloud-commons-dbcp-1.2.2.jar",
- "cloud-commons-httpclient-3.1.jar", "cloud-commons-pool-1.4.jar",
- "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
- "cloud-ws-commons-util-1.0.2.jar",
- "cloud-commons-collections-3.2.1.jar", "vmware*.jar", "cloud-secstorage-extras.jar",
- "cloud-agent-simulator.jar", "cloud-awsapi.jar", "cloud-test.jar", "cloud-wsdl4j.jar", "cloud-console-proxy.jar"]
-
- for a in jars_str:
- if _basename (a).startswith ("cloud-") \
- and not _basename (a) in excludes:
- a = jarnode.abspath () + os.sep + a
- ant_jars.append (a)
-
- bld.install_files ('${JAVADIR}', ant_jars)
-
-
-def build_premium ():
- if buildpremium: bld.recurse(["cloudstack-proprietary/"],'build')
-
-def build_thirdparty_dir ():
- start_path = bld.path.find_dir ("thirdparty")
- bld.install_files('${PREMIUMJAVADIR}','*.jar', cwd = start_path)
- Utils.pprint ("GREEN", "Installed files of thirdparty/")
-
-def build_dependences ():
- excludes = ["cloud-xstream-1.3.1.jar", "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
- "cloud-ws-commons-util-1.0.2.jar",
- "cloud-commons-collections-3.2.1.jar", "cloud-wsdl4j.jar"]
-
- start_path = bld.path.find_dir ("deps")
-
- bld.install_files('${JAVADIR}',start_path.ant_glob(["CAStorSDK-*.jar", "javax.persistence-2.0.0.jar", "apache-log4j-extras-1.1.jar", "libvirt-0.4.9.jar", "axis2-1.5.1.jar", "jstl-1.2.jar", "commons-discovery-0.5.jar", "commons-codec-1.6.jar", "ejb-api-3.0.jar", "xmlrpc-client-3.1.3.jar", "commons-dbcp-1.4.jar", "commons-pool-1.6.jar", "gson-1.7.1.jar",
- "netscaler-1.0.jar", "netscaler-sdx-1.0.jar", "backport-util-concurrent-3.1.jar", "ehcache-1.5.0.jar", "httpcore-4.0.jar", "log4j-1.2.16.jar", "trilead-ssh2-build213-svnkit-1.3-patch.jar", "cglib-nodep-2.2.2.jar", "xmlrpc-common-3.*.jar",
- "axiom*.jar", "axis2*.jar", "antlr*.jar", "XmlSchema*.jar", "json-simple*.jar", "neethi*.jar", "woden*.jar", "xercesImpl*.jar", "xml-apis*.jar", "dom4j*.jar", "javassist*.jar", "commons-fileupload*.jar",
- "xmlrpc-client-3.*.jar", "wsdl4j-1.6.2.jar", "bcprov-jdk16-1.45.jar", "jsch-0.1.42.jar", "jasypt-1.9.0.jar", "commons-configuration-1.8.jar", "mail-1.4.jar", "activation-1.1.jar", "xapi-5.6.100-1-SNAPSHOT.jar"], excl = excludes), cwd=start_path)
-
-#def build_console_proxy ():
- # binary unsubstitutable files:
-# start_path = bld.path.find_dir ("console-proxy")
-# bld.install_files("${CPLIBDIR}",start_path.ant_glob("images/**",src=True,bld=False,dir=False,flat=True),cwd=start_path,relative_trick=True)
-
- # text substitutable files (substitute with tokens from the environment bld.env):
-# bld.substitute('css/** js/** ui/** scripts/**',install_to="${CPLIBDIR}", cwd=start_path)
-
- # config files (do not replace them if preserve config option is true)
-# if not Options.options.PRESERVECONFIG: bld.install_files_filtered("${CPSYSCONFDIR}","conf.dom0/*", cwd=start_path)
-
-def build_patches ():
- # done here because the patches require substituted files
- start_path = bld.path.find_dir ("patches")
- bld.substitute("*/**",name="patchsubst", cwd = start_path)
-
- for virttech in Utils.to_list(start_path.ant_glob("*",dir=True)):
- if virttech in ["shared"]: continue
- patchfiles = start_path.ant_glob('shared/** %s/debian/config/**'%virttech,src=False,bld=True,dir=False,flat=True)
- tmp = bld.path
- bld.path = start_path
- tgen = bld(
- features = 'tar',#Utils.tar_up,
- source = patchfiles,
- target = 'cloud-scripts.tgz',
- name = 'cloud-scripts_tgz',
- root = os.path.join("patches", virttech + "/debian/config"),
- rename = lambda x: re.sub(".subst$","",x),
- )
- bld.path = tmp
-
-
-def build_systemvm_patch ():
- if bld.env.DISTRO not in ["Windows","Mac"]:
- # patch creation
- bld.install_files ("${COMMONLIBDIR}/vms", "%s/systemvm.zip" % distdir)
- # ISO creation
- bld.install_as("${COMMONLIBDIR}/vms/systemvm.iso", "%s/systemvm.iso" % distdir)
-
-def build_systemvm_iso ():
- if buildpremium:
- bld.install_as("${AGENTLIBDIR}/vms/systemvm-premium.iso", "%s/systemvm-premium.iso" % distdir)
-
-# =================== Empty directory / symlink creation on install target ====================
-
-def build_dirs_symlinks ():
- bld.createuser(bld.env.MSUSER,bld.env.MSENVIRON,'/bin/sh')
-
- # 7. make log and cache dirs (this actually runs first)
- if bld.env.DISTRO in 'Windows Mac': pass
- else:
- x = ("root",bld.env.MSUSER)
- directories = [
- ("${MSLOGDIR}",0770,x),
- ("${AGENTLOGDIR}",0770,x),
- ("${USAGELOGDIR}",0770,x),
-# ("${CPLOGDIR}",0770,x),
- ("${IPALLOCATORLOGDIR}",0770,x),
- ("${LOCALSTATEDIR}/cache/${MSPATH}",0770,x),
- ("${LOCALSTATEDIR}/cache/${MSPATH}/temp",0770,x),
- ("${LOCALSTATEDIR}/cache/${MSPATH}/work",0770,x),
- ("${SHAREDSTATEDIR}/${MSPATH}",0770,x),
- ("${MSMNTDIR}",0770,x),
- ("${MSCONF}/Catalina",0770,x),
- ("${MSCONF}/Catalina/localhost",0770,x),
- ("${MSCONF}/Catalina/localhost/client",0770,x),
- ("${PIDDIR}",0755,("root","root")),
- ("${LOCKDIR}",0755,("root","root")),
- ]
-
- for a,mode,owner in directories:
- s = bld.subst_add_destdir(a,bld)
- if Options.is_install:
- bld.install_dir(a)
- bld.setownership(a,owner[0],owner[1],mode)
-
- # 8. create environment symlinks
- symlinks = [
- ('${MSENVIRON}/bin', '${TOMCATHOME}/bin'),
- ('${MSENVIRON}/lib', '${TOMCATHOME}/lib'),
- ('${MSENVIRON}/logs', "${MSLOGDIR}"),
- ('${MSENVIRON}/temp', '${LOCALSTATEDIR}/cache/${MSPATH}/temp'),
- ('${MSENVIRON}/work','${LOCALSTATEDIR}/cache/${MSPATH}/work'),
- ('${MSENVIRON}/conf', '${SYSCONFDIR}/${MSPATH}'),
-# ("${AGENTLIBDIR}/css", '${CPLIBDIR}/css'),
-# ("${AGENTLIBDIR}/images", '${CPLIBDIR}/images'),
-# ("${AGENTLIBDIR}/js", '${CPLIBDIR}/js'),
-# ("${AGENTLIBDIR}/ui", '${CPLIBDIR}/ui'),
- ("${MSCONF}/server.xml", '${MSCONF}/server-nonssl.xml'),
- ("${MSCONF}/tomcat6.conf", '${MSCONF}/tomcat6-nonssl.conf'),
- ]
-
- for lnk,dst in symlinks: bld.symlink_as(lnk,Utils.subst_vars(dst,bld.env))
-
-
-def build_scripts ():
- start_path = bld.path.find_dir ("scripts")
- bld.substitute('**',"${COMMONLIBDIR}/scripts",chmod=0755, cwd=start_path)
-
-def build_bin_exec_dirs ():
- #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)
-
- bld.install_files_filtered("${LIBEXECDIR}","*/libexec/*",chmod=0755)
- bld.install_files_filtered("${BINDIR}","*/bindir/*",chmod=0755)
- bld.install_files_filtered("${SBINDIR}","*/sbindir/*",chmod=0755)
-
-def build_server_client ():
- start_path = bld.path.find_dir("client/WEB-INF")
- bld.install_files('${MSENVIRON}/webapps/client/WEB-INF',
- start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True),
- cwd=start_path,relative_trick=True)
-
- start_path = bld.path.find_dir("client")
- bld.install_files("${MSCONF}/resources",'WEB-INF/classes/resources/*.properties',chmod=0640, cwd=start_path)
-
- if not Options.options.PRESERVECONFIG:
- bld.install_files_filtered("${MSCONF}","tomcatconf/*", cwd=start_path)
- bld.install_files("${MSCONF}",'tomcatconf/db.properties',chmod=0640, cwd=start_path)
- bld.setownership("${MSCONF}/db.properties","root",bld.env.MSUSER)
-
- start_path = bld.path.find_dir("server")
- if not Options.options.PRESERVECONFIG:
- bld.install_files_filtered("${SERVERSYSCONFDIR}","conf/*", cwd=start_path)
-
-def build_agent ():
- start_path = bld.path.find_dir ("agent")
- bld.install_files("${AGENTLIBDIR}",
- start_path.ant_glob("storagepatch/**",src=True,bld=False,dir=False,flat=True),
- cwd=start_path,relative_trick=True)
- if not Options.options.PRESERVECONFIG:
- bld.install_files_filtered("${AGENTSYSCONFDIR}","conf/*", cwd = start_path)
-
-def build_ui ():
- # binary unsubstitutable files:
- start_path = bld.path.find_dir ("ui")
- bld.install_files ("${MSENVIRON}/webapps/client",start_path.ant_glob("*.ico **/*png **/*jpg **/*gif",src=True,bld=False,dir=False,flat=True),cwd=start_path,relative_trick=True)
-
- # text substitutable files (substitute with tokens from the environment bld.env):
- bld.substitute ("*html **/*html **/*js **/*css **/*properties **/*jsp *jsp",install_to="${MSENVIRON}/webapps/client", cwd=start_path)
-
-def build_conf_files ():
- # apply distro-specific config on top of the 'all' generic cloud-management config
- globspec = _join("*","distro",bld.env.DISTRO.lower(),"*") # matches premium/distro/centos/SYSCONFDIR
- #distrospecificdirs=_glob(globspec) + _glob(_join("cloudstack-proprietary",globspec))
- distrospecificdirs=_glob(globspec)
- for dsdir in distrospecificdirs:
- start_path = bld.srcnode.find_dir(dsdir)
- subpath,varname = _split(dsdir)
- dsdirwithvar = _join("${%s}"%varname)
- files = filelist('%s/**'%dsdir,src=True,bld=False,dir=False,flat=True)
- mode = 0644
- if "SYSCONFDIR" in dsdir:
- mode = 0755
- if Options.options.PRESERVECONFIG: continue
- bld.install_files_filtered(dsdirwithvar, files, cwd=start_path, relative_trick=True,chmod=mode)
-
-# cloudstack-proprietary still has db files for usage
-def build_db_files ():
- #bld.install_files_filtered("${SETUPDATADIR}",filelist("*/db/* cloudstack-proprietary/*/db/*",excl=Node.exclude_regs + "\ncloud-gate\ncloud-bridge"))
- start_path = bld.path.find_dir ("setup/db")
- bld.substitute('**',"${SETUPDATADIR}", cwd=start_path)
- if buildpremium:
- start_path = bld.path.find_dir ("cloudstack-proprietary/premium/db")
- bld.substitute('**',"${SETUPDATADIR}", cwd=start_path)
-
-
-def build_plugins ():
- # ====================== Feature-specific 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
- sources = filelist( '%s/**/*.java' % plugin.replace(sep,"/") , src=True, bld=False, dir=False )
- tgen = bld(rule=lambda x: runant("compile-%s"%pluginname), name='compile_%s'%pluginname, source=sources, target=target, after='runant')
- bld.install_files('${PLUGINJAVADIR}',target)
-
- # ====================== End feature-specific plugins ====================
-
-
- # ====================== Vendor-specific plugins ========================
-
- 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))
-
- # ====================== End vendor-specific plugins ====================
-
-def build_xml_api_description ():
- def generate_xml_api_description(task):
- relationship = Utils.relpath(sourcedir,os.getcwd())
- cp = [ _join(relationship,x) for x in task.generator.env.CLASSPATH.split(pathsep) ]
-
- jarnames = ['utils','server','core', 'api', 'server-extras']
- props = ["client/tomcatconf/commands.properties.in"]
-
- sources = []
- for i in jarnames:
- str = 'target/jar/cloud-%s.jar' % i
- sources.append (str)
- sources.append ("client/tomcatconf/commands.properties.in")
- if buildpremium:
- sources.append("client/tomcatconf/commands-ext.properties.in")
-
- buildproducts = []
- for i in sources:
- path = bld.path.abspath() + os.sep + i
- buildproducts.append (path)
-
- jars = [ x for x in buildproducts if x.endswith("jar") ]
- properties = [ x for x in buildproducts if x.endswith("properties.in") ]
- cp += jars
- cp = pathsep.join(cp)
- arguments = ["-f",",".join(properties),"-d",builddir]
- ret = Utils.exec_command(["java","-cp",cp,"com.cloud.api.doc.ApiXmlDocWriter"]+arguments,log=True)
- return ret
-
- #TODO: We can't use 'source' token here because task_gen check if sources
- # exist before all task_gen. This bring a problem that 'runant' task doesn't
- # run when the check happen, which results in no source found at target/jar.
- # Ask waf community to fix that
- tgen = bld.new_task_gen (
- rule = generate_xml_api_description,
- target = 'commands.xml',
- name = 'xmlapi',
- after = 'runant',
- install_path="${CLIDIR}"
- )
-
- bld.install_as("${PYTHONDIR}/cloud_utils.py", 'python/lib/cloud_utils.py')
- bld.install_files("${PYTHONDIR}/cloudtool", 'cloud-cli/cloudtool/*')
- bld.install_files("${PYTHONDIR}/cloudutils", 'python/lib/cloudutils/*')
- bld.install_as("${PYTHONDIR}/cloudapis.py", 'cloud-cli/cloudapis/cloud.py')
-
-def build_ovm():
- start_path = bld.path.find_dir("plugins/hypervisors/ovm/scripts")
- bld.substitute('**',"${COMMONLIBDIR}/scripts",chmod=0755, cwd=start_path)
-
-def build_test():
- start_path = bld.path.find_dir("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")
- 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:
- start_path = bld.path.find_dir("test")
- bld.install_files('${SYSCONFDIR}/${PACKAGE}/test','conf/*', cwd = start_path)
- Utils.pprint ("GREEN", "Installed files of test/")
-
-def build_usage_dir ():
- start_path = bld.path.find_dir ("usage")
- bld.install_files_filtered("${USAGESYSCONFDIR}","conf/*", cwd = start_path)
- bld.symlink_as("${USAGESYSCONFDIR}/db.properties", \
- Utils.subst_vars("${MSCONF}/db.properties",bld.env))
- Utils.pprint ("GREEN", "Installed files of usage/")
-
-
-# Get started to execute here
-#build_utils_docs ()
-build_jars ()
-build_premium ()
-#build_thirdparty_dir()
-build_dependences ()
-#build_patches ()
-build_systemvm_patch ()
-build_dirs_symlinks ()
-build_scripts ()
-build_bin_exec_dirs ()
-build_server_client ()
-build_agent ()
-build_ui ()
-build_conf_files ()
-build_db_files ()
-build_plugins ()
-build_xml_api_description ()
-build_ovm ()
-#build_test()
-build_usage_dir()
-
-# ====================== Magic! =========================================
-bld.use_the_magic()