summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-cinder_git.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-10-31 01:28:40 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-11-25 15:25:35 -0500
commit2290ee09ef3c2cd8aaf7fe3dc40bf22eb842b3f4 (patch)
tree119cce29fb8c39a1f6a7fcfc1ac7c9828d1e3a74 /meta-openstack/recipes-devtools/python/python-cinder_git.bb
parentf6a3429956683bd19aa9bdfa05da3cb57451ce2c (diff)
downloadmeta-cloud-services-2290ee09ef3c2cd8aaf7fe3dc40bf22eb842b3f4.tar.gz
cinder: uprev to havana release
Updating the cinder block storage component to the havana release. At the same time, 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-cinder_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder_git.bb125
1 files changed, 125 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
new file mode 100644
index 0000000..6e6f31b
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
@@ -0,0 +1,125 @@
1DESCRIPTION = "OpenStack Block storage service"
2HOMEPAGE = "https://launchpad.net/cinder"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
6
7PR = "r0"
8SRCNAME = "cinder"
9
10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \
11 file://cinder.conf \
12 file://cinder.init \
13 file://cinder-volume \
14 "
15
16SRCREV="1f99a044580286bf0d927cc7fc7ce3378653aef0"
17PV="2013.2+git${SRCPV}"
18S = "${WORKDIR}/git"
19
20inherit setuptools update-rc.d identity
21
22do_install_append() {
23 TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
24 CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME}
25
26 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
27 ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini
28 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini
29 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
30 -i ${WORKDIR}/api-paste.ini
31
32 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/cinder.conf
33 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/cinder.conf
34
35 install -d ${CINDER_CONF_DIR}
36 install -m 600 ${WORKDIR}/cinder.conf ${CINDER_CONF_DIR}/
37 install -m 600 ${WORKDIR}/api-paste.ini ${CINDER_CONF_DIR}/
38 install -m 600 ${S}/etc/cinder/policy.json ${CINDER_CONF_DIR}/
39
40 install -d ${D}${localstatedir}/log/${SRCNAME}
41
42 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
43 install -d ${D}${sysconfdir}/init.d
44 sed 's:@suffix@:api:' < ${WORKDIR}/cinder.init >${WORKDIR}/cinder-api.init.sh
45 install -m 0755 ${WORKDIR}/cinder-api.init.sh ${D}${sysconfdir}/init.d/cinder-api
46 sed 's:@suffix@:scheduler:' < ${WORKDIR}/cinder.init >${WORKDIR}/cinder-scheduler.init.sh
47 install -m 0755 ${WORKDIR}/cinder-scheduler.init.sh ${D}${sysconfdir}/init.d/cinder-scheduler
48 install -m 0755 ${WORKDIR}/cinder-volume ${D}${sysconfdir}/init.d/cinder-volume
49 fi
50}
51
52pkg_postinst_${SRCNAME} () {
53 if [ "x$D" != "x" ]; then
54 exit 1
55 fi
56
57 # This is to make sure postgres is configured and running
58 if ! pidof postmaster > /dev/null; then
59 /etc/init.d/postgresql-init
60 /etc/init.d/postgresql start
61 fi
62
63 sudo -u postgres createdb cinder
64 cinder-manage db sync
65
66 #Create cinder volume group backing file
67 [[ -f /etc/cinder/volumes-backing ]] || truncate -s 2G /etc/cinder/volumes-backing
68 echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf
69}
70
71PACKAGES += "${SRCNAME} ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler"
72
73FILES_${PN} = "${libdir}/*"
74
75FILES_${SRCNAME}-api = "${bindir}/cinder-api \
76 ${sysconfdir}/init.d/cinder-api"
77
78FILES_${SRCNAME}-volume = "${bindir}/cinder-volume \
79 ${sysconfdir}/init.d/cinder-volume"
80
81FILES_${SRCNAME}-scheduler = "${bindir}/cinder-scheduler \
82 ${sysconfdir}/init.d/cinder-scheduler"
83
84FILES_${SRCNAME} = "${bindir}/* \
85 ${sysconfdir}/${SRCNAME}/* \
86 ${localstatedir}/* \
87 "
88
89RDEPENDS_${PN} += "lvm2 \
90 python-sqlalchemy \
91 python-amqplib \
92 python-anyjson \
93 python-eventlet \
94 python-kombu \
95 python-lxml \
96 python-routes \
97 python-webob \
98 python-greenlet \
99 python-lockfile \
100 python-pastedeploy \
101 python-paste \
102 python-sqlalchemy-migrate \
103 python-stevedore \
104 python-suds \
105 python-paramiko \
106 python-babel \
107 python-iso8601 \
108 python-setuptools-git \
109 python-glanceclient \
110 python-keystoneclient \
111 python-swiftclient \
112 python-oslo.config \
113 "
114
115RDEPENDS_${SRCNAME} = "${PN} \
116 postgresql postgresql-client python-psycopg2 tgt"
117
118RDEPENDS_${SRCNAME}-api = "${SRCNAME}"
119RDEPENDS_${SRCNAME}-volume = "${SRCNAME}"
120RDEPENDS_${SRCNAME}-scheduler = "${SRCNAME}"
121
122INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler"
123INITSCRIPT_NAME_${SRCNAME}-api = "cinder-api"
124INITSCRIPT_NAME_${SRCNAME}-volume = "cinder-volume"
125INITSCRIPT_NAME_${SRCNAME}-scheduler = "cinder-scheduler"