summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools
diff options
context:
space:
mode:
authorMihai Prica <prica.mihai@gmail.com>2013-07-11 16:54:35 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:41:58 -0400
commit928ae886d0e6c908b2d6ea7c928fc01b216156b9 (patch)
treef20bf8c72abadec9ff92ac2ed8701d35c143418b /meta-openstack/recipes-devtools
parent92cb095b668e0d95ce6e362d4f4d9fed3f680a12 (diff)
downloadmeta-cloud-services-928ae886d0e6c908b2d6ea7c928fc01b216156b9.tar.gz
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 <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools')
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon/horizon.init73
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon_2013.1.2.bb83
2 files changed, 156 insertions, 0 deletions
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 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: OpenStack Dashboard
5# Required-Start: networking
6# Required-Stop: networking
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: OpenStack Dashboard
10# Description: Web based user interface to OpenStack services including
11# Nova, Swift, Keystone, etc.
12### END INIT INFO
13
14DESC="openstack-dashboard"
15PIDFILE="/var/run/$DESC.pid"
16PYTHON=`which python`
17EXEC="@PYTHON_SITEPACKAGES@/openstack_dashboard/manage.py"
18
19start()
20{
21 if [ -e $PIDFILE ]; then
22 PIDDIR=/proc/$(cat $PIDFILE)
23 if [ -d ${PIDDIR} ]; then
24 echo "$DESC already running."
25 exit 1
26 else
27 echo "Removing stale PID file $PIDFILE"
28 rm -f $PIDFILE
29 fi
30 fi
31
32 echo -n "Starting $DESC..."
33
34 start-stop-daemon --start --quiet --background --pidfile ${PIDFILE} \
35 --make-pidfile --exec ${PYTHON} -- ${EXEC} runserver 0.0.0.0:8080
36
37 if [ $? -eq 0 ]; then
38 echo "done."
39 else
40 echo "failed."
41 fi
42}
43
44stop()
45{
46 echo -n "Stopping $DESC..."
47 start-stop-daemon --stop --quiet --pidfile $PIDFILE
48 if [ $? -eq 0 ]; then
49 echo "done."
50 else
51 echo "failed."
52 fi
53 rm -f $PIDFILE
54}
55
56case "$1" in
57 start)
58 start
59 ;;
60 stop)
61 stop
62 ;;
63 restart|force-reload)
64 stop
65 start
66 ;;
67 *)
68 echo "Usage: $0 {start|stop|force-reload|restart}"
69 exit 1
70 ;;
71esac
72
73exit 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 @@
1DESCRIPTION = "The OpenStack Dashboard."
2HOMEPAGE = "https://github.com/openstack/horizon/"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
6DEPENDS_${PN} += "python-django \
7 python-django-compressor \
8 python-django-openstack-auth \
9 python-netaddr \
10 python-cinderclient \
11 python-glanceclient \
12 python-keystoneclient \
13 python-novaclient \
14 python-quantumclient \
15 python-pytz \
16 python-django-appconf \
17 python-six \
18 python-swiftclient \
19 python-lockfile \
20 "
21
22PR = "r0"
23SRCNAME = "horizon"
24
25SRC_URI = "https://launchpad.net/horizon/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \
26 file://horizon.init \
27 "
28
29SRC_URI[md5sum] = "23db8455f768c830485ef283c06f0e65"
30SRC_URI[sha256sum] = "12a0b87ed4796595ba15ed7c8743cbab188bafc711ade9735b635c5eb65652e6"
31
32S = "${WORKDIR}/${SRCNAME}-${PV}"
33
34inherit setuptools update-rc.d python-dir
35
36do_install_append() {
37 DASHBOARD_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/openstack_dashboard
38 sed -e "s:^LANGUAGE_CODE =.*:LANGUAGE_CODE = 'en-us':g" \
39 -i ${DASHBOARD_DIR}/settings.py
40 sed -e "s:^DEBUG =.*:DEBUG = False:g" \
41 ${DASHBOARD_DIR}/local/local_settings.py.example > ${DASHBOARD_DIR}/local/local_settings.py
42 sed -e "s:^# from horizon.utils:from horizon.utils:g" \
43 -i ${DASHBOARD_DIR}/local/local_settings.py
44 sed -e "s:^# SECRET_KEY =:SECRET_KEY =:g" \
45 -i ${DASHBOARD_DIR}/local/local_settings.py
46 install -m 644 ${S}/manage.py ${DASHBOARD_DIR}/manage.py
47
48 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
49 install -d ${D}${sysconfdir}/init.d
50 sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' ${WORKDIR}/horizon.init >${WORKDIR}/horizon
51 install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon
52 fi
53}
54
55PACKAGES += "${SRCNAME}"
56
57FILES_${PN} = "${libdir}/*"
58
59FILES_${SRCNAME} = "${bindir}/* \
60 ${sysconfdir}/init.d/* \
61 ${datadir}/* \
62 "
63
64RDEPENDS_${PN} += "python-django \
65 python-django-appconf \
66 python-django-compressor \
67 python-django-openstack-auth \
68 python-netaddr \
69 python-cinderclient \
70 python-glanceclient \
71 python-keystoneclient \
72 python-novaclient \
73 python-quantumclient \
74 python-pytz \
75 python-six \
76 python-swiftclient \
77 python-lockfile \
78 "
79
80RDEPENDS_${SRCNAME} = "${PN}"
81
82INITSCRIPT_PACKAGES = "${SRCNAME}"
83INITSCRIPT_NAME_${SRCNAME} = "horizon"