From 51406da671616f8697ebc15c3e064c4eda76c08a Mon Sep 17 00:00:00 2001 From: Maksym Yatsenko Date: Thu, 6 Nov 2014 18:29:14 +0200 Subject: [PATCH] Update deb spec according to upstream spec Close-bug:#1388092 Change-Id: Ib87933ddf9267ea9f3d3aa1bf0dac498e3c65a22 --- .gitreview | 6 +++--- debian/openstack-dashboard.install | 5 ++--- debian/openstack-dashboard.postinst | 9 +++++++++ debian/rules | 29 +++++++++++++++++++++-------- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.gitreview b/.gitreview index 7f413bc..07a3958 100644 --- a/.gitreview +++ b/.gitreview @@ -1,5 +1,5 @@ [gerrit] -host=gerrit.mirantis.com +host=review.fuel-infra.org port=29418 -project=openstack-ci/openstack/horizon-build -defaultbranch=master +project=openstack-build/horizon-build + diff --git a/debian/openstack-dashboard.install b/debian/openstack-dashboard.install index b343328..bfd2d43 100644 --- a/debian/openstack-dashboard.install +++ b/debian/openstack-dashboard.install @@ -1,6 +1,5 @@ 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/debian/openstack-dashboard.postinst b/debian/openstack-dashboard.postinst index 7e75670..ea10944 100644 --- a/debian/openstack-dashboard.postinst +++ b/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/debian/rules b/debian/rules index 69e7b95..82f57a0 100755 --- a/debian/rules +++ b/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