diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-31 01:28:40 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-25 15:25:35 -0500 |
commit | 2290ee09ef3c2cd8aaf7fe3dc40bf22eb842b3f4 (patch) | |
tree | 119cce29fb8c39a1f6a7fcfc1ac7c9828d1e3a74 /meta-openstack/recipes-devtools/python/python-cinder_git.bb | |
parent | f6a3429956683bd19aa9bdfa05da3cb57451ce2c (diff) | |
download | meta-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.bb | 125 |
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 @@ | |||
1 | DESCRIPTION = "OpenStack Block storage service" | ||
2 | HOMEPAGE = "https://launchpad.net/cinder" | ||
3 | SECTION = "devel/python" | ||
4 | LICENSE = "Apache-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | ||
6 | |||
7 | PR = "r0" | ||
8 | SRCNAME = "cinder" | ||
9 | |||
10 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | ||
11 | file://cinder.conf \ | ||
12 | file://cinder.init \ | ||
13 | file://cinder-volume \ | ||
14 | " | ||
15 | |||
16 | SRCREV="1f99a044580286bf0d927cc7fc7ce3378653aef0" | ||
17 | PV="2013.2+git${SRCPV}" | ||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit setuptools update-rc.d identity | ||
21 | |||
22 | do_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 | |||
52 | pkg_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 | |||
71 | PACKAGES += "${SRCNAME} ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" | ||
72 | |||
73 | FILES_${PN} = "${libdir}/*" | ||
74 | |||
75 | FILES_${SRCNAME}-api = "${bindir}/cinder-api \ | ||
76 | ${sysconfdir}/init.d/cinder-api" | ||
77 | |||
78 | FILES_${SRCNAME}-volume = "${bindir}/cinder-volume \ | ||
79 | ${sysconfdir}/init.d/cinder-volume" | ||
80 | |||
81 | FILES_${SRCNAME}-scheduler = "${bindir}/cinder-scheduler \ | ||
82 | ${sysconfdir}/init.d/cinder-scheduler" | ||
83 | |||
84 | FILES_${SRCNAME} = "${bindir}/* \ | ||
85 | ${sysconfdir}/${SRCNAME}/* \ | ||
86 | ${localstatedir}/* \ | ||
87 | " | ||
88 | |||
89 | RDEPENDS_${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 | |||
115 | RDEPENDS_${SRCNAME} = "${PN} \ | ||
116 | postgresql postgresql-client python-psycopg2 tgt" | ||
117 | |||
118 | RDEPENDS_${SRCNAME}-api = "${SRCNAME}" | ||
119 | RDEPENDS_${SRCNAME}-volume = "${SRCNAME}" | ||
120 | RDEPENDS_${SRCNAME}-scheduler = "${SRCNAME}" | ||
121 | |||
122 | INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" | ||
123 | INITSCRIPT_NAME_${SRCNAME}-api = "cinder-api" | ||
124 | INITSCRIPT_NAME_${SRCNAME}-volume = "cinder-volume" | ||
125 | INITSCRIPT_NAME_${SRCNAME}-scheduler = "cinder-scheduler" | ||