Update deb spec according to upstream spec 49/649/8
authorMaksym Yatsenko <myatsenko@mirantis.com>
Thu, 6 Nov 2014 16:29:14 +0000 (18:29 +0200)
committerMaksym Yatsenko <myatsenko@mirantis.com>
Fri, 7 Nov 2014 17:39:14 +0000 (19:39 +0200)
Close-bug:#1388092

Change-Id: Ib87933ddf9267ea9f3d3aa1bf0dac498e3c65a22

.gitreview
debian/openstack-dashboard.install
debian/openstack-dashboard.postinst
debian/rules

index 7f413bc55e17f8e4cde0cf9802c90f806b203899..07a39588a8c4ac6249e7b06617274c8d9f690e83 100644 (file)
@@ -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
+
index b3433280436ad5d070fc2dfcd00d1bb01ee4cb5c..bfd2d4303ada570b090a4a48682bb17ef10413f5 100644 (file)
@@ -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
+
+
index 7e75670dfa8de2a3fa3dd7f578824a1ef71e2e04..ea10944cfc69bfac1a476e080ec2c73b3dc82850 100644 (file)
@@ -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
index 69e7b9561a2c113f4f502d0ff5f998859327e60d..82f57a0aeb430ca5d8314f30f9852b28cd23a669 100755 (executable)
@@ -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 <debian/patches/ubuntu_settings.patch 
+#      ./run_tests.sh -N --compilemessages
+#      patch -p1 <debian/patches/ubuntu_settings.patch 
+#      dh_auto_build
+
 override_dh_auto_install:
        # install horizon and dashboard
        python setup.py install --root=$(CURDIR)/debian/tmp --no-compile -O0 --install-layout=deb
+       # install vendorfied xstatic assets
+#      cp -r xstatic $(CURDIR)/debian/tmp/usr/lib/$(PYVER)/dist-packages/horizon
        install -d -m 755 $(CURDIR)/debian/tmp/usr/share/openstack-dashboard
        install -d -m 755 $(CURDIR)/debian/tmp/etc/openstack-dashboard
        install -d -m 755 $(CURDIR)/debian/tmp/etc/apache2/conf-available
@@ -25,8 +46,6 @@ override_dh_auto_install:
                 $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/manage.py
        ln -fs /etc/openstack-dashboard/local_settings.py \
                $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py
-       cp $(CURDIR)/debian/theme/img/juju.png \
-               $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/juju.png
        ln -fs /usr/lib/$(PYVER)/dist-packages/horizon/static/horizon \
                $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/static/horizon
 
@@ -39,9 +58,3 @@ endif
 get-orig-source:
        uscan --verbose --force-download --rename --destdir=../build-area
 
-refresh-static-assets:
-       (cd openstack_dashboard/local; ln -sf local_settings.py.example local_settings.py)
-       python ./manage.py compress --force
-       rm -rf debian/static/openstack-dashboard/*
-       cp -r static/dashboard/* debian/static/openstack-dashboard/
-       rm -f openstack_dashboard/local/local_settings.py