diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb new file mode 100644 index 0000000..d593a66 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb | |||
| @@ -0,0 +1,183 @@ | |||
| 1 | DESCRIPTION = "Quantum (virtual network service)" | ||
| 2 | HOMEPAGE = "https://launchpad.net/quantum" | ||
| 3 | SECTION = "devel/python" | ||
| 4 | LICENSE = "Apache-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | ||
| 6 | |||
| 7 | PR = "r0" | ||
| 8 | SRCNAME = "quantum" | ||
| 9 | |||
| 10 | SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ | ||
| 11 | file://ovs_quantum_plugin.ini \ | ||
| 12 | file://linuxbridge_conf.ini \ | ||
| 13 | file://quantum-server.init \ | ||
| 14 | file://quantum-agent.init \ | ||
| 15 | " | ||
| 16 | |||
| 17 | SRC_URI[md5sum] = "ca410283029db2cade16c8af003f9b7f" | ||
| 18 | SRC_URI[sha256sum] = "79e60ec1aef800da3a4e1841909cdd8b2cf645979d08f27bc481957c7944e93d" | ||
| 19 | |||
| 20 | |||
| 21 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 22 | |||
| 23 | inherit setuptools update-rc.d identity | ||
| 24 | |||
| 25 | do_install_append() { | ||
| 26 | TEMPLATE_CONF_DIR=${S}${sysconfdir}/ | ||
| 27 | QUANTUM_CONF_DIR=${D}${sysconfdir}/quantum | ||
| 28 | |||
| 29 | sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ | ||
| 30 | ${TEMPLATE_CONF_DIR}/quantum.conf > ${WORKDIR}/quantum.conf | ||
| 31 | sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/quantum.conf | ||
| 32 | sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ | ||
| 33 | -i ${WORKDIR}/quantum.conf | ||
| 34 | sed -e "s:^# core_plugin.*:core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2:g" \ | ||
| 35 | -i ${WORKDIR}/quantum.conf | ||
| 36 | |||
| 37 | for file in ovs_quantum_plugin.ini linuxbridge_conf.ini | ||
| 38 | do | ||
| 39 | sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/${file} | ||
| 40 | sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/${file} | ||
| 41 | done | ||
| 42 | |||
| 43 | install -d ${QUANTUM_CONF_DIR} | ||
| 44 | install -d ${QUANTUM_CONF_DIR}/plugins/openvswitch | ||
| 45 | install -d ${QUANTUM_CONF_DIR}/plugins/linuxbridge | ||
| 46 | |||
| 47 | install -m 600 ${WORKDIR}/quantum.conf ${QUANTUM_CONF_DIR}/ | ||
| 48 | install -m 600 ${WORKDIR}/ovs_quantum_plugin.ini ${QUANTUM_CONF_DIR}/plugins/openvswitch/ | ||
| 49 | install -m 600 ${WORKDIR}/linuxbridge_conf.ini ${QUANTUM_CONF_DIR}/plugins/linuxbridge/ | ||
| 50 | install -m 600 ${S}/etc/api-paste.ini ${QUANTUM_CONF_DIR}/ | ||
| 51 | install -m 600 ${S}/etc/policy.json ${QUANTUM_CONF_DIR}/ | ||
| 52 | |||
| 53 | PLUGIN=openvswitch | ||
| 54 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 55 | install -d ${D}${sysconfdir}/init.d | ||
| 56 | sed "s:@plugin@:/etc/quantum/plugins/$PLUGIN/ovs_quantum_plugin.ini:" \ | ||
| 57 | < ${WORKDIR}/quantum-server.init >${WORKDIR}/quantum-server.init.sh | ||
| 58 | install -m 0755 ${WORKDIR}/quantum-server.init.sh ${D}${sysconfdir}/init.d/quantum-server | ||
| 59 | sed "s:@suffix@:$PLUGIN:" < ${WORKDIR}/quantum-agent.init >${WORKDIR}/quantum-$PLUGIN.init.sh | ||
| 60 | install -m 0755 ${WORKDIR}/quantum-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/quantum-$PLUGIN-agent | ||
| 61 | fi | ||
| 62 | } | ||
| 63 | |||
| 64 | pkg_postinst_${SRCNAME} () { | ||
| 65 | if [ "x$D" != "x" ]; then | ||
| 66 | exit 1 | ||
| 67 | fi | ||
| 68 | |||
| 69 | # This is to make sure postgres is configured and running | ||
| 70 | if ! pidof postmaster > /dev/null; then | ||
| 71 | sudo -u postgres initdb -D /etc/postgresql/ | ||
| 72 | /etc/init.d/postgresql start | ||
| 73 | sleep 0.2 | ||
| 74 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 75 | fi | ||
| 76 | |||
| 77 | sudo -u postgres createdb ovs_quantum | ||
| 78 | } | ||
| 79 | |||
| 80 | pkg_postinst_${SRCNAME}-plugin-openvswitch () { | ||
| 81 | if [ "x$D" != "x" ]; then | ||
| 82 | exit 1 | ||
| 83 | fi | ||
| 84 | |||
| 85 | /etc/init.d/openvswitch-switch start | ||
| 86 | ovs-vsctl --no-wait -- --may-exist add-br br-int | ||
| 87 | } | ||
| 88 | |||
| 89 | PACKAGES += " \ | ||
| 90 | ${SRCNAME} \ | ||
| 91 | ${SRCNAME}-doc \ | ||
| 92 | ${SRCNAME}-server \ | ||
| 93 | ${SRCNAME}-plugin-openvswitch \ | ||
| 94 | ${SRCNAME}-plugin-linuxbridge \ | ||
| 95 | ${SRCNAME}-dhcp-agent \ | ||
| 96 | ${SRCNAME}-l3-agent \ | ||
| 97 | ${SRCNAME}-metadata-agent \ | ||
| 98 | ${SRCNAME}-extra-agents \ | ||
| 99 | " | ||
| 100 | |||
| 101 | FILES_${PN} = "${libdir}/*" | ||
| 102 | |||
| 103 | FILES_${SRCNAME} = " \ | ||
| 104 | ${bindir}/quantum-db-manage \ | ||
| 105 | ${bindir}/quantum-rootwrap \ | ||
| 106 | ${bindir}/quantum-debug \ | ||
| 107 | ${bindir}/quantum-netns-cleanup \ | ||
| 108 | ${bindir}/quantum-ovs-cleanup \ | ||
| 109 | ${sysconfdir}/${SRCNAME}/* " | ||
| 110 | |||
| 111 | FILES_${SRCNAME}-server = "${bindir}/quantum-server \ | ||
| 112 | ${sysconfdir}/init.d/quantum-server \ | ||
| 113 | " | ||
| 114 | |||
| 115 | FILES_${SRCNAME}-plugin-openvswitch = " \ | ||
| 116 | ${bindir}/quantum-openvswitch-agent \ | ||
| 117 | ${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_quantum_plugin.ini \ | ||
| 118 | ${sysconfdir}/init.d/quantum-openvswitch-agent \ | ||
| 119 | " | ||
| 120 | |||
| 121 | FILES_${SRCNAME}-plugin-linuxbridge = " \ | ||
| 122 | ${bindir}/quantum-linuxbridge-agent \ | ||
| 123 | ${sysconfdir}/${SRCNAME}/plugins/linuxbridge/linuxbridge_conf.ini \ | ||
| 124 | ${sysconfdir}/init.d/quantum-linuxbridge-agent \ | ||
| 125 | " | ||
| 126 | |||
| 127 | FILES_${SRCNAME}-dhcp-agent = "${bindir}/quantum-dhcp-agent \ | ||
| 128 | ${sysconfdir}/${SRCNAME}/dhcp_agent.ini \ | ||
| 129 | ${sysconfdir}/init.d/dhcp_agent \ | ||
| 130 | " | ||
| 131 | |||
| 132 | FILES_${SRCNAME}-l3-agent = "${bindir}/quantum-l3-agent \ | ||
| 133 | ${sysconfdir}/${SRCNAME}/l3_agent.ini \ | ||
| 134 | ${sysconfdir}/init.d/l3_agent \ | ||
| 135 | " | ||
| 136 | |||
| 137 | FILES_${SRCNAME}-metadata-agent = "${bindir}/quantum-metadata-agent \ | ||
| 138 | ${sysconfdir}/${SRCNAME}/metadata_agent.ini \ | ||
| 139 | ${sysconfdir}/init.d/metadata_agent \ | ||
| 140 | " | ||
| 141 | |||
| 142 | FILES_${SRCNAME}-extra-agents = "${bindir}/*" | ||
| 143 | |||
| 144 | FILES_${SRCNAME}-doc = "${datadir}/*" | ||
| 145 | |||
| 146 | RDEPENDS_${PN} += "python-paste \ | ||
| 147 | python-pastedeploy \ | ||
| 148 | python-routes \ | ||
| 149 | python-amqplib \ | ||
| 150 | python-anyjson \ | ||
| 151 | python-alembic \ | ||
| 152 | python-eventlet \ | ||
| 153 | python-greenlet \ | ||
| 154 | python-httplib2 \ | ||
| 155 | python-iso8601 \ | ||
| 156 | python-kombu \ | ||
| 157 | python-netaddr \ | ||
| 158 | python-quantumclient \ | ||
| 159 | python-sqlalchemy \ | ||
| 160 | python-webob \ | ||
| 161 | python-keystoneclient \ | ||
| 162 | python-oslo.config \ | ||
| 163 | python-pyudev \ | ||
| 164 | python-novaclient \ | ||
| 165 | python-mako \ | ||
| 166 | python-markupsafe \ | ||
| 167 | " | ||
| 168 | |||
| 169 | RDEPENDS_${SRCNAME} = "${PN} \ | ||
| 170 | postgresql postgresql-client python-psycopg2" | ||
| 171 | |||
| 172 | RDEPENDS_${SRCNAME}-server = "${SRCNAME}" | ||
| 173 | RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} openvswitch-switch " | ||
| 174 | RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" | ||
| 175 | RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" | ||
| 176 | RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" | ||
| 177 | |||
| 178 | RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" | ||
| 179 | |||
| 180 | INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge" | ||
| 181 | INITSCRIPT_NAME_${SRCNAME}-server = "quantum-server" | ||
| 182 | INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "quantum-openvswitch-agent" | ||
| 183 | INITSCRIPT_NAME_${SRCNAME}-plugin-linuxbridge = "quantum-linuxbridge-agent" | ||
