From 2f135be15f1850280d27585153de2650f13f1dcb Mon Sep 17 00:00:00 2001 From: Noa Resare Date: Wed, 27 Feb 2013 08:55:24 +0000 Subject: [PATCH] CLOUDSTACK-1415: Debian & Ubuntu packaging work Some concepts included: * the replace.properties location used by maven is parameterized to allow for a build that does not modify the currently git tracked files * package naming is updated along the lines of what was discussed on the -dev mailing list and between committers at the Build a Cloud Day in Belgi * package version pattern is updated (since we redo all package names, we might as well drop the epoch) --- agent/pom.xml | 22 +- awsapi/pom.xml | 2 +- client/pom.xml | 26 +- client/tomcatconf/classpath.conf.in | 24 +- debian/README | 6 - debian/changelog | 6 + debian/cloud-agent.config | 17 -- debian/cloud-cli.install | 21 -- debian/cloud-client-ui.install | 19 -- debian/cloud-client.install | 58 ----- debian/cloud-client.postinst | 49 ---- debian/cloud-core.install | 19 -- debian/cloud-deps.install | 34 --- debian/cloud-python.install | 18 -- debian/cloud-scripts.install | 27 -- debian/cloud-server.install | 32 --- debian/cloud-system-iso.install | 18 -- debian/cloud-usage.install | 23 -- debian/cloud-usage.postinst | 47 ---- debian/cloud-utils.install | 22 -- ...agent.install => cloudstack-agent.install} | 4 +- ...lient.config => cloudstack-awsapi.install} | 1 + ...loud-cli.config => cloudstack-cli.install} | 3 +- ...libs.install => cloudstack-common.install} | 18 +- ...agement.config => cloudstack-docs.install} | 3 +- ....install => cloudstack-management.install} | 18 +- ...ostinst => cloudstack-management.postinst} | 20 +- ...-deps.install => cloudstack-usage.install} | 9 +- debian/control | 133 +++------- debian/rules | 124 ++++++--- framework/rest/pom.xml | 4 + packaging/debian/init/cloud-agent | 167 ++++++++++++ packaging/debian/init/cloud-management | 244 ++++++++++++++++++ packaging/debian/init/cloud-usage | 131 ++++++++++ packaging/debian/replace.properties | 6 +- plugins/hypervisors/kvm/pom.xml | 68 +---- pom.xml | 1 + server/pom.xml | 37 +++ usage/pom.xml | 4 +- 39 files changed, 830 insertions(+), 655 deletions(-) delete mode 100644 debian/README delete mode 100644 debian/cloud-agent.config delete mode 100644 debian/cloud-cli.install delete mode 100644 debian/cloud-client-ui.install delete mode 100644 debian/cloud-client.install delete mode 100644 debian/cloud-client.postinst delete mode 100644 debian/cloud-core.install delete mode 100644 debian/cloud-deps.install delete mode 100644 debian/cloud-python.install delete mode 100644 debian/cloud-scripts.install delete mode 100644 debian/cloud-server.install delete mode 100644 debian/cloud-system-iso.install delete mode 100644 debian/cloud-usage.install delete mode 100644 debian/cloud-usage.postinst delete mode 100644 debian/cloud-utils.install rename debian/{cloud-agent.install => cloudstack-agent.install} (92%) rename debian/{cloud-client.config => cloudstack-awsapi.install} (96%) rename debian/{cloud-cli.config => cloudstack-cli.install} (97%) rename debian/{cloud-agent-libs.install => cloudstack-common.install} (50%) rename debian/{cloud-management.config => cloudstack-docs.install} (97%) rename debian/{cloud-setup.install => cloudstack-management.install} (69%) rename debian/{cloud-agent.postinst => cloudstack-management.postinst} (77%) rename debian/{cloud-agent-deps.install => cloudstack-usage.install} (86%) create mode 100755 packaging/debian/init/cloud-agent create mode 100755 packaging/debian/init/cloud-management create mode 100755 packaging/debian/init/cloud-usage diff --git a/agent/pom.xml b/agent/pom.xml index a3d071b1c6a..aceb4d71dd3 100644 --- a/agent/pom.xml +++ b/agent/pom.xml @@ -83,7 +83,7 @@ + value="${cs.replace.properties}" /> @@ -97,7 +97,7 @@ + value="${cs.replace.properties}" /> @@ -106,6 +106,24 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 2.5.1 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/dependencies + runtime + + + + diff --git a/awsapi/pom.xml b/awsapi/pom.xml index 8e07f9e2124..f19a71381d3 100644 --- a/awsapi/pom.xml +++ b/awsapi/pom.xml @@ -354,7 +354,7 @@ + value="${cs.replace.properties}" /> diff --git a/client/pom.xml b/client/pom.xml index b485be53805..8e1ad2bc064 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -308,7 +308,7 @@ + value="${cs.replace.properties}" /> @@ -319,7 +319,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -341,7 +341,7 @@ - + @@ -351,10 +351,26 @@ - + + + + + + + + + + + + + + + + + diff --git a/client/tomcatconf/classpath.conf.in b/client/tomcatconf/classpath.conf.in index 3ae0fb4d778..5625f69ed33 100644 --- a/client/tomcatconf/classpath.conf.in +++ b/client/tomcatconf/classpath.conf.in @@ -16,23 +16,11 @@ # specific language governing permissions and limitations # under the License. -SYSTEMJARS="@SYSTEMJARS@" -SCP=$(build-classpath $SYSTEMJARS 2>/dev/null) ; if [ $? != 0 ] ; then export SCP="@SYSTEMCLASSPATH@" ; fi -MCP="@MSCLASSPATH@" -DCP="@DEPSCLASSPATH@" -CLASSPATH=$SCP:$DCP:$MCP:@MSCONF@:@SETUPDATADIR@ -for jarfile in "@PREMIUMJAVADIR@"/* ; do - if [ ! -e "$jarfile" ] ; then continue ; fi - CLASSPATH=$jarfile:$CLASSPATH -done -for plugin in "@PLUGINJAVADIR@"/* ; do - if [ ! -e "$plugin" ] ; then continue ; fi - CLASSPATH=$plugin:$CLASSPATH -done -for vendorconf in "@MSCONF@"/vendor/* ; do - if [ ! -d "$vendorconf" ] ; then continue ; fi - CLASSPATH=$vendorconf:$CLASSPATH +# We use WEB-INF/lib in the webapp for including things into +# the classpath nowdays + +for jar in /usr/share/tomcat6/lib/*.jar; do + CLASSPATH=$jar:$CLASSPATH done +CLASSPATH=${CLASSPATH}/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/mysql-connector-java-5.1.21.jar export CLASSPATH -PATH=/sbin:/usr/sbin:$PATH -export PATH diff --git a/debian/README b/debian/README deleted file mode 100644 index cbfbf1bb9d9..00000000000 --- a/debian/README +++ /dev/null @@ -1,6 +0,0 @@ -The Debian Package ----------------------------- - -This is part of the Cloud Stack collection of packages. - - -- Manuel Amador (Rudd-O) Thu, 25 Mar 2010 15:12:06 -0700 diff --git a/debian/changelog b/debian/changelog index c3243aad5e3..cbbaad32cad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cloudstack (4.1.0-incubating-0.0.snapshot) unstable; urgency=low + + * Incorporate incubating into version, remove epoch + + -- Noa Resare Tue, 05 Feb 2013 18:05:28 +0000 + cloud (1:4.0.0-1) unstable; urgency=low * Bumping the version to 4.0.0 diff --git a/debian/cloud-agent.config b/debian/cloud-agent.config deleted file mode 100644 index 00ae6c00d2e..00000000000 --- a/debian/cloud-agent.config +++ /dev/null @@ -1,17 +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. - diff --git a/debian/cloud-cli.install b/debian/cloud-cli.install deleted file mode 100644 index ce178461150..00000000000 --- a/debian/cloud-cli.install +++ /dev/null @@ -1,21 +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. - -/etc/cloud/cli/commands.xml -/usr/bin/cloud-grab-dependent-library-versions -/usr/bin/cloud-tool -/usr/bin/cloudvoladm diff --git a/debian/cloud-client-ui.install b/debian/cloud-client-ui.install deleted file mode 100644 index ba1408afcc5..00000000000 --- a/debian/cloud-client-ui.install +++ /dev/null @@ -1,19 +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. - -/usr/share/cloud/management/webapps/client/* - diff --git a/debian/cloud-client.install b/debian/cloud-client.install deleted file mode 100644 index aadb145ae1c..00000000000 --- a/debian/cloud-client.install +++ /dev/null @@ -1,58 +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. - -/etc/cloud/management/catalina.policy -/etc/cloud/management/catalina.properties -/etc/cloud/management/commands.properties -/etc/cloud/management/components.xml -/etc/cloud/management/context.xml -/etc/cloud/management/db.properties -/etc/cloud/management/environment.properties -/etc/cloud/management/ehcache.xml -/etc/cloud/management/log4j-cloud.xml -/etc/cloud/management/logging.properties -/etc/cloud/management/server.xml -/etc/cloud/management/tomcat6.conf -/etc/cloud/management/classpath.conf -/etc/cloud/management/tomcat-users.xml -/etc/cloud/management/web.xml -/etc/cloud/management/server-nonssl.xml -/etc/cloud/management/tomcat6-nonssl.conf -/etc/cloud/management/virtualrouter_commands.properties -/etc/cloud/management/f5bigip_commands.properties -/etc/cloud/management/junipersrx_commands.properties -/etc/cloud/management/netscalerloadbalancer_commands.properties -/etc/cloud/management/cisconexusvsm_commands.properties -/etc/cloud/management/Catalina -/etc/cloud/management/Catalina/localhost -/etc/cloud/management/Catalina/localhost/client -/etc/init.d/cloud-management -/usr/share/cloud/management/bin -/usr/share/cloud/management/conf -/usr/share/cloud/management/lib -/usr/share/cloud/management/logs -/usr/share/cloud/management/temp -/usr/share/cloud/management/work -/var/cache/cloud/management -/var/cache/cloud/management/work -/var/cache/cloud/management/temp -/var/log/cloud/management -/var/lib/cloud/mnt -/var/lib/cloud/management -/usr/bin/cloud-setup-management -/usr/bin/cloud-update-xenserver-licenses -/etc/cloud/management/commands-ext.properties diff --git a/debian/cloud-client.postinst b/debian/cloud-client.postinst deleted file mode 100644 index 87c7610320c..00000000000 --- a/debian/cloud-client.postinst +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -e -# 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. - -case "$1" in - configure) - if ! id cloud > /dev/null 2>&1 ; then - adduser --system --home /var/lib/cloud/management --no-create-home \ - --group --disabled-password --shell /bin/sh cloud - # update me in all the .postinst that you can find me in, as well - fi - - for i in /var/lib/cloud/mnt /var/cache/cloud/management \ - /var/cache/cloud/management/work /var/cache/cloud/management/temp \ - /var/log/cloud/management /etc/cloud/management/Catalina \ - /etc/cloud/management/Catalina/localhost /var/lib/cloud/management /etc/cloud/management/Catalina/localhost/client - do - chmod 0770 $i - chgrp cloud $i - done - - for i in /etc/cloud/management/db.properties - do - chmod 0640 $i - chgrp cloud $i - done - - if [ "$2" = "" ] ; then # no recently configured version, this is a first install - /usr/sbin/update-rc.d cloud-management defaults || true - fi - - ;; -esac - -#DEBHELPER# diff --git a/debian/cloud-core.install b/debian/cloud-core.install deleted file mode 100644 index 00a43d48259..00000000000 --- a/debian/cloud-core.install +++ /dev/null @@ -1,19 +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. - -/usr/share/java/cloud-core.jar - diff --git a/debian/cloud-deps.install b/debian/cloud-deps.install deleted file mode 100644 index 74aade12543..00000000000 --- a/debian/cloud-deps.install +++ /dev/null @@ -1,34 +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. - -/usr/share/java/ehcache-1.5.0.jar -/usr/share/java/mail-1.4.jar -/usr/share/java/httpcore-4.0.jar -/usr/share/java/log4j-*.jar -/usr/share/java/apache-log4j-extras-1.1.jar -/usr/share/java/trilead-ssh2-build213-svnkit-1.3-patch.jar -/usr/share/java/xmlrpc-common-3.*.jar -/usr/share/java/xmlrpc-client-3.*.jar -/usr/share/java/jstl-1.2.jar -/usr/share/java/axis2-1.5.1.jar -/usr/share/java/wsdl4j-1.6.2.jar -/usr/share/java/bcprov-*.jar -/usr/share/java/jasypt-1.*.jar -/usr/share/java/ejb-api-3.0.jar -/usr/share/java/javax.persistence-2.0.0.jar -/usr/share/java/gson-1.7.1.jar -/usr/share/java/xapi-5.6.100-1-SNAPSHOT.jar diff --git a/debian/cloud-python.install b/debian/cloud-python.install deleted file mode 100644 index b8eac722a6d..00000000000 --- a/debian/cloud-python.install +++ /dev/null @@ -1,18 +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. - -/usr/lib/python*/dist-packages/cloud* diff --git a/debian/cloud-scripts.install b/debian/cloud-scripts.install deleted file mode 100644 index 5e8896d43a3..00000000000 --- a/debian/cloud-scripts.install +++ /dev/null @@ -1,27 +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. - -/usr/lib/cloud/common/scripts/installer/* -/usr/lib/cloud/common/scripts/network/* -/usr/lib/cloud/common/scripts/storage/* -/usr/lib/cloud/common/scripts/util/* -/usr/lib/cloud/common/scripts/vm/network/* -/usr/lib/cloud/common/scripts/vm/systemvm/* -/usr/lib/cloud/common/scripts/vm/pingtest.sh -/usr/lib/cloud/common/scripts/vm/hypervisor/kvm/* -/usr/lib/cloud/common/scripts/vm/hypervisor/versions.sh -/usr/lib/cloud/common/scripts/vm/hypervisor/xenserver/* diff --git a/debian/cloud-server.install b/debian/cloud-server.install deleted file mode 100644 index f792cc2f7cd..00000000000 --- a/debian/cloud-server.install +++ /dev/null @@ -1,32 +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. - -/usr/share/java/cloud-server.jar -/usr/share/java/cloud-ovm.jar -/etc/cloud/server/* -/usr/share/java/cloud-dp-user-concentrated-pod.jar -/usr/share/java/cloud-dp-user-dispersing.jar -/usr/share/java/cloud-host-allocator-random.jar -/usr/share/java/cloud-plugin-elb.jar -/usr/share/java/cloud-plugin-ovs.jar -/usr/share/java/cloud-plugin-nicira-nvp.jar -/usr/share/java/cloud-plugin-bigswitch-vns.jar -/usr/share/java/cloud-storage-allocator-random.jar -/usr/share/java/cloud-user-authenticator-ldap.jar -/usr/share/java/cloud-user-authenticator-md5.jar -/usr/share/java/cloud-user-authenticator-plaintext.jar -/usr/share/java/cloud-plugin-hypervisor-xen.jar diff --git a/debian/cloud-system-iso.install b/debian/cloud-system-iso.install deleted file mode 100644 index 5a0b6364f4c..00000000000 --- a/debian/cloud-system-iso.install +++ /dev/null @@ -1,18 +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. - -/usr/lib/cloud/common/vms/systemvm.iso diff --git a/debian/cloud-usage.install b/debian/cloud-usage.install deleted file mode 100644 index 22f58344102..00000000000 --- a/debian/cloud-usage.install +++ /dev/null @@ -1,23 +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. - -/usr/share/java/cloud-usage.jar -/etc/init.d/cloud-usage -/var/log/cloud/usage -/etc/cloud/usage/usage-components.xml -/etc/cloud/usage/log4j-cloud_usage.xml -/etc/cloud/usage/db.properties diff --git a/debian/cloud-usage.postinst b/debian/cloud-usage.postinst deleted file mode 100644 index 56f895df6e0..00000000000 --- a/debian/cloud-usage.postinst +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -e -# 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. - -case "$1" in - configure) - - if ! id cloud > /dev/null 2>&1 ; then - adduser --system --home /var/lib/cloud/management --no-create-home \ - --group --disabled-password --shell /bin/sh cloud - # update me in cloud-client.postinst as well - fi - - for i in /var/log/cloud/usage - do - chmod 0770 $i - chgrp cloud $i - done - - for i in /etc/cloud/usage/db.properties - do - chmod 0640 $i - chgrp cloud $i - done - - if [ "$2" = "" ] ; then # no recently configured version, this is a first install - /usr/sbin/update-rc.d cloud-usage defaults || true - fi - - ;; -esac - -#DEBHELPER# diff --git a/debian/cloud-utils.install b/debian/cloud-utils.install deleted file mode 100644 index 39c357a1fa6..00000000000 --- a/debian/cloud-utils.install +++ /dev/null @@ -1,22 +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. - -/usr/share/java/cloud-utils.jar -/usr/share/java/cloud-api.jar -/usr/share/doc/cloud/version-info -/usr/bin/cloud-sccs -/usr/bin/cloud-gitrevs diff --git a/debian/cloud-agent.install b/debian/cloudstack-agent.install similarity index 92% rename from debian/cloud-agent.install rename to debian/cloudstack-agent.install index c67e90ab492..84eee10b578 100644 --- a/debian/cloud-agent.install +++ b/debian/cloudstack-agent.install @@ -16,10 +16,10 @@ # under the License. /etc/cloud/agent/agent.properties -/etc/cloud/agent/developer.properties.template /etc/cloud/agent/environment.properties /etc/cloud/agent/log4j-cloud.xml /etc/init.d/cloud-agent /usr/bin/cloud-setup-agent /usr/bin/cloud-ssh -/var/log/cloud/agent +/var/log/cloudstack/agent +/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar diff --git a/debian/cloud-client.config b/debian/cloudstack-awsapi.install similarity index 96% rename from debian/cloud-client.config rename to debian/cloudstack-awsapi.install index 00ae6c00d2e..02ba66829ef 100644 --- a/debian/cloud-client.config +++ b/debian/cloudstack-awsapi.install @@ -15,3 +15,4 @@ # specific language governing permissions and limitations # under the License. +/var/log/cloudstack/awsapi \ No newline at end of file diff --git a/debian/cloud-cli.config b/debian/cloudstack-cli.install similarity index 97% rename from debian/cloud-cli.config rename to debian/cloudstack-cli.install index 00ae6c00d2e..287f9b1f651 100644 --- a/debian/cloud-cli.config +++ b/debian/cloudstack-cli.install @@ -13,5 +13,4 @@ # "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. - +# under the License. \ No newline at end of file diff --git a/debian/cloud-agent-libs.install b/debian/cloudstack-common.install similarity index 50% rename from debian/cloud-agent-libs.install rename to debian/cloudstack-common.install index ba25935588c..de97ee9383a 100644 --- a/debian/cloud-agent-libs.install +++ b/debian/cloudstack-common.install @@ -15,5 +15,19 @@ # specific language governing permissions and limitations # under the License. -/usr/share/java/cloud-agent.jar -/usr/share/java/cloud-plugin-hypervisor-kvm.jar +/usr/share/cloudstack-common/lib/cloudstack-core.jar +/usr/share/cloudstack-common/lib/cloudstack-api.jar +/usr/share/cloudstack-common/vms/systemvm.iso +/usr/share/cloudstack-common/scripts/installer/* +/usr/share/cloudstack-common/scripts/network/* +/usr/share/cloudstack-common/scripts/storage/* +/usr/share/cloudstack-common/scripts/util/* +/usr/share/cloudstack-common/scripts/vm/network/* +/usr/share/cloudstack-common/scripts/vm/systemvm/* +/usr/share/cloudstack-common/scripts/vm/pingtest.sh +/usr/share/cloudstack-common/scripts/vm/hypervisor/kvm/* +/usr/share/cloudstack-common/scripts/vm/hypervisor/versions.sh +/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/* +/usr/bin/cloud-set-guest-password +/usr/bin/cloud-set-guest-sshkey +/usr/lib/python2.?/*-packages/* diff --git a/debian/cloud-management.config b/debian/cloudstack-docs.install similarity index 97% rename from debian/cloud-management.config rename to debian/cloudstack-docs.install index 00ae6c00d2e..287f9b1f651 100644 --- a/debian/cloud-management.config +++ b/debian/cloudstack-docs.install @@ -13,5 +13,4 @@ # "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. - +# under the License. \ No newline at end of file diff --git a/debian/cloud-setup.install b/debian/cloudstack-management.install similarity index 69% rename from debian/cloud-setup.install rename to debian/cloudstack-management.install index 5c37c64920d..e87b4446bd0 100644 --- a/debian/cloud-setup.install +++ b/debian/cloudstack-management.install @@ -15,11 +15,17 @@ # specific language governing permissions and limitations # under the License. +/etc/cloud/server/* +/etc/cloud/management/* +/etc/init.d/cloud-management +/var/cache/cloudstack/management +/var/cache/cloudstack/management/work +/var/cache/cloudstack/management/temp +/var/log/cloudstack/management +/var/lib/cloud/mnt +/var/lib/cloud/management +/usr/bin/cloud-update-xenserver-licenses +/usr/bin/cloud-setup-management /usr/bin/cloud-setup-databases /usr/bin/cloud-migrate-databases -/usr/bin/cloud-set-guest-password -/usr/bin/cloud-set-guest-sshkey -/usr/share/cloud/setup/*.sql -/usr/share/cloud/setup/*.sh -/usr/share/cloud/setup/server-setup.xml -/usr/share/cloud/setup/db/*.sql +/usr/share/cloudstack-management/* diff --git a/debian/cloud-agent.postinst b/debian/cloudstack-management.postinst similarity index 77% rename from debian/cloud-agent.postinst rename to debian/cloudstack-management.postinst index f022f6d16bc..6fe01453c10 100644 --- a/debian/cloud-agent.postinst +++ b/debian/cloudstack-management.postinst @@ -16,19 +16,11 @@ # specific language governing permissions and limitations # under the License. -case "$1" in - configure) - - for i in /var/log/cloud/agent - do - chmod 0770 $i - done - - if [ "$2" = "" ] ; then # no recently configured version, this is a first install - /usr/sbin/update-rc.d cloud-agent defaults || true - fi - - ;; -esac +if [ "$1" = configure ]; then + if ! getent passwd cloud >/dev/null; then + adduser --quiet --system --group --no-create-home --home /usr/share/cloudstack-manager cloud + fi + chown cloud /var/log/cloudstack/management +fi #DEBHELPER# diff --git a/debian/cloud-agent-deps.install b/debian/cloudstack-usage.install similarity index 86% rename from debian/cloud-agent-deps.install rename to debian/cloudstack-usage.install index b05b7d1d9d4..2696c20b5e9 100644 --- a/debian/cloud-agent-deps.install +++ b/debian/cloudstack-usage.install @@ -5,9 +5,9 @@ # 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 @@ -15,4 +15,7 @@ # specific language governing permissions and limitations # under the License. -/usr/share/java/libvirt-0.4.9.jar +/usr/share/cloudstack-usage/lib/cloudstack-usage.jar +/etc/init.d/cloud-usage +/var/log/cloudstack/usage +/etc/cloud/usage/* diff --git a/debian/control b/debian/control index e9697ea5e26..659084c38ae 100644 --- a/debian/control +++ b/debian/control @@ -1,118 +1,51 @@ -Source: cloud +Source: cloudstack Section: libs Priority: extra Maintainer: Wido den Hollander -Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, libws-commons-util-java, libcommons-codec-java (>= 1.5), libcommons-httpclient-java (>= 3.1), libservlet2.5-java, genisoimage, python-mysqldb, maven3 | maven (>= 3), liblog4j1.2-java (>= 1.2.16) +Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, genisoimage, + python-mysqldb, maven3 | maven (>= 3), python (>= 2.6.6-3~) Standards-Version: 3.8.1 Homepage: http://www.cloudstack.org/ -Package: cloud-deps -Architecture: any -Depends: openjdk-6-jre, libcommons-codec-java (>= 1.5), libcommons-httpclient-java (>= 3.1) -Description: CloudStack library dependencies - This package contains a number of third-party dependencies - not shipped by distributions, required to run the CloudStack - Management Server. +Package: cloudstack-common +Architecture: all +Depends: bash, genisoimage +Conflicts: cloud-scripts, cloud-utils, cloud-system-iso, cloud-console-proxy, cloud-daemonize, cloud-deps, cloud-python, cloud-setup +Description: A common package which contains files which are shared by several CloudStack packages -Package: cloud-agent-deps -Architecture: any -Depends: openjdk-6-jre, cloud-deps (= ${source:Version}) -Description: CloudStack agent library dependencies - This package contains a number of third-party dependencies - not shipped by distributions, required to run the CloudStack - Agent. - -Package: cloud-utils -Architecture: any -Depends: openjdk-6-jre, python, libcglib-java (>= 2.2.2), libjsch-java (>= 0.1.42), libbackport-util-concurrent-java (>= 3.1), libcommons-dbcp-java (>= 1.4), libcommons-pool-java (>= 1.5.6) -Description: CloudStack utility library - The CloudStack utility libraries provide a set of Java classes used - in the CloudStack environment. - -Package: cloud-client-ui -Architecture: any -Depends: openjdk-6-jre, cloud-client (= ${source:Version}) -Description: CloudStack management server UI - The CloudStack management server is the central point of coordination, - management, and intelligence in the CloudStack Cloud Stack. This package - is a requirement of the cloud-client package, which installs the - CloudStack management server. - -Package: cloud-server -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-scripts (= ${source:Version}), libservlet2.5-java +Package: cloudstack-management +Architecture: all +Depends: cloudstack-common (= ${source:Version}), tomcat6, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools +Conflicts: cloud-server, cloud-client, cloud-client-ui Description: CloudStack server library - The CloudStack server libraries provide a set of Java classes used - in the CloudStack management server. + The CloudStack management server -Package: cloud-scripts -Replaces: cloud-agent-scripts -Architecture: any -Depends: openjdk-6-jre, python, bash, bzip2, gzip, unzip, nfs-common, openssh-client, lsb-release -Description: CloudStack scripts - This package contains a number of scripts needed for the CloudStack Agent and Management Server. - Both the CloudStack Agent and Management server depend on this package - -Package: cloud-core -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}) -Description: CloudStack core library - The CloudStack core libraries provide a set of Java classes used - in the CloudStack Cloud Stack. - - -Package: cloud-client -Architecture: any -Depends: openjdk-6-jre, cloud-deps (= ${source:Version}), cloud-utils (= ${source:Version}), cloud-server (= ${source:Version}), cloud-client-ui (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-python (= ${source:Version}), tomcat6, libws-commons-util-java, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools, genisoimage, cloud-system-iso, libmysql-java (>= 5.1) -Description: CloudStack client - The CloudStack management server is the central point of coordination, - management, and intelligence in the CloudStack Cloud Stack. This package - is required for the management server to work. - -Package: cloud-setup -Architecture: any -Depends: openjdk-6-jre, python, cloud-utils (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-python (= ${source:Version}), python-mysqldb -Description: CloudStack client - The CloudStack setup tools let you set up your Management Server and Usage Server. - -Package: cloud-python -Architecture: any -Depends: python -Description: CloudStack Python library - The CloudStack Python library contains a few Python modules that the - CloudStack uses. - -Package: cloud-agent-libs -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}) -Description: CloudStack agent libraries - The CloudStack agent libraries are used by the Cloud Agent. - -Package: cloud-agent -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-agent-deps (= ${source:Version}), cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-scripts (= ${source:Version}), cloud-system-iso (= ${source:Version}), libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, liblog4j1.2-java (>= 1.2.16), libjna-java, wget, jsvc, lsb-base (>= 3.2) +Package: cloudstack-agent +Architecture: all +Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc +Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts Description: CloudStack agent The CloudStack agent is in charge of managing shared computing resources in a CloudStack powered cloud. Install this package if this computer will participate in your cloud as a KVM HyperVisor. -Package: cloud-system-iso -Architecture: any -Description: CloudStack system iso - The CloudStack agent is in charge of managing shared computing resources in - a CloudStack powered cloud. Install this package if this computer - will participate in your cloud. - -Package: cloud-usage -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-client (= ${source:Version}), jsvc +Package: cloudstack-usage +Architecture: all +Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), jsvc Description: CloudStack usage monitor The CloudStack usage monitor provides usage accounting across the entire cloud for cloud operators to charge based on usage parameters. -Package: cloud-cli -Provides: cloud-cli -Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), cloud-server (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-client (= ${source:Version}) -Description: CloudStack commandline tool - The CloudStack commandline tool for invoking APi +Package: cloudstack-awsapi +Architecture: all +Depends: cloudstack-common (= ${source:Version}), cloudstack-management (= ${source:Version}) +Description: CloudStack Amazon EC2 API + +Package: cloudstack-cli +Architecture: all +Depends: cloudstack-common (= ${source:Version}) +Description: The CloudStack CLI called CloudMonkey + +Package: cloudstack-docs +Architecture: all +Description: The CloudStack documentation diff --git a/debian/rules b/debian/rules index 69fba7a07ba..d537d86204b 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,9 @@ # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 +DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') +VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//') + # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 @@ -19,55 +22,118 @@ export DH_OPTIONS configure: configure-stamp configure-stamp: dh_testdir - cp packaging/debian/replace.properties build/replace.properties - echo VERSION=$VERSION >> build/replace.properties + cp packaging/debian/replace.properties replace.properties.tmp + echo VERSION=${VERSION} >> replace.properties.tmp touch configure-stamp -build: build-arch +build: build-indep -build-arch: build-arch-stamp -build-arch-stamp: configure-stamp - mvn package -Dsystemvm +build-indep: build-indep-stamp + +build-indep-stamp: configure + mvn package -DskipTests -Dsystemvm \ + -Dcs.replace.properties=replace.properties.tmp touch $@ clean: dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp configure-stamp + rm -f replace.properties.tmp dh_clean install: dh_testdir dh_testroot dh_prep -s - mkdir -p debian/tmp/usr/bin - mkdir -p debian/tmp/usr/share/cloud/management - mkdir -p debian/tmp/var/log/cloud - mkdir debian/tmp/var/log/cloud/managament - mkdir debian/tmp/var/log/cloud/awsapi - mkdir debian/tmp/var/log/cloud/agent - mkdir debian/tmp/var/log/cloud/ipallocator - mkdir debian/tmp/var/log/cloud/usage + + # Common packages mkdir -p debian/tmp/etc/cloud + mkdir -p debian/tmp/etc/init.d + mkdir -p debian/tmp/var/cache/cloudstack + mkdir -p debian/tmp/var/log/cloudstack + mkdir -p debian/tmp/var/lib/cloud + mkdir -p debian/tmp/usr/bin + mkdir -p debian/tmp/usr/share/cloud + mkdir -p debian/tmp/usr/lib/cloud + + # cloudstack-agent mkdir debian/tmp/etc/cloud/agent + mkdir debian/tmp/var/log/cloudstack/agent + install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar + install -D packaging/debian/init/cloud-agent debian/tmp/etc/init.d/ + install -D agent/bindir/cloud-setup-agent.in debian/tmp/usr/bin/cloud-setup-agent + install -D agent/bindir/cloud-ssh.in debian/tmp/usr/bin/cloud-ssh + cp agent/target/transformed/* debian/tmp/etc/cloud/agent + + # cloudstack-management mkdir debian/tmp/etc/cloud/server mkdir debian/tmp/etc/cloud/management - mkdir debian/tmp/etc/cloud/usage - mkdir -p debian/tmp/var/cache/cloud - mkdir debian/tmp/var/cache/cloud/management - mkdir -p debian/tmp/usr/share/cloud - mkdir debian/tmp/usr/share/cloud/setup - mkdir -p debian/tmp/usr/share/cloud/management/webapps/client - - cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/cloud/setup/ - cp -r client/target/cloud-client-ui-*-SNAPSHOT/* debian/tmp/usr/share/cloud/management/webapps/client/ - dh_installdirs -s - dh_install -s + mkdir -p debian/tmp/usr/share/cloudstack-management + mkdir -p debian/tmp/usr/share/cloudstack-management/webapps/client + mkdir debian/tmp/usr/share/cloudstack-management/setup + mkdir debian/tmp/var/log/cloudstack/management + mkdir debian/tmp/var/cache/cloudstack/management + mkdir debian/tmp/var/cache/cloudstack/management/work + mkdir debian/tmp/var/cache/cloudstack/management/temp + mkdir debian/tmp/var/log/cloudstack/ipallocator + mkdir debian/tmp/var/lib/cloud/management + mkdir debian/tmp/var/lib/cloud/mnt + cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/cloudstack-management/setup/ + cp -r client/target/cloud-client-ui-4.1.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/ + cp server/target/conf/* debian/tmp/etc/cloud/server/ + cp client/target/conf/* debian/tmp/etc/cloud/management/ + ln -s tomcat6-nonssl.conf debian/tmp/etc/cloud/management/tomcat6.conf + mkdir -p debian/tmp/etc/cloud/management/Catalina/localhost/client + install -D packaging/debian/init/cloud-management debian/tmp/etc/init.d/cloud-management + install -D client/bindir/cloud-update-xenserver-licenses.in debian/tmp/usr/bin/cloud-update-xenserver-licenses + install -D server/target/cloud-server-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar + ln -s /usr/share/tomcat6/bin debian/tmp/usr/share/cloudstack-management/bin + ln -s ../../../etc/cloud/management debian/tmp/usr/share/cloudstack-management/conf + ln -s /usr/share/tomcat6/lib debian/tmp/usr/share/cloudstack-management/lib + ln -s ../../../var/log/cloudstack/management debian/tmp/usr/share/cloudstack-management/logs + ln -s ../../../var/cache/cloudstack/management/temp debian/tmp/usr/share/cloudstack-management/temp + ln -s ../../../var/cache/cloudstack/management/work debian/tmp/usr/share/cloudstack-management/work -binary: binary-common -binary-common: - dh_testdir - dh_testroot + # cloudstack-common + mkdir -p debian/tmp/usr/share/cloudstack-common + mkdir debian/tmp/usr/share/cloudstack-common/scripts + mkdir debian/tmp/usr/share/cloudstack-common/setup + cp -r scripts/installer debian/tmp/usr/share/cloudstack-common/scripts + cp -r scripts/network debian/tmp/usr/share/cloudstack-common/scripts + cp -r scripts/storage debian/tmp/usr/share/cloudstack-common/scripts + cp -r scripts/util debian/tmp/usr/share/cloudstack-common/scripts + cp -r scripts/vm debian/tmp/usr/share/cloudstack-common/scripts + install -D client/target/utilities/bin/cloud-migrate-databases debian/tmp/usr/bin + install -D client/target/utilities/bin/cloud-set-guest-password debian/tmp/usr/bin + install -D client/target/utilities/bin/cloud-set-guest-sshkey debian/tmp/usr/bin + install -D client/target/utilities/bin/cloud-setup-databases debian/tmp/usr/bin + install -D client/target/utilities/bin/cloud-setup-management debian/tmp/usr/bin + install -D console-proxy/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso + install -D core/target/cloud-core-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar + install -D api/target/cloud-api-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar + + # cloudstack-python + mkdir -p debian/tmp/usr/lib/python2.7/dist-packages + cp -r python/lib/cloud* debian/tmp/usr/lib/python2.7/dist-packages + + # cloudstack-usage + mkdir debian/tmp/etc/cloud/usage + mkdir debian/tmp/var/log/cloudstack/usage + install -D usage/target/cloud-usage-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar + cp usage/target/transformed/* debian/tmp/etc/cloud/usage/ + ln -s ../management/db.properties debian/tmp/etc/cloud/usage/db.properties + install -D packaging/debian/init/cloud-usage debian/tmp/etc/init.d + + # cloudstack-awsapi + mkdir debian/tmp/var/log/cloudstack/awsapi + + dh_installdirs + dh_install + dh_python2 + +binary: install + dh_install dh_installchangelogs dh_installdocs LICENSE dh_installdocs DISCLAIMER diff --git a/framework/rest/pom.xml b/framework/rest/pom.xml index 2a22155603a..a783bc8de2f 100644 --- a/framework/rest/pom.xml +++ b/framework/rest/pom.xml @@ -67,6 +67,10 @@ org.eclipse.jetty jetty-server + + org.apache.geronimo.specs + geronimo-servlet_3.0_spec + diff --git a/packaging/debian/init/cloud-agent b/packaging/debian/init/cloud-agent new file mode 100755 index 00000000000..8b646935e8f --- /dev/null +++ b/packaging/debian/init/cloud-agent @@ -0,0 +1,167 @@ +#!/bin/bash + +### BEGIN INIT INFO +# Provides: cloud agent +# Required-Start: $network $local_fs +# Required-Stop: $network $local_fs +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Start/stop Apache CloudStack Agent +# Description: This scripts Starts/Stops the Apache CloudStack agent +## The CloudStack Agent is a part of the Apache CloudStack project and is used +## for managing KVM-based Hypervisors and performing secondary storage tasks inside +## the Secondary Storage System Virtual Machine. +## JSVC (Java daemonizing) is used for starting and stopping the agent +### END INIT INFO + +# 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. + +. /lib/lsb/init-functions + +SHORTNAME="cloud-agent" +PIDFILE=/var/run/"$SHORTNAME".pid +LOCKFILE=/var/lock/subsys/"$SHORTNAME" +PROGNAME="CloudStack Agent" +CLASS="com.cloud.agent.AgentShell" +PROG="jsvc" +DAEMON="/usr/bin/jsvc" +SHUTDOWN_WAIT="30" + +unset OPTIONS +[ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME" + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm" + +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +# We need to append the JSVC daemon JAR to the classpath +# AgentShell implements the JSVC daemon methods +export CLASSPATH="/usr/share/java/commons-daemon.jar:/usr/share/java/cloud-agent-kvm.jar:/etc/cloud/agent" + +wait_for_network() { + i=1 + while [ $i -lt 10 ] + do + # Under Ubuntu and Debian libvirt by default creates a bridge called virbr0. + # That's why we want more then 3 lines back from brctl, so that there is a manually created bridge + if [ "$(brctl show|wc -l)" -gt 2 ]; then + break + else + sleep 1 + let i=$i+1 + continue + fi + done +} + +start() { + if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then + log_daemon_msg "$PROGNAME apparently already running" + log_end_msg 0 + exit 0 + fi + + log_daemon_msg "Starting $PROGNAME" "$SHORTNAME" + if hostname --fqdn >/dev/null 2>&1 ; then + true + else + log_failure_msg "The host name does not resolve properly to an IP address. Cannot start $PROGNAME" + log_end_msg 1 + exit 1 + fi + + wait_for_network + + if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG -D jna.nosys=true $CLASS + RETVAL=$? + then + rc=0 + sleep 1 + if ! kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then + log_failure_msg "$PROG failed to start" + rc=1 + fi + else + rc=1 + fi + + if [ $rc -eq 0 ]; then + log_end_msg 0 + else + log_end_msg 1 + rm -f "$PIDFILE" + fi +} + +stop() { + count="0" + + log_daemon_msg "Stopping $PROGNAME" "$SHORTNAME" + killproc -p $PIDFILE $DAEMON + + until [ "$count" -gt "$SHUTDOWN_WAIT" ] + do + agentPid=$(ps aux|grep [j]svc|grep $SHORTNAME) + if [ "$?" -gt "0" ];then + break + fi + sleep 1 + let count="${count}+1" + done + + agentPid=$(ps aux|grep [j]svc|grep $SHORTNAME) + if [ "$?" -eq "0" ]; then + agentPid=$(ps aux|grep [j]svc|awk '{print $2}') + if [ "$agentPid" != "" ]; then + log_warning_msg "$PROG still running, forcing kill" + kill -9 $agentPid + fi + fi + + log_end_msg $? + rm -f "$PIDFILE" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status_of_proc -p "$PIDFILE" "$PROG" "$SHORTNAME" + RETVAL=$? + ;; + restart | force-reload) + stop + sleep 3 + start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" + RETVAL=3 +esac + +exit $RETVAL diff --git a/packaging/debian/init/cloud-management b/packaging/debian/init/cloud-management new file mode 100755 index 00000000000..490bf1e8e68 --- /dev/null +++ b/packaging/debian/init/cloud-management @@ -0,0 +1,244 @@ +#!/bin/sh +# +# /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine + +# 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. +### BEGIN INIT INFO +# Provides: tomcat-vmops +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start Tomcat (CloudStack). +# Description: Start the Tomcat servlet engine that runs the CloudStack Management Server. +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME=cloud-management +DESC="CloudStack-specific Tomcat servlet engine" +DAEMON=/usr/bin/jsvc +CATALINA_HOME=/usr/share/cloud/management +DEFAULT=/etc/cloud/management/tomcat6.conf +JVM_TMP=/tmp/$NAME-temp + +# We have to explicitly set the HOME variable to the homedir from the user "cloud" +# This is because various scripts run by the management server read the HOME variable +# and fail when this init script is run manually. +HOME=$(echo ~cloud) + +if [ `id -u` -ne 0 ]; then + echo "You need root privileges to run this script" + exit 1 +fi + +# Make sure tomcat is started with system locale +if [ -r /etc/default/locale ]; then + . /etc/default/locale + export LANG +fi + +. /lib/lsb/init-functions +. /etc/default/rcS + + +# The following variables can be overwritten in $DEFAULT + +# Run Tomcat 6 as this user ID +TOMCAT6_USER=tomcat6 + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not +# defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-1.6.0-openjdk-amd64/ /usr/lib/jvm/java-1.6.0-openjdk-i386/ /usr/lib/jvm/java-1.6.0-openjdk/ /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun" + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +# Directory for per-instance configuration files and webapps +CATALINA_BASE=/usr/share/cloud/management + +# Use the Java security manager? (yes/no) +TOMCAT6_SECURITY=no + +# Default Java options +# Set java.awt.headless=true if JAVA_OPTS is not set so the +# Xalan XSL transformer can work without X11 display on JDK 1.4+ +# It also looks like the default heap size of 64M is not enough for most cases +# so the maximum heap size is set to 128M +if [ -z "$JAVA_OPTS" ]; then + JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" +fi + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then + log_failure_msg "$NAME is not installed" + exit 1 +fi + +[ -f "$DAEMON" ] || exit 0 + +POLICY_CACHE="$CATALINA_BASE/work/catalina.policy" + +JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=$CATALINA_HOME/endorsed -Dcatalina.base=$CATALINA_BASE -Dcatalina.home=$CATALINA_HOME -Djava.io.tmpdir=$JVM_TMP" + +# Set the JSP compiler if set in the tomcat6.default file +if [ -n "$JSP_COMPILER" ]; then + JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=$JSP_COMPILER" +fi + +if [ "$TOMCAT6_SECURITY" = "yes" ]; then + JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY_CACHE" +fi + +# Set juli LogManager if logging.properties is provided +if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then + JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties" +fi + +# Define other required variables +CATALINA_PID="/var/run/$NAME.pid" +BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap +JSVC_CLASSPATH="/usr/share/java/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar" +JSVC_CLASSPATH=$CLASSPATH:$JSVC_CLASSPATH + +# Look for Java Secure Sockets Extension (JSSE) JARs +if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then + JSSE_HOME="${JAVA_HOME}/jre/" +fi +export JSSE_HOME + +case "$1" in + start) + if [ -z "$JAVA_HOME" ]; then + log_failure_msg "no JDK found - please set JAVA_HOME" + exit 1 + fi + + if [ ! -d "$CATALINA_BASE/conf" ]; then + log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE" + exit 1 + fi + + log_daemon_msg "Starting $DESC" "$NAME" + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + + # Regenerate POLICY_CACHE file + umask 022 + echo "// AUTO-GENERATED FILE from /etc/tomcat6/policy.d/" \ + > "$POLICY_CACHE" + echo "" >> "$POLICY_CACHE" + if ls $CATALINA_BASE/conf/policy.d/*.policy > /dev/null 2>&1 ; then + cat $CATALINA_BASE/conf/policy.d/*.policy \ + >> "$POLICY_CACHE" + fi + + # Remove / recreate JVM_TMP directory + rm -rf "$JVM_TMP" + mkdir "$JVM_TMP" || { + log_failure_msg "could not create JVM temporary directory" + exit 1 + } + chown $TOMCAT6_USER "$JVM_TMP" + cd "$JVM_TMP" + + + # fix storage issues on nfs mounts + umask 000 + $DAEMON -user "$TOMCAT6_USER" -cp "$JSVC_CLASSPATH" \ + -outfile SYSLOG -errfile SYSLOG \ + -pidfile "$CATALINA_PID" $JAVA_OPTS "$BOOTSTRAP_CLASS" + + sleep 5 + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + log_end_msg 1 + else + log_end_msg 0 + fi + else + log_progress_msg "(already running)" + log_end_msg 0 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user "$TOMCAT6_USER" --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + log_progress_msg "(not running)" + else + $DAEMON -cp "$JSVC_CLASSPATH" -pidfile "$CATALINA_PID" \ + -stop "$BOOTSTRAP_CLASS" + fi + rm -rf "$JVM_TMP" + log_end_msg 0 + ;; + status) + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + + if [ -f "$CATALINA_PID" ]; then + log_success_msg "$DESC is not running, but pid file exists." + exit 1 + else + log_success_msg "$DESC is not running." + exit 3 + fi + else + log_success_msg "$DESC is running with pid `cat $CATALINA_PID`" + fi + ;; + restart|force-reload) + if start-stop-daemon --test --stop --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + $0 stop + sleep 1 + fi + $0 start + ;; + try-restart) + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ + >/dev/null; then + $0 start + fi + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/packaging/debian/init/cloud-usage b/packaging/debian/init/cloud-usage new file mode 100755 index 00000000000..6b17ea82977 --- /dev/null +++ b/packaging/debian/init/cloud-usage @@ -0,0 +1,131 @@ +#!/bin/bash + +### BEGIN INIT INFO +# Provides: cloud usage +# Required-Start: $network $local_fs +# Required-Stop: $network $local_fs +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Start/stop Apache CloudStack Usage Monitor +# Description: This scripts Starts/Stops the Apache CloudStack Usage Monitor +## The CloudStack Usage Monitor is a part of the Apache CloudStack project and is used +## for storing usage statistics from instances. +## JSVC (Java daemonizing) is used for starting and stopping the usage monitor. +### END INIT INFO + +# 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. + +. /lib/lsb/init-functions + +SHORTNAME="cloud-usage" +PIDFILE=/var/run/"$SHORTNAME".pid +LOGFILE=/var/log/cloud/usage/usage-server.log +PROGNAME="CloudStack Usage Monitor" +CLASS="com.cloud.usage.UsageServer" +PROG="jsvc" +DAEMON="/usr/bin/jsvc" +USER=@MSUSER@ + +unset OPTIONS +[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source @SYSCONFDIR@/default/"$SHORTNAME" + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun /usr/lib/jvm/jre-1.6.0 /usr/lib/j2sdk1.5-sun /usr/lib/jre-openjdk" + +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +SCP="@SYSTEMCLASSPATH@" +DCP="@DEPSCLASSPATH@" +UCP="@USAGECLASSPATH@" +JCP="/usr/share/java/commons-daemon.jar" + +# We need to append the JSVC daemon JAR to the classpath +# AgentShell implements the JSVC daemon methods +export CLASSPATH="$SCP:$DCP:$UCP:$JCP:@USAGESYSCONFDIR@" + +start() { + if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then + log_daemon_msg "$PROGNAME apparently already running" + log_end_msg 0 + exit 0 + fi + + log_daemon_msg "Starting $PROGNAME" "$SHORTNAME" + if hostname --fqdn >/dev/null 2>&1 ; then + true + else + log_failure_msg "The host name does not resolve properly to an IP address. Cannot start $PROGNAME" + log_end_msg 1 + exit 1 + fi + + if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -user "$USER" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS + RETVAL=$? + then + rc=0 + sleep 1 + if ! kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then + log_failure_msg "$PROG failed to start" + rc=1 + fi + else + rc=1 + fi + + if [ $rc -eq 0 ]; then + log_end_msg 0 + else + log_end_msg 1 + rm -f "$PIDFILE" + fi +} + +stop() { + log_daemon_msg "Stopping $PROGNAME" "$SHORTNAME" + killproc -p $PIDFILE $DAEMON + log_end_msg $? + rm -f "$PIDFILE" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status_of_proc -p "$PIDFILE" "$PROG" "$SHORTNAME" + RETVAL=$? + ;; + restart | force-reload) + stop + sleep 3 + start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" + RETVAL=3 +esac + +exit $RETVAL diff --git a/packaging/debian/replace.properties b/packaging/debian/replace.properties index 6520f63e682..d891e795361 100644 --- a/packaging/debian/replace.properties +++ b/packaging/debian/replace.properties @@ -37,12 +37,12 @@ CONFIGUREVARS= DEPSCLASSPATH= DOCDIR= IPALOCATORLOG=/var/log/cloud/management/ipallocator.log -JAVADIR=/usr/share/java +JAVADIR=/usr/share/cloudstack-management/webapps/client/WEB-INF/lib LIBEXECDIR=/usr/libexec LOCKDIR=/var/lock MSCLASSPATH= MSCONF=/etc/cloud/management -MSENVIRON=/usr/share/cloud/management +MSENVIRON=/usr/share/cloudstack-management MSLOG=/var/log/cloud/management/management-server.log MSLOGDIR=/var/log/cloud/management/ MSMNTDIR=/var/lib/cloud/mnt @@ -52,7 +52,7 @@ PLUGINJAVADIR= PREMIUMJAVADIR= PYTHONDIR=/usr/lib/python2.6/site-packages/ SERVERSYSCONFDIR=/etc/cloud/server -SETUPDATADIR=/usr/share/cloud/setup +SETUPDATADIR=/usr/share/cloudstack-management/setup SYSCONFDIR=/etc SYSTEMCLASSPATH= SYSTEMJARS= diff --git a/plugins/hypervisors/kvm/pom.xml b/plugins/hypervisors/kvm/pom.xml index 579244014f9..4c3bc0c970f 100644 --- a/plugins/hypervisors/kvm/pom.xml +++ b/plugins/hypervisors/kvm/pom.xml @@ -43,6 +43,11 @@ libvirt 0.4.9 + + net.java.dev.jna + jna + 3.5.1 + install @@ -50,68 +55,23 @@ test - maven-assembly-plugin - 2.3 - - kvm-agent - false - - agent-descriptor.xml - - + org.apache.maven.plugins + maven-dependency-plugin + 2.5.1 - make-agent + copy-dependencies package - single + copy-dependencies + + ${project.build.directory}/dependencies + runtime + - - maven-resources-plugin - 2.6 - - - copy-resources - - package - - copy-resources - - - dist - - - target - - kvm-agent.zip - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.5.1 - - - copy-dependencies - package - - copy-dependencies - - - target/dependencies - runtime - - - - diff --git a/pom.xml b/pom.xml index 0ee62cd976f..b26ee4946b2 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,7 @@ 1.4 0.9.8 0.10 + build/replace.properties diff --git a/server/pom.xml b/server/pom.xml index 59d1b15b911..0d7dada7bdc 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -130,6 +130,43 @@ + + maven-antrun-plugin + 1.7 + + + generate-resource + generate-resources + + run + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/usage/pom.xml b/usage/pom.xml index 1e880a28615..28ab1a7dfc0 100644 --- a/usage/pom.xml +++ b/usage/pom.xml @@ -102,7 +102,7 @@ + value="${cs.replace.properties}" /> @@ -118,7 +118,7 @@ + value="${cs.replace.properties}" />