summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-glance_git.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-10-31 00:26:37 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-11-25 15:25:34 -0500
commit10471bcbb44991b525bf78b62339cfbd86ded520 (patch)
tree82a3ae313aa9beab5eb367f0d5fa8e8cc44f2e96 /meta-openstack/recipes-devtools/python/python-glance_git.bb
parente2a6168655ac43d8fa70cfb21dc9c6713f09953c (diff)
downloadmeta-cloud-services-10471bcbb44991b525bf78b62339cfbd86ded520.tar.gz
glance: update to havana release version
As part of the glance uprev to havana, we switch to a git based build. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-glance_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance_git.bb123
1 files changed, 123 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb
new file mode 100644
index 0000000..284399e
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb
@@ -0,0 +1,123 @@
1DESCRIPTION = "Services for discovering, registering and retrieving virtual machine images"
2HOMEPAGE = "http://glance.openstack.org/"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
6
7PR = "r0"
8SRCNAME = "glance"
9
10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \
11 file://glance.init \
12 "
13
14SRCREV="252fe8572400c25c35e1973b2622e479947c6135"
15PV="2013.2+git${SRCPV}"
16
17S = "${WORKDIR}/git"
18
19inherit setuptools update-rc.d identity
20
21do_install_append() {
22 TEMPLATE_CONF_DIR=${S}${sysconfdir}
23 GLANCE_CONF_DIR=${D}${sysconfdir}/glance
24
25 for file in api registry cache
26 do
27 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
28 ${TEMPLATE_CONF_DIR}/glance-$file.conf > ${WORKDIR}/glance-$file.conf
29 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/glance-$file.conf
30 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
31 -i ${WORKDIR}/glance-$file.conf
32 sed -e "s#^sql_conn.*#sql_connection = postgresql://${DB_USER}:${DB_PASSWORD}@localhost/glance#g" \
33 -i ${WORKDIR}/glance-$file.conf
34 done
35 sed -e "s:^filesystem_store_datadir =.*:filesystem_store_datadir = ${sysconfdir}/${SRCNAME}/images/:g" \
36 -i ${WORKDIR}/glance-api.conf
37
38 install -d ${GLANCE_CONF_DIR}
39 install -m 600 ${WORKDIR}/glance-registry.conf ${GLANCE_CONF_DIR}/
40 install -m 600 ${WORKDIR}/glance-api.conf ${GLANCE_CONF_DIR}/
41 install -m 600 ${WORKDIR}/glance-cache.conf ${GLANCE_CONF_DIR}/
42
43 install -m 600 ${S}/etc/glance-registry-paste.ini ${GLANCE_CONF_DIR}/
44 install -m 600 ${S}/etc/glance-api-paste.ini ${GLANCE_CONF_DIR}/
45 install -m 600 ${S}/etc/policy.json ${GLANCE_CONF_DIR}/
46
47 install -d ${GLANCE_CONF_DIR}/images
48 install -d ${D}${localstatedir}/lib/glance/image_cache
49
50 install -d ${D}${localstatedir}/log/${SRCNAME}
51
52 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
53 install -d ${D}${sysconfdir}/init.d
54 sed 's:@suffix@:api:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-api.init.sh
55 install -m 0755 ${WORKDIR}/glance-api.init.sh ${D}${sysconfdir}/init.d/glance-api
56 sed 's:@suffix@:registry:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-registry.init.sh
57 install -m 0755 ${WORKDIR}/glance-registry.init.sh ${D}${sysconfdir}/init.d/glance-registry
58 fi
59}
60
61pkg_postinst_${SRCNAME} () {
62 if [ "x$D" != "x" ]; then
63 exit 1
64 fi
65
66 # This is to make sure postgres is configured and running
67 if ! pidof postmaster > /dev/null; then
68 /etc/init.d/postgresql-init
69 /etc/init.d/postgresql start
70 sleep 5
71 fi
72
73 mkdir /var/log/glance
74 sudo -u postgres createdb glance
75 glance-manage db_sync
76}
77
78PACKAGES += " ${SRCNAME} ${SRCNAME}-api ${SRCNAME}-registry"
79
80FILES_${PN} = "${libdir}/*"
81
82FILES_${SRCNAME} = "${bindir}/* \
83 ${sysconfdir}/${SRCNAME}/* \
84 ${localstatedir}/* \
85 "
86
87FILES_${SRCNAME}-api = "${bindir}/glance-api \
88 ${sysconfdir}/init.d/glance-api \
89 "
90
91FILES_${SRCNAME}-registry = "${bindir}/glance-registry \
92 ${sysconfdir}/init.d/glance-registry \
93 "
94
95RDEPENDS_${PN} += "python-greenlet \
96 python-sqlalchemy \
97 python-anyjson \
98 python-eventlet \
99 python-pastedeploy \
100 python-routes \
101 python-webob \
102 python-boto \
103 python-sqlalchemy-migrate \
104 python-httplib2 \
105 python-kombu \
106 python-iso8601 \
107 python-oslo.config \
108 python-lxml \
109 python-paste \
110 python-pycrypto \
111 python-jsonschema \
112 python-keystoneclient \
113 python-swiftclient \
114 "
115
116RDEPENDS_${SRCNAME} = "${PN} \
117 postgresql postgresql-client python-psycopg2"
118RDEPENDS_${SRCNAME}-api = "${SRCNAME}"
119RDEPENDS_${SRCNAME}-registry = "${SRCNAME}"
120
121INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-registry"
122INITSCRIPT_NAME_${SRCNAME}-api = "glance-api"
123INITSCRIPT_NAME_${SRCNAME}-registry = "glance-registry"