Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ tools/cli/build/
*.jar
*.war
*.mar
*.zip
*.iso
*.tar.gz
*.tgz
Expand Down
4 changes: 3 additions & 1 deletion debian/cloudstack-management.install
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
/etc/cloudstack/management/ehcache.xml
/etc/cloudstack/management/server-ssl.xml
/etc/cloudstack/management/server-nonssl.xml
/etc/cloudstack/management/server.xml
/etc/cloudstack/management/server7-ssl.xml
/etc/cloudstack/management/server7-nonssl.xml
/etc/cloudstack/management/classpath.conf
/etc/cloudstack/management/db.properties
/etc/cloudstack/management/tomcat6-ssl.conf
Expand All @@ -33,6 +34,7 @@
/etc/cloudstack/management/log4j-cloud.xml
/etc/cloudstack/management/tomcat-users.xml
/etc/cloudstack/management/context.xml
/etc/default/cloudstack-management
/etc/init.d/cloudstack-management
/etc/security/limits.d/cloudstack-limits.conf
/etc/sudoers.d/cloudstack
Expand Down
21 changes: 20 additions & 1 deletion debian/cloudstack-management.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,26 @@ if [ "$1" = configure ]; then

chmod 0640 ${CONFDIR}/${DBPROPS}
chgrp cloud ${CONFDIR}/${DBPROPS}
invoke-rc.d tomcat6 stop || true

if [ -d "/usr/share/tomcat7" ]; then
rm -f /usr/share/cloudstack-management/bin
rm -f /usr/share/cloudstack-management/lib
ln -s /usr/share/tomcat7/bin /usr/share/cloudstack-management/bin
ln -s /usr/share/tomcat7/lib /usr/share/cloudstack-management/lib
invoke-rc.d tomcat7 stop || true
if [ ! -f "/etc/cloudstack/management/server.xml" ]; then
ln -s /etc/cloudstack/management/server7-nonssl.xml /etc/cloudstack/management/server.xml
fi
elif [ -d "/usr/share/tomcat6" ]; then
rm -f /usr/share/cloudstack-management/bin
rm -f /usr/share/cloudstack-management/lib
ln -s /usr/share/tomcat6/bin /usr/share/cloudstack-management/bin
ln -s /usr/share/tomcat6/lib /usr/share/cloudstack-management/lib
invoke-rc.d tomcat6 stop || true
if [ ! -f "/etc/cloudstack/management/server.xml" ]; then
ln -s /etc/cloudstack/management/server-nonssl.xml /etc/cloudstack/management/server.xml
fi
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we this is the best way. Usually creating directories and moving symlinks is not the way to go in postinst files.

When cleaning packages or upgrading this might break things. Can you think of a different way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wido I was thinking of other ways but could not find. Do you have any idea?
We can remove this change and ask users to execute "cloudstack-setup-management --tomcat7" after each upgrade. It seems not wise.

I have tested the upgrade from 4.7.1 to 4.9.3.0-SNAPSHOT on ubuntu 12.04 and 16.04 without any issue.
I did not test the os upgrade or tomcat upgrade.


# Add jdbc MySQL driver settings to db.properties if not present
grep -s -q "db.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS}
Expand Down
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Source: cloudstack
Section: libs
Priority: extra
Maintainer: Wido den Hollander <wido@widodh.nl>
Build-Depends: debhelper (>= 9), openjdk-8-jdk | java8-sdk | java8-jdk | openjdk-7-jdk, genisoimage,
python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, dh-systemd
Build-Depends: debhelper (>= 9), openjdk-8-jdk | java8-sdk | java7-jdk | openjdk-7-jdk, genisoimage,
python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, dh-systemd, python-setuptools
Standards-Version: 3.8.1
Homepage: http://www.cloudstack.org/

Expand All @@ -16,6 +16,7 @@ Description: A common package which contains files which are shared by several C
Package: cloudstack-management
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release
Recommends: init-system-helpers
Conflicts: cloud-server, cloud-client, cloud-client-ui
Description: CloudStack server library
The CloudStack management server
Expand Down
60 changes: 60 additions & 0 deletions debian/control.ubuntu12
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Source: cloudstack
Section: libs
Priority: extra
Maintainer: Wido den Hollander <wido@widodh.nl>
Build-Depends: debhelper (>= 9), openjdk-8-jdk | java8-sdk | java7-jdk | openjdk-7-jdk, genisoimage,
python-mysql.connector, maven (>= 3) | maven3, python (>= 2.7), lsb-release, python-setuptools
Standards-Version: 3.8.1
Homepage: http://www.cloudstack.org/

Package: cloudstack-common
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, genisoimage, nfs-common
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: cloudstack-management
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, cloudstack-common (= ${source:Version}), tomcat6 | tomcat7, sudo, jsvc, python-mysql.connector, libmysql-java, augeas-tools, mysql-client, adduser, bzip2, ipmitool, lsb-release
Recommends: init-system-helpers
Conflicts: cloud-server, cloud-client, cloud-client-ui
Description: CloudStack server library
The CloudStack management server

Package: cloudstack-agent
Architecture: all
Depends: ${python:Depends}, openjdk-8-jre-headless | java8-runtime-headless | java8-runtime | openjdk-7-jre-headless, cloudstack-common (= ${source:Version}), lsb-base (>= 4.0), libcommons-daemon-java, openssh-client, qemu-kvm (>= 1.0), libvirt-bin (>= 0.9.8), uuid-runtime, iproute, ebtables, vlan, jsvc, ipset, python-libvirt, ethtool, iptables, lsb-release
Recommends: init-system-helpers
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: cloudstack-usage
Architecture: all
Depends: openjdk-8-jre-headless | java8-runtime-headless | java8-runtime | openjdk-7-jre-headless, cloudstack-common (= ${source:Version}), jsvc, libmysql-java
Recommends: init-system-helpers
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: cloudstack-cli
Architecture: all
Depends: ${misc:Depends}, cloudstack-common (= ${source:Version})
Description: The CloudStack CLI called CloudMonkey

Package: cloudstack-docs
Architecture: all
Depends: ${misc:Depends}
Description: The CloudStack documentation

Package: cloudstack-marvin
Architecture: all
Depends: ${misc:Depends}, python-pip, python-dev, libffi-dev
Description: The CloudStack Marvin library

Package: cloudstack-integration-tests
Architecture: all
Depends: ${misc:Depends}, cloudstack-marvin (= ${source:Version})
Description: The CloudStack Marvin integration tests
9 changes: 5 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,20 @@ override_dh_auto_install:
chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE)

ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
ln -s server-nonssl.xml $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/server.xml
install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
install -D client/target/utilities/bin/cloud-update-xenserver-licenses $(DESTDIR)/usr/bin/cloudstack-update-xenserver-licenses
ln -s /usr/share/tomcat6/bin $(DESTDIR)/usr/share/$(PACKAGE)-management/bin
# Remove configuration in /ur/share/cloudstack-management/webapps/client/WEB-INF
# This should all be in /etc/cloudstack/management
rm $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/WEB-INF/classes/*.*
ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/conf
ln -s ../../../usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
ln -s ../../../var/log/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/logs
ln -s ../../../var/cache/$(PACKAGE)/management/temp $(DESTDIR)/usr/share/$(PACKAGE)-management/temp
ln -s ../../../var/cache/$(PACKAGE)/management/work $(DESTDIR)/usr/share/$(PACKAGE)-management/work

install -d -m0755 debian/$(PACKAGE)-management/lib/systemd/system
install -m0644 packaging/systemd/$(PACKAGE)-management.service.ubuntu debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service
install -m0644 packaging/systemd/$(PACKAGE)-management.default.ubuntu $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management

# cloudstack-common
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
Expand Down Expand Up @@ -149,7 +150,7 @@ override_dh_installinit:
dh_installinit -pcloudstack-management -pcloudstack-agent -pcloudstack-usage --onlyscripts --no-start

override_dh_systemd_enable:
dh_systemd_enable -pcloudstack-agent -pcloudstack-usage
dh_systemd_enable -pcloudstack-management -pcloudstack-agent -pcloudstack-usage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we somehow clean up any left behind script in /etc/init.d of the management server?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wido we should if we do not support ubuntu 12.04 anymore. I prefer to remove it in 4.10. I can create another PR for it. This PR is only for 4.9 branch.


override_dh_installdocs:
dh_installdocs -A tools/whisker/LICENSE tools/whisker/NOTICE INSTALL.md
156 changes: 156 additions & 0 deletions debian/rules.ubuntu12
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
#!/usr/bin/make -f
# -*- makefile -*-
VERSION := $(shell grep '^ <version>' pom.xml| cut -d'>' -f2 |cut -d'<' -f1)
PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1)
SYSCONFDIR = "/etc"
DESTDIR = "debian/tmp"

%:
dh $@ --with python2

override_dh_auto_configure:
cp packaging/debian/replace.properties replace.properties.tmp
echo VERSION=${VERSION} >> replace.properties.tmp

override_dh_auto_build:
mvn -T C1.5 clean package -Psystemvm,developer -Dsystemvm \
-Dcs.replace.properties=replace.properties.tmp \
-Dmaven.repo.local=$(HOME)/.m2/repository \
${ACS_BUILD_OPTS}

override_dh_auto_clean:
dh_auto_clean
rm -f replace.properties.tmp

override_dh_auto_install:
# Common packages
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/init.d
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/default

mkdir -p $(DESTDIR)/var/cache/$(PACKAGE)
mkdir -p $(DESTDIR)/var/log/$(PACKAGE)
mkdir -p $(DESTDIR)/var/lib/$(PACKAGE)
mkdir -p $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/usr/share

# cloudstack-agent
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/agent
mkdir $(DESTDIR)/$(SYSCONFDIR)/profile.d
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/plugins
install -D agent/target/cloud-agent-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/$(PACKAGE)-agent.jar
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/hypervisors/kvm/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/

install -m0755 packaging/debian/$(PACKAGE)-agent.init $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-agent
install -d -m0755 debian/$(PACKAGE)-agent/lib/systemd/system
# Fix libvirt service name for Debian/Ubuntu
sed -i 's/Requires=libvirtd.service/Requires=libvirt-bin.service/g' packaging/systemd/$(PACKAGE)-agent.service
sed -i 's/After=libvirtd.service/After=libvirt-bin.service/g' packaging/systemd/$(PACKAGE)-agent.service
install -m0644 packaging/systemd/$(PACKAGE)-agent.service debian/$(PACKAGE)-agent/lib/systemd/system/$(PACKAGE)-agent.service
install -m0644 packaging/systemd/$(PACKAGE)-agent.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-agent

install -D agent/target/transformed/cloud-setup-agent $(DESTDIR)/usr/bin/cloudstack-setup-agent
install -D agent/target/transformed/cloud-ssh $(DESTDIR)/usr/bin/cloudstack-ssh
install -D agent/target/transformed/cloudstack-agent-profile.sh $(DESTDIR)/$(SYSCONFDIR)/profile.d/cloudstack-agent-profile.sh
install -D agent/target/transformed/cloudstack-agent.logrotate $(DESTDIR)/$(SYSCONFDIR)/logrotate.d/cloudstack-agent
install -D agent/target/transformed/cloudstack-agent-upgrade $(DESTDIR)/usr/bin/cloudstack-agent-upgrade
install -D agent/target/transformed/libvirtqemuhook $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D agent/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/agent

# 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
mkdir $(DESTDIR)/var/log/$(PACKAGE)/management
mkdir $(DESTDIR)/var/cache/$(PACKAGE)/management
mkdir $(DESTDIR)/var/cache/$(PACKAGE)/management/work
mkdir $(DESTDIR)/var/cache/$(PACKAGE)/management/temp
mkdir $(DESTDIR)/var/log/$(PACKAGE)/ipallocator
mkdir $(DESTDIR)/var/lib/$(PACKAGE)/management
mkdir $(DESTDIR)/var/lib/$(PACKAGE)/mnt
cp -r client/target/utilities/scripts/db/* $(DESTDIR)/usr/share/$(PACKAGE)-management/setup/
cp -r client/target/cloud-client-ui-$(VERSION)/* $(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/$(PACKAGE)
chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE)

ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
ln -s server-nonssl.xml $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/server.xml
install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
install -D client/target/utilities/bin/cloud-update-xenserver-licenses $(DESTDIR)/usr/bin/cloudstack-update-xenserver-licenses
ln -s /usr/share/tomcat6/bin $(DESTDIR)/usr/share/$(PACKAGE)-management/bin
# Remove configuration in /ur/share/cloudstack-management/webapps/client/WEB-INF
# This should all be in /etc/cloudstack/management
rm $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/WEB-INF/classes/*.*
ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/conf
ln -s ../../../usr/share/tomcat6/lib $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
ln -s ../../../var/log/$(PACKAGE)/management $(DESTDIR)/usr/share/$(PACKAGE)-management/logs
ln -s ../../../var/cache/$(PACKAGE)/management/temp $(DESTDIR)/usr/share/$(PACKAGE)-management/temp
ln -s ../../../var/cache/$(PACKAGE)/management/work $(DESTDIR)/usr/share/$(PACKAGE)-management/work

install -d -m0755 debian/$(PACKAGE)-management/lib/systemd/system
install -m0644 packaging/systemd/$(PACKAGE)-management.service.ubuntu debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service
install -m0644 packaging/systemd/$(PACKAGE)-management.default.ubuntu $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management

# cloudstack-common
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
cp -r scripts/util $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/vm $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts
install -D client/target/utilities/bin/cloud-migrate-databases $(DESTDIR)/usr/bin/cloudstack-migrate-databases
install -D client/target/utilities/bin/cloud-set-guest-password $(DESTDIR)/usr/bin/cloudstack-set-guest-password
install -D client/target/utilities/bin/cloud-set-guest-sshkey $(DESTDIR)/usr/bin/cloudstack-set-guest-sshkey
install -D client/target/utilities/bin/cloud-setup-databases $(DESTDIR)/usr/bin/cloudstack-setup-databases
install -D client/target/utilities/bin/cloud-setup-management $(DESTDIR)/usr/bin/cloudstack-setup-management
install -D client/target/utilities/bin/cloud-setup-encryption $(DESTDIR)/usr/bin/cloudstack-setup-encryption
install -D client/target/utilities/bin/cloud-sysvmadm $(DESTDIR)/usr/bin/cloudstack-sysvmadm
install -D systemvm/dist/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.2.jar $(DESTDIR)/usr/share/$(PACKAGE)-common/lib

# cloudstack-python
mkdir -p $(DESTDIR)/usr/share/pyshared
cp -r python/lib/cloud* $(DESTDIR)/usr/share/pyshared

# cloudstack-usage
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage/plugins
install -D usage/target/cloud-usage-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
install -D usage/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/
cp usage/target/transformed/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
cp usage/target/transformed/log4j-cloud_usage.xml $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/log4j-cloud.xml

install -D -m0755 packaging/debian/$(PACKAGE)-usage.init $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
install -d -m0755 debian/$(PACKAGE)-usage/lib/systemd/system
install -m0644 packaging/systemd/$(PACKAGE)-usage.service debian/$(PACKAGE)-usage/lib/systemd/system/$(PACKAGE)-usage.service
install -m0644 packaging/systemd/$(PACKAGE)-usage.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-usage

# cloudstack-marvin
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-marvin
cp tools/marvin/dist/Marvin-*.tar.gz $(DESTDIR)/usr/share/$(PACKAGE)-marvin/

# cloudstack-integration-tests
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-integration-tests
cp -r test/integration/* $(DESTDIR)/usr/share/$(PACKAGE)-integration-tests/

override_dh_installinit:
dh_installinit -pcloudstack-management -pcloudstack-agent -pcloudstack-usage --onlyscripts --no-start

override_dh_installdocs:
dh_installdocs -A tools/whisker/LICENSE tools/whisker/NOTICE INSTALL.md
29 changes: 25 additions & 4 deletions packaging/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.

set -e
#set -e

#
# This script builds Debian packages for CloudStack and does
Expand All @@ -43,11 +43,32 @@ set -e
cd `dirname $0`
cd ..

dpkg-checkbuilddeps
DCH=$(which dch)
if [ -z "$DCH" ] ; then
echo -e "dch not found, please install devscripts at first. \nDEB Build Failed"
exit
fi

VERSION=$(grep '^ <version>' pom.xml| cut -d'>' -f2 |cut -d'<' -f1)
VERSION=$(head -n1 debian/changelog |awk -F [\(\)] '{print $2}')
DISTCODE=$(lsb_release -sc)

/bin/cp debian/changelog /tmp/changelog.orig

dch -b -v "${VERSION}~${DISTCODE}" -u low -m "Apache CloudStack Release ${VERSION}"
sed -i '0,/ UNRELEASED;/s// unstable;/g' debian/changelog

if [ "$DISTCODE" == "precise" ];then
/bin/cp debian/control /tmp/control.systemd
/bin/cp debian/rules /tmp/rules.systemd
/bin/cp debian/control.ubuntu12 debian/control
/bin/cp debian/rules.ubuntu12 debian/rules
fi

dpkg-checkbuilddeps
dpkg-buildpackage -uc -us -d

dpkg-buildpackage -j2 -b -uc -us
/bin/mv /tmp/changelog.orig debian/changelog
if [ "$DISTCODE" == "precise" ];then
/bin/mv /tmp/control.systemd debian/control
/bin/mv /tmp/rules.systemd debian/rules
fi
Loading