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