From 928ae886d0e6c908b2d6ea7c928fc01b216156b9 Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Thu, 11 Jul 2013 16:54:35 +0300 Subject: python-horizon: Added 2013.1.2 * Horizon is a web based user interface that provides an interface to the OpenStack services. * Added initscript that starts the service at boot time. Signed-off-by: Mihai Prica --- .../python/python-horizon/horizon.init | 73 +++++++++++++++++++ .../python/python-horizon_2013.1.2.bb | 83 ++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-horizon/horizon.init create mode 100644 meta-openstack/recipes-devtools/python/python-horizon_2013.1.2.bb (limited to 'meta-openstack/recipes-devtools') diff --git a/meta-openstack/recipes-devtools/python/python-horizon/horizon.init b/meta-openstack/recipes-devtools/python/python-horizon/horizon.init new file mode 100644 index 0000000..d5dbadd --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-horizon/horizon.init @@ -0,0 +1,73 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: OpenStack Dashboard +# Required-Start: networking +# Required-Stop: networking +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OpenStack Dashboard +# Description: Web based user interface to OpenStack services including +# Nova, Swift, Keystone, etc. +### END INIT INFO + +DESC="openstack-dashboard" +PIDFILE="/var/run/$DESC.pid" +PYTHON=`which python` +EXEC="@PYTHON_SITEPACKAGES@/openstack_dashboard/manage.py" + +start() +{ + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 1 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + + echo -n "Starting $DESC..." + + start-stop-daemon --start --quiet --background --pidfile ${PIDFILE} \ + --make-pidfile --exec ${PYTHON} -- ${EXEC} runserver 0.0.0.0:8080 + + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +stop() +{ + echo -n "Stopping $DESC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi + rm -f $PIDFILE +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openstack/recipes-devtools/python/python-horizon_2013.1.2.bb b/meta-openstack/recipes-devtools/python/python-horizon_2013.1.2.bb new file mode 100644 index 0000000..04a63f5 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-horizon_2013.1.2.bb @@ -0,0 +1,83 @@ +DESCRIPTION = "The OpenStack Dashboard." +HOMEPAGE = "https://github.com/openstack/horizon/" +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" +DEPENDS_${PN} += "python-django \ + python-django-compressor \ + python-django-openstack-auth \ + python-netaddr \ + python-cinderclient \ + python-glanceclient \ + python-keystoneclient \ + python-novaclient \ + python-quantumclient \ + python-pytz \ + python-django-appconf \ + python-six \ + python-swiftclient \ + python-lockfile \ + " + +PR = "r0" +SRCNAME = "horizon" + +SRC_URI = "https://launchpad.net/horizon/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ + file://horizon.init \ + " + +SRC_URI[md5sum] = "23db8455f768c830485ef283c06f0e65" +SRC_URI[sha256sum] = "12a0b87ed4796595ba15ed7c8743cbab188bafc711ade9735b635c5eb65652e6" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit setuptools update-rc.d python-dir + +do_install_append() { + DASHBOARD_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/openstack_dashboard + sed -e "s:^LANGUAGE_CODE =.*:LANGUAGE_CODE = 'en-us':g" \ + -i ${DASHBOARD_DIR}/settings.py + sed -e "s:^DEBUG =.*:DEBUG = False:g" \ + ${DASHBOARD_DIR}/local/local_settings.py.example > ${DASHBOARD_DIR}/local/local_settings.py + sed -e "s:^# from horizon.utils:from horizon.utils:g" \ + -i ${DASHBOARD_DIR}/local/local_settings.py + sed -e "s:^# SECRET_KEY =:SECRET_KEY =:g" \ + -i ${DASHBOARD_DIR}/local/local_settings.py + install -m 644 ${S}/manage.py ${DASHBOARD_DIR}/manage.py + + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' ${WORKDIR}/horizon.init >${WORKDIR}/horizon + install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon + fi +} + +PACKAGES += "${SRCNAME}" + +FILES_${PN} = "${libdir}/*" + +FILES_${SRCNAME} = "${bindir}/* \ + ${sysconfdir}/init.d/* \ + ${datadir}/* \ + " + +RDEPENDS_${PN} += "python-django \ + python-django-appconf \ + python-django-compressor \ + python-django-openstack-auth \ + python-netaddr \ + python-cinderclient \ + python-glanceclient \ + python-keystoneclient \ + python-novaclient \ + python-quantumclient \ + python-pytz \ + python-six \ + python-swiftclient \ + python-lockfile \ + " + +RDEPENDS_${SRCNAME} = "${PN}" + +INITSCRIPT_PACKAGES = "${SRCNAME}" +INITSCRIPT_NAME_${SRCNAME} = "horizon" -- cgit v1.2.3-54-g00ecf