debian: Various packaging fixes from master

This commit includes various packaging fixes already in master.
This commit is contained in:
Wido den Hollander 2013-03-31 15:31:15 +02:00
parent 9cf20ae38b
commit 11892d34d7
10 changed files with 158 additions and 13 deletions

40
debian/cloudstack-agent.postinst vendored Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# 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.
set -e
case "$1" in
configure)
OLDCONFDIR="/etc/cloud/agent"
NEWCONFDIR="/etc/cloudstack/agent"
CONFFILES="agent.properties log4j.xml log4j-cloud.xml"
# Copy old configuration so the admin doesn't have to do that
# Only do so when we are installing for the first time
if [ -z "$2" ]; then
for FILE in $CONFFILES; do
if [ -f "$OLDCONFDIR/${FILE}" ]; then
cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
fi
done
fi
;;
esac
exit 0

View File

@ -26,6 +26,7 @@
/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/share/cloudstack-common/lib/*
/usr/bin/cloud-set-guest-password
/usr/bin/cloud-set-guest-sshkey
/usr/lib/python2.?/*-packages/*

View File

@ -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
@ -18,6 +18,8 @@
/etc/cloudstack/server/*
/etc/cloudstack/management/*
/etc/init.d/cloudstack-management
/etc/security/limits.d/cloudstack-limits.conf
/etc/sudoers.d/cloudstack
/var/cache/cloudstack/management
/var/cache/cloudstack/management/work
/var/cache/cloudstack/management/temp
@ -29,5 +31,4 @@
/usr/bin/cloud-setup-databases
/usr/bin/cloud-migrate-databases
/usr/share/cloudstack-management/*
/usr/share/java/*
/usr/share/tomcat6/lib/*

View File

@ -20,7 +20,7 @@ if [ "$1" = configure ]; then
if ! getent passwd cloud >/dev/null; then
adduser --quiet --system --group --no-create-home --home /var/lib/cloudstack/management cloud
else
usermod -m -d /var/lib/cloudstack/management cloud
usermod -m -d /var/lib/cloudstack/management cloud || true
fi
for i in /var/cache/cloudstack/management \
@ -36,6 +36,20 @@ if [ "$1" = configure ]; then
chgrp cloud $i
done
OLDCONFDIR="/etc/cloud/management"
NEWCONFDIR="/etc/cloudstack/management"
CONFFILES="db.properties db-enc.properties cloud.keystore key"
# Copy old configuration so the admin doesn't have to do that
# Only do so when we are installing for the first time
if [ -z "$2" ]; then
for FILE in $CONFFILES; do
if [ -f "$OLDCONFDIR/${FILE}" ]; then
cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
fi
done
fi
chmod 0640 /etc/cloudstack/management/db.properties
chgrp cloud /etc/cloudstack/management/db.properties
fi

37
debian/cloudstack-usage.postinst vendored Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# 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.
set -e
case "$1" in
configure)
# We copy the db.properties file from the management server to the usage server
# This used to be a symlink, but we don't do that anymore
if [ -f "/etc/cloud/management/db.properties" ]; then
cp -a /etc/cloud/management/db.properties /etc/cloudstack/usage/db.properties
fi
# We also retain the log4j configuration
if [ -f "/etc/cloud/usage/log4j-cloud_usage.xml" ]; then
cp -a /etc/cloud/usage/log4j-cloud_usage.xml /etc/cloudstack/usage/log4j-cloud_usage.xml
fi
;;
esac
exit 0

17
debian/rules vendored
View File

@ -38,12 +38,12 @@ build-indep-stamp: configure
-Dcs.replace.properties=replace.properties.tmp
touch $@
clean:
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp
rm -f replace.properties.tmp
dh_clean
dh_clean
install:
dh_testdir
@ -75,6 +75,8 @@ install:
# cloudstack-management
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-management/setup
@ -89,13 +91,17 @@ install:
cp -r client/target/cloud-client-ui-$(VERSION)-SNAPSHOT/* $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/
cp server/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/
cp client/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/
# nast hack for a couple of configuration files
mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-limits.conf $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-sudoers $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/Catalina/localhost/client
mkdir -p ${DESTDIR}/usr/share/tomcat6/lib
mkdir -p ${DESTDIR}/usr/share/java
install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
install -D client/bindir/cloud-update-xenserver-licenses.in $(DESTDIR)/usr/bin/cloud-update-xenserver-licenses
install -D server/target/cloud-server-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/java/$(PACKAGE)-server.jar
ln -s /usr/share/tomcat6/bin $(DESTDIR)/usr/share/$(PACKAGE)-management/bin
ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/conf
ln -s ../../../usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
@ -108,6 +114,7 @@ install:
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/setup
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/lib
cp -r scripts/installer $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/network $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/storage $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
@ -119,6 +126,8 @@ install:
install -D client/target/utilities/bin/cloud-setup-databases $(DESTDIR)/usr/bin
install -D client/target/utilities/bin/cloud-setup-management $(DESTDIR)/usr/bin
install -D client/target/cloud-client-ui-$(VERSION)-SNAPSHOT/WEB-INF/classes/vms/systemvm.iso $(DESTDIR)/usr/share/$(PACKAGE)-common/vms/systemvm.iso
# We need jasypt for cloud-install-sys-tmplt, so this is a nasty hack to get it into the right place
install -D agent/target/dependencies/jasypt-1.9.0.jar $(DESTDIR)/usr/share/$(PACKAGE)-common/lib
# cloudstack-python
mkdir -p $(DESTDIR)/usr/lib/python2.7/dist-packages

View File

@ -19,7 +19,7 @@
# specific language governing permissions and limitations
# under the License.
### BEGIN INIT INFO
# Provides: tomcat-vmops
# Provides: cloudstack-management
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
@ -34,7 +34,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=cloudstack-management
DESC="CloudStack-specific Tomcat servlet engine"
DAEMON=/usr/bin/jsvc
CATALINA_HOME=/usr/share/cloudstack/management
CATALINA_HOME=/usr/share/cloudstack-management
DEFAULT=/etc/cloudstack/management/tomcat6.conf
JVM_TMP=/tmp/$NAME-temp
@ -65,7 +65,7 @@ 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"
JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 /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"
# Look for the right JVM to use
for jdir in $JDK_DIRS; do
@ -76,7 +76,7 @@ done
export JAVA_HOME
# Directory for per-instance configuration files and webapps
CATALINA_BASE=/usr/share/cloudstack/management
CATALINA_BASE=/usr/share/cloudstack-management
# Use the Java security manager? (yes/no)
TOMCAT6_SECURITY=no

View File

@ -34,7 +34,7 @@ AWSAPILOG=/var/log/cloudstack/awsapi/awsapi.log
BINDIR=/usr/bin
COMMONLIBDIR=/usr/share/cloudstack-common
CONFIGUREVARS=
DEPSCLASSPATH=
DEPSCLASSPATH=/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar
DOCDIR=
IPALOCATORLOG=/var/log/cloudstack/management/ipallocator.log
JAVADIR=/usr/share/cloudstack-management/webapps/client/WEB-INF/lib

View File

@ -0,0 +1,21 @@
# 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.
# Specific limits for the CloudStack management server which
# runs under the user 'cloud' by default
@MSUSER hard nofile 4096
@MSUSER soft nofile 4096

View File

@ -0,0 +1,22 @@
# 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 CloudStack management server needs sudo permissions
# without a password.
@MSUSER ALL =NOPASSWD : ALL