nova-14.0.5.ebuild 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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 python3_4 )
  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://dev.gentoo.org/~prometheanfire/dist/openstack/nova/newton/nova.conf.sample -> newton-nova.conf.sample
  9. https://tarballs.openstack.org/${PN}/${P}.tar.gz"
  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. ${CDEPEND}
  21. app-admin/sudo"
  22. RDEPEND="
  23. ${CDEPEND}
  24. compute-only? (
  25. >=dev-python/sqlalchemy-1.0.10[${PYTHON_USEDEP}]
  26. <dev-python/sqlalchemy-1.1.0[${PYTHON_USEDEP}]
  27. )
  28. sqlite? (
  29. >=dev-python/sqlalchemy-1.0.10[sqlite,${PYTHON_USEDEP}]
  30. <dev-python/sqlalchemy-1.1.0[sqlite,${PYTHON_USEDEP}]
  31. )
  32. mysql? (
  33. >=dev-python/pymysql-0.6.2[${PYTHON_USEDEP}]
  34. !~dev-python/pymysql-0.7.7[${PYTHON_USEDEP}]
  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.5.0[${PYTHON_USEDEP}]
  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/keystonemiddleware-4.5.0[${PYTHON_USEDEP}]
  50. >=dev-python/lxml-2.3[${PYTHON_USEDEP}]
  51. >=dev-python/routes-1.12.3[${PYTHON_USEDEP}]
  52. !~dev-python/routes-2.0[${PYTHON_USEDEP}]
  53. !~dev-python/routes-2.1[$(python_gen_usedep 'python2_7')]
  54. !~dev-python/routes-2.3[${PYTHON_USEDEP}]
  55. >=dev-python/cryptography-1.0[${PYTHON_USEDEP}]
  56. !~dev-python/cryptography-1.3.0[${PYTHON_USEDEP}]
  57. >=dev-python/webob-1.2.3[${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.13[${PYTHON_USEDEP}]
  65. !~dev-python/netaddr-0.7.16[${PYTHON_USEDEP}]
  66. >=dev-python/netifaces-0.10.4[${PYTHON_USEDEP}]
  67. >=dev-python/paramiko-2.0[${PYTHON_USEDEP}]
  68. >=dev-python/Babel-2.3.4[${PYTHON_USEDEP}]
  69. >=dev-python/iso8601-0.1.11[${PYTHON_USEDEP}]
  70. >=dev-python/jsonschema-2.0.0[${PYTHON_USEDEP}]
  71. !~dev-python/jsonschema-2.5.0[${PYTHON_USEDEP}]
  72. <dev-python/jsonschema-3.0.0[${PYTHON_USEDEP}]
  73. >=dev-python/python-cinderclient-1.6.0[${PYTHON_USEDEP}]
  74. !~dev-python/python-cinderclient-1.7.0[${PYTHON_USEDEP}]
  75. !~dev-python/python-cinderclient-1.7.1[${PYTHON_USEDEP}]
  76. >=dev-python/keystoneauth-2.10.0[${PYTHON_USEDEP}]
  77. >=dev-python/python-neutronclient-5.1.0[${PYTHON_USEDEP}]
  78. >=dev-python/python-glanceclient-2.3.0[${PYTHON_USEDEP}]
  79. !~dev-python/python-glanceclient-2.4.0[${PYTHON_USEDEP}]
  80. >=dev-python/requests-2.10.0[${PYTHON_USEDEP}]
  81. >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
  82. >=dev-python/stevedore-1.16.0[${PYTHON_USEDEP}]
  83. >=dev-python/setuptools-16.0[${PYTHON_USEDEP}]
  84. !~dev-python/setuptools-24.0.0[${PYTHON_USEDEP}]
  85. >=dev-python/websockify-0.8.0[${PYTHON_USEDEP}]
  86. >=dev-python/oslo-cache-1.5.0[${PYTHON_USEDEP}]
  87. >=dev-python/oslo-concurrency-3.8.0[${PYTHON_USEDEP}]
  88. >=dev-python/oslo-config-3.14.0[${PYTHON_USEDEP}]
  89. >=dev-python/oslo-context-2.9.0[${PYTHON_USEDEP}]
  90. >=dev-python/oslo-log-1.14.0[${PYTHON_USEDEP}]
  91. >=dev-python/oslo-reports-0.6.0[${PYTHON_USEDEP}]
  92. >=dev-python/oslo-serialization-1.10.0[${PYTHON_USEDEP}]
  93. >=dev-python/oslo-utils-3.16.0[${PYTHON_USEDEP}]
  94. >=dev-python/oslo-db-4.10.0[${PYTHON_USEDEP}]
  95. !~dev-python/oslo-db-4.13.1[${PYTHON_USEDEP}]
  96. !~dev-python/oslo-db-4.13.2[${PYTHON_USEDEP}]
  97. >=dev-python/oslo-rootwrap-5.0.0[${PYTHON_USEDEP}]
  98. >=dev-python/oslo-messaging-5.2.0[${PYTHON_USEDEP}]
  99. >=dev-python/oslo-policy-1.9.0[${PYTHON_USEDEP}]
  100. >=dev-python/oslo-i18n-2.1.0[${PYTHON_USEDEP}]
  101. >=dev-python/oslo-service-1.10.0[${PYTHON_USEDEP}]
  102. >=dev-python/rfc3986-0.2.2[${PYTHON_USEDEP}]
  103. >=dev-python/oslo-middleware-3.0.0[${PYTHON_USEDEP}]
  104. >=dev-python/psutil-1.1.1[${PYTHON_USEDEP}]
  105. <dev-python/psutil-2.0.0[${PYTHON_USEDEP}]
  106. >=dev-python/oslo-versionedobjects-1.13.0[${PYTHON_USEDEP}]
  107. >=dev-python/os-brick-1.6.1[${PYTHON_USEDEP}]
  108. >=dev-python/os-vif-1.1.0[${PYTHON_USEDEP}]
  109. >=dev-python/os-win-0.2.3[${PYTHON_USEDEP}]
  110. >=dev-python/castellan-0.4.0[${PYTHON_USEDEP}]
  111. >=dev-python/microversion-parse-0.1.2[${PYTHON_USEDEP}]
  112. >=dev-python/wsgiintercept-0.6.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? (
  120. net-misc/memcached
  121. >=dev-python/python-memcached-1.58
  122. )
  123. sys-fs/sysfsutils
  124. sys-fs/multipath-tools
  125. net-misc/bridge-utils
  126. compute? (
  127. app-cdr/cdrtools
  128. sys-fs/dosfstools
  129. app-emulation/qemu
  130. )
  131. iscsi? (
  132. sys-fs/lsscsi
  133. >=sys-block/open-iscsi-2.0.873-r1
  134. )"
  135. #PATCHES=(
  136. #)
  137. pkg_setup() {
  138. linux-info_pkg_setup
  139. CONFIG_CHECK_MODULES="BLK_DEV_NBD VHOST_NET IP6_NF_FILTER IP6_NF_IPTABLES IP_NF_TARGET_REJECT \
  140. IP_NF_MANGLE IP_NF_TARGET_MASQUERADE NF_NAT_IPV4 IP_NF_FILTER IP_NF_IPTABLES \
  141. NF_CONNTRACK_IPV4 NF_DEFRAG_IPV4 NF_NAT_IPV4 NF_NAT NF_CONNTRACK NETFILTER_XTABLES \
  142. ISCSI_TCP SCSI_DH DM_MULTIPATH DM_SNAPSHOT"
  143. if linux_config_exists; then
  144. for module in ${CONFIG_CHECK_MODULES}; do
  145. linux_chkconfig_present ${module} || ewarn "${module} needs to be enabled in kernel"
  146. done
  147. fi
  148. enewgroup nova
  149. enewuser nova -1 -1 /var/lib/nova nova
  150. }
  151. python_prepare_all() {
  152. sed -i '/^hacking/d' test-requirements.txt || die
  153. distutils-r1_python_prepare_all
  154. }
  155. python_install_all() {
  156. distutils-r1_python_install_all
  157. if use !compute-only; then
  158. for svc in api cert conductor consoleauth network scheduler spicehtml5proxy xvpvncproxy; do
  159. newinitd "${FILESDIR}/nova.initd" "nova-${svc}"
  160. done
  161. fi
  162. use compute && newinitd "${FILESDIR}/nova.initd" "nova-compute"
  163. use novncproxy && newinitd "${FILESDIR}/nova.initd" "nova-novncproxy"
  164. diropts -m 0750 -o nova -g qemu
  165. dodir /var/log/nova /var/lib/nova/instances
  166. diropts -m 0750 -o nova -g nova
  167. insinto /etc/nova
  168. insopts -m 0640 -o nova -g nova
  169. newins "${DISTDIR}/newton-nova.conf.sample" "nova.conf.sample"
  170. doins "${FILESDIR}/nova-compute.conf"
  171. doins "${S}/etc/nova/"*
  172. # rootwrap filters
  173. insopts -m 0644
  174. insinto /etc/nova/rootwrap.d
  175. doins "etc/nova/rootwrap.d/api-metadata.filters"
  176. doins "etc/nova/rootwrap.d/compute.filters"
  177. doins "etc/nova/rootwrap.d/network.filters"
  178. # add sudoers definitions for user nova
  179. insinto /etc/sudoers.d/
  180. insopts -m 0600 -o root -g root
  181. doins "${FILESDIR}/nova-sudoers"
  182. if use iscsi ; then
  183. # Install udev rules for handle iscsi disk with right links under /dev
  184. udev_newrules "${FILESDIR}/openstack-scsi-disk.rules" 60-openstack-scsi-disk.rules
  185. insinto /etc/nova/
  186. doins "${FILESDIR}/scsi-openscsi-link.sh"
  187. fi
  188. }
  189. python_install() {
  190. distutils-r1_python_install
  191. # copy migration conf file (not coppied on install via setup.py script)
  192. insinto "$(python_get_sitedir)/db/sqlalchemy/migrate_repo/"
  193. doins "nova/db/sqlalchemy/migrate_repo/migrate.cfg"
  194. # copy the CA cert dir (not coppied on install via setup.py script)
  195. cp -R "${S}/nova/CA" "${D}/$(python_get_sitedir)/nova/" || die "installing CA files failed"
  196. }
  197. pkg_postinst() {
  198. if use iscsi ; then
  199. elog "iscsid needs to be running if you want cinder to connect"
  200. fi
  201. }