nova-13.1.4.ebuild 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 eutils 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://tarballs.openstack.org/${PN}/${P}.tar.gz
  9. https://dev.gentoo.org/~prometheanfire/dist/openstack/nova/mitaka/nova.conf.sample -> mitaka-nova.conf.sample"
  10. LICENSE="Apache-2.0"
  11. SLOT="0"
  12. KEYWORDS="amd64 ~arm64 x86"
  13. IUSE="+compute compute-only iscsi +memcached mysql +novncproxy openvswitch postgres +rabbitmq sqlite"
  14. REQUIRED_USE="
  15. !compute-only? ( || ( mysql postgres sqlite ) )
  16. compute-only? ( compute !rabbitmq !memcached !mysql !postgres !sqlite )"
  17. CDEPEND=">=dev-python/pbr-1.8[${PYTHON_USEDEP}]"
  18. DEPEND="
  19. >=dev-python/setuptools-16.0[${PYTHON_USEDEP}]
  20. !~dev-python/setuptools-24.0.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/mysql-python
  35. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  36. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  37. )
  38. postgres? (
  39. dev-python/psycopg:2
  40. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  41. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  42. )
  43. >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
  44. >=dev-python/decorator-3.4.0[${PYTHON_USEDEP}]
  45. >=dev-python/eventlet-0.18.4[${PYTHON_USEDEP}]
  46. >=dev-python/jinja-2.8[${PYTHON_USEDEP}]
  47. >=dev-python/keystonemiddleware-4.0.0[${PYTHON_USEDEP}]
  48. !~dev-python/keystonemiddleware-4.1.0[${PYTHON_USEDEP}]
  49. >=dev-python/lxml-2.3[${PYTHON_USEDEP}]
  50. >=dev-python/routes-1.12.3[${PYTHON_USEDEP}]
  51. !~dev-python/routes-2.0[${PYTHON_USEDEP}]
  52. !~dev-python/routes-2.1[$(python_gen_usedep 'python2_7')]
  53. !~dev-python/routes-2.3.0[${PYTHON_USEDEP}]
  54. >=dev-python/cryptography-1.0[${PYTHON_USEDEP}]
  55. !~dev-python/cryptography-1.3.0[${PYTHON_USEDEP}]
  56. >=dev-python/webob-1.2.3[${PYTHON_USEDEP}]
  57. >=dev-python/pycrypto-2.6[${PYTHON_USEDEP}]
  58. >=dev-python/greenlet-0.3.2[${PYTHON_USEDEP}]
  59. >=dev-python/pastedeploy-1.5.0-r1[${PYTHON_USEDEP}]
  60. dev-python/paste[${PYTHON_USEDEP}]
  61. >=dev-python/prettytable-0.7[${PYTHON_USEDEP}]
  62. <dev-python/prettytable-0.8[${PYTHON_USEDEP}]
  63. >=dev-python/sqlalchemy-migrate-0.9.6[${PYTHON_USEDEP}]
  64. >=dev-python/netaddr-0.7.12[${PYTHON_USEDEP}]
  65. !~dev-python/netaddr-0.7.16[${PYTHON_USEDEP}]
  66. >=dev-python/netifaces-0.10.4[${PYTHON_USEDEP}]
  67. >=dev-python/paramiko-1.16.0[${PYTHON_USEDEP}]
  68. >=dev-python/Babel-1.3[${PYTHON_USEDEP}]
  69. !~dev-python/Babel-2.3.0[${PYTHON_USEDEP}]
  70. !~dev-python/Babel-2.3.1[${PYTHON_USEDEP}]
  71. !~dev-python/Babel-2.3.2[${PYTHON_USEDEP}]
  72. !~dev-python/Babel-2.3.3[${PYTHON_USEDEP}]
  73. >=dev-python/iso8601-0.1.9[${PYTHON_USEDEP}]
  74. >=dev-python/jsonschema-2.0.0[${PYTHON_USEDEP}]
  75. !~dev-python/jsonschema-2.5.0[${PYTHON_USEDEP}]
  76. <dev-python/jsonschema-3.0.0[${PYTHON_USEDEP}]
  77. >=dev-python/python-cinderclient-1.3.1[${PYTHON_USEDEP}]
  78. >=dev-python/keystoneauth-2.1.0[${PYTHON_USEDEP}]
  79. >=dev-python/python-neutronclient-2.6.0[${PYTHON_USEDEP}]
  80. !~dev-python/python-neutronclient-4.1.0[${PYTHON_USEDEP}]
  81. >=dev-python/python-glanceclient-2.0.0[${PYTHON_USEDEP}]
  82. >=dev-python/requests-2.8.1[${PYTHON_USEDEP}]
  83. !~dev-python/requests-2.9.0[${PYTHON_USEDEP}]
  84. >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
  85. >=dev-python/stevedore-1.5.0[${PYTHON_USEDEP}]
  86. >=dev-python/setuptools-16.0[${PYTHON_USEDEP}]
  87. !~dev-python/setuptools-24.0.0[${PYTHON_USEDEP}]
  88. >=dev-python/websockify-0.6.1[${PYTHON_USEDEP}]
  89. >=dev-python/oslo-cache-1.5.0[${PYTHON_USEDEP}]
  90. >=dev-python/oslo-concurrency-3.7.1[${PYTHON_USEDEP}]
  91. >=dev-python/oslo-config-3.7.0[${PYTHON_USEDEP}]
  92. >=dev-python/oslo-context-0.2.0[${PYTHON_USEDEP}]
  93. >=dev-python/oslo-log-1.14.0[${PYTHON_USEDEP}]
  94. >=dev-python/oslo-reports-0.6.0[${PYTHON_USEDEP}]
  95. >=dev-python/oslo-serialization-1.10.0[${PYTHON_USEDEP}]
  96. >=dev-python/oslo-utils-3.5.0[${PYTHON_USEDEP}]
  97. >=dev-python/oslo-db-4.1.0[${PYTHON_USEDEP}]
  98. >=dev-python/oslo-rootwrap-2.0.0[${PYTHON_USEDEP}]
  99. >=dev-python/oslo-messaging-4.0.0[${PYTHON_USEDEP}]
  100. >=dev-python/oslo-policy-0.5.0[${PYTHON_USEDEP}]
  101. >=dev-python/oslo-i18n-2.1.0[${PYTHON_USEDEP}]
  102. >=dev-python/oslo-service-1.0.0[${PYTHON_USEDEP}]
  103. >=dev-python/rfc3986-0.2.0[${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.5.0[${PYTHON_USEDEP}]
  108. >=dev-python/alembic-0.8.0[${PYTHON_USEDEP}]
  109. >=dev-python/os-brick-1.0.0[${PYTHON_USEDEP}]
  110. !~dev-python/os-brick-1.4.0[${PYTHON_USEDEP}]
  111. >=dev-python/os-win-0.2.3[${PYTHON_USEDEP}]
  112. >=dev-python/castellan-0.3.1[${PYTHON_USEDEP}]
  113. dev-python/libvirt-python[${PYTHON_USEDEP}]
  114. app-emulation/libvirt[iscsi?]
  115. novncproxy? ( www-apps/novnc )
  116. sys-apps/iproute2
  117. openvswitch? ( net-misc/openvswitch )
  118. rabbitmq? ( net-misc/rabbitmq-server )
  119. memcached? ( net-misc/memcached
  120. <=dev-python/python-memcached-1.57 )
  121. sys-fs/sysfsutils
  122. sys-fs/multipath-tools
  123. net-misc/bridge-utils
  124. compute? (
  125. app-cdr/cdrkit
  126. sys-fs/dosfstools
  127. app-emulation/qemu
  128. )
  129. iscsi? (
  130. sys-fs/lsscsi
  131. >=sys-block/open-iscsi-2.0.872-r3
  132. )"
  133. #PATCHES=(
  134. #)
  135. pkg_setup() {
  136. linux-info_pkg_setup
  137. CONFIG_CHECK_MODULES="BLK_DEV_NBD VHOST_NET IP6_NF_FILTER IP6_NF_IPTABLES IP_NF_TARGET_REJECT \
  138. IP_NF_MANGLE IP_NF_TARGET_MASQUERADE NF_NAT_IPV4 IP_NF_FILTER IP_NF_IPTABLES \
  139. NF_CONNTRACK_IPV4 NF_DEFRAG_IPV4 NF_NAT_IPV4 NF_NAT NF_CONNTRACK NETFILTER_XTABLES \
  140. ISCSI_TCP SCSI_DH DM_MULTIPATH DM_SNAPSHOT"
  141. if linux_config_exists; then
  142. for module in ${CONFIG_CHECK_MODULES}; do
  143. linux_chkconfig_present ${module} || ewarn "${module} needs to be enabled in kernel"
  144. done
  145. fi
  146. enewgroup nova
  147. enewuser nova -1 -1 /var/lib/nova nova
  148. }
  149. python_prepare_all() {
  150. sed -i '/^hacking/d' test-requirements.txt || die
  151. distutils-r1_python_prepare_all
  152. }
  153. python_install() {
  154. distutils-r1_python_install
  155. if use !compute-only; then
  156. for svc in api cert conductor consoleauth network scheduler spicehtml5proxy xvpvncproxy; do
  157. newinitd "${FILESDIR}/nova.initd" "nova-${svc}"
  158. done
  159. fi
  160. use compute && newinitd "${FILESDIR}/nova.initd" "nova-compute"
  161. use novncproxy && newinitd "${FILESDIR}/nova.initd" "nova-novncproxy"
  162. diropts -m 0750 -o nova -g qemu
  163. dodir /var/log/nova /var/lib/nova/instances
  164. diropts -m 0750 -o nova -g nova
  165. insinto /etc/nova
  166. insopts -m 0640 -o nova -g nova
  167. newins "${DISTDIR}/mitaka-nova.conf.sample" "nova.conf.sample"
  168. doins "${S}/etc/nova/"*
  169. #rootwrap filters
  170. insopts -m 0644
  171. insinto /etc/nova/rootwrap.d
  172. newins "${FILESDIR}/etc.mitaka/rootwrap.d/api-metadata.filters" "api-metadata.filters"
  173. newins "${FILESDIR}/etc.mitaka/rootwrap.d/compute.filters" "compute.filters"
  174. newins "${FILESDIR}/etc.mitaka/rootwrap.d/network.filters" "network.filters"
  175. #copy migration conf file (not coppied on install via setup.py script)
  176. insinto /usr/$(get_libdir)/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/
  177. doins "nova/db/sqlalchemy/migrate_repo/migrate.cfg"
  178. #copy the CA cert dir (not coppied on install via setup.py script)
  179. cp -R "${S}/nova/CA" "${D}/usr/$(get_libdir)/python2.7/site-packages/nova/" || die "installing CA files failed"
  180. #add sudoers definitions for user nova
  181. insinto /etc/sudoers.d/
  182. insopts -m 0600 -o root -g root
  183. doins "${FILESDIR}/nova-sudoers"
  184. if use iscsi ; then
  185. # Install udev rules for handle iscsi disk with right links under /dev
  186. udev_newrules "${FILESDIR}/openstack-scsi-disk.rules" 60-openstack-scsi-disk.rules
  187. insinto /etc/nova/
  188. doins "${FILESDIR}/scsi-openscsi-link.sh"
  189. fi
  190. }
  191. pkg_postinst() {
  192. if use iscsi ; then
  193. elog "iscsid needs to be running if you want cinder to connect"
  194. fi
  195. }