[python-django-horizon] adapt httpd config to httpd 2.4 (bz. 868408)

Matthias Runge mrunge at fedoraproject.org
Mon Oct 22 10:11:06 UTC 2012


commit e3c669e1da63b7fc248db42c7b8b11711f3f34db
Author: Matthias Runge <mrunge at redhat.com>
Date:   Mon Oct 22 12:09:48 2012 +0200

    adapt httpd config to httpd 2.4 (bz. 868408)

 openstack-dashboard-httpd-2.4.conf     |   19 ++++++++++++++++
 python-django-horizon-no_webroot.patch |   20 +++++++++++++++++
 python-django-horizon.spec             |   36 +++++++++++++++++++++++++++----
 3 files changed, 70 insertions(+), 5 deletions(-)
---
diff --git a/openstack-dashboard-httpd-2.4.conf b/openstack-dashboard-httpd-2.4.conf
new file mode 100644
index 0000000..63d1b17
--- /dev/null
+++ b/openstack-dashboard-httpd-2.4.conf
@@ -0,0 +1,19 @@
+WSGIDaemonProcess dashboard
+WSGIProcessGroup dashboard
+WSGISocketPrefix run/wsgi
+
+WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
+Alias /static /usr/share/openstack-dashboard/static
+
+<Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
+  Options All
+  AllowOverride All
+  Require all granted
+</Directory>
+
+<Directory /usr/share/openstack-dashboard/static>
+  Options All
+  AllowOverride All
+  Require all granted
+</Directory>
+
diff --git a/python-django-horizon-no_webroot.patch b/python-django-horizon-no_webroot.patch
index e69de29..c02a0fc 100644
--- a/python-django-horizon-no_webroot.patch
+++ b/python-django-horizon-no_webroot.patch
@@ -0,0 +1,20 @@
+diff -up openstack_dashboard/settings.py.no_webroot openstack_dashboard/settings.py
+--- openstack_dashboard/settings.py.no_webroot	2012-10-17 13:02:49.869147461 +0200
++++ openstack_dashboard/settings.py	2012-10-17 13:03:45.768016867 +0200
+@@ -35,12 +35,13 @@ TEMPLATE_DEBUG = DEBUG
+ 
+ SITE_BRANDING = 'OpenStack Dashboard'
+ 
+-LOGIN_URL = '/auth/login/'
+-LOGOUT_URL = '/auth/logout/'
++WEBROOT='/dashboard'
++LOGIN_URL = WEBROOT+'/auth/login/'
++LOGOUT_URL = WEBROOT+'/auth/logout/'
+ # LOGIN_REDIRECT_URL can be used as an alternative for
+ # HORIZON_CONFIG.user_home, if user_home is not set.
+ # Do not set it to '/home/', as this will cause circular redirect loop
+-LOGIN_REDIRECT_URL = '/dashboard'
++LOGIN_REDIRECT_URL = WEBROOT
+ 
+ MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))
+ MEDIA_URL = '/media/'
diff --git a/python-django-horizon.spec b/python-django-horizon.spec
index 059a374..d49b731 100644
--- a/python-django-horizon.spec
+++ b/python-django-horizon.spec
@@ -1,6 +1,6 @@
 Name:       python-django-horizon
 Version:    2012.2
-Release:    2%{?dist}
+Release:    3%{?dist}
 Summary:    Django application for talking to Openstack
 
 Group:      Development/Libraries
@@ -11,9 +11,10 @@ BuildArch:  noarch
 
 Source0:    http://launchpad.net/horizon/folsom/%{version}/+download/horizon-%{version}.tar.gz
 Source1:    openstack-dashboard.conf
+Source2:    openstack-dashboard-httpd-2.4.conf
 
 # offline compressed css, js
-Source2:    python-django-horizon-compressed-css.tar.gz
+Source3:    python-django-horizon-compressed-css.tar.gz
 
 # change settings to use offline compression
 Patch0:     python-django-horizon-dashboard-settings.patch
@@ -28,7 +29,14 @@ Patch3:     python-django-horizon-no_webroot.patch
 
 
 %if 0%{?rhel}<7 || 0%{?fedora} < 18
+
+# epel6 has a separate Django14 package
+%if 0%{?rhel}==6
+Requires:   Django14
+%else
 Requires:   Django
+%endif
+
 %else
 Requires:   python-django
 %endif
@@ -88,8 +96,11 @@ Summary:    Documentation for Django Horizon
 Group:      Documentation
 
 Requires:   %{name} = %{version}-%{release}
-
+%if 0%{?rhel}==6
+BuildRequires: python-sphinx10
+%else
 BuildRequires: python-sphinx >= 1.1.3
+%endif
 
 # Doc building basically means we have to mirror Requires:
 BuildRequires: python-cloudfiles >= 1.7.9.3
@@ -118,7 +129,7 @@ find . -name "django*.po" -exec rm -f '{}' \;
 %patch2 -p1
 
 # move dashboard login/logout to /dashboard
-%patch3 -p1
+%patch3 
 
 %build
 %{__python} setup.py build
@@ -126,10 +137,20 @@ find . -name "django*.po" -exec rm -f '{}' \;
 %install
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 
+# drop httpd-conf snippet
+%if 0%{?rhel} || 0%{?fedora} <18
 install -m 0644 -D -p %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/openstack-dashboard.conf
+%else
+# httpd-2.4 changed the syntax
+install -m 0644 -D -p %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf.d/openstack-dashboard.conf
+%endif
 
 export PYTHONPATH="$( pwd ):$PYTHONPATH"
+%if 0%{?rhel}==6
+sphinx-1.0-build -b html doc/source html
+%else
 sphinx-build -b html doc/source html
+%endif
 
 # Fix hidden-file-or-dir warnings
 rm -fr html/.doctrees html/.buildinfo
@@ -179,7 +200,7 @@ cp -a horizon/static/* %{buildroot}%{_datadir}/openstack-dashboard/static
 
 # finally put compressed js, css to the right place, and also manifest.json
 cd %{buildroot}%{_datadir}/openstack-dashboard
-tar xzf %{SOURCE2}
+tar xzf %{SOURCE3}
 
 
 %files -f horizon.lang
@@ -229,6 +250,11 @@ tar xzf %{SOURCE2}
 %doc html
 
 %changelog
+* Mon Oct 22 2012 Matthias Runge <mrunge at redhat.com> - 2012-2-3
+- require Django14 for EPEL6
+- finally move login/logout to /dashboard/auth/login
+- adapt httpd config to httpd-2.4 (bz 868408)
+
 * Mon Oct 15 2012 Matthias Runge <mrunge at redhat.com> - 2012-2-2
 - fix static img, static fonts issue
 


More information about the scm-commits mailing list