nova-2016.2.9999.ebuild 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 python3_4 )
  5. inherit distutils-r1 eutils git-r3 linux-info multilib user
  6. DESCRIPTION="Cloud computing fabric controller (main part of an IaaS system) in Python"
  7. HOMEPAGE="https://launchpad.net/nova"
  8. SRC_URI="https://dev.gentoo.org/~prometheanfire/dist/openstack/nova/newton/nova.conf.sample -> newton-nova.conf.sample"
  9. EGIT_REPO_URI="https://github.com/openstack/nova.git"
  10. EGIT_BRANCH="stable/newton"
  11. LICENSE="Apache-2.0"
  12. SLOT="0"
  13. KEYWORDS=""
  14. IUSE="+compute compute-only iscsi +memcached mysql +novncproxy openvswitch postgres +rabbitmq sqlite"
  15. REQUIRED_USE="
  16. !compute-only? ( || ( mysql postgres sqlite ) )
  17. compute-only? ( compute !rabbitmq !memcached !mysql !postgres !sqlite )"
  18. CDEPEND=">=dev-python/pbr-1.8[${PYTHON_USEDEP}]"
  19. DEPEND="
  20. >=dev-python/setuptools-16.0[${PYTHON_USEDEP}]
  21. ${CDEPEND}
  22. app-admin/sudo"
  23. RDEPEND="
  24. ${CDEPEND}
  25. compute-only? (
  26. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  27. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  28. )
  29. sqlite? (
  30. >=dev-python/sqlalchemy-1.0.10[sqlite,${PYTHON_USEDEP}]
  31. <dev-python/sqlalchemy-1.1.0[sqlite,${PYTHON_USEDEP}]
  32. )
  33. mysql? (
  34. >=dev-python/pymysql-0.6.2[${PYTHON_USEDEP}]
  35. !~dev-python/pymysql-0.7.7[${PYTHON_USEDEP}]
  36. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  37. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  38. )
  39. postgres? (
  40. >=dev-python/psycopg-2.5.0[${PYTHON_USEDEP}]
  41. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  42. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  43. )
  44. >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
  45. >=dev-python/decorator-3.4.0[${PYTHON_USEDEP}]
  46. >=dev-python/eventlet-0.18.4[${PYTHON_USEDEP}]
  47. >=dev-python/jinja-2.8[${PYTHON_USEDEP}]
  48. >=dev-python/keystonemiddleware-4.0.0[${PYTHON_USEDEP}]
  49. !~dev-python/keystonemiddleware-4.1.0[${PYTHON_USEDEP}]
  50. !~dev-python/keystonemiddleware-4.5.0[${PYTHON_USEDEP}]
  51. >=dev-python/lxml-2.3[${PYTHON_USEDEP}]
  52. >=dev-python/routes-1.12.3[${PYTHON_USEDEP}]
  53. !~dev-python/routes-2.0[${PYTHON_USEDEP}]
  54. !~dev-python/routes-2.1[$(python_gen_usedep 'python2_7')]
  55. !~dev-python/routes-2.3[${PYTHON_USEDEP}]
  56. >=dev-python/cryptography-1.0[${PYTHON_USEDEP}]
  57. !~dev-python/cryptography-1.3.0[${PYTHON_USEDEP}]
  58. >=dev-python/webob-1.2.3[${PYTHON_USEDEP}]
  59. >=dev-python/greenlet-0.3.2[${PYTHON_USEDEP}]
  60. >=dev-python/pastedeploy-1.5.0-r1[${PYTHON_USEDEP}]
  61. dev-python/paste[${PYTHON_USEDEP}]
  62. >=dev-python/prettytable-0.7[${PYTHON_USEDEP}]
  63. <dev-python/prettytable-0.8[${PYTHON_USEDEP}]
  64. >=dev-python/sqlalchemy-migrate-0.9.6[${PYTHON_USEDEP}]
  65. >=dev-python/netaddr-0.7.13[${PYTHON_USEDEP}]
  66. !~dev-python/netaddr-0.7.16[${PYTHON_USEDEP}]
  67. >=dev-python/netifaces-0.10.4[${PYTHON_USEDEP}]
  68. >=dev-python/paramiko-2.0[${PYTHON_USEDEP}]
  69. >=dev-python/Babel-2.3.4[${PYTHON_USEDEP}]
  70. >=dev-python/iso8601-0.1.11[${PYTHON_USEDEP}]
  71. >=dev-python/jsonschema-2.0.0[${PYTHON_USEDEP}]
  72. !~dev-python/jsonschema-2.5.0[${PYTHON_USEDEP}]
  73. <dev-python/jsonschema-3.0.0[${PYTHON_USEDEP}]
  74. >=dev-python/python-cinderclient-1.6.0[${PYTHON_USEDEP}]
  75. !~dev-python/python-cinderclient-1.7.0[${PYTHON_USEDEP}]
  76. !~dev-python/python-cinderclient-1.7.1[${PYTHON_USEDEP}]
  77. >=dev-python/keystoneauth-2.10.0[${PYTHON_USEDEP}]
  78. >=dev-python/python-neutronclient-5.1.0[${PYTHON_USEDEP}]
  79. >=dev-python/python-glanceclient-2.3.0[${PYTHON_USEDEP}]
  80. !~dev-python/python-glanceclient-2.4.0[${PYTHON_USEDEP}]
  81. >=dev-python/requests-2.10.0[${PYTHON_USEDEP}]
  82. >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
  83. >=dev-python/stevedore-1.16.0[${PYTHON_USEDEP}]
  84. >=dev-python/setuptools-16.0[${PYTHON_USEDEP}]
  85. !~dev-python/setuptools-24.0.0[${PYTHON_USEDEP}]
  86. >=dev-python/websockify-0.8.0[${PYTHON_USEDEP}]
  87. >=dev-python/oslo-cache-1.5.0[${PYTHON_USEDEP}]
  88. >=dev-python/oslo-concurrency-3.8.0[${PYTHON_USEDEP}]
  89. >=dev-python/oslo-config-3.14.0[${PYTHON_USEDEP}]
  90. >=dev-python/oslo-context-2.9.0[${PYTHON_USEDEP}]
  91. >=dev-python/oslo-log-1.14.0[${PYTHON_USEDEP}]
  92. >=dev-python/oslo-reports-0.6.0[${PYTHON_USEDEP}]
  93. >=dev-python/oslo-serialization-1.10.0[${PYTHON_USEDEP}]
  94. >=dev-python/oslo-utils-3.16.0[${PYTHON_USEDEP}]
  95. >=dev-python/oslo-db-4.10.0[${PYTHON_USEDEP}]
  96. !~dev-python/oslo-db-4.13.1[${PYTHON_USEDEP}]
  97. !~dev-python/oslo-db-4.13.2[${PYTHON_USEDEP}]
  98. >=dev-python/oslo-rootwrap-5.0.0[${PYTHON_USEDEP}]
  99. >=dev-python/oslo-messaging-5.2.0[${PYTHON_USEDEP}]
  100. >=dev-python/oslo-policy-1.9.0[${PYTHON_USEDEP}]
  101. >=dev-python/oslo-i18n-2.1.0[${PYTHON_USEDEP}]
  102. >=dev-python/oslo-service-1.10.0[${PYTHON_USEDEP}]
  103. >=dev-python/rfc3986-0.2.2[${PYTHON_USEDEP}]
  104. >=dev-python/oslo-middleware-3.0.0[${PYTHON_USEDEP}]
  105. >=dev-python/psutil-1.1.1[${PYTHON_USEDEP}]
  106. <dev-python/psutil-2.0.0[${PYTHON_USEDEP}]
  107. >=dev-python/oslo-versionedobjects-1.13.0[${PYTHON_USEDEP}]
  108. >=dev-python/os-brick-1.6.1[${PYTHON_USEDEP}]
  109. >=dev-python/os-vif-1.1.0[${PYTHON_USEDEP}]
  110. >=dev-python/os-win-0.2.3[${PYTHON_USEDEP}]
  111. >=dev-python/castellan-0.4.0[${PYTHON_USEDEP}]
  112. >=dev-python/microversion-parse-0.1.2[${PYTHON_USEDEP}]
  113. >=dev-python/wsgiintercept-0.6.1[${PYTHON_USEDEP}]
  114. dev-python/libvirt-python[${PYTHON_USEDEP}]
  115. app-emulation/libvirt[iscsi?]
  116. novncproxy? ( www-apps/novnc )
  117. sys-apps/iproute2
  118. openvswitch? ( net-misc/openvswitch )
  119. rabbitmq? ( net-misc/rabbitmq-server )
  120. memcached? (
  121. net-misc/memcached
  122. >=dev-python/python-memcached-1.58
  123. )
  124. sys-fs/sysfsutils
  125. sys-fs/multipath-tools
  126. net-misc/bridge-utils
  127. compute? (
  128. app-cdr/cdrtools
  129. sys-fs/dosfstools
  130. app-emulation/qemu
  131. )
  132. iscsi? (
  133. sys-fs/lsscsi
  134. >=sys-block/open-iscsi-2.0.873-r1
  135. )"
  136. #PATCHES=(
  137. #)
  138. pkg_setup() {
  139. linux-info_pkg_setup
  140. CONFIG_CHECK_MODULES="BLK_DEV_NBD VHOST_NET IP6_NF_FILTER IP6_NF_IPTABLES IP_NF_TARGET_REJECT \
  141. IP_NF_MANGLE IP_NF_TARGET_MASQUERADE NF_NAT_IPV4 IP_NF_FILTER IP_NF_IPTABLES \
  142. NF_CONNTRACK_IPV4 NF_DEFRAG_IPV4 NF_NAT_IPV4 NF_NAT NF_CONNTRACK NETFILTER_XTABLES \
  143. ISCSI_TCP SCSI_DH DM_MULTIPATH DM_SNAPSHOT"
  144. if linux_config_exists; then
  145. for module in ${CONFIG_CHECK_MODULES}; do
  146. linux_chkconfig_present ${module} || ewarn "${module} needs to be enabled in kernel"
  147. done
  148. fi
  149. enewgroup nova
  150. enewuser nova -1 -1 /var/lib/nova nova
  151. }
  152. python_prepare_all() {
  153. sed -i '/^hacking/d' test-requirements.txt || die
  154. distutils-r1_python_prepare_all
  155. }
  156. python_install_all() {
  157. distutils-r1_python_install_all
  158. if use !compute-only; then
  159. for svc in api cert conductor consoleauth network scheduler spicehtml5proxy xvpvncproxy; do
  160. newinitd "${FILESDIR}/nova.initd" "nova-${svc}"
  161. done
  162. fi
  163. use compute && newinitd "${FILESDIR}/nova.initd" "nova-compute"
  164. use novncproxy && newinitd "${FILESDIR}/nova.initd" "nova-novncproxy"
  165. diropts -m 0750 -o nova -g qemu
  166. dodir /var/log/nova /var/lib/nova/instances
  167. diropts -m 0750 -o nova -g nova
  168. insinto /etc/nova
  169. insopts -m 0640 -o nova -g nova
  170. newins "${DISTDIR}/newton-nova.conf.sample" "nova.conf.sample"
  171. doins "${FILESDIR}/nova-compute.conf"
  172. doins "${S}/etc/nova/"*
  173. # rootwrap filters
  174. insopts -m 0644
  175. insinto /etc/nova/rootwrap.d
  176. doins "etc/nova/rootwrap.d/api-metadata.filters"
  177. doins "etc/nova/rootwrap.d/compute.filters"
  178. doins "etc/nova/rootwrap.d/network.filters"
  179. # add sudoers definitions for user nova
  180. insinto /etc/sudoers.d/
  181. insopts -m 0600 -o root -g root
  182. doins "${FILESDIR}/nova-sudoers"
  183. if use iscsi ; then
  184. # Install udev rules for handle iscsi disk with right links under /dev
  185. udev_newrules "${FILESDIR}/openstack-scsi-disk.rules" 60-openstack-scsi-disk.rules
  186. insinto /etc/nova/
  187. doins "${FILESDIR}/scsi-openscsi-link.sh"
  188. fi
  189. }
  190. python_install() {
  191. distutils-r1_python_install
  192. # copy migration conf file (not coppied on install via setup.py script)
  193. insinto "$(python_get_sitedir)/db/sqlalchemy/migrate_repo/"
  194. doins "nova/db/sqlalchemy/migrate_repo/migrate.cfg"
  195. # copy the CA cert dir (not coppied on install via setup.py script)
  196. cp -R "${S}/nova/CA" "${D}/$(python_get_sitedir)/nova/" || die "installing CA files failed"
  197. }
  198. pkg_postinst() {
  199. if use iscsi ; then
  200. elog "iscsid needs to be running if you want cinder to connect"
  201. fi
  202. }