From 2a26516c50d308d33803fba0da9a8eaa2bdc8cb5 Mon Sep 17 00:00:00 2001 From: iberezovskiy Date: Wed, 4 Mar 2015 00:23:57 +0300 Subject: [PATCH] Fix horizon postinst and install scripts for Trusty build Implements support-ubuntu-trusty Change-Id: I08541d595d47cb8b1aeefa593fc4475f9f2ed806 --- trusty/debian/openstack-dashboard.install | 3 --- trusty/debian/openstack-dashboard.postinst | 9 +++++++ trusty/debian/rules | 29 ++++++++++++++++------ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/trusty/debian/openstack-dashboard.install b/trusty/debian/openstack-dashboard.install index b343328..1781db6 100644 --- a/trusty/debian/openstack-dashboard.install +++ b/trusty/debian/openstack-dashboard.install @@ -1,6 +1,3 @@ debian/openstack-dashboard.conf etc/apache2/conf-available -debian/static/openstack-dashboard/css/* usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css -debian/static/openstack-dashboard/js/* usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/js -debian/static/openstack-dashboard/manifest.json usr/share/openstack-dashboard/openstack_dashboard/static/dashboard etc/openstack-dashboard usr/share/openstack-dashboard diff --git a/trusty/debian/openstack-dashboard.postinst b/trusty/debian/openstack-dashboard.postinst index 7e75670..ea10944 100644 --- a/trusty/debian/openstack-dashboard.postinst +++ b/trusty/debian/openstack-dashboard.postinst @@ -27,6 +27,15 @@ if [ "$1" = "configure" ]; then --no-create-home --shell /bin/false horizon fi + ( + cd /usr/share/openstack-dashboard + echo "Collecting and compressing static assets..." + rm -rf ./static/horizon 2>&1 > /dev/null + python manage.py collectstatic --noinput 2>&1 > /dev/null + python manage.py compress --force 2>&1 > /dev/null + ) + + if [ -e /usr/share/openstack-dashboard/openstack_dashboard/static ] ; then chown -R horizon:horizon \ /usr/share/openstack-dashboard/openstack_dashboard/static diff --git a/trusty/debian/rules b/trusty/debian/rules index 69e7b95..f8a3658 100755 --- a/trusty/debian/rules +++ b/trusty/debian/rules @@ -8,9 +8,30 @@ PYVER=$(shell pyversions -d) +DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-) +DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//') + +override_dh_auto_clean: + find . -name "django*.mo" -delete || : + rm -f horizon/xstatic + dh_auto_clean + rm -f horizon/openstack_dashboard/local/.secret_key_store + +override_dh_auto_build: + # NOTE(jamespage) this is a little horrible but works around + # the switch to /var/lib/openstack once installed for lockfiles +# ln -sf ../xstatic horizon/xstatic +# patch -p1 -R